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/10] 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/10] 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/10] 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/10] 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/10] 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/10] 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/10] 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/10] 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/10] 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/10] 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 } } }