From 5bbb56c26deaee33b22789a32987d664fb972cce Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 9 Jul 2021 12:35:11 +0100 Subject: [PATCH 1/3] Improve attaching new files --- package-lock.json | 21 +++++ package.json | 1 + .../agenda/edit-event/edit-event.page.html | 11 +-- .../agenda/edit-event/edit-event.page.ts | 78 ++++++++++++++----- src/app/pages/search/search.page.ts | 18 ++--- 5 files changed, 96 insertions(+), 33 deletions(-) diff --git a/package-lock.json b/package-lock.json index 73e1c0b20..7896c0a29 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3722,6 +3722,11 @@ "integrity": "sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1MCwlkhUms+gtdzigTeUyBr09+u8BwOIY3MXvHdcsA==", "dev": true }, + "@types/uuid": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.1.tgz", + "integrity": "sha512-Y2mHTRAbqfFkpjldbkHGY8JIzRN6XqYRliG8/24FcHm2D2PwW24fl5xMRTVGdrb7iMrwCaIEbLWerGIkXuFWVg==" + }, "@types/webpack-sources": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-0.1.8.tgz", @@ -19762,6 +19767,22 @@ "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==", "dev": true }, + "uuidv4": { + "version": "6.2.11", + "resolved": "https://registry.npmjs.org/uuidv4/-/uuidv4-6.2.11.tgz", + "integrity": "sha512-OTS4waH9KplrXNADKo+Q1kT9AHWr8DaC0S5F54RQzEwcUaEzBEWQQlJyDUw/u1bkRhJyqkqhLD4M4lbFbV+89g==", + "requires": { + "@types/uuid": "8.3.1", + "uuid": "8.3.2" + }, + "dependencies": { + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + } + } + }, "valid-identifier": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/valid-identifier/-/valid-identifier-0.0.2.tgz", diff --git a/package.json b/package.json index f2a435fe0..2af2bc0c2 100644 --- a/package.json +++ b/package.json @@ -79,6 +79,7 @@ "sharp": "^0.25.4", "socket.io-client": "^2.3.0", "tslib": "^2.0.0", + "uuidv4": "^6.2.11", "wordcloud": "^1.1.2", "ws": "^7.4.6", "zone.js": "~0.10.2" diff --git a/src/app/pages/agenda/edit-event/edit-event.page.html b/src/app/pages/agenda/edit-event/edit-event.page.html index 05d1fc398..a167d9ae2 100644 --- a/src/app/pages/agenda/edit-event/edit-event.page.html +++ b/src/app/pages/agenda/edit-event/edit-event.page.html @@ -235,23 +235,24 @@ -
- +
+

{{document.SourceName}} - +

-

{{document.Stakeholders}}

+

Correspondência Acções Presidenciais Arquivo Despacho Electrónico - {{document.CreateDate | date: 'dd-MM-yy'}}

+ +

