From 7ff4eb67fc7eb380e7480541297eed30c9f79700 Mon Sep 17 00:00:00 2001 From: "EQUILIBRIUM\\hirondino.van-dunem" Date: Wed, 8 Jun 2022 12:12:57 +0100 Subject: [PATCH 01/19] create function to mark active item in list on accoes presidenciais --- src/app/pages/publications/publications.page.html | 1 + src/app/pages/publications/publications.page.ts | 4 ++++ .../publication/view-publications/view-publications.page.ts | 2 ++ 3 files changed, 7 insertions(+) diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index f42b34e44..36e1a4dc4 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -225,6 +225,7 @@ (goBackToViewPublications)="goBackToViewPublications()" (closeDesktopComponent)="closeDesktopComponent($event)" (getActions)="getActions()" + (ativaClasse)="ativaClasse($event)" > diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index 10ef64bf8..7b6276b71 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -343,6 +343,10 @@ export class PublicationsPage implements OnInit { } + ativaClasse(folderId: string){ + this.idSelected = folderId; + } + async viewPublications(folderId: string) { this.folderId = folderId 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 ebca0dcd1..ccb8f9512 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.ts +++ b/src/app/shared/publication/view-publications/view-publications.page.ts @@ -34,6 +34,7 @@ export class ViewPublicationsPage implements OnInit { @Output() closeDesktopComponent = new EventEmitter(); @Output() goBacktoPublicationDetails = new EventEmitter(); @Output() getActions= new EventEmitter(); + @Output() ativaClasse= new EventEmitter(); publicationPipe = new PublicationPipe() @@ -252,6 +253,7 @@ export class ViewPublicationsPage implements OnInit { // } this.openPublicationDetails.emit(publicationId); + this.ativaClasse.emit(this.folderId); } From 4c3480554755ef4ae78c149e69c23aa993f44b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Wed, 8 Jun 2022 13:02:43 +0100 Subject: [PATCH 02/19] Duplicated publications solved --- .../publication/view-publications/view-publications.page.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ccb8f9512..7b5e5efb8 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.ts +++ b/src/app/shared/publication/view-publications/view-publications.page.ts @@ -54,10 +54,10 @@ export class ViewPublicationsPage implements OnInit { this.folderId = this.folderId['ProcessId'] } - this.getPublicationsIds(); - this.getPublicationDetail(); + //this.getPublicationsIds(); window['app-view-publications-page-doRefresh'] = this.doRefresh + this.getPublicationDetail(); } ngOnChanges(changes: any): void { From 162a39454afa6eb98a420aa57d7288e40f44aba9 Mon Sep 17 00:00:00 2001 From: "EQUILIBRIUM\\hirondino.van-dunem" Date: Wed, 8 Jun 2022 14:34:01 +0100 Subject: [PATCH 03/19] edit mark ative item in list on accoes presidenciais --- src/app/pages/publications/publications.page.html | 1 - src/app/pages/publications/publications.page.ts | 8 ++++---- .../view-publications/view-publications.page.ts | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index 36e1a4dc4..f42b34e44 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -225,7 +225,6 @@ (goBackToViewPublications)="goBackToViewPublications()" (closeDesktopComponent)="closeDesktopComponent($event)" (getActions)="getActions()" - (ativaClasse)="ativaClasse($event)" > diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index 7b6276b71..218cf7478 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -343,10 +343,6 @@ export class PublicationsPage implements OnInit { } - ativaClasse(folderId: string){ - this.idSelected = folderId; - } - async viewPublications(folderId: string) { this.folderId = folderId @@ -405,6 +401,7 @@ export class PublicationsPage implements OnInit { goBackToViewPublications() { this.closeDesktopComponent(); + this.idSelected = this.folderId; this.desktopComponent.showViewPublication = true; } @@ -412,6 +409,7 @@ export class PublicationsPage implements OnInit { // Emitters goBackToPubications() { this.closeDesktopComponent(); + this.idSelected = this.folderId; this.desktopComponent.showViewPublication = true; } @@ -433,6 +431,7 @@ export class PublicationsPage implements OnInit { // edit publication will send null if (folderId != undefined) { this.folderId = folderId; + this.idSelected = this.folderId; } this.publication = publication; @@ -449,6 +448,7 @@ export class PublicationsPage implements OnInit { this.publicationId = publicationId; this.closeDesktopComponent(); + this.idSelected = this.folderId; this.desktopComponent.showPublicationDetail = true; } 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 7b5e5efb8..e23d412a2 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.ts +++ b/src/app/shared/publication/view-publications/view-publications.page.ts @@ -34,7 +34,6 @@ export class ViewPublicationsPage implements OnInit { @Output() closeDesktopComponent = new EventEmitter(); @Output() goBacktoPublicationDetails = new EventEmitter(); @Output() getActions= new EventEmitter(); - @Output() ativaClasse= new EventEmitter(); publicationPipe = new PublicationPipe() @@ -197,6 +196,7 @@ export class ViewPublicationsPage implements OnInit { } async openEditPublication(folderId?:any){ + console.log('object'); if( window.innerWidth < 701) { const modal = await this.modalController.create({ component: EditActionPage, @@ -253,7 +253,6 @@ export class ViewPublicationsPage implements OnInit { // } this.openPublicationDetails.emit(publicationId); - this.ativaClasse.emit(this.folderId); } From 46537b61e8da68cff0ace976d80df54204788abf Mon Sep 17 00:00:00 2001 From: "EQUILIBRIUM\\hirondino.van-dunem" Date: Thu, 9 Jun 2022 09:10:36 +0100 Subject: [PATCH 04/19] disable past dates on agenda --- src/app/shared/agenda/new-event/new-event.page.html | 2 ++ src/app/shared/agenda/new-event/new-event.page.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/app/shared/agenda/new-event/new-event.page.html b/src/app/shared/agenda/new-event/new-event.page.html index c51ac294f..f70060fab 100644 --- a/src/app/shared/agenda/new-event/new-event.page.html +++ b/src/app/shared/agenda/new-event/new-event.page.html @@ -128,6 +128,7 @@ placeholder="Choose a date" [(ngModel)]="postEvent.StartDate" [disabled]="disabled" + [min]="currentDate" > Date: Thu, 9 Jun 2022 09:37:58 +0100 Subject: [PATCH 05/19] disable past dates on accoes --- src/app/shared/publication/new-action/new-action.page.html | 2 ++ src/app/shared/publication/new-action/new-action.page.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/app/shared/publication/new-action/new-action.page.html b/src/app/shared/publication/new-action/new-action.page.html index b46192da2..1304afdd1 100644 --- a/src/app/shared/publication/new-action/new-action.page.html +++ b/src/app/shared/publication/new-action/new-action.page.html @@ -46,6 +46,7 @@ placeholder="Choose a date*" [(ngModel)]="folder.DateBegin" [disabled]="disabled" + [min]="currentDate" > Date: Thu, 9 Jun 2022 09:54:26 +0100 Subject: [PATCH 06/19] disable past dates on agenda-edit --- src/app/shared/agenda/edit-event/edit-event.page.html | 2 ++ src/app/shared/agenda/edit-event/edit-event.page.ts | 1 + 2 files changed, 3 insertions(+) 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 00c2e0949..f533c3b11 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.html +++ b/src/app/shared/agenda/edit-event/edit-event.page.html @@ -118,6 +118,7 @@ [(ngModel)]="postEvent.StartDate" [max]="maxDate" [disabled]="disabled" + [min]="currentDate" > Date: Thu, 9 Jun 2022 10:24:50 +0100 Subject: [PATCH 07/19] mark ative item in list on accoes-edit --- src/app/pages/publications/publications.page.ts | 1 + .../publication/view-publications/view-publications.page.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index 218cf7478..345388407 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -440,6 +440,7 @@ export class PublicationsPage implements OnInit { async editPublication(foolderId: string) { this.closeDesktopComponent(); + this.idSelected = this.folderId; this.desktopComponent.showEditActions = true; } 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 e23d412a2..f950b0878 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.ts +++ b/src/app/shared/publication/view-publications/view-publications.page.ts @@ -196,7 +196,7 @@ export class ViewPublicationsPage implements OnInit { } async openEditPublication(folderId?:any){ - console.log('object'); + if( window.innerWidth < 701) { const modal = await this.modalController.create({ component: EditActionPage, From 64a27f0bb1b8bfdd43b03997fa85f9d5414abb9c Mon Sep 17 00:00:00 2001 From: "EQUILIBRIUM\\hirondino.van-dunem" Date: Fri, 10 Jun 2022 12:37:10 +0100 Subject: [PATCH 08/19] disable and validate past dates on new and edit accoes on mobile view --- .../edit-action/edit-action.page.html | 2 +- .../edit-action/edit-action.page.ts | 17 +++++++++++++++-- .../publications/new-action/new-action.page.ts | 12 ++++++++++-- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/app/pages/publications/edit-action/edit-action.page.html b/src/app/pages/publications/edit-action/edit-action.page.html index 11a687578..afd8220da 100644 --- a/src/app/pages/publications/edit-action/edit-action.page.html +++ b/src/app/pages/publications/edit-action/edit-action.page.html @@ -36,7 +36,7 @@ diff --git a/src/app/pages/publications/edit-action/edit-action.page.ts b/src/app/pages/publications/edit-action/edit-action.page.ts index 7e582fff8..59517d6af 100644 --- a/src/app/pages/publications/edit-action/edit-action.page.ts +++ b/src/app/pages/publications/edit-action/edit-action.page.ts @@ -22,13 +22,14 @@ export class EditActionPage implements OnInit { public showSeconds = false; public touchUi = false; public enableMeridian = false; - public minDate = new Date().toISOString().slice(0,10) + public minDate = new Date().toISOString() public maxDate: any; public stepHour = 1; public stepMinute = 5; public stepSecond = 5; public dateControlStart = new FormControl(moment("DD MM YYYY hh")); public dateControlEnd = new FormControl(moment("DD MM YYYY hh")); + currentDate = new Date(); folder: PublicationFolder; folderId: string; @@ -64,8 +65,15 @@ export class EditActionPage implements OnInit { } get dateValid() { + var validado: boolean; + if (window.innerWidth <= 800) { - return this.folder.DateBegin < this.folder.DateEnd? ['ok']: [] + if ((this.folder.DateBegin < this.folder.DateEnd) && (new Date(this.folder.DateBegin).getTime() > this.currentDate.getTime())) { + validado = true; + }else{ + validado = false; + } + return validado == true ? ['ok']: []; } else { return ['ok'] } @@ -89,6 +97,11 @@ export class EditActionPage implements OnInit { } async save() { + this.injectValidation() + this.runValidation() + + if(this.Form.invalid) return false + let body = { ProcessId: this.folderId, Description: this.folder.Description, diff --git a/src/app/pages/publications/new-action/new-action.page.ts b/src/app/pages/publications/new-action/new-action.page.ts index 6e086e615..34c7f3dd9 100644 --- a/src/app/pages/publications/new-action/new-action.page.ts +++ b/src/app/pages/publications/new-action/new-action.page.ts @@ -43,13 +43,14 @@ export class NewActionPage implements OnInit { public showSeconds = false; public touchUi = false; public enableMeridian = false; - public minDate = new Date().toISOString().slice(0,10) + public minDate = new Date().toISOString() public endMinDate = new Date(new Date().getTime() + 15 * 60000); public stepHour = 1; public stepMinute = 5; public stepSecond = 5; public dateControlStart = new FormControl(moment("DD MM YYYY hh")); public dateControlEnd = new FormControl(moment("DD MM YYYY hh")); + currentDate = new Date(); showLoader = false @@ -94,8 +95,15 @@ export class NewActionPage implements OnInit { } get dateValid() { + var validado: boolean; + if (window.innerWidth <= 800) { - return this.folder.DateBegin < this.folder.DateEnd? ['ok']: [] + if ((this.folder.DateBegin < this.folder.DateEnd) && (new Date(this.folder.DateBegin).getTime() > this.currentDate.getTime())) { + validado = true; + }else{ + validado = false; + } + return validado == true ? ['ok']: []; } else { return ['ok'] } From 6895b5893018cfb9aaebbf4bfd4604651b736f4b Mon Sep 17 00:00:00 2001 From: "EQUILIBRIUM\\hirondino.van-dunem" Date: Fri, 10 Jun 2022 14:52:05 +0100 Subject: [PATCH 09/19] redirect user to login when session expired --- src/app/app.component.ts | 6 ++++-- src/app/home/home.page.ts | 7 ++++++- src/app/services/inativity.service.ts | 7 ++++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index fadb07747..14ab0d183 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -12,7 +12,8 @@ import { SqliteService } from 'src/app/services/sqlite.service'; import { BackgroundService } from 'src/app/services/background.service'; import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx'; import { StorageService } from 'src/app/services/storage.service'; -import { MessageModel } from './models/beast-orm' +import { MessageModel } from './models/beast-orm'; +import { InativityService } from "src/app/services/inativity.service"; const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { parse: { @@ -43,7 +44,8 @@ export class AppComponent { private screenOrientation: ScreenOrientation, private sqliteservice: SqliteService, private backgroundservice: BackgroundService, - private storageservice: StorageService + private storageservice: StorageService, + private InativityService: InativityService ) { // this.createCacheFolder() this.initializeApp(); diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index 732fc50af..6e0f74a4d 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -118,7 +118,12 @@ export class HomePage implements OnInit { const pathname = window.location.pathname SessionStore.setUrlBeforeInactivity(pathname) - this.router.navigate(['/inactivity']); + + if (this.platform.is('mobileweb')) { + this.router.navigate(['/inactivity']); + }else{ + this.router.navigate(['/']); + } } } diff --git a/src/app/services/inativity.service.ts b/src/app/services/inativity.service.ts index 1ea52ceca..e90571ed8 100644 --- a/src/app/services/inativity.service.ts +++ b/src/app/services/inativity.service.ts @@ -11,7 +11,7 @@ export class InativityService { private router: Router, ) { - var t; + var time; window.onload = resetTimer; window.onmousemove = resetTimer; window.onmousedown = resetTimer; // catches touchscreen presses as well @@ -28,8 +28,9 @@ export class InativityService { } function resetTimer() { - clearTimeout(t); - t = setTimeout(userIsNotActive, 60000 * 5); // time is in milliseconds + clearTimeout(time); + // t = setTimeout(userIsNotActive, 60000 * 5); // time is in milliseconds + time = setTimeout(userIsNotActive, 3000); } } } From 125fd51cee7dde95035a52e8616d0f5abc937cfd Mon Sep 17 00:00:00 2001 From: "EQUILIBRIUM\\hirondino.van-dunem" Date: Fri, 10 Jun 2022 15:02:14 +0100 Subject: [PATCH 10/19] redirect user to login when session expired changed --- src/app/services/inativity.service.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/services/inativity.service.ts b/src/app/services/inativity.service.ts index e90571ed8..a4892dd1d 100644 --- a/src/app/services/inativity.service.ts +++ b/src/app/services/inativity.service.ts @@ -29,8 +29,7 @@ export class InativityService { function resetTimer() { clearTimeout(time); - // t = setTimeout(userIsNotActive, 60000 * 5); // time is in milliseconds - time = setTimeout(userIsNotActive, 3000); + time = setTimeout(userIsNotActive, 60000 * 5); // time is in milliseconds } } } From c965f0b5489d093eee2176408d6c8d7b5204369f Mon Sep 17 00:00:00 2001 From: "EQUILIBRIUM\\hirondino.van-dunem" Date: Tue, 14 Jun 2022 14:23:17 +0100 Subject: [PATCH 11/19] define date of last occurrence on agenda new and edit function --- .../agenda/edit-event/edit-event.page.ts | 43 +++++++++++++++++++ .../shared/agenda/new-event/new-event.page.ts | 39 +++++++++++++++++ 2 files changed, 82 insertions(+) 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 25e0db208..f30fd1a33 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.ts +++ b/src/app/shared/agenda/edit-event/edit-event.page.ts @@ -137,6 +137,8 @@ export class EditEventPage implements OnInit { this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString(); + this.postEvent.EventRecurrence.LastOccurrence = this.currentDate; + setTimeout(() => { this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString(); @@ -226,6 +228,8 @@ export class EditEventPage implements OnInit { } onSelectedRecurringChanged(ev:any){ + + this.calculetedLastOccurrence(ev); if(ev.length > 1){ @@ -236,6 +240,45 @@ export class EditEventPage implements OnInit { } } + calculetedLastOccurrence(type:number){ + console.log(type); + var valor; + var opcao: boolean; + if (type == 0) { + valor = 7; + opcao = true; + } else if(type == 1){ + valor = 30; + opcao = true; + } else if(type == 2){ + valor = 1; + opcao = false; + }else if(type == 3){ + valor = 5; + opcao = false; + } + this.defineLastOccurrence(valor, opcao); + } + + + defineLastOccurrence(valor:number, opcao:boolean){ + var time = new Date(this.postEvent.EndDate); + if (opcao == true) { + time.setDate(time.getDate() + valor); + this.postEvent.EventRecurrence.LastOccurrence = time; + } else { + time = new Date( + time.getFullYear() + valor, + time.getMonth(), + time.getDate(), + time.getHours(), + time.getMinutes() + ); + this.postEvent.EventRecurrence.LastOccurrence = time; + } + + } + async save() { 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 f4fa0b50a..b9819c308 100644 --- a/src/app/shared/agenda/new-event/new-event.page.ts +++ b/src/app/shared/agenda/new-event/new-event.page.ts @@ -365,6 +365,8 @@ export class NewEventPage implements OnInit { onSelectedRecurringChanged(ev:any){ + this.calculetedLastOccurrence(ev); + if(ev.length > 1){ this.postEvent.EventRecurrence.Type = ev.filter(data => data != '-1'); @@ -374,8 +376,45 @@ export class NewEventPage implements OnInit { } } + calculetedLastOccurrence(type:number){ + console.log(type); + var valor; + var opcao: boolean; + if (type == 0) { + valor = 7; + opcao = true; + } else if(type == 1){ + valor = 30; + opcao = true; + } else if(type == 2){ + valor = 1; + opcao = false; + }else if(type == 3){ + valor = 5; + opcao = false; + } + this.defineLastOccurrence(valor, opcao); + } + defineLastOccurrence(valor:number, opcao:boolean){ + var time = new Date(this.postEvent.EndDate); + if (opcao == true) { + time.setDate(time.getDate() + valor); + this.postEvent.EventRecurrence.LastOccurrence = time; + } else { + time = new Date( + time.getFullYear() + valor, + time.getMonth(), + time.getDate(), + time.getHours(), + time.getMinutes() + ); + this.postEvent.EventRecurrence.LastOccurrence = time; + } + + } + async save() { this.injectValidation() From 097b4398bebb19eda16404f45f125bb85ab24f78 Mon Sep 17 00:00:00 2001 From: "EQUILIBRIUM\\hirondino.van-dunem" Date: Wed, 15 Jun 2022 15:19:40 +0100 Subject: [PATCH 12/19] disable past dates on accoes-edit --- src/app/shared/publication/edit-action/edit-action.page.html | 2 +- src/app/shared/publication/edit-action/edit-action.page.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/shared/publication/edit-action/edit-action.page.html b/src/app/shared/publication/edit-action/edit-action.page.html index 173d6e34f..1c10a1a44 100644 --- a/src/app/shared/publication/edit-action/edit-action.page.html +++ b/src/app/shared/publication/edit-action/edit-action.page.html @@ -36,7 +36,7 @@ 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 42312aa68..7569c9a76 100644 --- a/src/app/shared/publication/edit-action/edit-action.page.ts +++ b/src/app/shared/publication/edit-action/edit-action.page.ts @@ -29,6 +29,7 @@ export class EditActionPage implements OnInit { public stepSecond = 5; public dateControlStart = new FormControl(moment("DD MM YYYY hh")); public dateControlEnd = new FormControl(moment("DD MM YYYY hh")); + public currentDate = new Date(); folder: PublicationFolder; @Input() folderId: string; From 555654df2328cc02257b985efa756a50235fe053 Mon Sep 17 00:00:00 2001 From: "EQUILIBRIUM\\hirondino.van-dunem" Date: Thu, 16 Jun 2022 10:49:59 +0100 Subject: [PATCH 13/19] define date of last occurrence on agenda in event-edit and approve-event function --- .../approve-event/approve-event.page.html | 11 +++-- .../approve-event/approve-event.page.ts | 1 + .../edit-event-to-approve.page.ts | 44 +++++++++++++++++++ .../agenda/edit-event/edit-event.page.ts | 8 ---- .../agenda/view-event/view-event.page.html | 5 +-- .../agenda/view-event/view-event.page.ts | 1 + 6 files changed, 56 insertions(+), 14 deletions(-) diff --git a/src/app/shared/agenda/approve-event/approve-event.page.html b/src/app/shared/agenda/approve-event/approve-event.page.html index e3f5efea6..3ebb71116 100644 --- a/src/app/shared/agenda/approve-event/approve-event.page.html +++ b/src/app/shared/agenda/approve-event/approve-event.page.html @@ -66,9 +66,14 @@

{{customDate}}

das {{loadedEvent.workflowInstanceDataFields.StartDate | date: 'HH:mm'}} às {{loadedEvent.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}

-

{{loadedEvent.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ loadedEvent.workflowInstanceDataFields.StartDate | date: 'dd/M/yy'}}

-

(Não se repete)

-

Repete

+

{{loadedEvent.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ loadedEvent.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}}

+

+ Diário + Semanal + Mensal + Anual + (Não se repete) +

diff --git a/src/app/shared/agenda/approve-event/approve-event.page.ts b/src/app/shared/agenda/approve-event/approve-event.page.ts index 84340d863..b2e7b0ac6 100644 --- a/src/app/shared/agenda/approve-event/approve-event.page.ts +++ b/src/app/shared/agenda/approve-event/approve-event.page.ts @@ -71,6 +71,7 @@ export class ApproveEventPage implements OnInit { this.processes.GetTask(this.serialNumber).subscribe(res => { this.loadedEvent = res; + console.log(this.loadedEvent); this.today = new Date(res.workflowInstanceDataFields.StartDate); // this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); diff --git a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts index 7fa166360..c1f5bffcd 100644 --- a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts +++ b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts @@ -179,6 +179,9 @@ export class EditEventToApprovePage implements OnInit { } onSelectedRecurringChanged(ev:any) { + + this.calculetedLastOccurrence(ev); + if(ev.length > 1) { this.eventProcess.workflowInstanceDataFields.OccurrenceType = ev.filter(data => data != '-1'); @@ -188,6 +191,45 @@ export class EditEventToApprovePage implements OnInit { } } + calculetedLastOccurrence(type:number){ + console.log(type); + var valor; + var opcao: boolean; + if (type == 0) { + valor = 7; + opcao = true; + } else if(type == 1){ + valor = 30; + opcao = true; + } else if(type == 2){ + valor = 1; + opcao = false; + }else if(type == 3){ + valor = 5; + opcao = false; + } + this.defineLastOccurrence(valor, opcao); + } + + + defineLastOccurrence(valor:number, opcao:boolean){ + var time = new Date(this.eventProcess.workflowInstanceDataFields.EndDate); + if (opcao == true) { + time.setDate(time.getDate() + valor); + this.eventProcess.workflowInstanceDataFields.LastOccurrence = time; + } else { + time = new Date( + time.getFullYear() + valor, + time.getMonth(), + time.getDate(), + time.getHours(), + time.getMinutes() + ); + this.eventProcess.workflowInstanceDataFields.LastOccurrence = time; + } + + } + setOtherData() { if(this.eventProcess.workflowInstanceDataFields.ParticipantsList) { this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => { @@ -291,6 +333,8 @@ export class EditEventToApprovePage implements OnInit { } }) + console.log(this.eventProcess); + const event: EventToApproveEdit = { SerialNumber: this.eventProcess.serialNumber, Body: this.eventProcess.workflowInstanceDataFields.Body, 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 f30fd1a33..34b210462 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.ts +++ b/src/app/shared/agenda/edit-event/edit-event.page.ts @@ -119,14 +119,6 @@ export class EditEventPage implements OnInit { this.setIntervenient.emit(this.taskParticipants); this.setIntervenientCC.emit(this.taskParticipantsCc); - this.isEventEdited = false; - - if(this.postEvent.IsRecurring == false) { - this.isRecurring = "Não se repete"; - } - else{ - this.isRecurring = "Repete"; - } } this.initCalendarName = this.postEvent.CalendarName; diff --git a/src/app/shared/agenda/view-event/view-event.page.html b/src/app/shared/agenda/view-event/view-event.page.html index 834cf7de3..185e14d62 100644 --- a/src/app/shared/agenda/view-event/view-event.page.html +++ b/src/app/shared/agenda/view-event/view-event.page.html @@ -53,13 +53,12 @@

{{customDate}}

das {{loadedEvent.StartDate | date: 'HH:mm'}} às {{loadedEvent.EndDate | date: 'HH:mm'}}

{{loadedEvent.StartDate | date: 'd/M/yy' }} - {{ loadedEvent.StartDate | date: 'dd/M/yy'}}

-

(Não se repete)

-

+

Diário Semanal Mensal Anual - Nunca + (Não se repete)

diff --git a/src/app/shared/agenda/view-event/view-event.page.ts b/src/app/shared/agenda/view-event/view-event.page.ts index 8cf67a75b..8855a1897 100644 --- a/src/app/shared/agenda/view-event/view-event.page.ts +++ b/src/app/shared/agenda/view-event/view-event.page.ts @@ -105,6 +105,7 @@ export class ViewEventPage implements OnInit { this.eventsService.getEvent(this.eventId).subscribe(res => { this.loadedEvent = res; + console.log(this.loadedEvent); this.today = new Date(res.StartDate); this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); }, (error)=> { From e665ca70c3583a9b65c29a3f5820f1218315da4e Mon Sep 17 00:00:00 2001 From: "EQUILIBRIUM\\hirondino.van-dunem" Date: Fri, 17 Jun 2022 16:00:39 +0100 Subject: [PATCH 14/19] correction of dates in the event-to-aprove --- .../edit-event-to-approve.page.html | 6 +++--- .../edit-event-to-approve.page.ts | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.html b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.html index 9aba6682d..01dfd4946 100644 --- a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.html +++ b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.html @@ -159,7 +159,7 @@ @@ -197,8 +197,8 @@ diff --git a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts index c1f5bffcd..248230c96 100644 --- a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts +++ b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts @@ -41,7 +41,7 @@ export class EditEventToApprovePage implements OnInit { public showSeconds = false; public touchUi = false; public enableMeridian = false; - public minDate = new Date().toISOString().slice(0,10) + public minDate = new Date() public endMinDate = new Date(new Date().getTime() + 15 * 60000); public maxDate: any; public stepHour = 1; @@ -192,7 +192,6 @@ export class EditEventToApprovePage implements OnInit { } calculetedLastOccurrence(type:number){ - console.log(type); var valor; var opcao: boolean; if (type == 0) { @@ -318,7 +317,10 @@ export class EditEventToApprovePage implements OnInit { if(this.Form.invalid) return false // set dates to eventProcess object - this.getDatepickerData() + this.dateControlStart = new FormControl(moment(new Date(this.eventProcess.workflowInstanceDataFields.StartDate)).add(1, 'hours')); + this.dateControlEnd = new FormControl(moment(new Date(this.eventProcess.workflowInstanceDataFields.EndDate)).add(1, 'hours')); + // this.restoreDatepickerData() + // this.getDatepickerData() this.taskParticipantsCc.forEach( e => { e.IsRequired = false @@ -333,15 +335,14 @@ export class EditEventToApprovePage implements OnInit { } }) - console.log(this.eventProcess); const event: EventToApproveEdit = { SerialNumber: this.eventProcess.serialNumber, Body: this.eventProcess.workflowInstanceDataFields.Body, Location: this.eventProcess.workflowInstanceDataFields.Location, Subject: this.eventProcess.workflowInstanceDataFields.Subject, - StartDate: this.eventProcess.workflowInstanceDataFields.StartDate, - EndDate: this.eventProcess.workflowInstanceDataFields.EndDate, + StartDate: this.dateControlStart.value, + EndDate: this.dateControlEnd.value, ReviewUserComment: '', Agenda: this.eventProcess.workflowInstanceDataFields.Agenda, MDName: this.eventProcess.workflowInstanceDataFields.MDName, @@ -516,7 +517,6 @@ export class EditEventToApprovePage implements OnInit { } getDatepickerData() { - this.eventProcess.workflowInstanceDataFields.StartDate = this.dateStart this.eventProcess.workflowInstanceDataFields.EndDate = this.dateEnd From 4ea374ad0afba1ad60c25d025f832857c7384a4c Mon Sep 17 00:00:00 2001 From: "EQUILIBRIUM\\hirondino.van-dunem" Date: Mon, 20 Jun 2022 09:24:53 +0100 Subject: [PATCH 15/19] remove formatting from event title --- src/app/shared/agenda/event-list/event-list.page.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/shared/agenda/event-list/event-list.page.scss b/src/app/shared/agenda/event-list/event-list.page.scss index 72b9e85f6..a9ce19c12 100644 --- a/src/app/shared/agenda/event-list/event-list.page.scss +++ b/src/app/shared/agenda/event-list/event-list.page.scss @@ -98,6 +98,7 @@ font-style: normal; line-height: normal; letter-spacing: normal; + text-transform: none ; color: var(--title-text-color); margin: 0; padding: 0; From 53ff43c05bd265f82d9f74eea4eb231a1d96699f Mon Sep 17 00:00:00 2001 From: "EQUILIBRIUM\\hirondino.van-dunem" Date: Mon, 20 Jun 2022 11:46:24 +0100 Subject: [PATCH 16/19] put loader in gabinete method enviar para pendentes --- src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts index e19baa83a..1c5683c65 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts +++ b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts @@ -426,10 +426,12 @@ export class PedidoPage implements OnInit { } sendExpedienteToPending() { + const loader = this.toastService.loading() this.processes.SetTaskToPending(this.serialnumber).subscribe(res => { this.goBack(); + loader.remove() }, () => { - + loader.remove() this.toastService._badRequest('Processo não encontrado') }); } From a42b336133e6d655545d6699fe0eb86246e0c5a4 Mon Sep 17 00:00:00 2001 From: "EQUILIBRIUM\\hirondino.van-dunem" Date: Mon, 20 Jun 2022 14:21:06 +0100 Subject: [PATCH 17/19] put loader in gabinete method despachos and despachos-pr --- .../despachos-pr/despacho-pr/despacho-pr.page.ts | 4 +++- .../gabinete-digital/despachos/despacho/despacho.page.ts | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) 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 99941db31..d5677927f 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 @@ -394,12 +394,14 @@ export class DespachoPrPage implements OnInit { } sendExpedienteToPending() { + const loader = this.toastService.loading() this.processes.SetTaskToPending(this.serialNumber).subscribe(res => { this.popoverController.dismiss('close') this.toastService._successMessage('Processo enviado para pendentes') this.goBack() + loader.remove() }, () => { - + loader.remove() this.toastService._badRequest('Processo não encontrado') }); } 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 2a05fb7e1..4d0a0c165 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -387,15 +387,17 @@ export class DespachoPage implements OnInit { } async sendExpedienteToPending() { - + const loader = this.toastService.loading() this.despachoService.sendExpedienteToPending(this.serialnumber).subscribe(res => { this.goBack(); + loader.remove() this.toastService.successMessage() }, error => { + loader.remove() this.toastService.badRequest("Processo não enviado para despacho") }); - + // loader.remove() } async openAddNoteModal(actionName: string) { From 4ffa969b0411e7ce20af9d87745ea5a535fa2a7c Mon Sep 17 00:00:00 2001 From: "EQUILIBRIUM\\hirondino.van-dunem" Date: Mon, 20 Jun 2022 16:26:30 +0100 Subject: [PATCH 18/19] change page redirect in gabinete method despachos-pr --- .../despachos-pr/despacho-pr/despacho-pr.page.ts | 5 ----- 1 file changed, 5 deletions(-) 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 d5677927f..a5a3cec8b 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 @@ -276,7 +276,6 @@ export class DespachoPrPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() - this.close(); this.toastService._successMessage() } catch (error) { this.toastService._badRequest() @@ -303,7 +302,6 @@ export class DespachoPrPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() this.toastService._successMessage('Processo arquivado') - this.close(); } catch (error) { this.toastService._badRequest('Processo não arquivado') } @@ -326,7 +324,6 @@ export class DespachoPrPage implements OnInit { }).toPromise() this.toastService._successMessage('Processo criado') - this.close(); } catch (error) { this.toastService._badRequest('Processo não criado') } @@ -352,7 +349,6 @@ export class DespachoPrPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() this.toastService._successMessage('') - this.close(); } catch (error) { this.toastService._badRequest() } @@ -379,7 +375,6 @@ export class DespachoPrPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() this.toastService._successMessage() - this.close(); } catch (error) { this.toastService._badRequest() } From 00ef86c688e188190348f083c3610df77c866043 Mon Sep 17 00:00:00 2001 From: Evandre Da Silva Date: Tue, 21 Jun 2022 16:13:57 +0100 Subject: [PATCH 19/19] fix: fixing bug on refresh gabinete digital page's --- .../gabinete-digital/gabinete-digital.module.ts | 12 ------------ .../pages/gabinete-digital/gabinete-digital.page.ts | 11 +++-------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/app/pages/gabinete-digital/gabinete-digital.module.ts b/src/app/pages/gabinete-digital/gabinete-digital.module.ts index 8249a4664..7e4a738a1 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.module.ts +++ b/src/app/pages/gabinete-digital/gabinete-digital.module.ts @@ -7,19 +7,7 @@ import { IonicModule } from '@ionic/angular'; import { GabineteDigitalPageRoutingModule } from './gabinete-digital-routing.module'; import { GabineteDigitalPage } from './gabinete-digital.page'; -import { SharedModule } from 'src/app/shared/shared.module'; -import { EventListPage } from 'src/app/shared/agenda/event-list/event-list.page'; -import { EmptyContainerPage } from 'src/app/shared/empty-container/empty-container.page'; -import { EventsToApprovePage } from 'src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page'; -import { ExpedientsPage } from 'src/app/shared/gabinete-digital/expedients/expedients.page'; -import { PendentesPage } from 'src/app/shared/gabinete-digital/pendentes/pendentes.page'; -import { PedidosPage } from 'src/app/shared/gabinete-digital/pedidos/pedidos.page'; -import { DespachosPage } from 'src/app/shared/gabinete-digital/despachos/despachos.page'; -import { DespachosPrPage } from 'src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page'; -import { DiplomasPage } from 'src/app/shared/gabinete-digital/diplomas/diplomas.page'; -import { ExpedientesPrPage } from 'src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page'; -import { DiplomasAssinarPage } from 'src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page'; import { EmptyContainerPageModule } from 'src/app/shared/empty-container/empty-container.module'; import { EventsToApprovePageModule } from 'src/app/shared/gabinete-digital/events-to-approve/events-to-approve.module'; diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.ts b/src/app/pages/gabinete-digital/gabinete-digital.page.ts index 3c977a90f..bdf689e9e 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.ts +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.ts @@ -40,7 +40,7 @@ import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe'; styleUrls: ['./gabinete-digital.page.scss'], }) -export class GabineteDigitalPage implements OnInit, DoCheck { +export class GabineteDigitalPage implements OnInit { segment: string; segmentVista: string; @@ -161,11 +161,6 @@ export class GabineteDigitalPage implements OnInit, DoCheck { this.checkRoutes(); } - - ngDoCheck(): void { - - } - closeAllDesktopComponent() { this.desktopComponent = { showEventList: false, @@ -568,10 +563,10 @@ export class GabineteDigitalPage implements OnInit, DoCheck { } else if (this.p.userRole(['PR'])) { allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Diploma Assinado') } - + console.log(this.p.userRole(['PR'])); this.addProcessToDB(allProcessesList) this.skeletonLoader = true; - + console.log(allProcessesList) this.allProcessesList = []; allProcessesList.forEach(element => {