This commit is contained in:
Peter Maquiran
2023-08-10 16:46:55 +01:00
parent 8b3989de3b
commit 19ddb18148
33 changed files with 257 additions and 222 deletions
@@ -25,8 +25,8 @@ export class ViewPublicationsPage implements OnInit {
publicationList: {[key: string]: Publication[] } = {};
publicationItem: {[key: string]: PublicationFolder } = {};
getpublication = [];
error: any;
oldpublicationIds = []
@Input() folderId: any;
@Output() addNewPublication = new EventEmitter<any>();
@@ -59,6 +59,9 @@ export class ViewPublicationsPage implements OnInit {
this.createPublicationList()
window['app-view-publications-page-doRefresh'] = this.doRefresh
window['_deletePublication'] = (a, b) => {
this._deletePublication(a, b)
}
this.getFromDB();
}
@@ -121,9 +124,10 @@ export class ViewPublicationsPage implements OnInit {
this.showLoader = true;
const folderId = this.folderId
try {
const publicationIds = await this.publications.GetPublicationsList(folderId).toPromise();
this.publicationList[folderId] = []
this.createPublicationList(folderId)
let loadLater = []
@@ -144,13 +148,22 @@ export class ViewPublicationsPage implements OnInit {
this.showLoader = false;
this.storage.set(folderId, this.publicationList[folderId]);
this.getpublication = this.publicationList[folderId];
this.oldpublicationIds = publicationIds
} catch(error) {
this.showLoader = false;
}
}
_deletePublication = (folderId, publicationId) => {
this.publicationList[folderId] = this.publicationList[folderId].filter( e => e.DocumentId != publicationId)
console.log('this.publicationList[folderId]', this.publicationList[folderId].length)
}
publicationIsPresent(publicationId, folderId) {
return this.publicationList[folderId].find( e => e.DocumentId == publicationId )
}