diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index 2546cc305..8ce820f8e 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -89,7 +89,6 @@ export class PublicationsPage implements OnInit { }); this.hideRefreshButton(); - } @@ -148,40 +147,22 @@ export class PublicationsPage implements OnInit { this.showLoader = false; const folders: PublicationFolder[] = this.getPublicationFolderMap(res) - // let publications = await ActionModel.create(folders) - // console.log('publications', publications) this.publicationsEventFolderList = folders.filter((e)=>e.ActionType == 'Evento') this.publicationsTravelFolderList = folders.filter((e)=>e.ActionType != 'Evento') - if (this.platform.is('desktop') || this.platform.is('mobileweb')) { - await this.storage.set('actionsEvents', this.publicationsEventFolderList); - await this.storage.set('actionsViagens', this.publicationsTravelFolderList); - } else { - folders.forEach((folder)=> { - this.addActionToDB(folder); - }) - } + await this.storage.set('actionsEvents', this.publicationsEventFolderList); + await this.storage.set('actionsViagens', this.publicationsTravelFolderList); this.showLoader = false; }, (error) => { this.showLoader = false; this.getFromDB() - }); } - // addActionToStorage(events, viagens) { - - // if (this.platform.is('desktop') || this.platform.is('mobileweb')) { - // this.storage.set('actionsEvents', events); - // this.storage.set('actionsViagens', viagens); - // } - // } - - addActionToDB(folder) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) { } else { @@ -204,39 +185,26 @@ export class PublicationsPage implements OnInit { } getFromDB() { - - if (this.platform.is('desktop') || this.platform.is('mobileweb')) { - this.storage.get('actionsEvents').then((events = []) => { + this.storage.get('actionsEvents').then((events = []) => { - if(Array.isArray(events)) { - const folders: PublicationFolder[] = this.getPublicationFolderMap(events) + if(Array.isArray(events)) { + const folders: PublicationFolder[] = this.getPublicationFolderMap(events) - this.showLoader = false; - this.publicationsEventFolderList = folders - } - - }); - this.storage.get('actionsViagens').then((viagens = []) => { - - if(Array.isArray(viagens)) { - const folders: PublicationFolder[] = this.getPublicationFolderMap(viagens) - - this.publicationsTravelFolderList = folders - this.showLoader = false; - } - - }); - } else { - this.sqliteservice.getAllActions().then((actions: any[] = []) => { - - const folders: PublicationFolder[] = this.getPublicationFolderMap(actions) - - this.publicationsEventFolderList = folders.filter((e)=>e.ActionType == 'Evento') - this.publicationsTravelFolderList = folders.filter((e)=>e.ActionType != 'Evento') this.showLoader = false; + this.publicationsEventFolderList = folders + } - }) - } + }); + this.storage.get('actionsViagens').then((viagens = []) => { + + if(Array.isArray(viagens)) { + const folders: PublicationFolder[] = this.getPublicationFolderMap(viagens) + + this.publicationsTravelFolderList = folders + this.showLoader = false; + } + + }); } async editAction(folderId?: string) { diff --git a/src/app/pages/publications/view-publications/view-publications.page.html b/src/app/pages/publications/view-publications/view-publications.page.html index eab5ca99e..623bb0ea2 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.html +++ b/src/app/pages/publications/view-publications/view-publications.page.html @@ -7,10 +7,10 @@ -
+
{{publicationItem[folderId].Description}}

{{publicationItem[folderId].Detail}}

- +
diff --git a/src/app/pages/publications/view-publications/view-publications.page.ts b/src/app/pages/publications/view-publications/view-publications.page.ts index 7c5715daf..117b59617 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.ts +++ b/src/app/pages/publications/view-publications/view-publications.page.ts @@ -133,10 +133,9 @@ export class ViewPublicationsPage implements OnInit { } getPublicationDetail() { - this.showLoader = true; const folderId = this.folderId this.publications.GetPresidentialAction(folderId).subscribe(res =>{ - this.showLoader = false; + this.publicationItem[folderId] = res this.storage.set(folderId+"name", res) }, (error) => { diff --git a/src/app/shared/publication/view-publications/view-publications.page.html b/src/app/shared/publication/view-publications/view-publications.page.html index 9c677e644..45b94bf0e 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.html +++ b/src/app/shared/publication/view-publications/view-publications.page.html @@ -20,9 +20,9 @@
-
+

{{publicationItem[folderId].Detail}}

- +
diff --git a/src/app/shared/publication/view-publications/view-publications.page.ts b/src/app/shared/publication/view-publications/view-publications.page.ts index e5579fb3a..aad1bc377 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.ts +++ b/src/app/shared/publication/view-publications/view-publications.page.ts @@ -105,10 +105,8 @@ export class ViewPublicationsPage implements OnInit { } getPublicationDetail() { - this.showLoader = true; const folderId = this.folderId this.publications.GetPresidentialAction(folderId).subscribe(res=>{ - this.showLoader = false; this.publicationItem[folderId] = res this.storage.set(folderId+"name", res) }, (error) => { diff --git a/version/git-version.ts b/version/git-version.ts index e1e9032da..48d723873 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -1,12 +1,12 @@ export let versionData = { - "shortSHA": "2a4a22c1d", - "SHA": "2a4a22c1d59ec83d01d2fe500140cbc6dffd5dfc", + "shortSHA": "54e1f9bee", + "SHA": "54e1f9bee3acfcd0ab352b45affb0d84a503b69a", "branch": "no_bug_movemente", "lastCommitAuthor": "'Eudes InĂ¡cio'", - "lastCommitTime": "'Fri Mar 10 14:45:12 2023 +0100'", - "lastCommitMessage": "enviroment changed", - "lastCommitNumber": "4864", + "lastCommitTime": "'Fri Mar 10 16:26:42 2023 +0100'", + "lastCommitMessage": "publcation moved getfromDB", + "lastCommitNumber": "4868", "change": "", - "changeStatus": "On branch no_bug_movemente\nYour branch and 'origin/no_bug_movemente' have diverged,\nand have 1 and 5 different commits each, respectively.\n (use \"git pull\" to merge the remote branch into yours)\n\nAll conflicts fixed but you are still merging.\n (use \"git commit\" to conclude merge)\n\nChanges to be committed:\n\tmodified: src/app/pages/chat/chat.page.ts\n\tmodified: src/app/pages/chat/group-messages/group-messages.page.ts\n\tmodified: src/app/pages/publications/publications.page.ts\n\tmodified: src/app/pages/publications/view-publications/view-publications.page.ts\n\tmodified: src/app/shared/chat/group-messages/group-messages.page.ts\n\tmodified: src/app/shared/popover/chat-popover/chat-popover.page.ts\n\tmodified: src/app/shared/publication/view-publications/view-publications.page.ts\n\tmodified: src/environments/environment.prod.ts\n\tmodified: src/environments/environment.ts\n\tmodified: src/theme/variables.scss", + "changeStatus": "On branch no_bug_movemente\nYour branch and 'origin/no_bug_movemente' have diverged,\nand have 2 and 2 different commits each, respectively.\n (use \"git pull\" to merge the remote branch into yours)\n\nAll conflicts fixed but you are still merging.\n (use \"git commit\" to conclude merge)\n\nChanges to be committed:\n\tmodified: src/app/pages/publications/publications.page.ts\n\tmodified: src/app/pages/publications/view-publications/view-publications.page.html\n\tmodified: src/app/pages/publications/view-publications/view-publications.page.ts\n\tmodified: src/app/shared/publication/view-publications/view-publications.page.html\n\tmodified: src/app/shared/publication/view-publications/view-publications.page.ts", "changeAuthor": "eudes.inacio" } \ No newline at end of file