From c164621e75d8ffa17b27ccdc4d5564a4500c5eb3 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Wed, 30 Jun 2021 15:45:14 +0100 Subject: [PATCH 01/29] Improve --- .../edit-event-to-approve.page.ts | 77 +++++++++---------- 1 file changed, 38 insertions(+), 39 deletions(-) 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 c7df52414..007e5038e 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 @@ -95,8 +95,6 @@ export class EditEventToApprovePage implements OnInit { taskParticipantsCc: any = []; adding: "intervenient" | "CC" = "intervenient"; - Location = '' - showAttendees = false; InstanceId: string; @@ -123,53 +121,59 @@ export class EditEventToApprovePage implements OnInit { ngOnInit() { - if(!this.restoreTemporaryData()){ - alert('restore!!') + if(this.restoreTemporaryData()){ + this.setOtherData() + } else { + this.getTask(); + } - this.getTask(); - - // console.log(this.serialNumber); } async getTask() { - // console.log('this.eventProcess', this.eventProcess); - const result = await this.processes.GetTask(this.serialNumber).subscribe( result =>{ - this.eventProcess = result - - this.restoreDatepickerData() - - console.log(this.eventProcess.workflowInstanceDataFields.Subject) + this.processes.GetTask(this.serialNumber).subscribe( result =>{ + this.eventProcess = result + + this.restoreDatepickerData() // description let body : any =this.eventProcess.workflowInstanceDataFields.Body.replace(/<[^>]+>/g, '') this.eventProcess.workflowInstanceDataFields.Body = body - this.Location = this.eventProcess.workflowInstanceDataFields.Location this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId this.getAttachments() - - if(this.eventProcess.workflowInstanceDataFields.IsRecurring == false) { - this.isRecurring = "Não se repete"; - } - else { - this.isRecurring = "Repete"; - } + + this.setOtherData() - if(this.eventProcess.workflowInstanceDataFields.ParticipantsList) { - this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => { - if(e.IsRequired) { - this.taskParticipants.push(e); - } else { - this.taskParticipantsCc.push(e); - } - }) - } - + this.saveTemporaryData() }) } + setOtherData() { + + if(this.eventProcess.workflowInstanceDataFields.ParticipantsList) { + this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => { + if(e.IsRequired) { + this.taskParticipants.push(e); + } else { + this.taskParticipantsCc.push(e); + } + }) + } + + if(this.eventProcess.workflowInstanceDataFields.IsRecurring == false) { + this.isRecurring = "Não se repete"; + } + else { + this.isRecurring = "Repete"; + } + + this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId + + this.getAttachments() + } + close() { window['temp.path:/shared/agenda/edit-event-to-approve.ts'] = {} @@ -182,11 +186,11 @@ export class EditEventToApprovePage implements OnInit { //this.deleteTemporaryData(); } - save() { + save() { // set dates to eventProcess object this.getDatepickerData() - this.taskParticipantsCc.forEach(e=>{ + this.taskParticipantsCc.forEach( e => { e.IsRequired = false }) @@ -289,8 +293,6 @@ export class EditEventToApprovePage implements OnInit { async addParticipantsCC() { - // //this.saveTemporaryData(); - this.openAttendeesComponent.emit({ type: "CC" }); @@ -325,9 +327,6 @@ export class EditEventToApprovePage implements OnInit { } - // this.clearContact.emit(); - // } - async getAttachments() { let result: any = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise(); From 28c483ff0bf965e506ad8bbb604fa0528a4fc6a5 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Wed, 30 Jun 2021 15:48:37 +0100 Subject: [PATCH 02/29] save --- .../pages/publications/publications.page.html | 4 +- .../pages/publications/publications.page.scss | 4 ++ .../pages/publications/publications.page.ts | 39 ++++++++++++++----- src/app/services/publications.service.ts | 10 ++--- .../actions-options/actions-options.page.ts | 17 +++++++- 5 files changed, 54 insertions(+), 20 deletions(-) diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index 7996ac0ee..257096e4b 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -44,7 +44,7 @@

{{viagem.Description}}

{{viagem.Detail}}

-
+
@@ -60,7 +60,7 @@

{{evento.Description}}

-
+
diff --git a/src/app/pages/publications/publications.page.scss b/src/app/pages/publications/publications.page.scss index 80e4c2259..51eddcc14 100644 --- a/src/app/pages/publications/publications.page.scss +++ b/src/app/pages/publications/publications.page.scss @@ -157,6 +157,7 @@ ion-toolbar{ } .item-options{ + width: 25px; font-size: 20px; } @@ -174,4 +175,7 @@ ion-toolbar{ .aside-left{ width: 35%; } + .item-options{ + display: block !important; + } } diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index d678eb14f..877c2aefd 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -277,20 +277,41 @@ export class PublicationsPage implements OnInit { } } - async openOptions(taskAction?: any) { - - const popover = await this.modalController.create({ + async openOptions(id?: string) { + const enterAnimation = (baseEl: any) => { + const backdropAnimation = this.animationController.create() + .addElement(baseEl.querySelector('ion-backdrop')!) + .fromTo('opacity', '0.01', 'var(--backdrop-opacity)'); + + const wrapperAnimation = this.animationController.create() + .addElement(baseEl.querySelector('.modal-wrapper')!) + .keyframes([ + { offset: 0, opacity: '1', right: '-100%' }, + { offset: 1, opacity: '1', right: '0px' } + ]); + + return this.animationController.create() + .addElement(baseEl) + .easing('ease-out') + .duration(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ + enterAnimation, + leaveAnimation, component: ActionsOptionsPage, - cssClass: 'model aside-modal', + cssClass: 'model profile-modal search-submodal', componentProps: { - /* task: this.task, - fulltask: this.fulltask, */ - taskAction: taskAction, - showEnviarPendentes: false + id: id, }, //translucent: true }); - return await popover.present(); + return await modal.present(); } } \ No newline at end of file diff --git a/src/app/services/publications.service.ts b/src/app/services/publications.service.ts index 84f2e7483..989b3e1eb 100644 --- a/src/app/services/publications.service.ts +++ b/src/app/services/publications.service.ts @@ -58,15 +58,11 @@ export class PublicationsService { }); } - DeletePublicationFolderById(id:any){ - const geturl = environment.apiURL + 'presidentialActions'; - let params = new HttpParams(); - - params = params.set("id", id); - + DeletePresidentialAction(id:any){ + const geturl = environment.apiURL + 'presidentialActions/'+id; + let options = { headers: this.headers, - params: params }; return this.http.delete(`${geturl}`, options); } diff --git a/src/app/shared/popover/actions-options/actions-options.page.ts b/src/app/shared/popover/actions-options/actions-options.page.ts index 0bef4bc5e..95f8a71b3 100644 --- a/src/app/shared/popover/actions-options/actions-options.page.ts +++ b/src/app/shared/popover/actions-options/actions-options.page.ts @@ -1,5 +1,6 @@ import { Component, OnInit } from '@angular/core'; -import { ModalController, PopoverController } from '@ionic/angular'; +import { ModalController, NavParams, PopoverController } from '@ionic/angular'; +import { PublicationsService } from 'src/app/services/publications.service'; @Component({ selector: 'app-actions-options', @@ -8,12 +9,20 @@ import { ModalController, PopoverController } from '@ionic/angular'; }) export class ActionsOptionsPage implements OnInit { + id:string; + constructor( private popoverController: PopoverController, private modalController: ModalController, - ) { } + private navParams: NavParams, + private publicationsService: PublicationsService, + ) { + this.id = this.navParams.get('id'); + } ngOnInit() { + console.log(this.id); + } close () { @@ -23,7 +32,11 @@ export class ActionsOptionsPage implements OnInit { editAction(){} deleteAction(){ + console.log('HEY'); + console.log(this.id); + this.publicationsService.DeletePresidentialAction(this.id).toPromise(); + this.close(); } } From 5fb6ca2ecfbe0a3c3e38e6ed451102b20f591257 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Wed, 30 Jun 2021 16:11:07 +0100 Subject: [PATCH 03/29] Improve --- .../new-publication/new-publication.page.ts | 9 ++---- .../edit-event-to-approve.page.ts | 29 ++++++++++--------- .../attendee-modal/attendee-modal.page.ts | 11 ++++--- 3 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/app/pages/publications/new-publication/new-publication.page.ts b/src/app/pages/publications/new-publication/new-publication.page.ts index 2b85de163..43c264baf 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -177,16 +177,11 @@ export class NewPublicationPage implements OnInit { FileBase64: this.capturedImage, FileExtension: 'jpeg', } - - /* console.log('Create'); - console.log(this.publication); */ - this.publications.CreatePublication(this.folderId, this.publication).toPromise(); - this.close(); - try { console.log(this.publication); - await this.publications.CreatePublication(this.folderId, this.publication).toPromise() + await this.publications.CreatePublication(this.folderId, this.publication).toPromise(); + this.close(); this.toastService.successMessage("Publicação criado") 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 007e5038e..6749127ed 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 @@ -11,6 +11,7 @@ import { EventsService } from 'src/app/services/events.service'; import { ProcessesService } from 'src/app/services/processes.service'; import { ToastService } from 'src/app/services/toast.service'; import { NgxMatDateFormats } from '@angular-material-components/datetime-picker'; +import { removeDuplicate } from 'src/plugin/removeDuplicate.js' const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { parse: { @@ -58,8 +59,6 @@ export class EditEventToApprovePage implements OnInit { @ViewChild('fim') fim: any; @ViewChild('inicio') inicio: any; @ViewChild('picker1') picker1: any; - - @Input() serialNumber: string loadedAttachments: Attachment[]= [] @@ -91,8 +90,6 @@ export class EditEventToApprovePage implements OnInit { eventAttendees: EventPerson[]; loadedEventAttachments: Attachment[]; - taskParticipants: any = []; - taskParticipantsCc: any = []; adding: "intervenient" | "CC" = "intervenient"; showAttendees = false; @@ -106,6 +103,9 @@ export class EditEventToApprovePage implements OnInit { @Output() closeComponent = new EventEmitter(); @Input() saveData: any; + @Input() serialNumber: string + @Input() taskParticipants: EventPerson[]; + @Input() taskParticipantsCc: EventPerson[]; constructor( private modalController: ModalController, @@ -161,6 +161,9 @@ export class EditEventToApprovePage implements OnInit { } }) } + + this.taskParticipants = removeDuplicate(this.taskParticipants) + this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc) if(this.eventProcess.workflowInstanceDataFields.IsRecurring == false) { this.isRecurring = "Não se repete"; @@ -274,21 +277,21 @@ export class EditEventToApprovePage implements OnInit { // } dynamicSetIntervenient({taskParticipants, taskParticipantsCc}) { - this.taskParticipants = taskParticipants; - this.taskParticipantsCc = taskParticipantsCc; + this.taskParticipants = removeDuplicate(taskParticipants) ; + this.taskParticipantsCc = removeDuplicate(taskParticipantsCc) ; } - // async addParticipants() { + async addParticipants() { - // //this.saveTemporaryData(); + //this.saveTemporaryData(); - // this.openAttendeesComponent.emit({ - // type: "intervenient" - // }); + this.openAttendeesComponent.emit({ + type: "intervenient" + }); - // this.clearContact.emit(); - // } + this.clearContact.emit(); + } async addParticipantsCC() { diff --git a/src/app/shared/event/attendee-modal/attendee-modal.page.ts b/src/app/shared/event/attendee-modal/attendee-modal.page.ts index e6011df58..0c3a952e6 100644 --- a/src/app/shared/event/attendee-modal/attendee-modal.page.ts +++ b/src/app/shared/event/attendee-modal/attendee-modal.page.ts @@ -3,6 +3,7 @@ import { ModalController } from '@ionic/angular'; import { ContactsService } from 'src/app/services/contacts.service'; import { EventPerson } from 'src/app/models/eventperson.model'; import { removeDuplicate } from 'src/plugin/removeDuplicate.js' + @Component({ selector: 'app-attendee-modal', templateUrl: './attendee-modal.page.html', @@ -35,16 +36,14 @@ export class AttendeePage implements OnInit { private modalCtrl: ModalController, private contactsService: ContactsService ) { - this.LtaskParticipants = this.taskParticipants; - this.LtaskParticipantsCc = this.taskParticipantsCc; - + this.LtaskParticipants = removeDuplicate(this.taskParticipants); + this.LtaskParticipantsCc = removeDuplicate(this.taskParticipantsCc); } ngOnChanges(){ - this.LtaskParticipants = this.taskParticipants; - this.LtaskParticipantsCc = this.taskParticipantsCc; + this.LtaskParticipants = removeDuplicate(this.taskParticipants); + this.LtaskParticipantsCc = removeDuplicate(this.taskParticipantsCc); } - currentPath = window.location.pathname; @Input() adding: "intervenient" | "CC"; From 8feb2a4f6e895586c642cb0d9fe1dbe299635718 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Wed, 30 Jun 2021 16:12:47 +0100 Subject: [PATCH 04/29] save --- src/app/app-routing.module.ts | 4 + .../pages/publications/publications.module.ts | 2 + .../pages/publications/publications.page.html | 4 + .../pages/publications/publications.page.ts | 7 +- .../actions-options/actions-options.page.ts | 7 +- .../edit-action/edit-action-routing.module.ts | 17 +++ .../edit-action/edit-action.module.ts | 21 +++ .../edit-action/edit-action.page.html | 95 +++++++++++++ .../edit-action/edit-action.page.scss | 128 ++++++++++++++++++ .../edit-action/edit-action.page.spec.ts | 24 ++++ .../edit-action/edit-action.page.ts | 46 +++++++ 11 files changed, 350 insertions(+), 5 deletions(-) create mode 100644 src/app/shared/publication/edit-action/edit-action-routing.module.ts create mode 100644 src/app/shared/publication/edit-action/edit-action.module.ts create mode 100644 src/app/shared/publication/edit-action/edit-action.page.html create mode 100644 src/app/shared/publication/edit-action/edit-action.page.scss create mode 100644 src/app/shared/publication/edit-action/edit-action.page.spec.ts create mode 100644 src/app/shared/publication/edit-action/edit-action.page.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 4ff1bdf49..73dc21b82 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -143,6 +143,10 @@ const routes: Routes = [ path: 'actions-options', loadChildren: () => import('./shared/popover/actions-options/actions-options.module').then( m => m.ActionsOptionsPageModule) }, + { + path: 'edit-action', + loadChildren: () => import('./shared/publication/edit-action/edit-action.module').then( m => m.EditActionPageModule) + }, diff --git a/src/app/pages/publications/publications.module.ts b/src/app/pages/publications/publications.module.ts index 6439f05ae..245306b66 100644 --- a/src/app/pages/publications/publications.module.ts +++ b/src/app/pages/publications/publications.module.ts @@ -18,6 +18,7 @@ import { NewPublicationPageModule } from 'src/app/shared/publication/new-publica import { NewActionPageModule } from 'src/app/shared/publication/new-action/new-action.module'; import { PublicationDetailPageModule } from 'src/app/shared/publication/view-publications/publication-detail/publication-detail.module'; import { HeaderPageModule } from 'src/app/shared/header/header.module'; +import { EditActionPageModule } from 'src/app/shared/publication/edit-action/edit-action.module'; @NgModule({ @@ -32,6 +33,7 @@ import { HeaderPageModule } from 'src/app/shared/header/header.module'; NewPublicationPageModule, PublicationDetailPageModule, NewActionPageModule, + EditActionPageModule, ], declarations: [ PublicationsPage, diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index 257096e4b..f86d374aa 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -120,6 +120,10 @@ class="height-100 d-flex flex-column overflow-hidden background-white flex-grow-1" (closeDesktopComponent)="closeDesktopComponent($event)" > + + + + diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index 877c2aefd..86d31af4a 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -311,7 +311,12 @@ export class PublicationsPage implements OnInit { }, //translucent: true }); - return await modal.present(); + await modal.present(); + modal.onDidDismiss().then(res =>{ + if(res['data']=='edit'){ + this.desktopComponent.showAddActions = true; + } + }); } } \ No newline at end of file diff --git a/src/app/shared/popover/actions-options/actions-options.page.ts b/src/app/shared/popover/actions-options/actions-options.page.ts index 95f8a71b3..3db4d14ca 100644 --- a/src/app/shared/popover/actions-options/actions-options.page.ts +++ b/src/app/shared/popover/actions-options/actions-options.page.ts @@ -29,12 +29,11 @@ export class ActionsOptionsPage implements OnInit { this.modalController.dismiss(); } - editAction(){} + editAction(){ + this.modalController.dismiss('edit'); + } deleteAction(){ - console.log('HEY'); - - console.log(this.id); this.publicationsService.DeletePresidentialAction(this.id).toPromise(); this.close(); } diff --git a/src/app/shared/publication/edit-action/edit-action-routing.module.ts b/src/app/shared/publication/edit-action/edit-action-routing.module.ts new file mode 100644 index 000000000..1cc787832 --- /dev/null +++ b/src/app/shared/publication/edit-action/edit-action-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { EditActionPage } from './edit-action.page'; + +const routes: Routes = [ + { + path: '', + component: EditActionPage + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class EditActionPageRoutingModule {} diff --git a/src/app/shared/publication/edit-action/edit-action.module.ts b/src/app/shared/publication/edit-action/edit-action.module.ts new file mode 100644 index 000000000..87961f035 --- /dev/null +++ b/src/app/shared/publication/edit-action/edit-action.module.ts @@ -0,0 +1,21 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import { IonicModule } from '@ionic/angular'; + +import { EditActionPageRoutingModule } from './edit-action-routing.module'; + +import { EditActionPage } from './edit-action.page'; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + EditActionPageRoutingModule + ], + exports: [EditActionPage], + declarations: [EditActionPage] +}) +export class EditActionPageModule {} diff --git a/src/app/shared/publication/edit-action/edit-action.page.html b/src/app/shared/publication/edit-action/edit-action.page.html new file mode 100644 index 000000000..e8fba430a --- /dev/null +++ b/src/app/shared/publication/edit-action/edit-action.page.html @@ -0,0 +1,95 @@ + +
+
+ Editar acção presidencial +
+ + +
+
+ + +
+ +
+ +
+ +
+
+
+ +
+
+ + +
+
+
+ +
+
+
+ +
+
+ + +
+
+
+ +
+
+
+ +
+
+ +
+
+
+
+ + + +
+ + + + + + Cancelar + + + + + Criar + + + + diff --git a/src/app/shared/publication/edit-action/edit-action.page.scss b/src/app/shared/publication/edit-action/edit-action.page.scss new file mode 100644 index 000000000..9cbe53718 --- /dev/null +++ b/src/app/shared/publication/edit-action/edit-action.page.scss @@ -0,0 +1,128 @@ +:host{ + background: #fff; + } + ion-content{ + --background: transparent; + transform: translate3d(0, 5px, 0); + --border-radius: 30px; + } + ion-footer{ + background: #fff; + } + ion-toolbar{ + /* --background:#0782c9; */ + border-width: 0 !important; + } + .div-top-header{ + margin: 0 auto; + background-color: #0782c9; + overflow: auto; + padding-top: 15px; + border: 0!important; + } + .div-search{ + font-size: 45px; + float: left; + margin: 0 0 0 10px + } + .div-logo{ + background: transparent; + width: 140px; + margin: 5px 0 0px 71px; + float: left; + } + .div-logo img{ + width: 100%; + } + .div-profile{ + font-size: 45px; + float: right; + margin-right: 10px; + } + .content-top{ + background: #f3f2f2; + height: 20px; + margin: 0 auto; + border-top-left-radius: 25px; + border-top-right-radius: 25px; + } + .content-container{ + width: 100%; + margin:0 auto; + border-top-left-radius: 25px; + border-top-right-radius: 25px; + background: #ffffff; + height: 100%; + padding: 25px 20px 0 20px; + overflow: auto; + } + .title-content{ + margin: 0px auto; + overflow: auto; + padding: 0 !important; + } + .div-title{ + width: 180px; + /* padding: 0!important; */ + float: left; + margin: 2.5px 0 0 5px; + } + .title{ + font-size: 25px; + } + .container-div{ + margin-bottom: 15px; + overflow: auto; + } + .ion-item-container{ + margin: 15px auto; + border: 1px solid #ebebeb; + border-radius: 5px; + padding-left: 10px; + } + .ion-item-container-no-border{ + width: 100%; + margin: 0px auto; + padding: 0 !important; + overflow: auto; + } + .ion-item-class-2{ + margin: 0px auto; + } + .ion-icon-class{ + width: 45px; + height: 45px; + float: left; + padding: 10px; + font-size: 25px; + } + .ion-input-class{ + height: auto; + border: 1px solid #ebebeb; + border-radius: 5px; + padding-left: 5px; + padding-right: 10px; + float: left; + } + .ion-textarea-class{ + width: 315px; + height: auto; + border: 1px solid #ebebeb; + border-radius: 5px; + padding-left: 5px; + padding-right: 10px; + float: left; + } + .ion-input-class-no-height{ + border: 1px solid #ebebeb; + border-radius: 5px; + overflow: auto; + } + .actionType{ + float: right; + overflow: auto; + border-radius: 30px; + } + .ion-segment{ + --background: #0782c9; + } \ No newline at end of file diff --git a/src/app/shared/publication/edit-action/edit-action.page.spec.ts b/src/app/shared/publication/edit-action/edit-action.page.spec.ts new file mode 100644 index 000000000..402bd92ed --- /dev/null +++ b/src/app/shared/publication/edit-action/edit-action.page.spec.ts @@ -0,0 +1,24 @@ +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; + +import { EditActionPage } from './edit-action.page'; + +describe('EditActionPage', () => { + let component: EditActionPage; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ EditActionPage ], + imports: [IonicModule.forRoot()] + }).compileComponents(); + + fixture = TestBed.createComponent(EditActionPage); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/shared/publication/edit-action/edit-action.page.ts b/src/app/shared/publication/edit-action/edit-action.page.ts new file mode 100644 index 000000000..14ce5e68b --- /dev/null +++ b/src/app/shared/publication/edit-action/edit-action.page.ts @@ -0,0 +1,46 @@ +import { Component, EventEmitter, OnInit, Output } from '@angular/core'; +import { PublicationFolder } from 'src/app/models/publicationfolder'; + +@Component({ + selector: 'app-edit-action', + templateUrl: './edit-action.page.html', + styleUrls: ['./edit-action.page.scss'], +}) +export class EditActionPage implements OnInit { + + folder: PublicationFolder; + @Output() closeDesktopComponent= new EventEmitter(); + + constructor() { + this.folder = new PublicationFolder(); + } + + ngOnInit() { + } + + close(){ + this.closeDesktopComponent.emit(); + } + + save(){ + /* this.folder = { + ProcessId: null, + Description: this.folder.Description, + Detail: this.folder.Detail, + DateBegin: this.folder.DateBegin, + DateEnd: this.folder.DateEnd, + ActionType: this.segment, + } + console.log(this.folder); + + try { + await this.publication.CreatePublicationFolder(this.folder).toPromise() + this.close(); + this.toastService.successMessage('Acção presidencial criada') + } catch (error) { + this.toastService.badRequest('Não foi possivel criar a acção presidencial') + } */ + + } + +} From b1ce9c86857a8e8919eaee4d7e72d7359dbdb62b Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Wed, 30 Jun 2021 16:15:54 +0100 Subject: [PATCH 05/29] save --- src/app/pages/publications/publications.page.html | 3 ++- src/app/pages/publications/publications.page.ts | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index f86d374aa..109800c75 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -121,7 +121,8 @@ (closeDesktopComponent)="closeDesktopComponent($event)" > - + *ngIf="desktopComponent.showEditActions" + diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index 86d31af4a..9ed6cb827 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -39,7 +39,8 @@ export class PublicationsPage implements OnInit { showViewPublication: false, showAddNewPublication: false, showPublicationDetail: false, - showAddActions: false + showAddActions: false, + showEditActions: false } folderId: string; @@ -314,7 +315,7 @@ export class PublicationsPage implements OnInit { await modal.present(); modal.onDidDismiss().then(res =>{ if(res['data']=='edit'){ - this.desktopComponent.showAddActions = true; + this.desktopComponent.showEditActions = true; } }); } From 24bd68867ddd5fe9710356110ed31200ded3b79f Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Wed, 30 Jun 2021 16:18:48 +0100 Subject: [PATCH 06/29] save --- src/app/pages/publications/publications.page.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index 109800c75..d6a2499b9 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -120,9 +120,12 @@ class="height-100 d-flex flex-column overflow-hidden background-white flex-grow-1" (closeDesktopComponent)="closeDesktopComponent($event)" > - - *ngIf="desktopComponent.showEditActions" + From 9e7a6b050350596b077605843e75c8b5a6439727 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Wed, 30 Jun 2021 16:26:35 +0100 Subject: [PATCH 07/29] save --- src/app/pages/publications/publications.page.html | 3 ++- src/app/pages/publications/publications.page.ts | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index d6a2499b9..b21e9a287 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -75,7 +75,8 @@ desktopComponent.showViewPublication == false && desktopComponent.showAddNewPublication == false && desktopComponent.showPublicationDetail == false && - desktopComponent.showAddActions == false + desktopComponent.showAddActions == false && + desktopComponent.showEditActions == false )">
Nenhuma ação presidencial selecionada
diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index 9ed6cb827..2f9b573d1 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -275,6 +275,7 @@ export class PublicationsPage implements OnInit { showAddNewPublication: false, showPublicationDetail: false, showAddActions: false, + showEditActions: false, } } @@ -315,6 +316,11 @@ export class PublicationsPage implements OnInit { await modal.present(); modal.onDidDismiss().then(res =>{ if(res['data']=='edit'){ + //this.closeDesktopComponent(); + this.desktopComponent.showViewPublication = false, + this.desktopComponent.showAddNewPublication = false, + this.desktopComponent.showPublicationDetail = false, + this.desktopComponent.showAddActions = false, this.desktopComponent.showEditActions = true; } }); From 64b3602f49ac8a5067a0cf766385876d994f9319 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Wed, 30 Jun 2021 16:33:53 +0100 Subject: [PATCH 08/29] save --- .../view-publications/view-publications.page.ts | 2 +- src/app/services/publications.service.ts | 2 +- .../publication/edit-action/edit-action.page.ts | 12 +++++++++++- .../view-publications/view-publications.page.ts | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/app/pages/publications/view-publications/view-publications.page.ts b/src/app/pages/publications/view-publications/view-publications.page.ts index 192700c27..92f9c3776 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.ts +++ b/src/app/pages/publications/view-publications/view-publications.page.ts @@ -66,7 +66,7 @@ export class ViewPublicationsPage implements OnInit { } getPublicationDetail(){ - this.publications.GetPublicationFolderById(this.folderId).subscribe(res=>{ + this.publications.PresidentialAction(this.folderId).subscribe(res=>{ console.log(res); this.item = res; }); diff --git a/src/app/services/publications.service.ts b/src/app/services/publications.service.ts index 989b3e1eb..b8ce40165 100644 --- a/src/app/services/publications.service.ts +++ b/src/app/services/publications.service.ts @@ -29,7 +29,7 @@ export class PublicationsService { return this.http.get(`${geturl}`, options); } - GetPublicationFolderById(id:any){ + PresidentialAction(id:any){ const geturl = environment.apiURL + 'presidentialActions/'+id; let options = { 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 14ce5e68b..80c87a862 100644 --- a/src/app/shared/publication/edit-action/edit-action.page.ts +++ b/src/app/shared/publication/edit-action/edit-action.page.ts @@ -1,5 +1,6 @@ import { Component, EventEmitter, OnInit, Output } from '@angular/core'; import { PublicationFolder } from 'src/app/models/publicationfolder'; +import { PublicationsService } from 'src/app/services/publications.service'; @Component({ selector: 'app-edit-action', @@ -8,10 +9,13 @@ import { PublicationFolder } from 'src/app/models/publicationfolder'; }) export class EditActionPage implements OnInit { + folderId:string; folder: PublicationFolder; @Output() closeDesktopComponent= new EventEmitter(); - constructor() { + constructor( + private publicationsService: PublicationsService, + ) { this.folder = new PublicationFolder(); } @@ -22,6 +26,12 @@ export class EditActionPage implements OnInit { this.closeDesktopComponent.emit(); } + getPublicationDetail() { + this.publicationsService.PresidentialAction(this.folderId).subscribe(res=>{ + console.log(res); + }); + } + save(){ /* this.folder = { ProcessId: null, 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 c3613ef40..a0c8fdf05 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.ts +++ b/src/app/shared/publication/view-publications/view-publications.page.ts @@ -65,7 +65,7 @@ export class ViewPublicationsPage implements OnInit { } getPublicationDetail() { - this.publications.GetPublicationFolderById(this.folderId).subscribe(res=>{ + this.publications.PresidentialAction(this.folderId).subscribe(res=>{ console.log(res); this.item = res; }); From d4887c195866e666d80ab2078e46aa76d5aa735c Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Thu, 1 Jul 2021 09:36:17 +0100 Subject: [PATCH 09/29] save --- .../pages/publications/publications.page.html | 1 + .../pages/publications/publications.page.ts | 1 + .../view-publications.page.ts | 2 +- src/app/services/publications.service.ts | 11 ++++++- .../edit-action/edit-action.page.scss | 11 +++---- .../edit-action/edit-action.page.ts | 32 ++++++++++++------- .../view-publications.page.ts | 2 +- 7 files changed, 39 insertions(+), 21 deletions(-) diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index b21e9a287..54e4ef780 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -124,6 +124,7 @@ diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index 2f9b573d1..cfae7d49f 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -280,6 +280,7 @@ export class PublicationsPage implements OnInit { } async openOptions(id?: string) { + this.folderId = id; const enterAnimation = (baseEl: any) => { const backdropAnimation = this.animationController.create() .addElement(baseEl.querySelector('ion-backdrop')!) diff --git a/src/app/pages/publications/view-publications/view-publications.page.ts b/src/app/pages/publications/view-publications/view-publications.page.ts index 92f9c3776..d41e65fac 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.ts +++ b/src/app/pages/publications/view-publications/view-publications.page.ts @@ -66,7 +66,7 @@ export class ViewPublicationsPage implements OnInit { } getPublicationDetail(){ - this.publications.PresidentialAction(this.folderId).subscribe(res=>{ + this.publications.GetPresidentialAction(this.folderId).subscribe(res=>{ console.log(res); this.item = res; }); diff --git a/src/app/services/publications.service.ts b/src/app/services/publications.service.ts index b8ce40165..12da5c2fa 100644 --- a/src/app/services/publications.service.ts +++ b/src/app/services/publications.service.ts @@ -29,7 +29,16 @@ export class PublicationsService { return this.http.get(`${geturl}`, options); } - PresidentialAction(id:any){ + GetPresidentialAction(id:any){ + const geturl = environment.apiURL + 'presidentialActions/'+id; + + let options = { + headers: this.headers, + }; + return this.http.get(`${geturl}`, options); + } + + UpdatePresidentialAction(id:any){ const geturl = environment.apiURL + 'presidentialActions/'+id; let options = { diff --git a/src/app/shared/publication/edit-action/edit-action.page.scss b/src/app/shared/publication/edit-action/edit-action.page.scss index 9cbe53718..260338602 100644 --- a/src/app/shared/publication/edit-action/edit-action.page.scss +++ b/src/app/shared/publication/edit-action/edit-action.page.scss @@ -62,14 +62,13 @@ padding: 0 !important; } .div-title{ - width: 180px; - /* padding: 0!important; */ - float: left; - margin: 2.5px 0 0 5px; + width: fit-content; + float: left; + margin: 2.5px 0 0 5px; } .title{ - font-size: 25px; - } + font-size: 25px; + } .container-div{ margin-bottom: 15px; overflow: auto; 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 80c87a862..a1beb5c0b 100644 --- a/src/app/shared/publication/edit-action/edit-action.page.ts +++ b/src/app/shared/publication/edit-action/edit-action.page.ts @@ -1,6 +1,7 @@ -import { Component, EventEmitter, OnInit, Output } from '@angular/core'; +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { PublicationFolder } from 'src/app/models/publicationfolder'; import { PublicationsService } from 'src/app/services/publications.service'; +import { ToastService } from 'src/app/services/toast.service'; @Component({ selector: 'app-edit-action', @@ -9,48 +10,55 @@ import { PublicationsService } from 'src/app/services/publications.service'; }) export class EditActionPage implements OnInit { - folderId:string; + @Input() folderId: string; folder: PublicationFolder; + segment:string; @Output() closeDesktopComponent= new EventEmitter(); constructor( private publicationsService: PublicationsService, + private toastService: ToastService, ) { this.folder = new PublicationFolder(); } ngOnInit() { + console.log(this.folderId); + + this.getPublicationDetail(); } close(){ this.closeDesktopComponent.emit(); } - getPublicationDetail() { - this.publicationsService.PresidentialAction(this.folderId).subscribe(res=>{ - console.log(res); + getPublicationDetail(){ + this.publicationsService.GetPresidentialAction(this.folderId).subscribe(res=>{ + this.folder = res; }); } - save(){ - /* this.folder = { + async save(){ + console.log(this.folder); + + this.folder = { ProcessId: null, Description: this.folder.Description, Detail: this.folder.Detail, DateBegin: this.folder.DateBegin, DateEnd: this.folder.DateEnd, - ActionType: this.segment, + ActionType: this.folder.ActionType, } console.log(this.folder); - try { - await this.publication.CreatePublicationFolder(this.folder).toPromise() + /* try { + await this.publicationsService.UpdatePresidentialAction(this.folder).toPromise() this.close(); this.toastService.successMessage('Acção presidencial criada') } catch (error) { this.toastService.badRequest('Não foi possivel criar a acção presidencial') - } */ - + } + */ } } 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 a0c8fdf05..f1f44a37c 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.ts +++ b/src/app/shared/publication/view-publications/view-publications.page.ts @@ -65,7 +65,7 @@ export class ViewPublicationsPage implements OnInit { } getPublicationDetail() { - this.publications.PresidentialAction(this.folderId).subscribe(res=>{ + this.publications.GetPresidentialAction(this.folderId).subscribe(res=>{ console.log(res); this.item = res; }); From 60d6e6c53edf9dfe86873e9aefe6bff75596ad17 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Thu, 1 Jul 2021 09:52:36 +0100 Subject: [PATCH 10/29] Improve login --- src/app/pages/login/login.page.html | 10 +- src/app/pages/login/login.page.ts | 142 ++++++++++------------------ src/app/services/auth.service.ts | 4 + 3 files changed, 59 insertions(+), 97 deletions(-) diff --git a/src/app/pages/login/login.page.html b/src/app/pages/login/login.page.html index 4f8568efd..5ccb062a9 100644 --- a/src/app/pages/login/login.page.html +++ b/src/app/pages/login/login.page.html @@ -1,6 +1,6 @@
-
+
@@ -32,7 +32,7 @@
-
+
@@ -41,8 +41,8 @@
- Digite o PIN - Digite o novo PIN + Digite o PIN + Digite o novo PIN
@@ -70,7 +70,7 @@
-
+
Entrar com senha
diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 50b902e5c..3ab3f920b 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -1,25 +1,12 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import { AuthService } from 'src/app/services/auth.service'; -import { User, UserForm } from 'src/app/models/user.model'; +import { UserForm } from 'src/app/models/user.model'; import { ToastService } from 'src/app/services/toast.service'; import { environment } from 'src/environments/environment'; -import { AlertController, AnimationController, ModalController } from '@ionic/angular'; -import { StorageService } from 'src/app/services/storage.service'; -import { AuthConnstants } from 'src/app/config/auth-constants'; -import { PhotoService } from 'src/app/services/photo.service'; +import { AlertController } from '@ionic/angular'; import { NotificationsService } from 'src/app/services/notifications.service'; -import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import crypto from 'crypto-js' -import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; -import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; - -//import { Token } from '../../models/token.model'; -//import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx'; - -/* import { Plugins, PushNotification, PushNotificationToken, PushNotificationActionPerformed } from '@capacitor/core'; -const { PushNotifications } = Plugins; -*/ @Component({ selector: 'app-login', @@ -34,38 +21,44 @@ export class LoginPage implements OnInit { userattempt: UserForm; code = [] - setPint = false - pin = false + hasPin: boolean + loginPreference: string + hasSession = false + enterWithPassword = false - userLoginPreference: any constructor( - private http: HttpClient, private notificatinsservice: NotificationsService, private router: Router, private authService: AuthService, - private storageService: StorageService, private toastService: ToastService, - private photoService: PhotoService, - public alertController: AlertController, - private modalController: ModalController, - private animationController: AnimationController, - - //private fcm: FCM + public alertController: AlertController ) { + // App has session + if(!localStorage.getItem('UserData')) { + this.hasSession = false + } else { + this.hasSession = true + // this.router.navigate(['/home/events']); + } + let userData = JSON.parse(localStorage.getItem('UserData')) || {} - if (userData.hasOwnProperty('loginPreference')) { - this.userLoginPreference = userData.loginPreference - this.pin = true + const loginPreference = userData?.loginPreference + const pin = userData?.PIN + + if (pin) { + this.hasPin = true + } else { + this.hasPin = false + } + + if (loginPreference) { + this.loginPreference = loginPreference } else { - - this.userLoginPreference = '' - this.setPint = false - this.pin = false - + this.loginPreference = '' } } @@ -114,13 +107,14 @@ export class LoginPage implements OnInit { } */ getToken() { - this.notificatinsservice.getAndpostToken(this.username); + this.notificatinsservice.getAndpostToken(this.username); } async Login() { if (this.validateUsername()) { if(this.validatePassword()){ + this.userattempt = { username: this.username, password: this.password, @@ -128,26 +122,24 @@ export class LoginPage implements OnInit { BasicAuthKey: "" } let attempt = await this.authService.login(this.userattempt); - console.log(JSON.stringify(attempt)); if (attempt) { - //this.loginRocketChat(); this.authService.loginChat(this.userattempt); this.getToken(); + this.hasSession = true + this.hasPin = false + this.enterWithPassword = false - if(!this.pin) { - this.setPint = true - this.pin = true + if(!this.hasPin) { } else { this.router.navigate(['/home/events']); } - } else { this.toastService.badRequest('O nome de utilizador e/ou palavra-passe estão incorretas ou verifique a sua conexão com a internet e volte a tentar'); } } - else{ + else { this.toastService.badRequest('Por favor, insira a sua palavra-passe'); } } @@ -158,7 +150,6 @@ export class LoginPage implements OnInit { setCode(code: string) { - if(this.code.length < 4) { this.code.push(code) } @@ -168,25 +159,32 @@ export class LoginPage implements OnInit { const code = this.code.join('') const encrypted = crypto.SHA1(code) - if(this.setPint) { + if(!this.hasPin) { + // alert('storePin') this.storePin() } else { + // alert('pinLogin') this.pinLogin() } } - } clearCode() { this.code =[] } - pinLogin() { + pinLogin() { const code = this.code.join('') const encrypted = crypto.SHA1(code) + let userData = JSON.parse(localStorage.getItem('UserData')) || {} + const pin = userData?.PIN + + //if( encrypted == pin) { + if( encrypted == localStorage.getItem('PIN')) { + //this.toastService.successMessage() this.router.navigate(['/home/events']); } else { @@ -200,6 +198,12 @@ export class LoginPage implements OnInit { const code = this.code.join('') const encrypted = crypto.SHA1(code) + let userData: Object = JSON.parse(localStorage.getItem('UserData')) || {} + + userData['PIN'] = encrypted + + + localStorage.setItem('UserData', JSON.stringify(userData) ) localStorage.setItem('PIN', encrypted) @@ -207,50 +211,4 @@ export class LoginPage implements OnInit { } - - - async badRequest(message?: string, callback?) { - - - const enterAnimation = (baseEl: any) => { - const backdropAnimation = this.animationController.create() - .addElement(baseEl.querySelector('ion-backdrop')!) - .fromTo('opacity', '0.01', 'var(--backdrop-opacity)'); - - const wrapperAnimation = this.animationController.create() - .addElement(baseEl.querySelector('.modal-wrapper')!) - .keyframes([ - { offset: 0, opacity: '1', right: '-100%' }, - { offset: 1, opacity: '1', right: '0px' } - ]); - - return this.animationController.create() - .addElement(baseEl) - .easing('ease-out') - .duration(500) - .addAnimation([backdropAnimation, wrapperAnimation]); - } - - const leaveAnimation = (baseEl: any) => { - return enterAnimation(baseEl).direction('reverse'); - } - - - const modal = await this.modalController.create({ - enterAnimation, - leaveAnimation, - component: BadRequestPage, - componentProps: { - message: message || 'Processo não efetuado' , - }, - cssClass: 'notification-modal' - }); - - modal.present() - - setTimeout(()=> { - modal.dismiss() - },3000) - } - } \ No newline at end of file diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index 7fd25e3ea..326a4f6bb 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -28,6 +28,10 @@ export class AuthService { public alertController: AlertController, ) { + if(window.location.pathname != '' && !localStorage.getItem('UserData')) { + this.router.navigate(['/']); + } + this.headers = new HttpHeaders(); if (localStorage.getItem("user") != null) { From 4bf5640538d23d562c52afd49ab7974d715f1ef6 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Thu, 1 Jul 2021 09:57:01 +0100 Subject: [PATCH 11/29] Improve login --- .../shared/headers/header-no-search/profile/profile.page.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/shared/headers/header-no-search/profile/profile.page.html b/src/app/shared/headers/header-no-search/profile/profile.page.html index 6d54d67b5..a37d6e927 100644 --- a/src/app/shared/headers/header-no-search/profile/profile.page.html +++ b/src/app/shared/headers/header-no-search/profile/profile.page.html @@ -64,7 +64,7 @@ - + \ No newline at end of file From dee65e60cf6627690fc797ccac249063db5551c4 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Thu, 1 Jul 2021 10:10:21 +0100 Subject: [PATCH 12/29] improve event to edit --- src/app/pages/agenda/edit-event/edit-event.page.html | 3 ++- .../shared/headers/header-no-search/profile/profile.page.html | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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 2659fe497..ffa971123 100644 --- a/src/app/pages/agenda/edit-event/edit-event.page.html +++ b/src/app/pages/agenda/edit-event/edit-event.page.html @@ -176,7 +176,8 @@
- + +
diff --git a/src/app/shared/headers/header-no-search/profile/profile.page.html b/src/app/shared/headers/header-no-search/profile/profile.page.html index a37d6e927..025607064 100644 --- a/src/app/shared/headers/header-no-search/profile/profile.page.html +++ b/src/app/shared/headers/header-no-search/profile/profile.page.html @@ -7,9 +7,9 @@
Perfil
-
+
From 65e9a52e1c8d225a424f3e343c620c55518f792c Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Thu, 1 Jul 2021 10:17:25 +0100 Subject: [PATCH 13/29] Improve agenda --- src/app/pages/agenda/edit-event/edit-event.page.ts | 1 - 1 file changed, 1 deletion(-) 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 b86920f94..d9d87bc0b 100644 --- a/src/app/pages/agenda/edit-event/edit-event.page.ts +++ b/src/app/pages/agenda/edit-event/edit-event.page.ts @@ -47,7 +47,6 @@ export class EditEventPage implements OnInit { private eventsService: EventsService, public alertController: AlertController, private attachmentsService: AttachmentsService, - private animationController: AnimationController, private toastService: ToastService, private router: Router, ) { From fabab8b4aa6781091af4f8b0bf72396ce1d78fd5 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Thu, 1 Jul 2021 10:28:03 +0100 Subject: [PATCH 14/29] Save --- .../document-detail/document-detail.page.html | 38 ------------------- 1 file changed, 38 deletions(-) diff --git a/src/app/modals/document-detail/document-detail.page.html b/src/app/modals/document-detail/document-detail.page.html index 3dc1ed785..1bce97e89 100644 --- a/src/app/modals/document-detail/document-detail.page.html +++ b/src/app/modals/document-detail/document-detail.page.html @@ -1,41 +1,3 @@ - - - - Menu - - - - - - - Efectuar Despacho - - - - Pedido de Parecer - - - - Pedido de Deferimento - - - - Marcar reunião - - - - Descartar - - - - Enviar para pendentes - - - - -
- -
From 123c364ff066f4d790b9af7ddeddb08fdc5ba6fb Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Thu, 1 Jul 2021 10:29:33 +0100 Subject: [PATCH 15/29] Save --- src/app/pages/agenda/agenda.page.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/pages/agenda/agenda.page.html b/src/app/pages/agenda/agenda.page.html index 799d4b299..be3532bcf 100644 --- a/src/app/pages/agenda/agenda.page.html +++ b/src/app/pages/agenda/agenda.page.html @@ -123,8 +123,8 @@ - From 44e1927246b321054501f264c637351daa456959 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Thu, 1 Jul 2021 11:08:04 +0100 Subject: [PATCH 16/29] save --- src/app/home/home-routing.module.ts | 26 +++++++ src/app/models/publicationfolder.ts | 2 +- .../despachos/despacho/despacho.page.ts | 46 ++++++++++--- .../despachos/despachos.page.html | 2 +- .../despachos/despachos.page.ts | 12 +--- .../pedidos/pedido/pedido.page.ts | 20 +++--- .../gabinete-digital/pedidos/pedidos.page.ts | 7 +- .../pendentes/pendentes.page.ts | 67 +------------------ src/app/services/publications.service.ts | 6 +- .../actions-options/actions-options.page.ts | 5 +- .../despachos-options.page.ts | 43 +----------- .../edit-action/edit-action.page.html | 10 +-- .../edit-action/edit-action.page.ts | 19 ++---- 13 files changed, 100 insertions(+), 165 deletions(-) diff --git a/src/app/home/home-routing.module.ts b/src/app/home/home-routing.module.ts index cd42571d5..af999f471 100644 --- a/src/app/home/home-routing.module.ts +++ b/src/app/home/home-routing.module.ts @@ -154,6 +154,32 @@ const routes: Routes = [ }, ] }, + { + path: 'despachos', + children: [ + { + path: '', + loadChildren: ()=> import('../pages/gabinete-digital/despachos/despachos.module').then(m => m.DespachosPageModule), + }, + { + path:':SerialNumber/:caller', + loadChildren: ()=> import('../pages/gabinete-digital/despachos/despacho/despacho.module').then(m => m.DespachoPageModule), + }, + ] + }, + { + path: 'pedidos', + children: [ + { + path: '', + loadChildren: ()=> import('../pages/gabinete-digital/pedidos/pedidos.module').then(m => m.PedidosPageModule), + }, + { + path:':SerialNumber/:caller', + loadChildren: ()=> import('../pages/gabinete-digital/pedidos/pedido/pedido.module').then(m => m.PedidoPageModule), + }, + ] + }, { path:'event-list', children: [ diff --git a/src/app/models/publicationfolder.ts b/src/app/models/publicationfolder.ts index 8d9a4ecb4..19366e297 100644 --- a/src/app/models/publicationfolder.ts +++ b/src/app/models/publicationfolder.ts @@ -1,5 +1,5 @@ export class PublicationFolder { - ProcessId: number; + ProcessId: string; Description: string; Detail: string; DateBegin: string; 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 36632cd8e..5aba6db20 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -39,6 +39,7 @@ export class DespachoPage implements OnInit { fulltask: any; eventsList: Event[] = []; serialnumber: string; + caller:string; profile: string; intervenientes: any; cc: any = []; @@ -58,11 +59,16 @@ export class DespachoPage implements OnInit { private toastService: ToastService, ) { - this.activatedRoute.queryParams.subscribe(params => { - if(params["serialNumber"]) { - this.serialnumber = params["serialNumber"]; - console.log(params["serialNumber"]); + this.activatedRoute.paramMap.subscribe(params => { + console.log(params["params"]); + + if(params["params"].SerialNumber) { + this.serialnumber = params["params"].SerialNumber; } + if(params["params"].caller) { + this.caller = params["params"].caller; + } + }); } @@ -88,15 +94,30 @@ export class DespachoPage implements OnInit { } goBack() { - if (window.innerWidth <= 800) { - this.router.navigate(['/home/gabinete-digital/despachos']); - } else { - let navigationExtras: NavigationExtras = { - queryParams: { - 'despachos': true + if(this.task.Status == "Pending" && this.caller == 'gabinete-digital'){ + 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{ + if (window.innerWidth <= 800) { + this.router.navigate(['/home/gabinete-digital/despachos']); + } else { + let navigationExtras: NavigationExtras = { + queryParams: { + 'despachos': true + } + } + this.router.navigate(['/home/gabinete-digital'], navigationExtras); } - this.router.navigate(['/home/gabinete-digital'], navigationExtras); } } @@ -117,6 +138,7 @@ export class DespachoPage implements OnInit { "WorkflowName": res.workflowDisplayName, "DeadlineType": res.workflowInstanceDataFields.DeadlineType, "activityInstanceName": res.activityInstanceName, + "Status": res.workflowInstanceDataFields.Status, } this.fulltask = res; console.log(this.task); @@ -267,6 +289,8 @@ export class DespachoPage implements OnInit { } async sendExpedienteToPending() { + console.log(this.serialnumber); + this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{ console.log(res); this.close(); diff --git a/src/app/pages/gabinete-digital/despachos/despachos.page.html b/src/app/pages/gabinete-digital/despachos/despachos.page.html index 1f676176d..e280ad930 100644 --- a/src/app/pages/gabinete-digital/despachos/despachos.page.html +++ b/src/app/pages/gabinete-digital/despachos/despachos.page.html @@ -33,7 +33,7 @@
diff --git a/src/app/pages/gabinete-digital/despachos/despachos.page.ts b/src/app/pages/gabinete-digital/despachos/despachos.page.ts index 1ea664a91..73962cf15 100644 --- a/src/app/pages/gabinete-digital/despachos/despachos.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despachos.page.ts @@ -146,16 +146,8 @@ export class DespachosPage implements OnInit { }, 2000); } - async viewExpedientDetail(serialNumber:any) { - - let navigationExtras: NavigationExtras = { - queryParams: { - "serialNumber": serialNumber, - } - }; - - this.router.navigate(['/home/gabinete-digital/despachos/despacho'], navigationExtras); - + async GoToDespacho(serialNumber:any) { + this.router.navigate(['/home/gabinete-digital/despachos',serialNumber,'gabinete-digital']); } docIndex(index: number) { 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 2bb5e61b7..60b0a4e80 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts +++ b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts @@ -58,14 +58,18 @@ export class PedidoPage implements OnInit { private animationController: AnimationController, private toastService: ToastService,) { this.loggeduser = authService.ValidatedUser; - this.activatedRoute.queryParams.subscribe(params => { - if(params["serialNumber"]) { - this.serialnumber = params["serialNumber"]; - } - if(params["caller"]) { - this.caller = params["caller"]; - } - }); + + this.activatedRoute.paramMap.subscribe(params => { + console.log(params["params"]); + + if(params["params"].SerialNumber) { + this.serialnumber = params["params"].SerialNumber; + } + if(params["params"].caller) { + this.caller = params["params"].caller; + } + + }); } ngOnInit() { diff --git a/src/app/pages/gabinete-digital/pedidos/pedidos.page.ts b/src/app/pages/gabinete-digital/pedidos/pedidos.page.ts index 81e0fcec0..12af1ddce 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedidos.page.ts +++ b/src/app/pages/gabinete-digital/pedidos/pedidos.page.ts @@ -81,12 +81,7 @@ export class PedidosPage implements OnInit { } goToPedido(serialNumber:any){ - let navigationExtras: NavigationExtras = { - queryParams: { - "serialNumber": serialNumber, - } - }; - this.router.navigate(['/home/gabinete-digital/pedidos/pedido'], navigationExtras); + this.router.navigate(['/home/gabinete-digital/pedidos',serialNumber,'gabinete-digital']); } notImplemented(){ diff --git a/src/app/pages/gabinete-digital/pendentes/pendentes.page.ts b/src/app/pages/gabinete-digital/pendentes/pendentes.page.ts index fff07e2cc..5b26ddcc8 100644 --- a/src/app/pages/gabinete-digital/pendentes/pendentes.page.ts +++ b/src/app/pages/gabinete-digital/pendentes/pendentes.page.ts @@ -129,78 +129,17 @@ export class PendentesPage implements OnInit { async viewTaskDetails(serialNumber:string, workflowName:string) { if(workflowName == 'Despacho'){ - this.goToDespacho(serialNumber); + this.router.navigate(['/home/gabinete-digital/despachos',serialNumber,'gabinete-digital']); } else if(workflowName == 'Pedido de Parecer' || workflowName == 'Pedido de Deferimento'){ - this.goToPedido(serialNumber); + this.router.navigate(['/home/gabinete-digital/pedidos',serialNumber,'gabinete-digital']); } else if(workflowName == 'Expediente'){ - this.goToExpediente(serialNumber); + this.router.navigate(['/home/gabinete-digital/expediente',serialNumber,'gabinete-digital']); } } - - goToDespacho(serialNumber:any){ - let navigationExtras: NavigationExtras = { - queryParams: { - "serialNumber": serialNumber, - "from": "pendentes" - } - }; - this.router.navigate(['/home/gabinete-digital/despachos/despacho'], navigationExtras); - } - - goToPedido(serialNumber:any) { - let navigationExtras: NavigationExtras = { - queryParams: { - "serialNumber": serialNumber, - "from": "pendentes" - } - }; - this.router.navigate(['/home/gabinete-digital/pedidos/pedido'], navigationExtras); - } - - goToExpediente(serialNumber:any){ - this.router.navigate(['/home/gabinete-digital/expediente',serialNumber,'gabinete-digital']); - } - - - async openDespacho(serialNumber:string){ - - const modal = await this.modalController.create({ - component: DespachoPage, - componentProps:{ - enterAnimation: "", - serialNumber: serialNumber, - profile: this.profile, - }, - cssClass: 'modal modal-desktop', - }); - await modal.present(); - modal.onDidDismiss().then((res)=>{ - console.log('refresh list'); - this.LoadList(); - }); - } - - async openPedido(serialNumber:string){ - - const modal = await this.modalController.create({ - component: PedidoPage, - componentProps:{ - enterAnimation: "", - serialNumber: serialNumber, - profile: this.profile, - }, - cssClass: 'modal modal-desktop', - }); - await modal.present(); - modal.onDidDismiss().then((res)=>{ - console.log('refresh list'); - this.LoadList(); - }); - } } \ No newline at end of file diff --git a/src/app/services/publications.service.ts b/src/app/services/publications.service.ts index 12da5c2fa..9b5b4da46 100644 --- a/src/app/services/publications.service.ts +++ b/src/app/services/publications.service.ts @@ -38,13 +38,13 @@ export class PublicationsService { return this.http.get(`${geturl}`, options); } - UpdatePresidentialAction(id:any){ - const geturl = environment.apiURL + 'presidentialActions/'+id; + UpdatePresidentialAction(body:any){ + const geturl = environment.apiURL + 'presidentialActions'; let options = { headers: this.headers, }; - return this.http.get(`${geturl}`, options); + return this.http.put(`${geturl}`, body, options); } CreatePublicationFolder(body:any){ diff --git a/src/app/shared/popover/actions-options/actions-options.page.ts b/src/app/shared/popover/actions-options/actions-options.page.ts index 3db4d14ca..ce641025d 100644 --- a/src/app/shared/popover/actions-options/actions-options.page.ts +++ b/src/app/shared/popover/actions-options/actions-options.page.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { ModalController, NavParams, PopoverController } from '@ionic/angular'; +import { ModalController, NavParams } from '@ionic/angular'; import { PublicationsService } from 'src/app/services/publications.service'; @Component({ @@ -12,7 +12,6 @@ export class ActionsOptionsPage implements OnInit { id:string; constructor( - private popoverController: PopoverController, private modalController: ModalController, private navParams: NavParams, private publicationsService: PublicationsService, @@ -21,8 +20,6 @@ export class ActionsOptionsPage implements OnInit { } ngOnInit() { - console.log(this.id); - } close () { diff --git a/src/app/shared/popover/despachos-options/despachos-options.page.ts b/src/app/shared/popover/despachos-options/despachos-options.page.ts index c478e110d..a3013683d 100644 --- a/src/app/shared/popover/despachos-options/despachos-options.page.ts +++ b/src/app/shared/popover/despachos-options/despachos-options.page.ts @@ -1,20 +1,10 @@ import { Component, OnInit } from '@angular/core'; import { ProcessesService } from 'src/app/services/processes.service'; -import { AttachmentsService } from 'src/app/services/attachments.service'; -import { EventsService } from 'src/app/services/events.service'; -import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; import { ActivatedRoute, NavigationExtras, Router } from '@angular/router'; -import { formatDate } from '@angular/common'; -import { AnimationController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular'; -import { AlertService } from 'src/app/services/alert.service'; -import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page'; -import { momentG } from 'src/plugin/momentG' +import { AnimationController, ModalController, NavParams, PopoverController } from '@ionic/angular'; import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page'; import { DelegarPage } from 'src/app/modals/delegar/delegar.page'; import { AddNotePage } from 'src/app/modals/add-note/add-note.page'; -import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page'; -import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; -import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page'; import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page'; import { ToastService } from 'src/app/services/toast.service'; @@ -30,45 +20,26 @@ export class DespachosOptionsPage implements OnInit { task: any; fulltask: any; serialnumber: string; - profile: string constructor(private activateRoute: ActivatedRoute, private processes: ProcessesService, - private iab: InAppBrowser, - private attachmentsService: AttachmentsService, - private events: EventsService, - private menu: MenuController, private router: Router, private modalController: ModalController, - private alertService: AlertService, public popoverController: PopoverController, - private activatedRoute: ActivatedRoute, private animationController: AnimationController, private navParams: NavParams, private toastService: ToastService) { - this.task = this.navParams.get('task') this.fulltask = this.navParams.get('fulltask') - } ngOnInit() { - - this.profile = "mdgpr"; - - this.activatedRoute.queryParams.subscribe(params => { - if(params["serialNumber"]) { - this.serialnumber = params["serialNumber"]; - console.log(params["serialNumber"]); - } - }); } close () { this.goBack() } - async openExpedientActionsModal(taskAction: any, task: any) { this.popoverController.dismiss(); let classs; @@ -82,7 +53,6 @@ export class DespachosOptionsPage implements OnInit { componentProps: { taskAction: taskAction, task: task, - profile: this.profile, }, cssClass: classs, }); @@ -91,16 +61,14 @@ export class DespachosOptionsPage implements OnInit { console.log(res['data']); if(res['data']=='openDiscart'){ console.log('open discart'); - this.distartExpedientModal(); - } - }); } sendExpedienteToPending(){ - this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{ + this.popoverController.dismiss(); + this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{ console.log(res); this.close(); }); @@ -124,11 +92,7 @@ export class DespachosOptionsPage implements OnInit { modal.onDidDismiss().then(res=>{ if(res['data']=='close'){ this.close(); - /* console.log('2Expedient Discard closed2'); - this.close(); - this.openMenu(); */ } - }); } @@ -310,7 +274,6 @@ export class DespachosOptionsPage implements OnInit { } - goBack() { let navigationExtras: NavigationExtras = { 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 e8fba430a..21ceb8f32 100644 --- a/src/app/shared/publication/edit-action/edit-action.page.html +++ b/src/app/shared/publication/edit-action/edit-action.page.html @@ -82,14 +82,14 @@ - + - - Criar - + 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 a1beb5c0b..ec0f5200f 100644 --- a/src/app/shared/publication/edit-action/edit-action.page.ts +++ b/src/app/shared/publication/edit-action/edit-action.page.ts @@ -10,9 +10,8 @@ import { ToastService } from 'src/app/services/toast.service'; }) export class EditActionPage implements OnInit { - @Input() folderId: string; folder: PublicationFolder; - segment:string; + @Input() folderId: string; @Output() closeDesktopComponent= new EventEmitter(); constructor( @@ -23,8 +22,6 @@ export class EditActionPage implements OnInit { } ngOnInit() { - console.log(this.folderId); - this.getPublicationDetail(); } @@ -39,26 +36,24 @@ export class EditActionPage implements OnInit { } async save(){ - console.log(this.folder); - - this.folder = { - ProcessId: null, + let body = { + ProcessId: this.folderId, Description: this.folder.Description, Detail: this.folder.Detail, DateBegin: this.folder.DateBegin, DateEnd: this.folder.DateEnd, ActionType: this.folder.ActionType, } - console.log(this.folder); + console.log(body); - /* try { - await this.publicationsService.UpdatePresidentialAction(this.folder).toPromise() + try { + await this.publicationsService.UpdatePresidentialAction(body).toPromise() this.close(); this.toastService.successMessage('Acção presidencial criada') } catch (error) { this.toastService.badRequest('Não foi possivel criar a acção presidencial') } - */ + } } From 4035a22c2b6c3c51f9b8103273da80a978e38f00 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Thu, 1 Jul 2021 11:26:45 +0100 Subject: [PATCH 17/29] Save --- .../agenda/edit-event/edit-event.page.ts | 3 + .../events/edit-event/edit-event.page.ts | 1 + src/app/pages/login/login.page.html | 6 +- src/app/pages/login/login.page.ts | 64 ++++++++++--------- .../edit-event-to-approve.page.ts | 2 + .../edit-event-to-approve/edit-event.page.ts | 2 + 6 files changed, 44 insertions(+), 34 deletions(-) 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 d9d87bc0b..b91f3358e 100644 --- a/src/app/pages/agenda/edit-event/edit-event.page.ts +++ b/src/app/pages/agenda/edit-event/edit-event.page.ts @@ -50,6 +50,9 @@ export class EditEventPage implements OnInit { private toastService: ToastService, private router: Router, ) { + + + this.isEventEdited = false; this.postEvent = this.navParams.get('event'); this.caller = this.navParams.get('caller'); 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 787ae3e99..22b43307b 100644 --- a/src/app/pages/events/edit-event/edit-event.page.ts +++ b/src/app/pages/events/edit-event/edit-event.page.ts @@ -48,6 +48,7 @@ export class EditEventPage implements OnInit { private iab: InAppBrowser) { this.loadedEvent = new Event(); this.loadedEvent.Body = new EventBody(); + } ngOnInit() { diff --git a/src/app/pages/login/login.page.html b/src/app/pages/login/login.page.html index 5ccb062a9..c63aa3c63 100644 --- a/src/app/pages/login/login.page.html +++ b/src/app/pages/login/login.page.html @@ -1,6 +1,6 @@
-
+
@@ -32,7 +32,7 @@
-
+
@@ -74,7 +74,7 @@ Entrar com senha
-
+
Limpar
diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 3ab3f920b..d59e0bcad 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -24,7 +24,7 @@ export class LoginPage implements OnInit { hasPin: boolean loginPreference: string hasSession = false - enterWithPassword = false + setPin = false constructor( @@ -35,35 +35,37 @@ export class LoginPage implements OnInit { public alertController: AlertController ) { - // App has session - if(!localStorage.getItem('UserData')) { - this.hasSession = false - } else { - this.hasSession = true - // this.router.navigate(['/home/events']); - } - - let userData = JSON.parse(localStorage.getItem('UserData')) || {} - - const loginPreference = userData?.loginPreference - const pin = userData?.PIN - - if (pin) { - this.hasPin = true - } else { - this.hasPin = false - } - - if (loginPreference) { - this.loginPreference = loginPreference - - } else { - this.loginPreference = '' - } - } - ngOnInit() {} + ngOnInit() { + + // App has session + if(!localStorage.getItem('UserData')) { + this.hasSession = false + } else { + this.hasSession = true + // this.router.navigate(['/home/events']); + } + + let userData = JSON.parse(localStorage.getItem('UserData')) || {} + + const loginPreference = userData?.loginPreference + const pin = userData?.PIN + + if (pin) { + this.hasPin = true + } else { + this.hasPin = false + } + + if (loginPreference) { + this.loginPreference = loginPreference + + } else { + this.loginPreference = '' + } + + } //Function to validade the login inputs validateUsername() { @@ -128,9 +130,9 @@ export class LoginPage implements OnInit { this.getToken(); this.hasSession = true this.hasPin = false - this.enterWithPassword = false + this.setPin = true - if(!this.hasPin) { + if(!this.hasPin || this.hasPin) { } else { this.router.navigate(['/home/events']); } @@ -180,7 +182,7 @@ export class LoginPage implements OnInit { let userData = JSON.parse(localStorage.getItem('UserData')) || {} const pin = userData?.PIN - + //if( encrypted == pin) { if( encrypted == localStorage.getItem('PIN')) { 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 6749127ed..85c459244 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 @@ -117,6 +117,8 @@ export class EditEventToApprovePage implements OnInit { ) { this.isEventEdited = false; + alert('nice!!___') + } ngOnInit() { diff --git a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts index 406b8384c..edb71b1cd 100644 --- a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts +++ b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts @@ -122,6 +122,8 @@ export class EditEventToApproveComponent implements OnInit { private animationController: AnimationController, private toastService: ToastService, ) { + // Edit event to approve + alert('nice!!___') this.serialNumber = this.navParams.get('serialNumber'); From 6492e1499730a8f418cc868074630061e44d3d69 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Thu, 1 Jul 2021 11:57:45 +0100 Subject: [PATCH 18/29] Improve --- src/global.scss | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/global.scss b/src/global.scss index d13cdf552..1102dd903 100644 --- a/src/global.scss +++ b/src/global.scss @@ -995,4 +995,12 @@ background: rgb(92, 92, 92); margin-top: -16px; margin-bottom: 10px; font-size: 11pt; +} + + +.mat-selected { + background-color: #87cefa !important; + span { + color: white !important; + } } \ No newline at end of file From c5497f26d33c2b68d782a718f2b36bcabd40b869 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Thu, 1 Jul 2021 12:21:37 +0100 Subject: [PATCH 19/29] Improve --- src/app/shared/agenda/edit-event/edit-event.page.html | 10 +++++----- src/app/shared/agenda/edit-event/edit-event.page.scss | 6 ++++++ src/global.scss | 2 +- 3 files changed, 12 insertions(+), 6 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 0d792ce3e..00cfca146 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.html +++ b/src/app/shared/agenda/edit-event/edit-event.page.html @@ -40,7 +40,7 @@
- + Oficial @@ -62,7 +62,7 @@
- + @@ -91,7 +91,7 @@
- +
- +
- + Não se repete diff --git a/src/app/shared/agenda/edit-event/edit-event.page.scss b/src/app/shared/agenda/edit-event/edit-event.page.scss index 285021125..e91c29131 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.scss +++ b/src/app/shared/agenda/edit-event/edit-event.page.scss @@ -201,4 +201,10 @@ ion-content{ .close-button { display: block !important; } +} + + + +.materia-top { + padding-top: 7px; } \ No newline at end of file diff --git a/src/global.scss b/src/global.scss index 1102dd903..a205e26e5 100644 --- a/src/global.scss +++ b/src/global.scss @@ -1003,4 +1003,4 @@ background: rgb(92, 92, 92); span { color: white !important; } -} \ No newline at end of file +} From d42efae2c7ba6b272112bc18cd4ad53e408c454a Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Thu, 1 Jul 2021 12:36:37 +0100 Subject: [PATCH 20/29] save --- .../create-process/create-process.page.ts | 11 ++ .../expediente-detail.page.ts | 33 +---- src/app/services/events.service.ts | 2 - src/app/services/processes.service.ts | 1 - .../despachos-options.page.html | 12 +- .../despachos-options.page.ts | 19 +-- .../opts-expediente/opts-expediente.page.html | 2 +- .../opts-expediente/opts-expediente.page.ts | 135 ++++++++++++++---- 8 files changed, 129 insertions(+), 86 deletions(-) diff --git a/src/app/modals/create-process/create-process.page.ts b/src/app/modals/create-process/create-process.page.ts index 52fe388c5..a1e807243 100644 --- a/src/app/modals/create-process/create-process.page.ts +++ b/src/app/modals/create-process/create-process.page.ts @@ -435,6 +435,17 @@ export class CreateProcessPage implements OnInit { "AttachmentList" :null, } } + if(this.task.activityInstanceName =='Tarefa de Despacho'){ + body = { + "serialNumber": this.task.serialNumber, + "action": "Conhecimento", + "ActionTypeId": 92, + "dataFields": { + "ReviewUserComment": message, + }, + "AttachmentList" :null, + } + } else{ body = { "serialNumber": this.task.serialNumber, 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 b09faabf3..e5271162e 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 @@ -45,7 +45,6 @@ export class ExpedienteDetailPage implements OnInit { constructor( - private activateRoute: ActivatedRoute, private processes: ProcessesService, private iab: InAppBrowser, private attachments: AttachmentsService, @@ -59,35 +58,17 @@ export class ExpedienteDetailPage implements OnInit { private toastService: ToastService, private animationController: AnimationController, ) { - - this.activateRoute.paramMap.subscribe(params => { - console.log(params["params"]); - + this.activatedRoute.paramMap.subscribe(params => { if(params["params"].SerialNumber) { this.serialnumber = params["params"].SerialNumber; } if(params["params"].caller) { this.caller = params["params"].caller; } - }); - } ngOnInit() { - this.profile = "mdgpr"; - - this.activateRoute.paramMap.subscribe(paramMap => { - if (!paramMap["params"].SerialNumber) { - console.log('HERE'); - - return; - } - console.log(paramMap); - - this.LoadTaskDetail(this.serialnumber); - this.LoadRelatedEvents(this.serialnumber); - }); this.LoadTaskDetail(this.serialnumber); this.LoadRelatedEvents(this.serialnumber); } @@ -115,7 +96,6 @@ export class ExpedienteDetailPage implements OnInit { } } else{ - console.log('HERE'); this.activatedRoute.paramMap.subscribe(params => { switch (params["params"].caller) { case 'events': @@ -155,8 +135,6 @@ export class ExpedienteDetailPage implements OnInit { async LoadTaskDetail(serial: string) { this.processes.GetTask(serial).subscribe(res => { - /* console.log(res); */ - this.task = { "SerialNumber": res.serialNumber, "Folio": res.workflowInstanceDataFields.Subject, @@ -171,11 +149,7 @@ export class ExpedienteDetailPage implements OnInit { "WorkflowName": res.workflowDisplayName, "Status": res.workflowInstanceDataFields.Status, } - - //console.log('task', this.task); - this.fulltask = res; - //console.log('GetTask', res); let thedate = new Date(this.task.CreateDate); this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]); @@ -188,8 +162,6 @@ export class ExpedienteDetailPage implements OnInit { this.cc = users.filter(user=>{ return user.Type == 'CC'; }); - console.log(users); - }) }); @@ -201,14 +173,12 @@ export class ExpedienteDetailPage implements OnInit { async LoadRelatedEvents(serial: string) { if (this.eventsList == null) { this.attachments.getAttachmentsBySerial(serial).subscribe(res => { - console.log(res); res.forEach(att => { if (this.eventsList == null) { this.eventsList = new Array(); } this.events.getEvent(att.ParentId).subscribe(event => { this.eventsList.push(event); - console.log(this.eventsList); }); }); }); @@ -217,7 +187,6 @@ export class ExpedienteDetailPage implements OnInit { viewDocument(){ this.processes.GetDocumentUrl(this.task.DocId, this.task.FsId).subscribe(res=>{ - console.log(res); const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1"); const browser = this.iab.create(url,"_blank"); browser.show(); diff --git a/src/app/services/events.service.ts b/src/app/services/events.service.ts index a17062b26..406887cdb 100644 --- a/src/app/services/events.service.ts +++ b/src/app/services/events.service.ts @@ -245,9 +245,7 @@ export class EventsService { getEvent(eventid: string): Observable{ let geturl = environment.apiURL + 'calendar/GetEvent'; let params = new HttpParams(); - console.log(eventid); - params = params.set("EventId", eventid); let options = { diff --git a/src/app/services/processes.service.ts b/src/app/services/processes.service.ts index 1ec0cd1b6..67863f0c8 100644 --- a/src/app/services/processes.service.ts +++ b/src/app/services/processes.service.ts @@ -244,7 +244,6 @@ export class ProcessesService { } GetDocumentDetails(DocId:string, FsId:string){ - console.log(DocId); const geturl = environment.apiURL + 'search/documents'; let params = new HttpParams(); diff --git a/src/app/shared/popover/despachos-options/despachos-options.page.html b/src/app/shared/popover/despachos-options/despachos-options.page.html index 1ef3745fc..70f1010c1 100644 --- a/src/app/shared/popover/despachos-options/despachos-options.page.html +++ b/src/app/shared/popover/despachos-options/despachos-options.page.html @@ -9,8 +9,8 @@
- - + +
@@ -19,8 +19,8 @@
- - + +
@@ -28,8 +28,8 @@
- - + +
diff --git a/src/app/shared/popover/despachos-options/despachos-options.page.ts b/src/app/shared/popover/despachos-options/despachos-options.page.ts index a3013683d..a12c2ef96 100644 --- a/src/app/shared/popover/despachos-options/despachos-options.page.ts +++ b/src/app/shared/popover/despachos-options/despachos-options.page.ts @@ -40,7 +40,7 @@ export class DespachosOptionsPage implements OnInit { this.goBack() } - async openExpedientActionsModal(taskAction: any, task: any) { + async openTaskProcessModal(taskAction: any, task: any) { this.popoverController.dismiss(); let classs; if( window.innerWidth <= 800){ @@ -58,11 +58,7 @@ export class DespachosOptionsPage implements OnInit { }); await modal.present(); modal.onDidDismiss().then(res=>{ - console.log(res['data']); - if(res['data']=='openDiscart'){ - console.log('open discart'); - this.distartExpedientModal(); - } + this.goBack(); }); } @@ -275,16 +271,7 @@ export class DespachosOptionsPage implements OnInit { } goBack() { - - let navigationExtras: NavigationExtras = { - queryParams: { - // "despachospr": true, - } - } - - this.router.navigate(['/home/gabinete-digital/despachos'], navigationExtras); - - // window.history.back() + this.router.navigate(['/home/gabinete-digital/despachos']); } } diff --git a/src/app/shared/popover/opts-expediente/opts-expediente.page.html b/src/app/shared/popover/opts-expediente/opts-expediente.page.html index d18831079..45cf2f23e 100644 --- a/src/app/shared/popover/opts-expediente/opts-expediente.page.html +++ b/src/app/shared/popover/opts-expediente/opts-expediente.page.html @@ -9,7 +9,7 @@ - +
diff --git a/src/app/shared/popover/opts-expediente/opts-expediente.page.ts b/src/app/shared/popover/opts-expediente/opts-expediente.page.ts index 3ec0d5fca..2692d2807 100644 --- a/src/app/shared/popover/opts-expediente/opts-expediente.page.ts +++ b/src/app/shared/popover/opts-expediente/opts-expediente.page.ts @@ -1,9 +1,11 @@ import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, NavigationExtras, Router } from '@angular/router'; import { ModalController, NavParams, PopoverController } from '@ionic/angular'; import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page'; import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page'; import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page'; import { ProcessesService } from 'src/app/services/processes.service'; +import { ToastService } from 'src/app/services/toast.service'; @Component({ selector: 'app-opts-expediente', @@ -14,6 +16,7 @@ export class OptsExpedientePage implements OnInit { task:any; fulltask: any; profile:string; + caller:string; showEnviarPendentes = false @@ -22,20 +25,19 @@ export class OptsExpedientePage implements OnInit { private modalController: ModalController, private navParams: NavParams, private processes: ProcessesService, + private toastService: ToastService, + private router: Router, + private activatedRoute: ActivatedRoute, ) { this.task = this.navParams.get('task'); this.fulltask = this.navParams.get('fulltask'); - this.showEnviarPendentes = this.navParams.get('showEnviarPendentes'); - - if(!this.showEnviarPendentes) this.showEnviarPendentes = false - + if(this.task.Status != 'Pending'){ + this.showEnviarPendentes = true; + } } ngOnInit() { - console.log(this.task); - this.profile = "mdgpr"; - window.onresize = (event) => { if( window.innerWidth >= 800){ this.popoverController.dismiss(); @@ -52,10 +54,50 @@ export class OptsExpedientePage implements OnInit { } } + 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() { + this.close(); this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{ - console.log(res); - this.close(); + this.goBack(); }); } @@ -92,45 +134,82 @@ export class OptsExpedientePage implements OnInit { componentProps: { taskAction: taskAction, task: task, - profile: this.profile, }, cssClass: classs, }); await modal.present(); modal.onDidDismiss().then(res=>{ console.log(res['data']); - if(res['data']=='openDiscart'){ - console.log('open discart'); - - this.distartExpedientModal(); - + let body = res['data']; + if(res['data']){ + console.log('open discart') + this.distartExpedientModal(body); + } + else{ + console.log('Not open'); } - }); } - async distartExpedientModal(){ - this.close(); + async distartExpedientModal(body:any){ const modal = await this.modalController.create({ component: DiscartExpedientModalPage, componentProps: { - serialNumber: this.fulltask.serialNumber, - folderId: this.fulltask.workflowInstanceDataFields.FolderID, - action: 'complete', }, cssClass: 'discart-expedient-modal', backdropDismiss: false }); await modal.present(); - modal.onDidDismiss().then(res=>{ - if(res['data']=='close'){ - this.close(); - /* console.log('2Expedient Discard closed2'); - this.close(); - this.openMenu(); */ + modal.onDidDismiss().then( async (res)=>{ + console.log(res['data']); + + if(body == 'descartar'){ + if(res['data']== 'Yes'){ + let otherbody = { + "serialNumber": this.task.SerialNumber, + "action": "Passivo", + "ActionTypeId": 99999877, + "dataFields": { + "Note": "", + } + } + + try { + await this.processes.CompleteTask(otherbody).toPromise() + this.toastService.successMessage('Processo descartado'); + this.goBack(); + } catch (error) { + this.toastService.badRequest('Processo não descartado') + } + + } + else if(res['data'] == 'No'){ + //Do nothing + } + } + else{ + if(res['data']== 'Yes'){ + try { + await this.processes.CompleteTask(body).toPromise(); + this.toastService.successMessage('Processo descartado'); + this.goBack(); + } catch (error) { + this.toastService.badRequest('Processo não descartado') + } + this.goBack(); + } + else if(res['data'] == 'No'){ + console.log('Update'); + try { + await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise(); + this.toastService.successMessage(); + this.goBack(); + } catch (error) { + this.toastService.badRequest() + } + } } - }); } From 80b2b915393ba902af2203e2874a18bc5f9fe154 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Thu, 1 Jul 2021 14:30:44 +0100 Subject: [PATCH 21/29] save --- src/app/pages/publications/publications.page.html | 1 + src/app/pages/publications/publications.page.ts | 10 +++++----- .../shared/publication/edit-action/edit-action.page.ts | 6 ++++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index 54e4ef780..3c7eef106 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -127,6 +127,7 @@ [folderId]="folderId" class="height-100 d-flex flex-column overflow-hidden background-white flex-grow-1" (closeDesktopComponent)="closeDesktopComponent($event)" + (updateDesktopComponent)="updateDesktopComponent($event)" > diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index cfae7d49f..4781abae5 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -266,6 +266,10 @@ export class PublicationsPage implements OnInit { this.desktopComponent.showPublicationDetail = true; } + + async updateDesktopComponent(e?:any){ + this.getActions(); + } async closeDesktopComponent (xx?: any){ @@ -317,11 +321,7 @@ export class PublicationsPage implements OnInit { await modal.present(); modal.onDidDismiss().then(res =>{ if(res['data']=='edit'){ - //this.closeDesktopComponent(); - this.desktopComponent.showViewPublication = false, - this.desktopComponent.showAddNewPublication = false, - this.desktopComponent.showPublicationDetail = false, - this.desktopComponent.showAddActions = false, + this.closeDesktopComponent(); this.desktopComponent.showEditActions = true; } }); 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 ec0f5200f..6c03235e3 100644 --- a/src/app/shared/publication/edit-action/edit-action.page.ts +++ b/src/app/shared/publication/edit-action/edit-action.page.ts @@ -13,6 +13,7 @@ export class EditActionPage implements OnInit { folder: PublicationFolder; @Input() folderId: string; @Output() closeDesktopComponent= new EventEmitter(); + @Output() updateDesktopComponent= new EventEmitter(); constructor( private publicationsService: PublicationsService, @@ -49,9 +50,10 @@ export class EditActionPage implements OnInit { try { await this.publicationsService.UpdatePresidentialAction(body).toPromise() this.close(); - this.toastService.successMessage('Acção presidencial criada') + this.updateDesktopComponent.emit(); + this.toastService.successMessage('Acção presidencial atualizada') } catch (error) { - this.toastService.badRequest('Não foi possivel criar a acção presidencial') + this.toastService.badRequest('Não foi possivel atualizar a acção presidencial') } } From 003a3d6ff1ce42a5c064878005bc01ef1a8f12d4 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Thu, 1 Jul 2021 14:54:54 +0100 Subject: [PATCH 22/29] Improve --- .../edit-event-to-approve.page.ts | 2 -- .../agenda/new-event/new-event.page.html | 19 ++++++++++++++----- .../shared/agenda/new-event/new-event.page.ts | 18 ++++++------------ .../edit-event-to-approve/edit-event.page.ts | 2 -- .../profile/profile.page.html | 2 +- .../header-no-search/profile/profile.page.ts | 10 ++++++---- 6 files changed, 27 insertions(+), 26 deletions(-) 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 85c459244..6749127ed 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 @@ -117,8 +117,6 @@ export class EditEventToApprovePage implements OnInit { ) { this.isEventEdited = false; - alert('nice!!___') - } ngOnInit() { 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 d095b64d7..57e724b43 100644 --- a/src/app/shared/agenda/new-event/new-event.page.html +++ b/src/app/shared/agenda/new-event/new-event.page.html @@ -14,7 +14,7 @@
-
+
@@ -35,7 +35,7 @@
-
+
@@ -144,7 +144,7 @@ -
+
+ +
+
+
+ Adicionar participant. +
+
+
+
-
+
@@ -218,7 +227,7 @@
-
+
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 a3bf1ec21..49e632fce 100644 --- a/src/app/shared/agenda/new-event/new-event.page.ts +++ b/src/app/shared/agenda/new-event/new-event.page.ts @@ -94,7 +94,7 @@ export class NewEventPage implements OnInit { @ViewChild('inicio') inicio: any; @ViewChild('picker1') picker1: any; - Form: any = {} + Form: FormGroup; validateFrom = false @@ -125,11 +125,8 @@ export class NewEventPage implements OnInit { private modalController: ModalController, private eventService: EventsService, private attachmentsService: AttachmentsService, - private animationController: AnimationController, private toastService: ToastService, private userService: AuthService, - private http: HttpClient, - private zone: NgZone, private dateAdapter: DateAdapter, // private translate: TranslateService ) { @@ -237,7 +234,7 @@ export class NewEventPage implements OnInit { this.Form = new FormGroup({ Subject: new FormControl(this.postEvent.Subject, [ Validators.required, - Validators.minLength(4) + // Validators.minLength(4) ]), Location: new FormControl(this.postEvent.Location, [ Validators.required, @@ -255,16 +252,13 @@ export class NewEventPage implements OnInit { IsRecurring: new FormControl(this.postEvent.IsRecurring, [ Validators.required ]), - participantes: new FormControl(this.participantes, [ + participantes: new FormControl(this.taskParticipantsCc.concat(this.taskParticipants), [ Validators.required ]), }) } - get participantes() { - return this.taskParticipantsCc.concat(this.taskParticipants) - } openInicio() { let input: any = document.querySelector('#new-inicio') @@ -327,10 +321,10 @@ export class NewEventPage implements OnInit { async save() { + this.injectValidation() this.runValidation() - - // dont runt this function - // if (!this.Form.valid) return false + + if(this.Form.invalid) return false this.getDatepickerData() diff --git a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts index edb71b1cd..c4882f5a6 100644 --- a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts +++ b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts @@ -123,8 +123,6 @@ export class EditEventToApproveComponent implements OnInit { private toastService: ToastService, ) { // Edit event to approve - alert('nice!!___') - this.serialNumber = this.navParams.get('serialNumber'); this.isEventEdited = false; diff --git a/src/app/shared/headers/header-no-search/profile/profile.page.html b/src/app/shared/headers/header-no-search/profile/profile.page.html index 025607064..0d6d6415b 100644 --- a/src/app/shared/headers/header-no-search/profile/profile.page.html +++ b/src/app/shared/headers/header-no-search/profile/profile.page.html @@ -24,7 +24,7 @@
-