From 42ef6f0dc4cc82ff3b7d6adf1d70f6b2d69d96dd Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Thu, 16 Sep 2021 09:35:09 +0100 Subject: [PATCH] save --- .../document-detail/document-detail.page.ts | 2 +- .../document-set-up-meeting.page.ts | 26 ++++++++++++++----- .../all-processes/all-processes.page.ts | 19 +++++++++++++- 3 files changed, 38 insertions(+), 9 deletions(-) diff --git a/src/app/modals/document-detail/document-detail.page.ts b/src/app/modals/document-detail/document-detail.page.ts index f5fed8a0c..702fee697 100644 --- a/src/app/modals/document-detail/document-detail.page.ts +++ b/src/app/modals/document-detail/document-detail.page.ts @@ -174,7 +174,7 @@ export class DocumentDetailPage implements OnInit { }); await modal.present(); modal.onDidDismiss().then(res=>{ - this.location.back(); + //this.location.back(); }); } diff --git a/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts b/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts index c685cfe74..1837fb12c 100644 --- a/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts +++ b/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts @@ -119,6 +119,8 @@ export class DocumentSetUpMeetingPage implements OnInit { this.adding = "intervenient"; this.setDefaultTime() this.getRecurrenceTypes(); + console.log(this.document); + } getRecurrenceTypes() { @@ -207,14 +209,24 @@ export class DocumentSetUpMeetingPage implements OnInit { }) }) */ - this.document.Documents.forEach((e)=> { - this.docs.push({ - ApplicationId: e.ApplicationId || e.ApplicationType, - Source: 1, - SourceId: e.DocId || e.docID || e.docId, - SourceName: e.Assunto + if(this.document.Documents){ + this.document.Documents.forEach((e)=> { + this.docs.push({ + ApplicationId: e.ApplicationId || e.ApplicationType, + Source: 1, + SourceId: e.DocId || e.docID || e.docId, + SourceName: e.Assunto + }) }) - }) + } + else{ + this.docs.push({ + ApplicationId: this.document.ApplicationId || this.document.ApplicationType, + Source: 1, + SourceId: this.document.DocId || this.document.docID || this.document.docId, + SourceName: this.document.Assunto + }) + } console.log(this.docs); diff --git a/src/app/shared/gabinete-digital/all-processes/all-processes.page.ts b/src/app/shared/gabinete-digital/all-processes/all-processes.page.ts index cd39b96d8..66532d60c 100644 --- a/src/app/shared/gabinete-digital/all-processes/all-processes.page.ts +++ b/src/app/shared/gabinete-digital/all-processes/all-processes.page.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; +import { NavigationStart, Router } from '@angular/router'; import { LoginUserRespose } from 'src/app/models/user.model'; import { AuthService } from 'src/app/services/auth.service'; import { ProcessesService } from 'src/app/services/processes.service'; @@ -26,6 +26,16 @@ export class AllProcessesPage implements OnInit { ngOnInit() { this.loadAllProcesses(); + + this.router.events.forEach((event) => { + if (event instanceof NavigationStart && event.url.startsWith('/home/gabinete-digital')) { + if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) { + this.refreshing(); + } else { + this.loadAllProcesses(); + } + } + }); } doRefresh() { @@ -35,6 +45,13 @@ export class AllProcessesPage implements OnInit { }, 1000); } + refreshing() { + + setTimeout(() => { + this.loadAllProcesses(); + }, 1000); + } + async loadAllProcesses(){ let allProcessesList = await this.processesService.GetTasksList("", false).toPromise(); console.log(allProcessesList);