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

1 line
12 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-action.page.html?ngResource\";\nimport __NG_CLI_RESOURCE__1 from \"./edit-action.page.scss?ngResource\";\nimport { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';\nimport * as moment from 'moment';\nimport { PublicationFolder } from 'src/app/models/publicationfolder';\nimport { PublicationsService } from 'src/app/services/publications.service';\nimport { ToastService } from 'src/app/services/toast.service';\nimport { HttpErrorHandle } from 'src/app/services/http-error-handle.service';\nlet EditActionPage = class EditActionPage {\n constructor(publicationsService, toastService, httpErrorHandle) {\n this.publicationsService = publicationsService;\n this.toastService = toastService;\n this.httpErrorHandle = httpErrorHandle;\n this.validateFrom = false;\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().toISOString().slice(0, 10);\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.currentDate = new Date();\n this.closeDesktopComponent = new EventEmitter();\n this.updateDesktopComponent = new EventEmitter();\n this.getActions = new EventEmitter();\n this.folder = new PublicationFolder();\n }\n ngOnInit() {\n this.getPublicationDetail();\n }\n close() {\n this.closeDesktopComponent.emit();\n }\n getPublicationDetail() {\n this.publicationsService.GetPresidentialAction(this.folderId).subscribe(res => {\n this.folder = res;\n this.dateControlStart = new UntypedFormControl(moment(new Date(this.folder.DateBegin)));\n this.dateControlEnd = new UntypedFormControl(moment(new Date(this.folder.DateEnd)));\n });\n }\n get dateValid() {\n if (window.innerWidth < 701) {\n return this.folder.DateBegin < this.folder.DateEnd ? ['ok'] : [];\n } else {\n return ['ok'];\n }\n }\n runValidation() {\n this.validateFrom = true;\n }\n injectValidation() {\n this.Form = new UntypedFormGroup({\n Subject: new UntypedFormControl(this.folder.Description, [Validators.required\n // Validators.minLength(4)\n ]),\n\n Date: new UntypedFormControl(this.dateValid, [Validators.required])\n });\n }\n save() {\n var _this = this;\n return _asyncToGenerator(function* () {\n _this.injectValidation();\n _this.runValidation();\n let body = {\n ProcessId: _this.folderId,\n Description: _this.folder.Description,\n Detail: _this.folder.Detail,\n DateBegin: _this.folder.DateBegin,\n DateEnd: _this.folder.DateEnd,\n ActionType: _this.folder.ActionType\n };\n const loader = _this.toastService.loading();\n try {\n yield _this.publicationsService.UpdatePresidentialAction(body).toPromise();\n _this.close();\n _this.updateDesktopComponent.emit();\n _this.httpErrorHandle.httpsSucessMessagge('Editar Acção');\n _this.getActions.emit();\n } catch (error) {\n _this.httpErrorHandle.httpStatusHandle(error);\n } finally {\n loader.remove();\n }\n })();\n }\n};\nEditActionPage.ctorParameters = () => [{\n type: PublicationsService\n}, {\n type: ToastService\n}, {\n type: HttpErrorHandle\n}];\nEditActionPage.propDecorators = {\n folderId: [{\n type: Input\n }],\n closeDesktopComponent: [{\n type: Output\n }],\n updateDesktopComponent: [{\n type: Output\n }],\n getActions: [{\n type: Output\n }]\n};\nEditActionPage = __decorate([Component({\n selector: 'app-edit-action',\n template: __NG_CLI_RESOURCE__0,\n styles: [__NG_CLI_RESOURCE__1]\n})], EditActionPage);\nexport { EditActionPage };","map":{"version":3,"mappings":";;;;AAAA,SAASA,SAAS,EAAEC,YAAY,EAAEC,KAAK,EAAUC,MAAM,QAAQ,eAAe;AAC9E,SAASC,kBAAkB,EAAEC,gBAAgB,EAAEC,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QACTC,SAAS,EAAEF,KAAI,CAAClB,QAAQ;QACxBe,WAAW,EAAEG,KAAI,CAACzB,MAAM,CAACsB,WAAW;QACpCM,MAAM,EAAEH,KAAI,CAACzB,MAAM,CAAC4B,MAAM;QAC1BjB,SAAS,EAAEc,KAAI,CAACzB,MAAM,CAACW,SAAS;QAChCE,OAAO,EAAEY,KAAI,CAACzB,MAAM,CAACa,OAAO;QAC5BgB,UAAU,EAAEJ,KAAI,CAACzB,MAAM,CAAC6B;OACzB;MAED,MAAMC,MAAM,GAAGL,KAAI,CAAC/B,YAAY,CAACqC,OAAO,EAAE;MAE1C,IAAI;QACF,MAAMN,KAAI,CAAChC,mBAAmB,CAACuC,wBAAwB,CAACN,IAAI,CAAC,CAACO,SAAS,EAAE;QACzER,KAAI,CAACtB,KAAK,EAAE;QACZsB,KAAI,CAACS,sBAAsB,CAAC7B,IAAI,EAAE;QAClCoB,KAAI,CAAC9B,eAAe,CAACwC,mBAAmB,CAAC,cAAc,CAAC;QACxDV,KAAI,CAACW,UAAU,CAAC/B,IAAI,EAAE;OAEvB,CAAC,OAAOgC,KAAK,EAAE;QACdZ,KAAI,CAAC9B,eAAe,CAAC2C,gBAAgB,CAACD,KAAK,CAAC;OAC7C,SAAS;QACRP,MAAM,CAACS,MAAM,EAAE;;IAChB;EAEH;;;;;;;;;;;UApFC1D;EAAK;;UACLC;EAAM;;UACNA;EAAM;;UACNA;EAAM;;AAzBIS,cAAc,eAL1BZ,SAAS,CAAC;EACT6D,QAAQ,EAAE,iBAAiB;EAC3BC,8BAAsC;;CAEvC,CAAC,GACWlD,cAAc;SAAdA,cAAc","names":["Component","EventEmitter","Input","Output","UntypedFormControl","UntypedFormGroup","Validators","moment","PublicationFolder","PublicationsService","ToastService","HttpErrorHandle","EditActionPage","constructor","publicationsService","toastService","httpErrorHandle","Date","toISOString","slice","getTime","folder","ngOnInit","getPublicationDetail","close","closeDesktopComponent","emit","GetPresidentialAction","folderId","subscribe","res","dateControlStart","DateBegin","dateControlEnd","DateEnd","dateValid","window","innerWidth","runValidation","validateFrom","injectValidation","Form","Subject","Description","required","save","_this","body","ProcessId","Detail","ActionType","loader","loading","UpdatePresidentialAction","toPromise","updateDesktopComponent","httpsSucessMessagge","getActions","error","httpStatusHandle","remove","selector","template"],"sourceRoot":"","sources":["C:\\Users\\eudes.inacio\\GabineteDigital\\gabinete-digital-fo\\src\\app\\shared\\publication\\edit-action\\edit-action.page.ts"],"sourcesContent":["import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\r\nimport { UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';\r\nimport * as moment from 'moment';\r\nimport { PublicationFolder } from 'src/app/models/publicationfolder';\r\nimport { PublicationsService } from 'src/app/services/publications.service';\r\nimport { ToastService } from 'src/app/services/toast.service';\r\nimport { HttpErrorHandle } from 'src/app/services/http-error-handle.service';\r\n\r\n@Component({\r\n selector: 'app-edit-action',\r\n templateUrl: './edit-action.page.html',\r\n styleUrls: ['./edit-action.page.scss'],\r\n})\r\nexport class EditActionPage implements OnInit {\r\n\r\n Form: UntypedFormGroup;\r\n validateFrom = false\r\n\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().toISOString().slice(0,10)\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 public currentDate = new Date();\r\n\r\n folder: PublicationFolder;\r\n @Input() folderId: string;\r\n @Output() closeDesktopComponent= new EventEmitter<any>();\r\n @Output() updateDesktopComponent= new EventEmitter<any>();\r\n @Output() getActions= new EventEmitter<any>();\r\n\r\n constructor(\r\n private publicationsService: PublicationsService,\r\n private toastService: ToastService,\r\n private httpErrorHandle: HttpErrorHandle,\r\n ) {\r\n this.folder = new PublicationFolder();\r\n }\r\n\r\n ngOnInit() {\r\n this.getPublicationDetail();\r\n }\r\n\r\n close() {\r\n this.closeDesktopComponent.emit();\r\n }\r\n\r\n getPublicationDetail() {\r\n this.publicationsService.GetPresidentialAction(this.folderId).subscribe( res => {\r\n this.folder = res;\r\n\r\n this.dateControlStart = new UntypedFormControl(moment(new Date(this.folder.DateBegin)));\r\n this.dateControlEnd = new UntypedFormControl(moment(new Date(this.folder.DateEnd)));\r\n\r\n });\r\n }\r\n\r\n get dateValid() {\r\n if (window.innerWidth < 701) {\r\n return this.folder.DateBegin < this.folder.DateEnd? ['ok']: []\r\n } else {\r\n return ['ok']\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.folder.Description, [\r\n Validators.required,\r\n // Validators.minLength(4)\r\n ]),\r\n Date: new UntypedFormControl(this.dateValid, [\r\n Validators.required\r\n ]),\r\n })\r\n }\r\n\r\n async save() {\r\n this.injectValidation();\r\n this.runValidation();\r\n\r\n let body = {\r\n ProcessId: this.folderId,\r\n Description: this.folder.Description,\r\n Detail: this.folder.Detail,\r\n DateBegin: this.folder.DateBegin,\r\n DateEnd: this.folder.DateEnd,\r\n ActionType: this.folder.ActionType,\r\n }\r\n\r\n const loader = this.toastService.loading()\r\n\r\n try {\r\n await this.publicationsService.UpdatePresidentialAction(body).toPromise()\r\n this.close();\r\n this.updateDesktopComponent.emit();\r\n this.httpErrorHandle.httpsSucessMessagge('Editar Acção')\r\n this.getActions.emit()\r\n\r\n } catch (error) {\r\n this.httpErrorHandle.httpStatusHandle(error)\r\n } finally {\r\n loader.remove()\r\n }\r\n\r\n }\r\n}\r\n"]},"metadata":{},"sourceType":"module"}