diff --git a/src/app/pages/agenda/edit-event/edit-event.page.ts b/src/app/pages/agenda/edit-event/edit-event.page.ts index 0228acc0b..75dfabae1 100644 --- a/src/app/pages/agenda/edit-event/edit-event.page.ts +++ b/src/app/pages/agenda/edit-event/edit-event.page.ts @@ -38,7 +38,7 @@ export class EditEventPage implements OnInit { caller:string; - loadedEventAttachments: Attachment[]; + loadedEventAttachments: Attachment[] = []; taskParticipants: any = []; taskParticipantsCc: any = []; adding: "intervenient" | "CC" = "intervenient"; @@ -185,6 +185,40 @@ export class EditEventPage implements OnInit { this.toastService.badRequest() } + this.saveDocument() + } + + + saveDocument() { + + this.loadedEventAttachments.forEach((e)=>{ + + const id: any = e.Id + const remove = e['remove'] + + if ( id == 'add') { + //data.selected + const DocumentToSave = { + SourceTitle: e.SourceName, + ParentId: this.postEvent.EventId, + Source: '1', + SourceId: e.SourceId, + ApplicationId: e.ApplicationId.toString(), + Id: '0', + Link: '', + SerialNumber: '', + }; + + this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe(()=>{ + this.getAttachments(this.postEvent.EventId); + }); + + } else if(remove) { + this.attachmentsService.deleteEventAttachmentById(e.Id).subscribe( res=> {}) + } + + }) + } async openAttendees() { @@ -254,12 +288,17 @@ export class EditEventPage implements OnInit { }); } - deleteAttachment(attachmentID: string) { + deleteAttachment(attachmentID: string, index) { - this.attachmentsService.deleteEventAttachmentById(attachmentID).subscribe( - res=>{ - this.loadedEventAttachments = this.loadedEventAttachments.filter(e=> e.Id.toString() != attachmentID); - }) + const id: any = this.loadedEventAttachments[index].Id + + if(id == 'add') { + this.loadedEventAttachments = this.loadedEventAttachments.filter((e,i)=> i!=index) + } else { + this.loadedEventAttachments[index]['remove'] = true + } + + } async getDoc() { @@ -273,27 +312,30 @@ export class EditEventPage implements OnInit { } }); await modal.present(); - modal.onDidDismiss().then( async (res)=>{ - if(res){ + modal.onDidDismiss().then( async (res)=> { + if(res) { const data = res.data; - //data.selected - const DocumentToSave = { - SourceTitle: data.selected.Assunto, + + const ApplicationIdDocumentToSave: any = { + SourceName: data.selected.Assunto, ParentId: this.postEvent.EventId, - Source: '1', SourceId: data.selected.Id, + Stakeholders: false, ApplicationId: data.selected.ApplicationType.toString(), - Id: '0', + CreateDate: false, + // needed to attach this document + Id: 'add', + SourceTitle: data.selected.Assunto, + Source: '1', Link: '', SerialNumber: '', - }; + } - await this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe(()=>{ - this.getAttachments(this.postEvent.EventId); - }); + console.log( this.loadedEventAttachments) + this.loadedEventAttachments.push(ApplicationIdDocumentToSave) } - }); + }) } } \ No newline at end of file diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index a3cda93c2..7e0e52038 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -463,15 +463,15 @@ export class SearchPage implements OnInit { } } - clearInputRemetente() { + clearInputRemetente(){ this.searchSender = ""; } - clearInputDocumentDate() { + clearInputDocumentDate(){ this.searchDocumentDate = ""; } - clearInputOrganicEntity() { + clearInputOrganicEntity(){ this.searchOrganicEntiry = ""; } @@ -531,10 +531,10 @@ export class SearchPage implements OnInit { } - async filterDocList(categoryName:string) { + async filterDocList(categoryName:string){ // show all category - if(this. showCategory == categoryName ) { + if(this. showCategory == categoryName ){ this.showSearchDocuments = this.searchDocuments; @@ -562,12 +562,12 @@ export class SearchPage implements OnInit { const ApplicationType = searchDocument.ApplicationType.toString() const Id = searchDocument.Id - if(this.select == false) { + if(this.select == false){ if(this.type == "Agenda") { const modal = await this.modalCtrl.create({ component: ViewEventPage, - componentProps: { + componentProps:{ eventId: Id }, cssClass: 'modal modal-desktop', @@ -575,7 +575,7 @@ export class SearchPage implements OnInit { await modal.present(); modal.onDidDismiss().then((res)=>{}); - } else if(this.type == "AccoesPresidenciais") { + } else if(this.type == "AccoesPresidenciais"){ this.viewPublicationDetail(Id); } @@ -585,8 +585,6 @@ export class SearchPage implements OnInit { } - } else { - console.log('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!', this.select) } } From cdece357e3f3a5603c3af0bc0733184bdc1c31aa Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 9 Jul 2021 12:50:03 +0100 Subject: [PATCH 2/3] Improve documents --- .../agenda/edit-event/edit-event.page.html | 6 +- .../agenda/edit-event/edit-event.page.ts | 74 +++++++++++++++---- .../agenda/event-list/event-list.page.ts | 1 - 3 files changed, 62 insertions(+), 19 deletions(-) diff --git a/src/app/shared/agenda/edit-event/edit-event.page.html b/src/app/shared/agenda/edit-event/edit-event.page.html index 797c03bea..f60650c94 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.html +++ b/src/app/shared/agenda/edit-event/edit-event.page.html @@ -261,8 +261,8 @@
-
- +
+

@@ -270,7 +270,7 @@ Correspondencia AccoesPresidenciais ArquivoDespachoElect - + diff --git a/src/app/shared/agenda/edit-event/edit-event.page.ts b/src/app/shared/agenda/edit-event/edit-event.page.ts index cd98e1da2..961134570 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.ts +++ b/src/app/shared/agenda/edit-event/edit-event.page.ts @@ -30,7 +30,7 @@ export class EditEventPage implements OnInit { segment:string = "true"; eventAttendees: EventPerson[]; // minDate: string; - loadedEventAttachments: Attachment[]; + loadedEventAttachments: Attachment[]=[]; public date: any; public disabled = false; @@ -221,6 +221,41 @@ export class EditEventPage implements OnInit { this.clearPostEvent.emit(); this.deleteTemporaryData(); this.close(); + + this.saveDocument() + } + + + saveDocument() { + + this.loadedEventAttachments.forEach((e)=>{ + + const id: any = e.Id + const remove = e['remove'] + + if ( id == 'add') { + //data.selected + const DocumentToSave = { + SourceTitle: e.SourceName, + ParentId: this.postEvent.EventId, + Source: '1', + SourceId: e.SourceId, + ApplicationId: e.ApplicationId.toString(), + Id: '0', + Link: '', + SerialNumber: '', + }; + + this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe(()=>{ + this.getAttachments(this.postEvent.EventId); + }); + + } else if(remove) { + this.attachmentsService.deleteEventAttachmentById(e.Id).subscribe( res=> {}) + } + + }) + } async addParticipants() { @@ -300,12 +335,17 @@ export class EditEventPage implements OnInit { }); } - deleteAttachment(attachmentID: string) { + deleteAttachment(attachmentID: string, index) { - this.attachmentsService.deleteEventAttachmentById(attachmentID).subscribe( - res=>{ - this.loadedEventAttachments = this.loadedEventAttachments.filter(e=> e.Id.toString() != attachmentID); - }) + const id: any = this.loadedEventAttachments[index].Id + + if(id == 'add') { + this.loadedEventAttachments = this.loadedEventAttachments.filter((e,i)=> i!=index) + } else { + this.loadedEventAttachments[index]['remove'] = true + } + + } @@ -323,21 +363,25 @@ export class EditEventPage implements OnInit { modal.onDidDismiss().then( async (res)=>{ if(res){ const data = res.data; - //data.selected - const DocumentToSave = { - SourceTitle: data.selected.Assunto, + + const ApplicationIdDocumentToSave: any = { + SourceName: data.selected.Assunto, ParentId: this.postEvent.EventId, - Source: '1', SourceId: data.selected.Id, + Stakeholders: false, ApplicationId: data.selected.ApplicationType.toString(), - Id: '0', + CreateDate: false, + // needed to attach this document + Id: 'add', + SourceTitle: data.selected.Assunto, + Source: '1', Link: '', SerialNumber: '', - }; + } + + console.log( this.loadedEventAttachments) + this.loadedEventAttachments.push(ApplicationIdDocumentToSave) - await this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe(()=>{ - this.getAttachments(this.postEvent.EventId); - }); } }); diff --git a/src/app/shared/agenda/event-list/event-list.page.ts b/src/app/shared/agenda/event-list/event-list.page.ts index 15ec45d77..91fe48d1c 100644 --- a/src/app/shared/agenda/event-list/event-list.page.ts +++ b/src/app/shared/agenda/event-list/event-list.page.ts @@ -27,7 +27,6 @@ export class EventListPage implements OnInit { @Output() approveEventDismiss = new EventEmitter(); - constructor( private processes:ProcessesService, private modalController: ModalController, From 1f34261db40626fa2bf16fa92f16b2e37263ebc2 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 9 Jul 2021 13:32:17 +0100 Subject: [PATCH 3/3] improve request --- src/app/pages/agenda/agenda.page.ts | 3 +++ src/app/pages/events/edit-event/edit-event.page.ts | 3 +-- src/app/pages/events/events.page.ts | 4 +++- .../gabinete-digital/despachos-pr/despachos-pr.page.ts | 5 ++++- src/app/pages/gabinete-digital/diplomas/diplomas.page.ts | 5 ++++- .../pages/gabinete-digital/event-list/event-list.page.ts | 4 +++- .../pages/gabinete-digital/expediente/expediente.page.ts | 5 ++++- .../expedientes-pr/expedientes-pr.page.ts | 5 ++++- src/app/pages/gabinete-digital/gabinete-digital.page.ts | 9 +++++++-- .../pages/gabinete-digital/pendentes/pendentes.page.ts | 4 +++- src/app/pages/publications/publications.page.ts | 5 ++++- src/app/shared/agenda/event-list/event-list.page.ts | 6 ++++-- .../gabinete-digital/despachos-pr/despachos-pr.page.ts | 5 ++++- .../shared/gabinete-digital/despachos/despachos.page.ts | 4 +++- .../diplomas-assinar/diplomas-assinar.page.ts | 4 +++- .../shared/gabinete-digital/diplomas/diplomas.page.ts | 5 ++++- .../events-to-approve/events-to-approve.page.ts | 4 +++- .../expedientes-pr/expedientes-pr.page.ts | 5 ++++- .../gabinete-digital/expedients/expedients.page.ts | 4 +++- src/app/shared/gabinete-digital/pedidos/pedidos.page.ts | 4 +++- .../shared/gabinete-digital/pendentes/pendentes.page.ts | 4 +++- 21 files changed, 74 insertions(+), 23 deletions(-) diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index d03ca0d63..a355a9a67 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -183,7 +183,10 @@ export class AgendaPage implements OnInit { ngOnInit() { this.profile = "mdgpr"; + const pathname = window.location.pathname + this.router.events.forEach((event) => { + if(event instanceof NavigationEnd && event.url == "/home/agenda") { if (this.segment == null){ this.segment = "Combinado"; diff --git a/src/app/pages/events/edit-event/edit-event.page.ts b/src/app/pages/events/edit-event/edit-event.page.ts index 22b43307b..b6c51d26a 100644 --- a/src/app/pages/events/edit-event/edit-event.page.ts +++ b/src/app/pages/events/edit-event/edit-event.page.ts @@ -14,14 +14,13 @@ import { FormGroup, FormBuilder, Validators } from "@angular/forms"; import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; import { AttachmentsPage } from '../attachments/attachments.page'; - @Component({ selector: 'app-edit-event', templateUrl: './edit-event.page.html', styleUrls: ['./edit-event.page.scss'], }) -export class EditEventPage implements OnInit { +export class EditEventPage implements OnInit { loadedEvent: Event; loadedEventAttachments: Attachment[]; diff --git a/src/app/pages/events/events.page.ts b/src/app/pages/events/events.page.ts index 2f9eca264..cb673824c 100644 --- a/src/app/pages/events/events.page.ts +++ b/src/app/pages/events/events.page.ts @@ -97,8 +97,10 @@ export class EventsPage implements OnInit { this.showGreeting(); + const pathname = window.location.pathname + this.router.events.forEach((event) => { - if(event instanceof NavigationEnd && event.url == this.router.url) { + if(event instanceof NavigationEnd && event.url == pathname) { this.RefreshEvents(); this.LoadList(); } diff --git a/src/app/pages/gabinete-digital/despachos-pr/despachos-pr.page.ts b/src/app/pages/gabinete-digital/despachos-pr/despachos-pr.page.ts index d74ecaaa5..9ab6445c5 100644 --- a/src/app/pages/gabinete-digital/despachos-pr/despachos-pr.page.ts +++ b/src/app/pages/gabinete-digital/despachos-pr/despachos-pr.page.ts @@ -64,8 +64,11 @@ export class DespachosPrPage implements OnInit { ngOnInit() { //Inicializar segment this.segment = "despachos"; + + const pathname = window.location.pathname + this.router.events.forEach((event) => { - if(event instanceof NavigationEnd && event.url == this.router.url) { + if(event instanceof NavigationEnd && event.url == pathname) { this.LoadList(); } }); diff --git a/src/app/pages/gabinete-digital/diplomas/diplomas.page.ts b/src/app/pages/gabinete-digital/diplomas/diplomas.page.ts index 9d3208a45..d81479cbd 100644 --- a/src/app/pages/gabinete-digital/diplomas/diplomas.page.ts +++ b/src/app/pages/gabinete-digital/diplomas/diplomas.page.ts @@ -39,8 +39,11 @@ constructor( } ngOnInit() { + + const pathname = window.location.pathname + this.router.events.forEach((event) => { - if(event instanceof NavigationEnd && event.url == this.router.url) { + if(event instanceof NavigationEnd && event.url == pathname) { this.refreshing(); } }); diff --git a/src/app/pages/gabinete-digital/event-list/event-list.page.ts b/src/app/pages/gabinete-digital/event-list/event-list.page.ts index 900815593..3a2bef146 100644 --- a/src/app/pages/gabinete-digital/event-list/event-list.page.ts +++ b/src/app/pages/gabinete-digital/event-list/event-list.page.ts @@ -36,8 +36,10 @@ export class EventListPage implements OnInit { this.LoadToApproveEvents(); + const pathname = window.location.pathname + this.router.events.forEach((event) => { - if(event instanceof NavigationEnd && event.url == this.router.url) { + if(event instanceof NavigationEnd && event.url == pathname) { this.LoadToApproveEvents(); } }); diff --git a/src/app/pages/gabinete-digital/expediente/expediente.page.ts b/src/app/pages/gabinete-digital/expediente/expediente.page.ts index 8379d6e98..7913c0bea 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente.page.ts +++ b/src/app/pages/gabinete-digital/expediente/expediente.page.ts @@ -40,8 +40,11 @@ export class ExpedientePage implements OnInit { ngOnInit() { this.LoadList(); + + const pathname = window.location.pathname + this.router.events.forEach((event) => { - if(event instanceof NavigationEnd && event.url == this.router.url) { + if(event instanceof NavigationEnd && event.url == pathname) { this.LoadList(); } }); diff --git a/src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts b/src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts index 07975558d..d8995453f 100644 --- a/src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts +++ b/src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts @@ -40,8 +40,11 @@ export class ExpedientesPrPage implements OnInit { } ngOnInit() { + + const pathname = window.location.pathname + this.router.events.forEach((event) => { - if(event instanceof NavigationEnd && event.url == this.router.url) { + if(event instanceof NavigationEnd && event.url == pathname) { this.refreshing(); } }); diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.ts b/src/app/pages/gabinete-digital/gabinete-digital.page.ts index 3e3e06a8c..014efec3e 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.ts +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.ts @@ -112,10 +112,15 @@ export class GabineteDigitalPage implements OnInit { ngOnInit() { - this.router.events.forEach((event) => { - if(event instanceof NavigationEnd && event.url == this.router.url) { + const pathname = window.location.pathname + + this.router.events.forEach((event) => { + if(event instanceof NavigationEnd && event.url == pathname) { this.checkRoutes(); this.LoadCounts(); + console.log('yes', pathname) + } else { + console.log('not') } }); diff --git a/src/app/pages/gabinete-digital/pendentes/pendentes.page.ts b/src/app/pages/gabinete-digital/pendentes/pendentes.page.ts index 3d9309608..363602e0e 100644 --- a/src/app/pages/gabinete-digital/pendentes/pendentes.page.ts +++ b/src/app/pages/gabinete-digital/pendentes/pendentes.page.ts @@ -38,8 +38,10 @@ export class PendentesPage implements OnInit { ngOnInit() { //Inicializar segment this.segment = "despachos"; + + const pathname = window.location.pathname this.router.events.forEach((event) => { - if(event instanceof NavigationEnd && event.url == this.router.url) { + if(event instanceof NavigationEnd && event.url == pathname) { this.refreshing(); } }); diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index f73261083..b060456b9 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -67,8 +67,11 @@ export class PublicationsPage implements OnInit { } ngOnInit() { + + const pathname = window.location.pathname + this.router.events.forEach((event) => { - if(event instanceof NavigationEnd && event.url == this.router.url) { + if(event instanceof NavigationEnd && event.url == pathname) { this.getActions(); } }); diff --git a/src/app/shared/agenda/event-list/event-list.page.ts b/src/app/shared/agenda/event-list/event-list.page.ts index 91fe48d1c..19f64b4a7 100644 --- a/src/app/shared/agenda/event-list/event-list.page.ts +++ b/src/app/shared/agenda/event-list/event-list.page.ts @@ -44,9 +44,11 @@ export class EventListPage implements OnInit { } this.LoadToApproveEvents(); - + + const pathname = window.location.pathname + this.router.events.forEach((event) => { - if(event instanceof NavigationEnd && event.url == this.router.url) { + if(event instanceof NavigationEnd && event.url == pathname) { this.LoadToApproveEvents(); } }); diff --git a/src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page.ts b/src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page.ts index ed8b1de8b..2bc78b563 100644 --- a/src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page.ts +++ b/src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page.ts @@ -65,8 +65,11 @@ ngOnInit() { //Inicializar segment this.segment = "despachos"; this.LoadList(); + + const pathname = window.location.pathname + this.router.events.forEach((event) => { - if(event instanceof NavigationEnd && event.url == this.router.url) { + if(event instanceof NavigationEnd && event.url == pathname) { this.doRefresh(); } }); diff --git a/src/app/shared/gabinete-digital/despachos/despachos.page.ts b/src/app/shared/gabinete-digital/despachos/despachos.page.ts index bfbbb6d2f..4e48b64d2 100644 --- a/src/app/shared/gabinete-digital/despachos/despachos.page.ts +++ b/src/app/shared/gabinete-digital/despachos/despachos.page.ts @@ -65,8 +65,10 @@ export class DespachosPage implements OnInit { //Inicializar segment this.segment = "despachos"; this.LoadList(); + + const pathname = window.location.pathname this.router.events.forEach((event) => { - if(event instanceof NavigationEnd && event.url == this.router.url) { + if(event instanceof NavigationEnd && event.url == pathname) { this.doRefresh(); } }); diff --git a/src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.ts b/src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.ts index 437e27e36..6de5efb3c 100644 --- a/src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.ts +++ b/src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.ts @@ -32,8 +32,10 @@ serialNumber:string; ngOnInit() { this.LoadList(); + + const pathname = window.location.pathname this.router.events.forEach((event) => { - if(event instanceof NavigationEnd && event.url == this.router.url) { + if(event instanceof NavigationEnd && event.url == pathname) { this.doRefresh(); } }); diff --git a/src/app/shared/gabinete-digital/diplomas/diplomas.page.ts b/src/app/shared/gabinete-digital/diplomas/diplomas.page.ts index dddaae1d8..5631af3d0 100644 --- a/src/app/shared/gabinete-digital/diplomas/diplomas.page.ts +++ b/src/app/shared/gabinete-digital/diplomas/diplomas.page.ts @@ -30,8 +30,11 @@ constructor( } ngOnInit() { + + const pathname = window.location.pathname + this.router.events.forEach((event) => { - if(event instanceof NavigationEnd && event.url == this.router.url) { + if(event instanceof NavigationEnd && event.url == pathname) { this.refreshing(); } }); diff --git a/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts b/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts index b10b79e00..cd21180ff 100644 --- a/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts +++ b/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts @@ -40,8 +40,10 @@ export class EventsToApprovePage implements OnInit { this.LoadToApproveEvents(); + const pathname = window.location.pathname + this.router.events.forEach((event) => { - if(event instanceof NavigationEnd && event.url == this.router.url) { + if(event instanceof NavigationEnd && event.url == pathname) { this.LoadToApproveEvents(); } }); diff --git a/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.ts b/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.ts index e945a551d..5e01214e2 100644 --- a/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.ts +++ b/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.ts @@ -39,8 +39,11 @@ export class ExpedientesPrPage implements OnInit { } ngOnInit() { + + const pathname = window.location.pathname + this.router.events.forEach((event) => { - if(event instanceof NavigationEnd && event.url == this.router.url) { + if(event instanceof NavigationEnd && event.url == pathname) { this.refreshing(); } }); diff --git a/src/app/shared/gabinete-digital/expedients/expedients.page.ts b/src/app/shared/gabinete-digital/expedients/expedients.page.ts index 5508efaef..e34d2bec4 100644 --- a/src/app/shared/gabinete-digital/expedients/expedients.page.ts +++ b/src/app/shared/gabinete-digital/expedients/expedients.page.ts @@ -42,8 +42,10 @@ export class ExpedientsPage implements OnInit { //Inicializar segment this.segment = "expedientes"; this.LoadList(); + + const pathname = window.location.pathname this.router.events.forEach((event) => { - if(event instanceof NavigationEnd && event.url == this.router.url) { + if(event instanceof NavigationEnd && event.url == pathname) { this.LoadList(); } }); diff --git a/src/app/shared/gabinete-digital/pedidos/pedidos.page.ts b/src/app/shared/gabinete-digital/pedidos/pedidos.page.ts index 67c88265e..49aa193b6 100644 --- a/src/app/shared/gabinete-digital/pedidos/pedidos.page.ts +++ b/src/app/shared/gabinete-digital/pedidos/pedidos.page.ts @@ -49,8 +49,10 @@ export class PedidosPage implements OnInit { ngOnInit() { this.LoadList(); + + const pathname = window.location.pathname this.router.events.forEach((event) => { - if(event instanceof NavigationEnd && event.url == this.router.url) { + if(event instanceof NavigationEnd && event.url == pathname) { this.doRefresh(); } }); diff --git a/src/app/shared/gabinete-digital/pendentes/pendentes.page.ts b/src/app/shared/gabinete-digital/pendentes/pendentes.page.ts index 66c9cb530..e43b725c5 100644 --- a/src/app/shared/gabinete-digital/pendentes/pendentes.page.ts +++ b/src/app/shared/gabinete-digital/pendentes/pendentes.page.ts @@ -46,8 +46,10 @@ export class PendentesPage implements OnInit { this.segment = "despachos"; this.LoadList(); + const pathname = window.location.pathname + this.router.events.forEach((event) => { - if(event instanceof NavigationEnd && event.url == this.router.url) { + if(event instanceof NavigationEnd && event.url == pathname) { this.LoadList(); } });