diff --git a/.gitignore b/.gitignore index 16e20818a..d0e817ccb 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,7 @@ npm-debug.log* # Custom /android /package-lock.json + + +src/app/architect/ +src/environments/environment.e2e.ts \ No newline at end of file diff --git a/src/app/home/home-routing.module.ts b/src/app/home/home-routing.module.ts index 14220cdfb..e7852477f 100644 --- a/src/app/home/home-routing.module.ts +++ b/src/app/home/home-routing.module.ts @@ -87,7 +87,7 @@ const routes: Routes = [ }, { path: 'emend-message-modal', - loadChildren: () => import('../pages/agenda/emend-message-modal/emend-message-modal.module').then( m => m.EmendMessageModalPageModule) + loadChildren: () => import('../pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.module').then( m => m.ApproveEventModalPageModule) }, ] }, diff --git a/src/app/pages/agenda/agenda.page.html b/src/app/pages/agenda/agenda.page.html index 24c136bd3..970df85e1 100644 --- a/src/app/pages/agenda/agenda.page.html +++ b/src/app/pages/agenda/agenda.page.html @@ -58,7 +58,7 @@ - @@ -372,6 +372,7 @@ (setIntervenient)="setIntervenient($event)" (setIntervenientCC)="setIntervenientCC($event)" > + +
${startHours.toString().padStart(2, '0')}:${startMinutos.toString().padStart(2, '0')}${eventlocation}
@@ -474,9 +474,9 @@ export class AgendaPage implements OnInit { this.showTimelineFilterState = false; - if( profile =='md'){ +/* if( profile =='md'){ console.log('eventsList: ', eventsList); - } + } */ eventsList.forEach((element, eventIndex) => { @@ -491,6 +491,7 @@ export class AgendaPage implements OnInit { console.log('mdEvent:', element,eventIndex); } + // console.log( element.CalendarName); events.push({ title: this.timeLineTemplate(startHours, element.Location, element.Body, element.CalendarName, element.Subject,startHoursOtherFormate,EndHoursOtherFormate, eventIndex, profile), start: setHours(setMinutes(new Date(element.StartDate), 0), parseInt(startHours)), @@ -834,7 +835,7 @@ export class AgendaPage implements OnInit { } async openAddEvent() { - + await this.cloneAllmobileComponent(); this.showEventEditOrOpen = 'add'; @@ -1063,5 +1064,4 @@ export class AgendaPage implements OnInit { this.postEvent = false; } -} - +} \ No newline at end of file diff --git a/src/app/pages/agenda/approve-event-modal/approve-event-modal.page.html b/src/app/pages/agenda/approve-event-modal/approve-event-modal.page.html index 12689f63c..37f1e01c5 100644 --- a/src/app/pages/agenda/approve-event-modal/approve-event-modal.page.html +++ b/src/app/pages/agenda/approve-event-modal/approve-event-modal.page.html @@ -39,7 +39,7 @@
- {{loadedEvent.workflowInstanceDataFields.Location}} + 11{{loadedEvent.workflowInstanceDataFields.Location}}
{{loadedEvent.workflowInstanceDataFields.Agenda}} 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 92ee11744..8e989f58d 100644 --- a/src/app/pages/agenda/edit-event/edit-event.page.html +++ b/src/app/pages/agenda/edit-event/edit-event.page.html @@ -8,202 +8,200 @@
- Editar Evento inicio + Editar Evento
- -
-
- -
-
-
-
- -
-
- -
-
- - - -
- -
-
-
- -
-
- - Oficial - Pessoal - -
-
-
- -
-
-
- -
-
- - Reunião - Viagem - Conferência - Encontro - -
-
-
- -
-
-
- -
-
- - - -
-
-
- -
-
-
- -
-
- - - -
-
-
- -
-
-
- -
-
- - Não se repete - Repete - -
-
-
- -
- -
-
-
- -
-
-
- - - Adicionar intervenientes - {{participant.Name}} - - -
-
- -
-
-
-
- -
-
-
- -
-
-
- - - Adicionar intervenientes - {{participant.Name}} - - -
-
- -
-
-
-
- -
+
+
+
- -
-
+
+
- +
-
- +
+
- - - + + +
+
+
+
+ +
+
+ + Oficial + Pessoal + +
+
+
+ +
+
+
+ +
+
+ + Reunião + Viagem + Conferência + Encontro + +
+
+
+ +
+
+
+ +
+
+ + + +
+
+
+ +
+
+
+ +
+
+ + + +
+
+
+ +
+
+
+ +
+
+ + Não se repete + Repete + +
+
+
+ +
+ +
+
+
+ +
+
+
+ + + Adicionar intervenientes + {{participant.Name}} + + +
+
+ +
+
+
+
+ +
+
+
+ +
+
+
+ + + Adicionar intervenientes + {{participant.Name}} + + +
+
+ +
+
+
+
+ +
+
+ +
+
+
+ +
+
+ +
+
+ + + +
{{loadedEvent.Subject}}
- - + +
@@ -75,9 +79,10 @@
Documentos Anexados
- - +

{{attach.SourceName}}

{{attach.Stakeholders}}{{ attach.CreateDate | date: 'dd-MM-yy' }}

diff --git a/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.html b/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.html index 5bf3fe573..0dba97d15 100644 --- a/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.html +++ b/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.html @@ -1,7 +1,9 @@
- +
@@ -48,22 +50,26 @@

{{customDate}}

-

das {{loadedEvent.workflowInstanceDataFields.StartDate}} às {{loadedEvent.workflowInstanceDataFields.EndDate}}

+

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

(Não se repete)

Repete

-
Intervenientes
- -

{{loadedEvent.workflowInstanceDataFields.Participants}}

-
+
+
Intervenientes
+
+ {{att.Name}} +
+
+
Detalhes
- -

{{loadedEvent.workflowInstanceDataFields.Body}}

+ +
+
diff --git a/src/app/pages/gabinete-digital/event-list/event-list.page.html b/src/app/pages/gabinete-digital/event-list/event-list.page.html index d43507fdc..04ee37c33 100644 --- a/src/app/pages/gabinete-digital/event-list/event-list.page.html +++ b/src/app/pages/gabinete-digital/event-list/event-list.page.html @@ -1,7 +1,9 @@
- +
diff --git a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html index 1585f5692..b416942c5 100644 --- a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html +++ b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html @@ -56,7 +56,7 @@
- Adicionar intervenientes + Adicionar intervenientes {{participant.Name}} @@ -77,7 +77,7 @@
- Com conhecimento + Com conhecimento {{participant.Name}} diff --git a/src/app/shared/agenda/approve-event/approve-event.component.html b/src/app/shared/agenda/approve-event/approve-event.component.html index 83a63b142..45f43ad3a 100644 --- a/src/app/shared/agenda/approve-event/approve-event.component.html +++ b/src/app/shared/agenda/approve-event/approve-event.component.html @@ -72,12 +72,15 @@
{{att.Name}}
+
+
+
+
Detalhes
+ +

+
+
-
-
Detalhes
- -

-
diff --git a/src/app/shared/agenda/edit-event/edit-event.component.ts b/src/app/shared/agenda/edit-event/edit-event.component.ts index 457558bfa..80dbab1d9 100644 --- a/src/app/shared/agenda/edit-event/edit-event.component.ts +++ b/src/app/shared/agenda/edit-event/edit-event.component.ts @@ -23,10 +23,10 @@ export class EditEventComponent implements OnInit { minDate: string; @Input() taskParticipants: EventPerson[]; - @Input() taskParticipantsCc: any = []; + @Input() taskParticipantsCc: EventPerson[]; @Input() profile:string; @Input() selectedSegment: string; - @Input() postEvent: any; + @Input() postEvent: Event; @Output() clearContact = new EventEmitter(); @Output() openAttendeesComponent = new EventEmitter(); @@ -45,32 +45,41 @@ export class EditEventComponent implements OnInit { } ngOnInit() { - if(this.postEvent){ - this.postEvent.Body.Text = this.postEvent.Body.Text.replace(/<[^>]+>/g, ''); - } - // attendees list - if(this.postEvent.Attendees != null) { - this.postEvent.Attendees.forEach(e =>{ - if(e.IsRequired) { - this.taskParticipants.push(e); - } else { - this.taskParticipantsCc.push(e); - } - }) - } - - this.taskParticipants = removeDuplicate(this.taskParticipants); - this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc); + if(!this.restoreTemporaryData()){ + + if(this.postEvent){ + this.postEvent.Body.Text = this.postEvent.Body.Text.replace(/<[^>]+>/g, ''); + } + + // attendees list + alert(JSON.stringify(this.postEvent.Attendees)) + if(this.postEvent.Attendees != null) { + this.postEvent.Attendees.forEach(e =>{ + if(e.IsRequired) { + this.taskParticipants.push(e); + } else { + this.taskParticipantsCc.push(e); + } + }) + } + + this.taskParticipants = removeDuplicate(this.taskParticipants); + this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc); - this.isEventEdited = false; - - if(this.postEvent.IsRecurring == false){ - this.isRecurring = "Não se repete"; - } - else{ - this.isRecurring = "Repete"; + this.setIntervenient.emit(this.taskParticipants); + this.setIntervenientCC.emit(this.taskParticipantsCc); + + this.isEventEdited = false; + + if(this.postEvent.IsRecurring == false){ + this.isRecurring = "Não se repete"; + } + else{ + this.isRecurring = "Repete"; + } } + } close(){ @@ -78,6 +87,8 @@ export class EditEventComponent implements OnInit { this.setIntervenient.emit([]); this.setIntervenientCC.emit([]); this.clearContact.emit(); + + this.deleteTemporaryData(); } async save(){ @@ -96,11 +107,14 @@ export class EditEventComponent implements OnInit { }); this.clearPostEvent.emit(); - + this.deleteTemporaryData(); this.close(); } async addParticipants() { + + this.saveTemporaryData(); + this.openAttendeesComponent.emit({ type: "intervenient" }); @@ -109,6 +123,9 @@ export class EditEventComponent implements OnInit { } async addParticipantsCc() { + + this.saveTemporaryData(); + this.openAttendeesComponent.emit({ type: "CC" }); @@ -116,4 +133,35 @@ export class EditEventComponent implements OnInit { this.clearContact.emit(); } + + saveTemporaryData(){ + + window['temp.path:/home/agenda/edit-event.component.ts'] = { + postEvent: this.postEvent, + eventBody: this.eventBody, + segment: this.segment + } + } + + + restoreTemporaryData(): boolean{ + + const restoredData = window['temp.path:/home/agenda/edit-event.component.ts'] + + if(JSON.stringify(restoredData) != "{}" && undefined != restoredData){ + this.postEvent = restoredData.postEvent + this.eventBody = restoredData.eventBody + this.segment = restoredData.segment + + return true; + } else { + return false; + } + + } + + deleteTemporaryData(){ + window['temp.path:/home/agenda/edit-event.component.ts'] = {} + } + } diff --git a/src/app/shared/agenda/new-event/new-event.component.ts b/src/app/shared/agenda/new-event/new-event.component.ts index d209102ce..915a84c36 100644 --- a/src/app/shared/agenda/new-event/new-event.component.ts +++ b/src/app/shared/agenda/new-event/new-event.component.ts @@ -4,7 +4,7 @@ import { EventPerson } from 'src/app/models/eventperson.model'; import { EventsService } from 'src/app/services/events.service'; import { Event } from 'src/app/models/event.model'; import { ModalController } from '@ionic/angular'; - +import { removeDuplicate } from 'src/plugin/removeDuplicate.js' @Component({ selector: 'app-new-event', templateUrl: './new-event.component.html', @@ -13,7 +13,6 @@ import { ModalController } from '@ionic/angular'; export class NewEventPage implements OnInit { - postEvent: Event; eventBody: EventBody; segment:string = "true"; @@ -27,6 +26,7 @@ export class NewEventPage implements OnInit { @Output() setIntervenient = new EventEmitter(); @Output() setIntervenientCC = new EventEmitter(); + @Input() postEvent: Event; @Output() onAddEvent = new EventEmitter(); @Output() openAttendeesComponent = new EventEmitter(); @Output() clearContact = new EventEmitter(); @@ -99,7 +99,24 @@ export class NewEventPage implements OnInit { }; } - + + if(this.postEvent.Attendees != null) { + this.postEvent.Attendees.forEach(e =>{ + if(e.IsRequired) { + this.taskParticipants.push(e); + } else { + this.taskParticipantsCc.push(e); + } + }) + } + + + this.taskParticipants = removeDuplicate(this.taskParticipants); + this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc); + + this.setIntervenient.emit(this.taskParticipants); + this.setIntervenientCC.emit(this.taskParticipantsCc); + } } @@ -110,16 +127,18 @@ export class NewEventPage implements OnInit { this.cloneAllmobileComponent.emit(); this.clearContact.emit(); + this.setIntervenient.emit([]); + this.setIntervenientCC.emit([]); } save(){ - this.postEvent.Attendees = this.taskParticipants; + this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc); - if(this.profile=='mdgpr'){ + if(this.profile=='mdgpr') { this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).subscribe(); } - else if(this.profile=='pr'){ + else if(this.profile=='pr') { this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).subscribe(); } @@ -134,6 +153,9 @@ export class NewEventPage implements OnInit { async addParticipants() { + + this.saveTemporaryData(); + this.openAttendeesComponent.emit({ type: "intervenient" }); @@ -142,6 +164,9 @@ export class NewEventPage implements OnInit { } async addParticipantsCc() { + + this.saveTemporaryData(); + this.openAttendeesComponent.emit({ type: "CC" }); 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 efb494c6d..0480d24ee 100644 --- a/src/app/shared/event/attendee-modal/attendee-modal.page.ts +++ b/src/app/shared/event/attendee-modal/attendee-modal.page.ts @@ -2,7 +2,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; 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', @@ -37,11 +37,11 @@ export class AttendeeModalPage implements OnInit { this.fetchContacts(""); - if(this.taskParticipants == null || this.taskParticipants == undefined){ + if(this.taskParticipants == null || this.taskParticipants == undefined) { this.taskParticipants = []; } - if(this.taskParticipantsCc == null || this.taskParticipantsCc == undefined){ + if(this.taskParticipantsCc == null || this.taskParticipantsCc == undefined) { this.taskParticipantsCc = []; }