Files
doneit-web/.angular/cache/14.2.12/babel-webpack/d53958d378918440d7a0498efe246a0f.json
T
Eudes Inácio 53b71ea16f its working
2023-06-30 09:54:21 +01:00

1 line
51 KiB
JSON

{"ast":null,"code":"import _asyncToGenerator from \"C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { __decorate } from \"tslib\";\nimport __NG_CLI_RESOURCE__0 from \"./edit-event-to-approve.page.html?ngResource\";\nimport __NG_CLI_RESOURCE__1 from \"./edit-event-to-approve.page.scss?ngResource\";\nimport { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';\nimport { UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';\nimport { AlertController, ModalController } from '@ionic/angular';\nimport * as moment from 'moment';\nimport { SearchPage } from 'src/app/pages/search/search.page';\nimport { AttachmentsService } from 'src/app/services/attachments.service';\nimport { EventsService } from 'src/app/services/events.service';\nimport { ProcessesService } from 'src/app/services/processes.service';\nimport { ToastService } from 'src/app/services/toast.service';\nimport { removeDuplicate } from 'src/plugin/removeDuplicate.js';\nimport { ThemeService } from 'src/app/services/theme.service';\nimport { HttpErrorHandle } from 'src/app/services/http-error-handle.service';\nconst CUSTOM_DATE_FORMATS = {\n parse: {\n dateInput: \"YYYY-MMMM-DD HH:mm\"\n },\n display: {\n dateInput: \"DD MMM YYYY H:mm\",\n monthYearLabel: \"MMM YYYY\",\n dateA11yLabel: \"LL\",\n monthYearA11yLabel: \"MMMM YYYY\"\n }\n};\nlet EditEventToApprovePage = class EditEventToApprovePage {\n constructor(modalController, eventsService, alertController, attachmentsService, processes, toastService, ThemeService, httpErrorHandler) {\n this.modalController = modalController;\n this.eventsService = eventsService;\n this.alertController = alertController;\n this.attachmentsService = attachmentsService;\n this.processes = processes;\n this.toastService = toastService;\n this.ThemeService = ThemeService;\n this.httpErrorHandler = httpErrorHandler;\n this.disabled = false;\n this.showSpinners = true;\n this.showSeconds = false;\n this.touchUi = false;\n this.enableMeridian = false;\n this.minDate = new Date();\n this.endMinDate = new Date(new Date().getTime() + 15 * 60000);\n this.stepHour = 1;\n this.stepMinute = 15;\n this.stepSecond = 5;\n this.dateControlStart = new UntypedFormControl(moment(\"DD MM YYYY hh\"));\n this.dateControlEnd = new UntypedFormControl(moment(\"DD MM YYYY hh\"));\n this.showLoader = false;\n this.loadedAttachments = [];\n this.eventProcess = {\n serialNumber: \"\",\n taskStartDate: \"\",\n workflowInstanceDataFields: {\n Body: \"\",\n OccurrenceType: '',\n Category: '',\n LastOccurrence: new Date(),\n IsRecurring: false,\n ParticipantsList: [],\n Agenda: '',\n EndDate: '',\n Location: '',\n Subject: '',\n InstanceId: '',\n EventType: '',\n StartDate: '',\n MDEmail: '',\n MDName: '',\n IsAllDayEvent: false,\n Message: '',\n Status: ''\n }\n };\n this.show = false;\n this.adding = \"intervenient\";\n this.showAttendees = false;\n this.validateFrom = false;\n this.openAttendeesComponent = new EventEmitter();\n this.clearContact = new EventEmitter();\n this.setIntervenient = new EventEmitter();\n this.setIntervenientCC = new EventEmitter();\n this.closeComponent = new EventEmitter();\n this.closeEventToApprove = new EventEmitter();\n this.approveEventDismiss = new EventEmitter();\n this.isEventEdited = false;\n }\n get dateStart() {\n return this.dateControlStart.value;\n }\n get dateEnd() {\n return this.dateControlEnd.value;\n }\n ngOnInit() {\n if (this.restoreTemporaryData()) {\n this.setOtherData();\n } else {\n this.getTask();\n }\n this.getRecurrenceTypes();\n }\n getTask() {\n var _this = this;\n return _asyncToGenerator(function* () {\n _this.processes.GetTask(_this.serialNumber).subscribe(result => {\n _this.eventProcess = result;\n _this.eventProcess.workflowInstanceDataFields.LastOccurrence = new Date(_this.eventProcess.workflowInstanceDataFields.LastOccurrence);\n _this.restoreDatepickerData();\n // description\n let body = _this.eventProcess.workflowInstanceDataFields.Body.replace(/<[^>]+>/g, '');\n _this.eventProcess.workflowInstanceDataFields.Body = body;\n _this.eventProcess.workflowInstanceDataFields.Category = _this.eventProcess.workflowInstanceDataFields.EventType;\n _this.InstanceId = _this.eventProcess.workflowInstanceDataFields.InstanceId;\n _this.getAttachments();\n _this.setOtherData();\n _this.saveTemporaryData();\n });\n })();\n }\n getRecurrenceTypes() {\n this.eventsService.getRecurrenceTypes().subscribe(res => {\n this.recurringTypes = res;\n });\n }\n onSelectedRecurringChanged(ev) {\n this.calculetedLastOccurrence(ev);\n if (ev.length > 1) {\n this.eventProcess.workflowInstanceDataFields.OccurrenceType = ev.filter(data => data != '-1');\n }\n if (ev.length == 0) {\n this.eventProcess.workflowInstanceDataFields.OccurrenceType = \"-1\";\n }\n }\n calculetedLastOccurrence(type) {\n var valor;\n var opcao;\n if (type == 0) {\n valor = 7;\n opcao = true;\n } else if (type == 1) {\n valor = 30;\n opcao = true;\n } else if (type == 2) {\n valor = 1;\n opcao = false;\n } else if (type == 3) {\n valor = 5;\n opcao = false;\n }\n this.defineLastOccurrence(valor, opcao);\n }\n defineLastOccurrence(valor, opcao) {\n var time = new Date(this.eventProcess.workflowInstanceDataFields.EndDate);\n if (opcao == true) {\n time.setDate(time.getDate() + valor);\n this.eventProcess.workflowInstanceDataFields.LastOccurrence = time;\n } else {\n time = new Date(time.getFullYear() + valor, time.getMonth(), time.getDate(), time.getHours(), time.getMinutes());\n this.eventProcess.workflowInstanceDataFields.LastOccurrence = time;\n }\n }\n setOtherData() {\n if (this.eventProcess.workflowInstanceDataFields.ParticipantsList) {\n this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => {\n if (e.IsRequired) {\n this.taskParticipants.push(e);\n } else {\n this.taskParticipantsCc.push(e);\n }\n });\n }\n this.taskParticipants = removeDuplicate(this.taskParticipants);\n this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc);\n if (this.eventProcess.workflowInstanceDataFields.IsRecurring == false) {\n this.isRecurring = \"Não se repete\";\n } else {\n this.isRecurring = \"Repete\";\n }\n this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId;\n this.getAttachments();\n }\n close() {\n window['temp.path:/shared/agenda/edit-event-to-approve.ts'] = {};\n this.closeEventToApprove.emit();\n this.setIntervenient.emit([]);\n this.setIntervenientCC.emit([]);\n this.clearContact.emit();\n this.approveEventDismiss.emit({\n serialNumber: this.eventProcess.serialNumber,\n action: \"Aprovar\",\n saveData: this.eventProcess\n });\n }\n runValidation() {\n this.validateFrom = true;\n }\n injectValidation() {\n this.Form = new UntypedFormGroup({\n Subject: new UntypedFormControl(this.eventProcess.workflowInstanceDataFields.Subject, [Validators.required\n // Validators.minLength(4)\n ]),\n\n Location: new UntypedFormControl(this.eventProcess.workflowInstanceDataFields.Location, [Validators.required]),\n //CalendarName: new FormControl(this.postEvent.CalendarName),\n // Categories: new FormControl(this.postEvent.Categories, [\n // Validators.required\n // ]),\n dateStart: new UntypedFormControl(this.dateStart, [Validators.required]),\n dateEnd: new UntypedFormControl(this.dateEnd, [Validators.required]),\n // IsRecurring: new FormControl(this.postEvent.IsRecurring, [\n // Validators.required\n // ]),\n participantes: new UntypedFormControl(this.taskParticipants, [\n // Validators.required\n ])\n });\n }\n save() {\n var _this2 = this;\n return _asyncToGenerator(function* () {\n _this2.injectValidation();\n _this2.runValidation();\n if (_this2.Form.invalid) return false;\n // set dates to eventProcess object\n _this2.dateControlStart = new UntypedFormControl(moment(new Date(_this2.eventProcess.workflowInstanceDataFields.StartDate)).add(1, 'hours'));\n _this2.dateControlEnd = new UntypedFormControl(moment(new Date(_this2.eventProcess.workflowInstanceDataFields.EndDate)).add(1, 'hours'));\n // this.restoreDatepickerData()\n // this.getDatepickerData()\n _this2.taskParticipantsCc.forEach(e => {\n e.IsRequired = false;\n });\n _this2.eventProcess.workflowInstanceDataFields.ParticipantsList = _this2.taskParticipants.concat(_this2.taskParticipantsCc);\n _this2.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => {\n if (e.hasOwnProperty('$type')) {\n delete e.$type;\n }\n });\n const event = {\n SerialNumber: _this2.eventProcess.serialNumber,\n Body: _this2.eventProcess.workflowInstanceDataFields.Body,\n Location: _this2.eventProcess.workflowInstanceDataFields.Location,\n Subject: _this2.eventProcess.workflowInstanceDataFields.Subject,\n StartDate: _this2.dateControlStart.value,\n EndDate: _this2.dateControlEnd.value,\n ReviewUserComment: '',\n Agenda: _this2.eventProcess.workflowInstanceDataFields.Agenda,\n MDName: _this2.eventProcess.workflowInstanceDataFields.MDName,\n MDEmail: _this2.eventProcess.workflowInstanceDataFields.MDEmail,\n IsAllDayEvent: _this2.eventProcess.workflowInstanceDataFields.IsAllDayEvent,\n Status: _this2.eventProcess.workflowInstanceDataFields.Status,\n EventType: _this2.eventProcess.workflowInstanceDataFields.EventType,\n IsRecurring: _this2.eventProcess.workflowInstanceDataFields.IsRecurring,\n Message: _this2.eventProcess.workflowInstanceDataFields.Message,\n EventRecurrence: {\n Type: _this2.eventProcess.workflowInstanceDataFields.OccurrenceType || '-1',\n LastOccurrence: _this2.eventProcess.workflowInstanceDataFields.LastOccurrence\n },\n ParticipantsList: _this2.eventProcess.workflowInstanceDataFields.ParticipantsList,\n Category: _this2.eventProcess.workflowInstanceDataFields.Category\n };\n try {\n yield _this2.eventsService.postEventToApproveEdit(event).toPromise();\n _this2.close();\n _this2.httpErrorHandler.httpsSucessMessagge('Editar evento');\n } catch (e) {\n _this2.httpErrorHandler.httpStatusHandle(e);\n _this2.toastService._badRequest('Evento não editado');\n }\n _this2.loadedAttachments.forEach(document => {\n if (document['action'] == 'add') {\n delete document.action;\n _this2.attachmentsService.setEventAttachmentById(document).subscribe(() => {\n window['edit-approve-event-desktop']();\n }, error => {\n _this2.toastService.badRequest();\n });\n } else if (document['action'] == 'delete') {\n delete document.action;\n _this2.attachmentsService.deleteEventAttachmentById(document.Id).subscribe(res => {\n window['edit-approve-event-desktop']();\n }, error => {\n _this2.toastService.badRequest();\n });\n }\n });\n })();\n }\n gravasAction() {\n var _this3 = this;\n return _asyncToGenerator(function* () {\n yield _this3.save();\n if (_this3.eventProcess['activityInstanceName'] == 'Editar Evento') {\n _this3.reenviar();\n }\n })();\n }\n reenviar() {\n var _this4 = this;\n return _asyncToGenerator(function* () {\n let body = {\n serialNumber: _this4.eventProcess.serialNumber,\n action: \"Reenviar\",\n dataFields: {\n ReviewUserComment: \"\"\n }\n };\n const loader = _this4.toastService.loading();\n try {\n yield _this4.processes.PostTaskAction(body).toPromise();\n _this4.toastService._successMessage();\n _this4.goToApproveEventList();\n } catch (error) {\n if (error.status == 0) {\n _this4.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão');\n } else {\n _this4.toastService._badRequest();\n }\n } finally {\n loader.remove();\n }\n })();\n }\n goToApproveEventList() {\n this.closeEventToApprove.emit();\n this.modalController.dismiss();\n }\n dynamicSetIntervenient({\n taskParticipants,\n taskParticipantsCc\n }) {\n this.taskParticipants = removeDuplicate(taskParticipants);\n this.taskParticipantsCc = removeDuplicate(taskParticipantsCc);\n }\n addParticipants() {\n var _this5 = this;\n return _asyncToGenerator(function* () {\n //this.saveTemporaryData();\n _this5.openAttendeesComponent.emit({\n type: \"intervenient\"\n });\n _this5.clearContact.emit();\n })();\n }\n addParticipantsCC() {\n var _this6 = this;\n return _asyncToGenerator(function* () {\n _this6.openAttendeesComponent.emit({\n type: \"CC\"\n });\n _this6.clearContact.emit();\n })();\n }\n saveTemporaryData() {\n this.getDatepickerData();\n window['temp.path:/shared/agenda/edit-event-to-approve.ts'] = {\n eventProcess: this.eventProcess\n };\n }\n restoreTemporaryData() {\n const restoredData = window['temp.path:/shared/agenda/edit-event-to-approve.ts'];\n if (JSON.stringify(restoredData) != \"{}\" && undefined != restoredData) {\n this.eventProcess = restoredData.eventProcess;\n // restore dater for date and hours picker\n this.restoreDatepickerData();\n return true;\n } else {\n return false;\n }\n }\n getAttachments() {\n var _this7 = this;\n return _asyncToGenerator(function* () {\n let result;\n try {\n result = yield _this7.attachmentsService.getAttachmentsById(_this7.InstanceId).toPromise();\n } catch (error) {\n console.error('getAttachment', error);\n }\n result.forEach(e => {\n e.action = false;\n });\n _this7.loadedAttachments = result;\n // \n })();\n }\n\n deleteAttachment(attachment, index) {\n this.loadedAttachments[index]['action'] = 'delete';\n }\n getDoc() {\n var _this8 = this;\n return _asyncToGenerator(function* () {\n const modal = yield _this8.modalController.create({\n component: SearchPage,\n cssClass: 'modal-width-100-width-background modal',\n componentProps: {\n type: 'AccoesPresidenciais & ArquivoDespachoElect',\n showSearchInput: true,\n select: true\n }\n });\n yield modal.present();\n modal.onDidDismiss().then( /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (res) {\n if (res) {\n const data = res.data.selected;\n const DocumentToSave = {\n SourceTitle: data.Assunto,\n ParentId: _this8.InstanceId,\n Source: '1',\n SourceId: data.Id,\n ApplicationId: data.ApplicationType.toString(),\n Id: '',\n Link: '',\n SerialNumber: '',\n action: 'add',\n CreateDate: data.Data,\n Data: data.Data,\n Description: data.DocTypeDesc,\n SourceName: data.Assunto,\n Stakeholders: data.EntidadeOrganicaNome\n };\n _this8.loadedAttachments.push(DocumentToSave);\n // await this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe(()=>{\n // this.getAttachments();\n // });\n }\n });\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }());\n })();\n }\n restoreDatepickerData() {\n this.dateControlStart = new UntypedFormControl(moment(new Date(this.eventProcess.workflowInstanceDataFields.StartDate)));\n this.dateControlEnd = new UntypedFormControl(moment(new Date(this.eventProcess.workflowInstanceDataFields.EndDate)));\n }\n getDatepickerData() {\n this.eventProcess.workflowInstanceDataFields.StartDate = this.dateStart;\n this.eventProcess.workflowInstanceDataFields.EndDate = this.dateEnd;\n }\n};\nEditEventToApprovePage.ctorParameters = () => [{\n type: ModalController\n}, {\n type: EventsService\n}, {\n type: AlertController\n}, {\n type: AttachmentsService\n}, {\n type: ProcessesService\n}, {\n type: ToastService\n}, {\n type: ThemeService\n}, {\n type: HttpErrorHandle\n}];\nEditEventToApprovePage.propDecorators = {\n picker: [{\n type: ViewChild,\n args: ['picker']\n }],\n fim: [{\n type: ViewChild,\n args: ['fim']\n }],\n inicio: [{\n type: ViewChild,\n args: ['inicio']\n }],\n picker1: [{\n type: ViewChild,\n args: ['picker1']\n }],\n openAttendeesComponent: [{\n type: Output\n }],\n clearContact: [{\n type: Output\n }],\n setIntervenient: [{\n type: Output\n }],\n setIntervenientCC: [{\n type: Output\n }],\n closeComponent: [{\n type: Output\n }],\n closeEventToApprove: [{\n type: Output\n }],\n approveEventDismiss: [{\n type: Output\n }],\n saveData: [{\n type: Input\n }],\n serialNumber: [{\n type: Input\n }],\n taskParticipants: [{\n type: Input\n }],\n taskParticipantsCc: [{\n type: Input\n }]\n};\nEditEventToApprovePage = __decorate([Component({\n selector: 'app-edit-event-to-approve',\n template: __NG_CLI_RESOURCE__0,\n styles: [__NG_CLI_RESOURCE__1]\n})], EditEventToApprovePage);\nexport { EditEventToApprovePage };","map":{"version":3,"mappings":";;;;AAAA,SAASA,SAAS,EAAEC,YAAY,EAAEC,KAAK,EAAUC,MAAM,EAAEC,SAAS,QAAQ,eAAe;AACzF,SAASC,kBAAkB,EAAEC,gBAAgB,EAAEC,UAAU,QAAQ,gBAAgB;AACjF,SAASC,eAAe,EAAEC,eAAe,QAAQ,gBAAgB;AACjE,OAAO,KAAKC,MAAM,MAAM,QAAQ;AAIhC,SAASC,UAAU,QAAQ,kCAAkC;AAC7D,SAASC,kBAAkB,QAAQ,sCAAsC;AACzE,SAASC,aAAa,QAAQ,iCAAiC;AAC/D,SAASC,gBAAgB,QAAQ,oCAAoC;AACrE,SAASC,YAAY,QAAQ,gCAAgC;AAE7D,SAASC,eAAe,QAAQ,+BAA+B;AAE/D,SAASC,YAAY,QAAQ,gCAAgC;AAC7D,SAASC,eAAe,QAAQ,4CAA4C;AAG5E,MAAMC,mBAAmB,GAAsB;EAC7CC,KAAK,EAAE;IACLC,SAAS,EAAE;GACZ;EACDC,OAAO,EAAE;IACPD,SAAS,EAAE,kBAAkB;IAC7BE,cAAc,EAAE,UAAU;IAC1BC,aAAa,EAAE,IAAI;IACnBC,kB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,8BAAgD;;CAEjD,CAAC,GACWrL,sBAAsB;SAAtBA,sBAAsB","names":["Component","EventEmitter","Input","Output","ViewChild","UntypedFormControl","UntypedFormGroup","Validators","AlertController","ModalController","moment","SearchPage","AttachmentsService","EventsService","ProcessesService","ToastService","removeDuplicate","ThemeService","HttpErrorHandle","CUSTOM_DATE_FORMATS","parse","dateInput","display","monthYearLabel","dateA11yLabel","monthYearA11yLabel","EditEventToApprovePage","constructor","modalController","eventsService","alertController","attachmentsService","processes","toastService","httpErrorHandler","Date","getTime","serialNumber","taskStartDate","workflowInstanceDataFields","Body","OccurrenceType","Category","LastOccurrence","IsRecurring","ParticipantsList","Agenda","EndDate","Location","Subject","InstanceId","EventType","StartDate","MDEmail","MDName","IsAllDayEvent","Message","Status","isEventEdited","dateStart","dateControlStart","value","dateEnd","dateControlEnd","ngOnInit","restoreTemporaryData","setOtherData","getTask","getRecurrenceTypes","_this","GetTask","subscribe","result","eventProcess","restoreDatepickerData","body","replace","getAttachments","saveTemporaryData","res","recurringTypes","onSelectedRecurringChanged","ev","calculetedLastOccurrence","length","filter","data","type","valor","opcao","defineLastOccurrence","time","setDate","getDate","getFullYear","getMonth","getHours","getMinutes","forEach","e","IsRequired","taskParticipants","push","taskParticipantsCc","isRecurring","close","window","closeEventToApprove","emit","setIntervenient","setIntervenientCC","clearContact","approveEventDismiss","action","saveData","runValidation","validateFrom","injectValidation","Form","required","participantes","save","_this2","invalid","add","concat","hasOwnProperty","$type","event","SerialNumber","ReviewUserComment","EventRecurrence","Type","postEventToApproveEdit","toPromise","httpsSucessMessagge","httpStatusHandle","_badRequest","loadedAttachments","document","setEventAttachmentById","error","badRequest","deleteEventAttachmentById","Id","gravasAction","_this3","reenviar","_this4","dataFields","loader","loading","PostTaskAction","_successMessage","goToApproveEventList","status","remove","dismiss","dynamicSetIntervenient","addParticipants","_this5","openAttendeesComponent","addParticipantsCC","_this6","getDatepickerData","restoredData","JSON","stringify","undefined","_this7","getAttachmentsById","console","deleteAttachment","attachment","index","getDoc","modal","_this8","create","component","cssClass","componentProps","showSearchInput","select","present","onDidDismiss","then","selected","DocumentToSave","SourceTitle","Assunto","ParentId","Source","SourceId","ApplicationId","ApplicationType","toString","Link","CreateDate","Data","Description","DocTypeDesc","SourceName","Stakeholders","EntidadeOrganicaNome","args","selector","template"],"sourceRoot":"","sources":["C:\\Users\\eudes.inacio\\GabineteDigital\\gabinete-digital-fo\\src\\app\\shared\\agenda\\edit-event-to-approve\\edit-event-to-approve.page.ts"],"sourcesContent":["import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\r\nimport { UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';\r\nimport { AlertController, ModalController } from '@ionic/angular';\r\nimport * as moment from 'moment';\r\nimport { Attachment } from 'src/app/models/attachment.model';\r\nimport { EventPerson } from 'src/app/models/eventperson.model';\r\nimport { SearchList } from 'src/app/models/search-document';\r\nimport { SearchPage } from 'src/app/pages/search/search.page';\r\nimport { AttachmentsService } from 'src/app/services/attachments.service';\r\nimport { EventsService } from 'src/app/services/events.service';\r\nimport { ProcessesService } from 'src/app/services/processes.service';\r\nimport { ToastService } from 'src/app/services/toast.service';\r\nimport { NgxMatDateFormats } from '@angular-material-components/datetime-picker';\r\nimport { removeDuplicate } from 'src/plugin/removeDuplicate.js'\r\nimport { EventToApproveEdit } from 'src/app/models/event.model';\r\nimport { ThemeService } from 'src/app/services/theme.service'\r\nimport { HttpErrorHandle } from 'src/app/services/http-error-handle.service';\r\n\r\n\r\nconst CUSTOM_DATE_FORMATS: NgxMatDateFormats = {\r\n parse: {\r\n dateInput: \"YYYY-MMMM-DD HH:mm\"\r\n },\r\n display: {\r\n dateInput: \"DD MMM YYYY H:mm\",\r\n monthYearLabel: \"MMM YYYY\",\r\n dateA11yLabel: \"LL\",\r\n monthYearA11yLabel: \"MMMM YYYY\"\r\n }\r\n}\r\n\r\n@Component({\r\n selector: 'app-edit-event-to-approve',\r\n templateUrl: './edit-event-to-approve.page.html',\r\n styleUrls: ['./edit-event-to-approve.page.scss'],\r\n})\r\nexport class EditEventToApprovePage implements OnInit {\r\n public date: any;\r\n public disabled = false;\r\n public showSpinners = true;\r\n public showSeconds = false;\r\n public touchUi = false;\r\n public enableMeridian = false;\r\n public minDate = new Date()\r\n public endMinDate = new Date(new Date().getTime() + 15 * 60000);\r\n public maxDate: any;\r\n public stepHour = 1;\r\n public stepMinute = 15;\r\n public stepSecond = 5;\r\n public dateControlStart = new UntypedFormControl(moment(\"DD MM YYYY hh\"));\r\n public dateControlEnd = new UntypedFormControl(moment(\"DD MM YYYY hh\"));\r\n recurringTypes: any;\r\n selectedRecurringType: any;\r\n\r\n showLoader = false\r\n\r\n get dateStart () {\r\n return this.dateControlStart.value\r\n }\r\n\r\n get dateEnd () {\r\n return this.dateControlEnd.value\r\n }\r\n\r\n @ViewChild('picker') picker: any;\r\n @ViewChild('fim') fim: any;\r\n @ViewChild('inicio') inicio: any;\r\n @ViewChild('picker1') picker1: any;\r\n\r\n loadedAttachments: Attachment[]= []\r\n\r\n eventProcess = {\r\n serialNumber: \"\",\r\n taskStartDate: \"\",\r\n workflowInstanceDataFields:{\r\n Body: \"\",\r\n OccurrenceType: '',\r\n Category: '',\r\n LastOccurrence: new Date(),\r\n IsRecurring: false,\r\n ParticipantsList: [],\r\n Agenda: '',\r\n EndDate: '',\r\n Location: '',\r\n Subject: '',\r\n InstanceId: '',\r\n EventType: '',\r\n StartDate: '',\r\n MDEmail: '',\r\n MDName: '',\r\n IsAllDayEvent: false,\r\n Message: '',\r\n Status: ''\r\n }\r\n }\r\n\r\n show = false\r\n isRecurring:string;\r\n isEventEdited: boolean;\r\n profile:string;\r\n eventAttendees: EventPerson[];\r\n\r\n loadedEventAttachments: Attachment[];\r\n adding: \"intervenient\" | \"CC\" = \"intervenient\";\r\n\r\n showAttendees = false;\r\n\r\n InstanceId: string;\r\n\r\n Form: UntypedFormGroup;\r\n validateFrom = false\r\n\r\n @Output() openAttendeesComponent = new EventEmitter<any>();\r\n @Output() clearContact = new EventEmitter<any>();\r\n @Output() setIntervenient = new EventEmitter<any>();\r\n @Output() setIntervenientCC = new EventEmitter<any>();\r\n @Output() closeComponent = new EventEmitter<any>();\r\n @Output() closeEventToApprove = new EventEmitter<any>();\r\n @Output() approveEventDismiss = new EventEmitter<any>(); \r\n\r\n @Input() saveData: any;\r\n @Input() serialNumber: string\r\n @Input() taskParticipants: EventPerson[];\r\n @Input() taskParticipantsCc: EventPerson[];\r\n\r\n constructor(\r\n private modalController: ModalController,\r\n private eventsService: EventsService,\r\n public alertController: AlertController,\r\n private attachmentsService: AttachmentsService,\r\n private processes:ProcessesService,\r\n private toastService: ToastService,\r\n public ThemeService: ThemeService,\r\n public httpErrorHandler: HttpErrorHandle\r\n ) {\r\n this.isEventEdited = false;\r\n }\r\n\r\n ngOnInit() {\r\n\r\n if(this.restoreTemporaryData()){\r\n this.setOtherData()\r\n } else {\r\n this.getTask();\r\n\r\n }\r\n this.getRecurrenceTypes();\r\n\r\n }\r\n\r\n async getTask() {\r\n\r\n this.processes.GetTask(this.serialNumber).subscribe( (result) => {\r\n this.eventProcess = result\r\n\r\n this.eventProcess.workflowInstanceDataFields.LastOccurrence = new Date(this.eventProcess.workflowInstanceDataFields.LastOccurrence)\r\n\r\n this.restoreDatepickerData()\r\n\r\n // description\r\n let body : any =this.eventProcess.workflowInstanceDataFields.Body.replace(/<[^>]+>/g, '')\r\n this.eventProcess.workflowInstanceDataFields.Body = body\r\n this.eventProcess.workflowInstanceDataFields.Category = this.eventProcess.workflowInstanceDataFields.EventType\r\n\r\n this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId\r\n this.getAttachments()\r\n\r\n this.setOtherData()\r\n\r\n this.saveTemporaryData()\r\n })\r\n }\r\n\r\n getRecurrenceTypes() {\r\n this.eventsService.getRecurrenceTypes().subscribe(res=>{\r\n \r\n this.recurringTypes = res;\r\n });\r\n }\r\n\r\n onSelectedRecurringChanged(ev:any) {\r\n\r\n this.calculetedLastOccurrence(ev);\r\n\r\n if(ev.length > 1) {\r\n \r\n this.eventProcess.workflowInstanceDataFields.OccurrenceType = ev.filter(data => data != '-1');\r\n }\r\n if(ev.length == 0) {\r\n this.eventProcess.workflowInstanceDataFields.OccurrenceType = \"-1\";\r\n }\r\n }\r\n\r\n calculetedLastOccurrence(type:number){\r\n var valor; \r\n var opcao: boolean;\r\n if (type == 0) {\r\n valor = 7;\r\n opcao = true;\r\n } else if(type == 1){\r\n valor = 30;\r\n opcao = true;\r\n } else if(type == 2){\r\n valor = 1;\r\n opcao = false;\r\n }else if(type == 3){\r\n valor = 5;\r\n opcao = false;\r\n }\r\n this.defineLastOccurrence(valor, opcao);\r\n }\r\n\r\n\r\n defineLastOccurrence(valor:number, opcao:boolean){\r\n var time = new Date(this.eventProcess.workflowInstanceDataFields.EndDate);\r\n if (opcao == true) {\r\n time.setDate(time.getDate() + valor);\r\n this.eventProcess.workflowInstanceDataFields.LastOccurrence = time;\r\n } else {\r\n time = new Date(\r\n time.getFullYear() + valor, \r\n time.getMonth(), \r\n time.getDate(), \r\n time.getHours(), \r\n time.getMinutes()\r\n );\r\n this.eventProcess.workflowInstanceDataFields.LastOccurrence = time;\r\n }\r\n \r\n }\r\n\r\n setOtherData() {\r\n if(this.eventProcess.workflowInstanceDataFields.ParticipantsList) {\r\n this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => {\r\n if(e.IsRequired) {\r\n this.taskParticipants.push(e);\r\n } else {\r\n this.taskParticipantsCc.push(e);\r\n }\r\n })\r\n }\r\n\r\n this.taskParticipants = removeDuplicate(this.taskParticipants)\r\n this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc)\r\n\r\n if(this.eventProcess.workflowInstanceDataFields.IsRecurring == false) {\r\n this.isRecurring = \"Não se repete\";\r\n }\r\n else {\r\n this.isRecurring = \"Repete\";\r\n }\r\n\r\n this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId\r\n\r\n this.getAttachments()\r\n }\r\n\r\n close() {\r\n\r\n window['temp.path:/shared/agenda/edit-event-to-approve.ts'] = {};\r\n\r\n this.closeEventToApprove.emit();\r\n this.setIntervenient.emit([]);\r\n this.setIntervenientCC.emit([]);\r\n this.clearContact.emit();\r\n\r\n this.approveEventDismiss.emit({\r\n serialNumber: this.eventProcess.serialNumber,\r\n action: \"Aprovar\",\r\n saveData: this.eventProcess\r\n });\r\n\r\n }\r\n\r\n\r\n runValidation() {\r\n this.validateFrom = true\r\n }\r\n\r\n injectValidation() {\r\n\r\n this.Form = new UntypedFormGroup({\r\n Subject: new UntypedFormControl(this.eventProcess.workflowInstanceDataFields.Subject, [\r\n Validators.required,\r\n // Validators.minLength(4)\r\n ]),\r\n Location: new UntypedFormControl(this.eventProcess.workflowInstanceDataFields.Location, [\r\n Validators.required,\r\n ]),\r\n //CalendarName: new FormControl(this.postEvent.CalendarName),\r\n // Categories: new FormControl(this.postEvent.Categories, [\r\n // Validators.required\r\n // ]),\r\n dateStart: new UntypedFormControl(this.dateStart, [\r\n Validators.required\r\n ]),\r\n dateEnd: new UntypedFormControl(this.dateEnd, [\r\n Validators.required\r\n ]),\r\n // IsRecurring: new FormControl(this.postEvent.IsRecurring, [\r\n // Validators.required\r\n // ]),\r\n participantes: new UntypedFormControl(this.taskParticipants, [\r\n // Validators.required\r\n ]),\r\n\r\n })\r\n }\r\n\r\n async save() {\r\n\r\n this.injectValidation()\r\n this.runValidation()\r\n\r\n if(this.Form.invalid) return false\r\n\r\n // set dates to eventProcess object\r\n this.dateControlStart = new UntypedFormControl(moment(new Date(this.eventProcess.workflowInstanceDataFields.StartDate)).add(1, 'hours'));\r\n this.dateControlEnd = new UntypedFormControl(moment(new Date(this.eventProcess.workflowInstanceDataFields.EndDate)).add(1, 'hours'));\r\n // this.restoreDatepickerData()\r\n // this.getDatepickerData()\r\n\r\n this.taskParticipantsCc.forEach( e => {\r\n e.IsRequired = false\r\n })\r\n\r\n this.eventProcess.workflowInstanceDataFields.ParticipantsList = this.taskParticipants.concat(this.taskParticipantsCc)\r\n\r\n this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e=>{\r\n\r\n if(e.hasOwnProperty('$type')) {\r\n delete e.$type\r\n }\r\n })\r\n\r\n\r\n const event: EventToApproveEdit = {\r\n SerialNumber: this.eventProcess.serialNumber,\r\n Body: this.eventProcess.workflowInstanceDataFields.Body,\r\n Location: this.eventProcess.workflowInstanceDataFields.Location,\r\n Subject: this.eventProcess.workflowInstanceDataFields.Subject,\r\n StartDate: this.dateControlStart.value,\r\n EndDate: this.dateControlEnd.value,\r\n ReviewUserComment: '',\r\n Agenda: this.eventProcess.workflowInstanceDataFields.Agenda,\r\n MDName: this.eventProcess.workflowInstanceDataFields.MDName,\r\n MDEmail: this.eventProcess.workflowInstanceDataFields.MDEmail,\r\n IsAllDayEvent: this.eventProcess.workflowInstanceDataFields.IsAllDayEvent,\r\n Status: this.eventProcess.workflowInstanceDataFields.Status,\r\n EventType: this.eventProcess.workflowInstanceDataFields.EventType,\r\n IsRecurring: this.eventProcess.workflowInstanceDataFields.IsRecurring,\r\n Message: this.eventProcess.workflowInstanceDataFields.Message,\r\n EventRecurrence: {\r\n Type: this.eventProcess.workflowInstanceDataFields.OccurrenceType || '-1',\r\n LastOccurrence: this.eventProcess.workflowInstanceDataFields.LastOccurrence,\r\n },\r\n ParticipantsList: this.eventProcess.workflowInstanceDataFields.ParticipantsList,\r\n Category: this.eventProcess.workflowInstanceDataFields.Category\r\n }\r\n\r\n try {\r\n await this.eventsService.postEventToApproveEdit(event).toPromise()\r\n \r\n this.close()\r\n\r\n this.httpErrorHandler.httpsSucessMessagge('Editar evento');\r\n\r\n } catch(e) {\r\n this.httpErrorHandler.httpStatusHandle(e);\r\n this.toastService._badRequest('Evento não editado');\r\n }\r\n \r\n this.loadedAttachments.forEach((document:any)=>{\r\n if(document['action'] == 'add') {\r\n delete document.action\r\n this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{\r\n window['edit-approve-event-desktop']()\r\n }, error =>{\r\n this.toastService.badRequest();\r\n });\r\n } else if(document['action'] == 'delete') {\r\n delete document.action\r\n this.attachmentsService.deleteEventAttachmentById(document.Id).subscribe( res=>{\r\n window['edit-approve-event-desktop']()\r\n }, error =>{\r\n this.toastService.badRequest()\r\n })\r\n }\r\n\r\n })\r\n\r\n }\r\n\r\n async gravasAction() {\r\n \r\n await this.save();\r\n\r\n if(this.eventProcess['activityInstanceName'] == 'Editar Evento') {\r\n this.reenviar();\r\n }\r\n\r\n }\r\n\r\n async reenviar() {\r\n let body = {\r\n serialNumber: this.eventProcess.serialNumber,\r\n action: \"Reenviar\",\r\n dataFields: {\r\n ReviewUserComment: \"\",\r\n }\r\n }\r\n \r\n const loader = this.toastService.loading();\r\n\r\n try {\r\n await this.processes.PostTaskAction(body).toPromise();\r\n this.toastService._successMessage();\r\n this.goToApproveEventList();\r\n } catch (error) {\r\n if(error.status == 0) {\r\n this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')\r\n } else {\r\n \r\n this.toastService._badRequest();\r\n }\r\n } finally {\r\n loader.remove()\r\n }\r\n }\r\n\r\n goToApproveEventList() {\r\n this.closeEventToApprove.emit();\r\n this.modalController.dismiss();\r\n }\r\n\r\n dynamicSetIntervenient({taskParticipants, taskParticipantsCc}) {\r\n this.taskParticipants = removeDuplicate(taskParticipants) ;\r\n this.taskParticipantsCc = removeDuplicate(taskParticipantsCc) ;\r\n }\r\n\r\n\r\n async addParticipants() {\r\n\r\n //this.saveTemporaryData();\r\n \r\n this.openAttendeesComponent.emit({\r\n type: \"intervenient\"\r\n });\r\n\r\n this.clearContact.emit();\r\n }\r\n\r\n\r\n async addParticipantsCC() {\r\n\r\n this.openAttendeesComponent.emit({\r\n type: \"CC\"\r\n });\r\n\r\n this.clearContact.emit();\r\n }\r\n\r\n saveTemporaryData() {\r\n\r\n this.getDatepickerData()\r\n\r\n window['temp.path:/shared/agenda/edit-event-to-approve.ts'] = {\r\n eventProcess: this.eventProcess\r\n }\r\n }\r\n\r\n\r\n restoreTemporaryData(): boolean {\r\n\r\n const restoredData = window['temp.path:/shared/agenda/edit-event-to-approve.ts']\r\n\r\n if(JSON.stringify(restoredData) != \"{}\" && undefined != restoredData) {\r\n this.eventProcess = restoredData.eventProcess\r\n\r\n // restore dater for date and hours picker\r\n this.restoreDatepickerData()\r\n return true;\r\n } else {\r\n\r\n return false;\r\n }\r\n }\r\n\r\n\r\n async getAttachments() {\r\n let result: any;\r\n try {\r\n result = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();\r\n } catch (error) {\r\n console.error('getAttachment',error)\r\n }\r\n \r\n result.forEach((e)=>{\r\n e.action = false\r\n })\r\n\r\n this.loadedAttachments = result\r\n\r\n // \r\n }\r\n\r\n deleteAttachment(attachment: Attachment, index) {\r\n\r\n this.loadedAttachments[index]['action'] = 'delete'\r\n }\r\n\r\n async getDoc() {\r\n const modal = await this.modalController.create({\r\n component: SearchPage,\r\n cssClass: 'modal-width-100-width-background modal',\r\n componentProps: {\r\n type: 'AccoesPresidenciais & ArquivoDespachoElect',\r\n showSearchInput: true,\r\n select: true,\r\n }\r\n });\r\n await modal.present();\r\n modal.onDidDismiss().then( async (res)=>{\r\n if(res){\r\n\r\n const data: SearchList = res.data.selected;\r\n\r\n const DocumentToSave: any = {\r\n SourceTitle: data.Assunto,\r\n ParentId: this.InstanceId,\r\n Source: '1',\r\n SourceId: data.Id,\r\n ApplicationId: data.ApplicationType.toString(),\r\n Id: '',\r\n Link: '',\r\n SerialNumber: '',\r\n action: 'add',\r\n CreateDate: data.Data,\r\n Data: data.Data,\r\n Description: data.DocTypeDesc,\r\n SourceName: data.Assunto,\r\n Stakeholders: data.EntidadeOrganicaNome,\r\n };\r\n\r\n\r\n this.loadedAttachments.push(DocumentToSave)\r\n \r\n\r\n // await this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe(()=>{\r\n // this.getAttachments();\r\n // });\r\n }\r\n });\r\n }\r\n\r\n restoreDatepickerData() {\r\n\r\n this.dateControlStart = new UntypedFormControl(moment(new Date(this.eventProcess.workflowInstanceDataFields.StartDate)));\r\n this.dateControlEnd = new UntypedFormControl(moment(new Date(this.eventProcess.workflowInstanceDataFields.EndDate)));\r\n\r\n }\r\n\r\n getDatepickerData() {\r\n this.eventProcess.workflowInstanceDataFields.StartDate = this.dateStart\r\n this.eventProcess.workflowInstanceDataFields.EndDate = this.dateEnd\r\n\r\n }\r\n\r\n}\r\n"]},"metadata":{},"sourceType":"module"}