From b15396e480128026fb64c9f1d8889556144893bc Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Mon, 30 May 2022 15:52:20 +0100 Subject: [PATCH 1/2] improve --- src/app/guards/inactivity.guard.ts | 41 ++----------------- .../chat-options-features.page.ts | 8 ++-- .../despacho-pr/despacho-pr.page.ts | 3 -- .../despachos/despacho/despacho.page.html | 4 +- .../despachos/despacho/despacho.page.ts | 8 ++-- .../book-meeting-modal.page.ts | 3 +- .../expediente-detail.page.html | 6 ++- .../expediente-detail.page.ts | 37 +---------------- .../expediente/expediente.page.ts | 2 +- .../expediente-pr/expediente-pr.page.html | 2 +- .../gabinete-digital.page.html | 4 +- .../gabinete-digital/gabinete-digital.page.ts | 2 - src/app/pages/search/search.page.ts | 2 +- .../shared/agenda/new-event/new-event.page.ts | 4 +- src/app/shared/chat/messages/messages.page.ts | 4 +- .../task-details/task-details.page.html | 2 +- 16 files changed, 30 insertions(+), 102 deletions(-) diff --git a/src/app/guards/inactivity.guard.ts b/src/app/guards/inactivity.guard.ts index 31daa8ec9..07758c649 100644 --- a/src/app/guards/inactivity.guard.ts +++ b/src/app/guards/inactivity.guard.ts @@ -22,42 +22,7 @@ export class InactivityGuard implements CanActivate { state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree { - if (this.platform.is('desktop') || this.platform.is('mobileweb')) { - if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){ - //When user has got access to Agenda but does not have their own calendar, goes to Agenda - if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0){ - this.router.navigate(['/home/agenda']); - } - else{ - this.router.navigate(['/home/events']); - } - } - //If user has access permission to both Chat and Action, goes to Chat by default. - else if((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.access)){ - this.router.navigate(['/home/chat']); - } - else if(this.p.userPermission(this.p.permissionList.Actions.access)) { - this.router.navigate(['/home/publications']); - } - else { - - this.alertController.create({ - cssClass: 'my-custom-class', - header: 'Utilizador sem acesso a aplicação', - buttons: [{ - text: 'Ok', - handler: () => { - - } - }] - }).then( async (alertPopup) => { - await alertPopup.present(); - }) - - } - - return false - } else if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin ) { + if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin ) { return true } else if(SessionStore.exist && !SessionStore.user.Inactivity) { return true @@ -77,7 +42,7 @@ export class InactivityGuard implements CanActivate { else if((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.access)){ this.router.navigate(['/home/chat']); } - else if(this.p.userPermission(this.p.permissionList.Actions.access)){ + else if(this.p.userPermission(this.p.permissionList.Actions.access)) { this.router.navigate(['/home/publications']); } else { @@ -90,7 +55,7 @@ export class InactivityGuard implements CanActivate { } }] - }).then( async (alertPopup)=>{ + }).then( async (alertPopup) => { await alertPopup.present(); }) } diff --git a/src/app/modals/chat-options-features/chat-options-features.page.ts b/src/app/modals/chat-options-features/chat-options-features.page.ts index 353c38aa2..f22b859c0 100644 --- a/src/app/modals/chat-options-features/chat-options-features.page.ts +++ b/src/app/modals/chat-options-features/chat-options-features.page.ts @@ -50,15 +50,15 @@ export class ChatOptionsFeaturesPage implements OnInit { } - notImplemented(){ + notImplemented() { this.alertService.presentAlert('Funcionalidade em desenvolvimento'); } - close(){ - if( window.innerWidth < 701){ + close() { + if( window.innerWidth < 701) { this.popoverController.dismiss(); } - else{ + else { this.modalController.dismiss(); } } diff --git a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts index 0ba668386..99941db31 100644 --- a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts +++ b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts @@ -569,9 +569,6 @@ export class DespachoPrPage implements OnInit { modal.onDidDismiss().then(res => { if (res['data'] == 'close') { this.close(); - /* - this.close(); - this.openMenu(); */ } }); } diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html index 19ddea156..5c69099f7 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html @@ -12,7 +12,7 @@
- {{ task.Folio}} + {{ task.Folio }}
@@ -62,7 +62,7 @@
Documentos Anexados
-

{{ Document.Assunto }}

+

{{ Document.Assunto || "Sem assunto" }}

{{ Document.Sender}}{{ Document.DocDate | date: 'dd/MM/yyyy HH:mm' }}

diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts index 0edc3c97b..0b8d7066c 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -305,10 +305,10 @@ export class DespachoPage implements OnInit { try { await this.despachoService.executado(note, documents, this.serialnumber).toPromise(); - this.toastService.successMessage('Processo criado') + this.toastService._successMessage('Processo criado') this.close(); } catch (error) { - this.toastService.badRequest("Processo não criado") + this.toastService._badRequest("Processo não criado") } finally { loader.remove() @@ -347,11 +347,11 @@ export class DespachoPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() - this.toastService.successMessage() + this.toastService._successMessage() this.close(); } catch (error) { - this.toastService.badRequest() + this.toastService._badRequest() } finally { loader.remove() diff --git a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts index c4294377e..066ebd408 100644 --- a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts +++ b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts @@ -325,6 +325,7 @@ export class BookMeetingModalPage implements OnInit { } } else{ + // alert(JSON.stringify(this.task)) this.toastService._successMessage('Não é possível marcar a reunião de momento'); } @@ -409,7 +410,7 @@ export class BookMeetingModalPage implements OnInit { modal.onDidDismiss().then((data) => { - if(data){ + if(data) { data = data['data']; const newAttendees: EventPerson[] = data['taskParticipants']; diff --git a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html index 28d912dca..3989b4955 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html +++ b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html @@ -59,7 +59,7 @@
Documentos Anexados
-

{{ Document.Assunto }}

+

{{ Document.Assunto || "Sem assunto" }}

{{ Document.Sender}}{{ Document.DocDate | date: 'dd/MM/yyyy HH:mm' }}

@@ -166,6 +166,8 @@
- +
+ +
diff --git a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts index ae4354548..da80cfbcb 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts +++ b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts @@ -320,42 +320,7 @@ export class ExpedienteDetailPage implements OnInit { goBack() { this.RouteService.goBack(); - /* if(this.task.Status == "Pending" && this.caller != 'events'){ - if (window.innerWidth <= 800) { - this.router.navigate(['/home/gabinete-digital/pendentes']); - } - else { - let navigationExtras: NavigationExtras = { - queryParams: { - "pendentes": true, - } - } - this.router.navigate(['/home/gabinete-digital'], navigationExtras); - } - } - else{ - this.activatedRoute.paramMap.subscribe(params => { - switch (params["params"].caller) { - case 'events': - this.router.navigate(['/home',params["params"].caller]); - break; - case 'gabinete-digital': - let navigationExtras: NavigationExtras = { - queryParams: { - "expedientes": true, - } - } - if( window.innerWidth < 801) { - this.router.navigate(['/home/gabinete-digital/expediente']); - } else { - this.router.navigate(['/home/gabinete-digital'], navigationExtras); - } - break; - - } - }); - } */ } sendExpedienteToPending() { @@ -383,7 +348,7 @@ export class ExpedienteDetailPage implements OnInit { "Remetente": res.workflowInstanceDataFields.Sender, "Note": res.workflowInstanceDataFields.TaskMessage || res.workflowInstanceDataFields.Note, "FolderId": res.workflowInstanceDataFields.FolderID, - "FsId": res.workflowInstanceDataFields.FsId, + "FsId": res.workflowInstanceDataFields.FsId || res.workflowInstanceDataFields.ApplicationID, "DocId": res.workflowInstanceDataFields.DocID, "WorkflowName": res.workflowDisplayName, "Status": res.workflowInstanceDataFields.Status, diff --git a/src/app/pages/gabinete-digital/expediente/expediente.page.ts b/src/app/pages/gabinete-digital/expediente/expediente.page.ts index 2a557ff6b..2e04cc42b 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente.page.ts +++ b/src/app/pages/gabinete-digital/expediente/expediente.page.ts @@ -83,7 +83,7 @@ export class ExpedientePage implements OnInit { }); this.taskslist = this.taskslist.filter(function(item) { return item.activityInstanceName != 'Retificar Expediente' - }) + }) this.listToPresent = this.sortService.sortDate(this.taskslist, 'taskStartDate') diff --git a/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.html b/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.html index a829e8d9c..6f023e836 100644 --- a/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.html +++ b/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.html @@ -68,7 +68,7 @@
Documentos Anexados
-

{{ Document.Assunto }}

+

{{ Document.Assunto || "Sem assunto" }}

{{ Document.Sender}}{{ Document.DocDate | date: 'dd/MM/yyyy HH:mm' }}

diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html index 58b7d79ad..b8566f650 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.html +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html @@ -36,7 +36,7 @@
- +
@@ -97,7 +97,7 @@ - + diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.ts b/src/app/pages/gabinete-digital/gabinete-digital.page.ts index d74ddca4f..5b37105c1 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.ts +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.ts @@ -383,8 +383,6 @@ export class GabineteDigitalPage implements OnInit, DoCheck { goToProcess(serialNumber: string, workflowName: string, activityName: string) { - alert('nice!!!') - if (workflowName == 'Despacho') { if (activityName == 'Tarefa de Despacho' || activityName == 'Concluir Despacho') { this.router.navigate(['/home/gabinete-digital/despachos', serialNumber, 'gabinete-digital']); diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index 998dc8932..dc6ca5916 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -717,7 +717,7 @@ export class SearchPage implements OnInit { if(ApplicationType == '8' || ApplicationType == '361') { - alert('view!!') + // alert('view!!') this.viewDocumentDetail(Id, ApplicationType); } } diff --git a/src/app/shared/agenda/new-event/new-event.page.ts b/src/app/shared/agenda/new-event/new-event.page.ts index f30eedaf4..132d95afe 100644 --- a/src/app/shared/agenda/new-event/new-event.page.ts +++ b/src/app/shared/agenda/new-event/new-event.page.ts @@ -475,7 +475,7 @@ export class NewEventPage implements OnInit { if(DocumentToSave.length == 0){ this.afterSave(); } - this.toastService.successMessage('Evento criado') + this.toastService._successMessage('Evento criado') }); } else { @@ -513,7 +513,7 @@ export class NewEventPage implements OnInit { if(DocumentToSave.length == 0){ this.afterSave(); } - this.toastService.successMessage('Evento criado') + this.toastService._successMessage('Evento criado') }); } diff --git a/src/app/shared/chat/messages/messages.page.ts b/src/app/shared/chat/messages/messages.page.ts index 7efd240dc..51b906f3a 100644 --- a/src/app/shared/chat/messages/messages.page.ts +++ b/src/app/shared/chat/messages/messages.page.ts @@ -287,8 +287,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy } async startRecording() { - if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})){ - if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})){ + if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})) { + if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})) { //if(await this.hasAudioRecordingPermission()){ if (this.recording) { return; diff --git a/src/app/shared/gabinete-digital/generic/task-details/task-details.page.html b/src/app/shared/gabinete-digital/generic/task-details/task-details.page.html index 2d2699ca0..6b49a086f 100644 --- a/src/app/shared/gabinete-digital/generic/task-details/task-details.page.html +++ b/src/app/shared/gabinete-digital/generic/task-details/task-details.page.html @@ -58,7 +58,7 @@
Documentos Anexados
-

{{ Document.Assunto }}

+

{{ Document.Assunto || "Sem assunto" }}

{{ Document.Sender}}{{ Document.DocDate | date: 'dd/MM/yyyy HH:mm' }}

From 7430bf7fe10d426442a996cd95281c6f010d0c64 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Mon, 30 May 2022 16:43:54 +0100 Subject: [PATCH 2/2] improve --- .../pages/agenda/new-event/new-event.page.ts | 17 ++++++++--------- .../shared/agenda/new-event/new-event.page.ts | 10 ++++++++-- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/app/pages/agenda/new-event/new-event.page.ts b/src/app/pages/agenda/new-event/new-event.page.ts index 241e22819..0ded75400 100644 --- a/src/app/pages/agenda/new-event/new-event.page.ts +++ b/src/app/pages/agenda/new-event/new-event.page.ts @@ -131,7 +131,7 @@ export class NewEventPage implements OnInit { this.getRecurrenceTypes(); if(this.selectedSegment != "Combinada"){ - this.postEvent ={ + this.postEvent = { EventId: '', Subject: '', Body: this.eventBody, @@ -153,7 +153,7 @@ export class NewEventPage implements OnInit { }; } else{ - this.postEvent ={ + this.postEvent = { EventId: '', Subject: '', Body: this.eventBody, @@ -176,7 +176,6 @@ export class NewEventPage implements OnInit { } window.onresize = (event) => { - // if not mobile remove all component if( window.innerWidth >= 1024){ this.modalController.dismiss(); } @@ -187,25 +186,25 @@ export class NewEventPage implements OnInit { } - close(){ + close() { this.modalController.dismiss(); } getRecurrenceTypes() { - this.eventService.getRecurrenceTypes().subscribe(res=>{ + this.eventService.getRecurrenceTypes().subscribe( res => { this.recurringTypes = res; }); } - onSelectedRecurringChanged(ev:any){ + onSelectedRecurringChanged(ev:any) { - if(ev.length > 1){ + if(ev.length > 1) { this.selectedRecurringType = ev.filter(data => data != '-1'); } - if(ev.length == 0){ + if(ev.length == 0) { this.selectedRecurringType = "-1"; } } @@ -286,7 +285,7 @@ export class NewEventPage implements OnInit { if(this.documents.length >= 0) { this.postEvent.HasAttachments = true; } - if(this.selectedRecurringType != '-1'){ + if(this.selectedRecurringType != '-1') { this.postEvent.EventRecurrence.Type = this.selectedRecurringType; } diff --git a/src/app/shared/agenda/new-event/new-event.page.ts b/src/app/shared/agenda/new-event/new-event.page.ts index 132d95afe..9ce709473 100644 --- a/src/app/shared/agenda/new-event/new-event.page.ts +++ b/src/app/shared/agenda/new-event/new-event.page.ts @@ -152,7 +152,11 @@ export class NewEventPage implements OnInit { ngOnInit() { - this.CalendarName = this.loggeduser.Profile; + + + if(!this.CalendarName) { + this.CalendarName = this.loggeduser.Profile; + } this.getRecurrenceTypes(); if(!this.restoreTemporaryData()){ @@ -574,7 +578,8 @@ export class NewEventPage implements OnInit { window['temp.path:/home/agenda/new-event.component.ts'] = { postEvent: this.postEvent, eventBody: this.eventBody, - segment: this.segment + segment: this.segment, + CalendarName: this.CalendarName } } @@ -591,6 +596,7 @@ export class NewEventPage implements OnInit { this.postEvent = restoredData.postEvent this.eventBody = restoredData.eventBody this.segment = restoredData.segment + this.CalendarName = restoredData.CalendarName // restore dater for date and hours picker