From 4a82191e92e682077011e89f8a58e784bffdf46a Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Wed, 28 Dec 2022 14:53:04 +0100 Subject: [PATCH] fix publication loaders --- .../pages/publications/publications.page.ts | 44 ++----------------- version/git-version.ts | 12 ++--- 2 files changed, 10 insertions(+), 46 deletions(-) diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index af1a669f6..15c4b244b 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -147,16 +147,7 @@ export class PublicationsPage implements OnInit { this.getFromDB() this.publications.GetPublicationFolderList().subscribe(async res => { - const folders: any = res.map((data): PublicationFolder => { - return { - ProcessId: data.ProcessId, - Description: data.Description, - Detail: data.Detail, - DateBegin: data.DateBegin, - DateEnd: data.DateEnd, - ActionType: data.ActionType, - } - }); + const folders: PublicationFolder[] = this.getPublicationFolderMap(res) this.publicationsEventFolderList = folders.filter((e)=>e.ActionType == 'Evento') this.publicationsTravelFolderList = folders.filter((e)=>e.ActionType != 'Evento') @@ -220,16 +211,7 @@ export class PublicationsPage implements OnInit { this.storage.get('actionsEvents').then((events = []) => { if(Array.isArray(events)) { - const folders: PublicationFolder[] = events.map((data) : PublicationFolder => { - return { - ProcessId: data.ProcessId, - Description: data.Description, - Detail: data.Detail, - DateBegin: data.DateBegin, - DateEnd: data.DateEnd, - ActionType: data.ActionType, - } - }); + const folders: PublicationFolder[] = this.getPublicationFolderMap(events) this.showLoader = false; this.publicationsEventFolderList = folders @@ -239,16 +221,7 @@ export class PublicationsPage implements OnInit { this.storage.get('actionsViagens').then((viagens = []) => { if(Array.isArray(viagens)) { - const folders: PublicationFolder[] = viagens.map((data): PublicationFolder => { - return { - ProcessId: data.ProcessId, - Description: data.Description, - Detail: data.Detail, - DateBegin: data.DateBegin, - DateEnd: data.DateEnd, - ActionType: data.ActionType, - } - }); + const folders: PublicationFolder[] = this.getPublicationFolderMap(viagens) this.publicationsTravelFolderList = folders this.showLoader = false; @@ -258,16 +231,7 @@ export class PublicationsPage implements OnInit { } else { this.sqliteservice.getAllActions().then((actions: any[] = []) => { - const folders: any = actions.map((data): PublicationFolder => { - return { - ProcessId: data.ProcessId, - Description: data.Description, - Detail: data.Detail, - DateBegin: data.DateBegin, - DateEnd: data.DateEnd, - ActionType: data.ActionType, - } - }); + const folders: PublicationFolder[] = this.getPublicationFolderMap(actions) this.publicationsEventFolderList = folders.filter((e)=>e.ActionType == 'Evento') this.publicationsTravelFolderList = folders.filter((e)=>e.ActionType != 'Evento') diff --git a/version/git-version.ts b/version/git-version.ts index 1ed805d35..1ef641476 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -1,12 +1,12 @@ export let versionData = { - "shortSHA": "fe6a3099a", - "SHA": "fe6a3099a9e52ebc4417844b213e0206f27d71e5", + "shortSHA": "a4063a883", + "SHA": "a4063a88397808334edb07fa8a7a22911da60a18", "branch": "develop_bitOut-fix", "lastCommitAuthor": "'Peter Maquiran'", - "lastCommitTime": "'Wed Dec 28 14:15:49 2022 +0100'", - "lastCommitMessage": "add prepare script", - "lastCommitNumber": "4590", + "lastCommitTime": "'Wed Dec 28 14:52:42 2022 +0100'", + "lastCommitMessage": "fix publication loaders", + "lastCommitNumber": "4591", "change": "", - "changeStatus": "On branch develop_bitOut-fix\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/pages/publications/publications.page.html\n\tmodified: src/app/pages/publications/publications.page.ts\n\tmodified: src/environments/environment.prod.ts\n\tmodified: src/environments/environment.ts", + "changeStatus": "On branch develop_bitOut-fix\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/pages/publications/publications.page.ts", "changeAuthor": "peter.maquiran" } \ No newline at end of file