From 80b2b915393ba902af2203e2874a18bc5f9fe154 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Thu, 1 Jul 2021 14:30:44 +0100 Subject: [PATCH] save --- src/app/pages/publications/publications.page.html | 1 + src/app/pages/publications/publications.page.ts | 10 +++++----- .../shared/publication/edit-action/edit-action.page.ts | 6 ++++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index 54e4ef780..3c7eef106 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -127,6 +127,7 @@ [folderId]="folderId" class="height-100 d-flex flex-column overflow-hidden background-white flex-grow-1" (closeDesktopComponent)="closeDesktopComponent($event)" + (updateDesktopComponent)="updateDesktopComponent($event)" > diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index cfae7d49f..4781abae5 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -266,6 +266,10 @@ export class PublicationsPage implements OnInit { this.desktopComponent.showPublicationDetail = true; } + + async updateDesktopComponent(e?:any){ + this.getActions(); + } async closeDesktopComponent (xx?: any){ @@ -317,11 +321,7 @@ export class PublicationsPage implements OnInit { await modal.present(); modal.onDidDismiss().then(res =>{ if(res['data']=='edit'){ - //this.closeDesktopComponent(); - this.desktopComponent.showViewPublication = false, - this.desktopComponent.showAddNewPublication = false, - this.desktopComponent.showPublicationDetail = false, - this.desktopComponent.showAddActions = false, + this.closeDesktopComponent(); this.desktopComponent.showEditActions = true; } }); diff --git a/src/app/shared/publication/edit-action/edit-action.page.ts b/src/app/shared/publication/edit-action/edit-action.page.ts index ec0f5200f..6c03235e3 100644 --- a/src/app/shared/publication/edit-action/edit-action.page.ts +++ b/src/app/shared/publication/edit-action/edit-action.page.ts @@ -13,6 +13,7 @@ export class EditActionPage implements OnInit { folder: PublicationFolder; @Input() folderId: string; @Output() closeDesktopComponent= new EventEmitter(); + @Output() updateDesktopComponent= new EventEmitter(); constructor( private publicationsService: PublicationsService, @@ -49,9 +50,10 @@ export class EditActionPage implements OnInit { try { await this.publicationsService.UpdatePresidentialAction(body).toPromise() this.close(); - this.toastService.successMessage('Acção presidencial criada') + this.updateDesktopComponent.emit(); + this.toastService.successMessage('Acção presidencial atualizada') } catch (error) { - this.toastService.badRequest('Não foi possivel criar a acção presidencial') + this.toastService.badRequest('Não foi possivel atualizar a acção presidencial') } }