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 7aa91df30..022a24731 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
@@ -5,15 +5,13 @@ import * as moment from 'moment';
import { Attachment } from 'src/app/models/attachment.model';
import { EventPerson } from 'src/app/models/eventperson.model';
import { SearchDocument } from 'src/app/models/search-document';
-import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
import { SearchPage } from 'src/app/pages/search/search.page';
import { AttachmentsService } from 'src/app/services/attachments.service';
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 { Event } from '../../../models/event.model';
-import { NgxMatDateFormats, NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
-
+import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: {
@@ -44,7 +42,6 @@ export class EditEventToApprovePage implements OnInit {
public stepHour = 1;
public stepMinute = 5;
public stepSecond = 5;
-
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
@@ -65,7 +62,6 @@ export class EditEventToApprovePage implements OnInit {
@Input() serialNumber: string
-
loadedAttachments: Attachment[]= []
eventProcess = {
@@ -91,10 +87,8 @@ export class EditEventToApprovePage implements OnInit {
show = false
- postEvent: Event;
isRecurring:string;
isEventEdited: boolean;
- segment:string = "true";
profile:string;
eventAttendees: EventPerson[];
@@ -107,7 +101,7 @@ export class EditEventToApprovePage implements OnInit {
showAttendees = false;
- InstanceId: string
+ InstanceId: string;
@Output() openAttendeesComponent = new EventEmitter
();
@Output() clearContact = new EventEmitter();
@@ -115,67 +109,69 @@ export class EditEventToApprovePage implements OnInit {
@Output() setIntervenientCC = new EventEmitter();
@Output() closeComponent = new EventEmitter();
+ @Input() saveData: any;
+
constructor(
private modalController: ModalController,
private eventsService: EventsService,
public alertController: AlertController,
private attachmentsService: AttachmentsService,
private processes:ProcessesService,
- private animationController: AnimationController,
private toastService: ToastService,
) {
-
- /* this.serialNumber = this.navParams.get('serialNumber'); */
-
this.isEventEdited = false;
this.dateControlStart = new FormControl(moment(new Date()));
this.dateControlEnd = new FormControl(moment(new Date()));
+ console.log('saveDatas', this.saveData)
+
+ alert(this.serialNumber)
+
+ // if(!this.restoreTemporaryData()) {
+ // alert('restore')
+
+ this.eventProcess = this.saveData
+
+ // }
+
}
ngOnInit() {
this.getTask();
- console.log(this.serialNumber);
}
async getTask() {
- console.log('this.eventProcess', this.eventProcess);
+ // this.eventProcess = result
- const result = await this.processes.GetTask(this.serialNumber).subscribe( result =>{
- this.eventProcess = result
-
this.restoreDatepickerData()
- console.log(this.eventProcess.workflowInstanceDataFields.Subject)
-
- // description
- let body : any =this.eventProcess.workflowInstanceDataFields.Body.replace(/<[^>]+>/g, '')
- this.eventProcess.workflowInstanceDataFields.Body = body
- this.Location = this.eventProcess.workflowInstanceDataFields.Location
+ // 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";
+ 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.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => {
+ if(e.IsRequired) {
+ this.taskParticipants.push(e);
+ } else {
+ this.taskParticipantsCc.push(e);
}
- else {
- this.isRecurring = "Repete";
- }
-
- this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => {
- if(e.IsRequired) {
- this.taskParticipants.push(e);
- } else {
- this.taskParticipantsCc.push(e);
- }
- })
})
+
}
close() {
- console.log('CLOSE');
-
+
this.closeComponent.emit();
/* this.setIntervenient.emit([]);
this.setIntervenientCC.emit([]);
@@ -220,7 +216,6 @@ export class EditEventToApprovePage implements OnInit {
ReviewUserComment: ''
}
- console.log(event);
this.eventsService.postEventToApproveEdit(event).subscribe(()=>{
this.toastService.successMessage('Evento editado');
@@ -228,7 +223,6 @@ export class EditEventToApprovePage implements OnInit {
this.toastService.badRequest('Evento não editado');
})
-
this.loadedAttachments.forEach((document:any)=>{
if(document['action'] == 'add') {
delete document.action
@@ -248,104 +242,34 @@ export class EditEventToApprovePage implements OnInit {
})
-
this.modalController.dismiss();
}
- /* async openAttendees() {
-
- if(window.innerWidth <= 1024) {
- const modal = await this.modalController.create({
- component: AttendeesPageModal,
- componentProps: {
- adding: this.adding,
- taskParticipants: this.taskParticipants,
- taskParticipantsCc: this.taskParticipantsCc
- },
- cssClass: 'attendee modal modal-desktop',
- backdropDismiss: false
- });
-
- await modal.present();
-
- modal.onDidDismiss().then((data) => {
-
- if(data){
- data = data['data'];
-
- const newAttendees: EventPerson[] = data['taskParticipants'];
- const newAttendeesCC: EventPerson[] = data['taskParticipantsCc'];
-
- this.setIntervenient(newAttendees);
- this.setIntervenientCC(newAttendeesCC);
- }
- });
- } else {
- this.showAttendees = true
- }
- }
-
- setIntervenient(data){
- this.taskParticipants = data;
- this.postEvent.Attendees = data;
- }
-
- setIntervenientCC(data) {
- this.taskParticipantsCc = data;
- }
-
- addParticipants(){
- this.adding = 'intervenient'
-
- this.openAttendees();
- }
-
- addParticipantsCC(){
-
- this.adding = 'CC'
- this.openAttendees();
- }
-
- dynamicSetIntervenient({taskParticipants, taskParticipantsCc}){
- this.taskParticipants = taskParticipants;
- this.taskParticipantsCc = 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() {
+ // async addParticipantsCC() {
- //this.saveTemporaryData();
+ // //this.saveTemporaryData();
- this.openAttendeesComponent.emit({
- type: "CC"
- });
-
- this.clearContact.emit();
- }
-
- saveTemporaryData() {
-
- this.getDatepickerData()
-
- window['temp.path:/home/agenda/edit-event-to-approve.page.ts'] = {
- postEvent: this.postEvent,
- segment: this.segment
- }
- }
+ // this.openAttendeesComponent.emit({
+ // type: "CC"
+ // });
+ // this.clearContact.emit();
+ // }
async getAttachments() {
@@ -416,6 +340,36 @@ export class EditEventToApprovePage implements OnInit {
}
+
+ saveTemporaryData() {
+
+ this.getDatepickerData()
+
+ window['temp.path:/home/agenda/edit-event.component.ts'] = {
+ eventProcess: this.eventProcess
+ }
+ }
+
+
+ restoreTemporaryData(): boolean {
+
+ const restoredData = window['temp.path:/home/agenda/edit-event.component.ts']
+
+ if(JSON.stringify(restoredData) != "{}" && undefined != restoredData){
+
+
+
+ this.eventProcess = restoredData.eventProcess
+
+ this.restoreDatepickerData()
+
+ return true;
+ } else {
+ return false;
+ }
+
+ }
+
getDatepickerData() {
this.eventProcess.workflowInstanceDataFields.StartDate = this.dateStart
diff --git a/src/app/shared/agenda/edit-event/edit-event.page.ts b/src/app/shared/agenda/edit-event/edit-event.page.ts
index 82437eff7..fa7502004 100644
--- a/src/app/shared/agenda/edit-event/edit-event.page.ts
+++ b/src/app/shared/agenda/edit-event/edit-event.page.ts
@@ -20,7 +20,6 @@ import * as moment from 'moment';
})
export class EditEventPage implements OnInit {
-
stEvent: Event;
isRecurring:string;
isEventEdited: boolean;
@@ -86,7 +85,6 @@ export class EditEventPage implements OnInit {
public stepMinutes = [1, 5, 10, 15, 20, 25];
public stepSeconds = [1, 5, 10, 15, 20, 25];
-
constructor(
private modalController: ModalController,
private eventsService: EventsService,
@@ -97,7 +95,6 @@ export class EditEventPage implements OnInit {
ngOnInit() {
-
if(!this.restoreTemporaryData()){
// clear
@@ -128,7 +125,7 @@ export class EditEventPage implements OnInit {
this.isEventEdited = false;
- if(this.postEvent.IsRecurring == false){
+ if(this.postEvent.IsRecurring == false) {
this.isRecurring = "Não se repete";
}
else{
@@ -139,7 +136,6 @@ export class EditEventPage implements OnInit {
this.getAttachments(this.postEvent.EventId);
this.restoreDatepickerData()
-
}
close() {
diff --git a/src/app/shared/agenda/event-list/event-list.page.ts b/src/app/shared/agenda/event-list/event-list.page.ts
index 9096aa845..fa7015204 100644
--- a/src/app/shared/agenda/event-list/event-list.page.ts
+++ b/src/app/shared/agenda/event-list/event-list.page.ts
@@ -15,8 +15,8 @@ export class EventListPage implements OnInit {
showLoader: boolean;
- eventsPRList: any;
- eventsMDGPRList: any;
+ eventsPRList: any = []
+ eventsMDGPRList: any = []
eventPerson: EventPerson;
eventBody: EventBody;
categories: string[];
@@ -72,7 +72,6 @@ export class EventListPage implements OnInit {
return eventSerialNumber == elem.serialNumber
});
- console.log(a);
this.approveEventDismiss.emit({
"serialNumber": eventSerialNumber,