mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
fix update
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
|
||||
<ion-card *ngFor="let publication of publicationFolderService.publicationList[folderId] let i = index">
|
||||
<ion-card-content>
|
||||
|
||||
|
||||
<div style="width: 100%; height: 395px;">
|
||||
<app-swiper
|
||||
[publicationList]=publication
|
||||
@@ -55,10 +55,10 @@
|
||||
[publicationList]=publication
|
||||
></app-swiper>
|
||||
</div> -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <swiper-container #swipers [slidechange]="onSlideChange()">
|
||||
<swiper-slide *ngFor="let files of publication.Files let k = index">
|
||||
@@ -81,8 +81,8 @@
|
||||
</div> -->
|
||||
|
||||
<!-- <div *ngIf="publication.Files.length > 2" class="dots-container">
|
||||
<span *ngFor="let files of publication.Files; let k = index"
|
||||
[class.dotsSwiper]="true"
|
||||
<span *ngFor="let files of publication.Files; let k = index"
|
||||
[class.dotsSwiper]="true"
|
||||
[class.active-dot]="swiperIndex === k"
|
||||
(click)="goToSlide(k)">
|
||||
</span>
|
||||
|
||||
@@ -132,7 +132,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
setTimeout(()=> {
|
||||
|
||||
this.doRefresh({})
|
||||
// this.doRefresh({})
|
||||
|
||||
}, 1500)
|
||||
|
||||
@@ -253,44 +253,6 @@ export class ViewPublicationsPage implements OnInit {
|
||||
return this.publicationFolderService.publicationList[folderId].findIndex(e => e.DocumentId == publicationId)
|
||||
}
|
||||
|
||||
async loadPublication(publicationId, folderId) {
|
||||
let Publication = await this.publications.GetPublicationWithArrayOfFilesById(publicationId).toPromise();
|
||||
console.log('Publications with array of file: ', Publication.Files)
|
||||
this.arrayOfFile = Publication.Files
|
||||
let publicationDetails: Publication = this.publicationPipe.itemList(Publication)
|
||||
|
||||
|
||||
|
||||
const findIndex = this.publicationFindIndex(publicationId, folderId)
|
||||
const found = this.publicationIsPresent(publicationId, folderId)
|
||||
|
||||
|
||||
|
||||
if (!found) {
|
||||
this.publicationFolderService.publicationList[folderId].push(publicationDetails)
|
||||
this.publicationFolderService.revertPublicationOrder(folderId)
|
||||
this.publicationList = this.publicationFolderService.publicationList[folderId];
|
||||
} else {
|
||||
|
||||
|
||||
let a: any = Object.assign({}, this.publicationFolderService.publicationList[folderId][findIndex])
|
||||
let b: any = Object.assign({}, publicationDetails)
|
||||
|
||||
a.Files = a.Files.length
|
||||
b.Files = b.Files.length
|
||||
|
||||
if (JSON.stringify(a) != JSON.stringify(b)) {
|
||||
|
||||
// console.log({a, b})
|
||||
this.publicationFolderService.publicationList[folderId][findIndex] = publicationDetails
|
||||
} else {
|
||||
// console.log({publicationDetails})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async AddPublication(publicationType: any, folderId: any) {
|
||||
|
||||
if(this.PublicationHolderService.PublicationFormMV.length == 0) {
|
||||
|
||||
@@ -124,22 +124,22 @@ export class PublicationFolderService {
|
||||
|
||||
async getPublicationsIds(folderId) {
|
||||
|
||||
|
||||
this.showLoader = true;
|
||||
|
||||
try {
|
||||
const publicationIds: number[] = await this.publications.GetPublicationsList(folderId).toPromise();
|
||||
|
||||
console.log(publicationIds, new Date());
|
||||
console.log(this.publicationList[folderId].map(e => e.DocumentId), 'current list')
|
||||
for (let localPublication of this.publicationList[folderId]) {
|
||||
this.createPublicationList(folderId)
|
||||
|
||||
for (let localPublication of this.publicationList[folderId]) {
|
||||
const apiPublication = publicationIds.includes(localPublication.DocumentId)
|
||||
if (!apiPublication) {
|
||||
this.deletePost(folderId, localPublication.DocumentId)
|
||||
}
|
||||
}
|
||||
|
||||
this.createPublicationList(folderId)
|
||||
|
||||
let loadLater = []
|
||||
for (let publicationId of publicationIds) {
|
||||
|
||||
@@ -176,8 +176,11 @@ export class PublicationFolderService {
|
||||
if (!found) {
|
||||
this.publicationList[folderId].push(publicationDetails)
|
||||
this.revertPublicationOrder(folderId);
|
||||
console.log('found')
|
||||
} else {
|
||||
|
||||
console.log('try')
|
||||
|
||||
let a: any = Object.assign({}, this.publicationList[folderId][findIndex])
|
||||
let b: any = Object.assign({}, publicationDetails)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user