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

1 line
15 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 \"./publication-detail.page.html?ngResource\";\nimport __NG_CLI_RESOURCE__1 from \"./publication-detail.page.scss?ngResource\";\nimport { Component, Input, Output, EventEmitter } from '@angular/core';\nimport { ModalController } from '@ionic/angular';\nimport { NewPublicationPage } from 'src/app/pages/publications/new-publication/new-publication.page';\nimport { PublicationsService } from 'src/app/services/publications.service';\nimport { ToastService } from 'src/app/services/toast.service';\nimport { ThemeService } from 'src/app/services/theme.service';\nimport { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';\nimport { PermissionService } from 'src/app/services/permission.service';\nimport { HttpErrorHandle } from 'src/app/services/http-error-handle.service';\nlet PublicationDetailPage = class PublicationDetailPage {\n constructor(modalController, publications, toastService, ThemeService, p, httpErrorHandle) {\n this.modalController = modalController;\n this.publications = publications;\n this.toastService = toastService;\n this.ThemeService = ThemeService;\n this.p = p;\n this.httpErrorHandle = httpErrorHandle;\n this.addNewPublication = new EventEmitter();\n this.closeDesktopComponent = new EventEmitter();\n this.goBackToViewPublications = new EventEmitter();\n /* this.folderId = this.navParams.get('folderIdId'); */\n this.publication = {\n DateIndex: null,\n DocumentId: null,\n ProcessId: '',\n Title: '',\n Message: '',\n /* image: null, */\n DatePublication: null,\n FileBase64: '',\n OriginalFileName: '',\n FileExtension: ''\n };\n }\n ngOnInit() {\n this.getPublicationDetail();\n }\n doRefresh(event) {\n this.getPublicationDetail();\n setTimeout(() => {\n try {\n event?.target?.complete();\n } catch (error) {}\n }, 2000);\n }\n getPublicationDetail() {\n this.showLoader = true;\n this.publications.GetPublicationById(this.publicationId).subscribe(res => {\n this.publication = {\n DateIndex: res.DateIndex,\n DocumentId: res.DocumentId,\n ProcessId: res.ProcessId,\n Title: res.Title,\n Message: res.Message,\n DatePublication: res.DatePublication,\n FileBase64: \"data:image/jpg;base64,\" + res.FileBase64,\n OriginalFileName: res.OriginalFileName,\n FileExtension: 'jpeg'\n };\n this.showLoader = false;\n });\n }\n close() {\n this.modalController.dismiss();\n }\n deletePost() {\n var _this = this;\n return _asyncToGenerator(function* () {\n const laoder = _this.toastService.loading();\n try {\n yield _this.publications.DeletePublication(_this.folderId, _this.publicationId).toPromise();\n _this.httpErrorHandle.httpsSucessMessagge('Eliminar publicação');\n _this.goBackToViewPublications.emit();\n } catch (error) {\n _this.httpErrorHandle.httpStatusHandle(error);\n } finally {\n laoder.remove();\n }\n })();\n }\n editPost(publicationType) {\n var _this2 = this;\n return _asyncToGenerator(function* () {\n if (window.innerWidth < 701) {\n const modal = yield _this2.modalController.create({\n component: NewPublicationPage,\n componentProps: {\n publicationType: publicationType,\n publication: _this2.publication\n },\n cssClass: 'new-publication',\n backdropDismiss: false\n });\n yield modal.present();\n modal.onDidDismiss().then(() => {\n setTimeout(() => {\n _this2.getPublicationDetail();\n }, 5000);\n });\n } else {\n _this2.addNewPublication.emit({\n publicationType: publicationType,\n folderId: _this2.folderId,\n publication: _this2.publication\n });\n }\n })();\n }\n goBack() {\n var _this3 = this;\n return _asyncToGenerator(function* () {\n _this3.goBackToViewPublications.emit();\n })();\n }\n openPreview(item) {\n var _this4 = this;\n return _asyncToGenerator(function* () {\n const modal = yield _this4.modalController.create({\n component: ViewMediaPage,\n cssClass: 'modal modal-desktop',\n componentProps: {\n image: item.FileBase64,\n username: item.Title,\n _updatedAt: item.DatePublication\n }\n });\n modal.present();\n })();\n }\n};\nPublicationDetailPage.ctorParameters = () => [{\n type: ModalController\n}, {\n type: PublicationsService\n}, {\n type: ToastService\n}, {\n type: ThemeService\n}, {\n type: PermissionService\n}, {\n type: HttpErrorHandle\n}];\nPublicationDetailPage.propDecorators = {\n publicationId: [{\n type: Input\n }],\n folderId: [{\n type: Input\n }],\n addNewPublication: [{\n type: Output\n }],\n closeDesktopComponent: [{\n type: Output\n }],\n goBackToViewPublications: [{\n type: Output\n }]\n};\nPublicationDetailPage = __decorate([Component({\n selector: 'app-publication-detail-shared',\n template: __NG_CLI_RESOURCE__0,\n styles: [__NG_CLI_RESOURCE__1]\n})], PublicationDetailPage);\nexport { PublicationDetailPage };","map":{"version":3,"mappings":";;;;AAAA,SAASA,SAAS,EAAUC,KAAK,EAAEC,MAAM,EAAEC,YAAY,QAAQ,eAAe;AAC9E,SAASC,eAAe,QAAQ,gBAAgB;AAEhD,SAASC,kBAAkB,QAAQ,iEAAiE;AACpG,SAASC,mBAAmB,QAAQ,uCAAuC;AAC3E,SAASC,YAAY,QAAQ,gCAAgC;AAC7D,SAASC,YAAY,QAAQ,gCAAgC;AAC7D,SAASC,aAAa,QAAQ,2CAA2C;AACzE,SAASC,iBAAiB,QAAQ,qCAAqC;AACvE,SAASC,eAAe,QAAQ,4CAA4C;AAOrE,IAAMC,qBAAqB,GAA3B,MAAMA,qBAAqB;EAWhCC,YACUC,eAAgC,EAChCC,YAAgC,EAChCC,YAA0B,EAC3BR,YAA0B,EAC1BS,CAAmB,EAClBC,eAAgC;IALhC,oBAAe,GAAfJ,eAAe;IACf,iBAAY,GAAZC,YAAY;IACZ,iBAAY,GAAZC,YAAY;IACb,iBAAY,GAAZR,YAAY;IACZ,MAAC,GAADS,CAAC;IACA,oBAAe,GAAfC,eAAe;IAVf,sBAAiB,GAAI,IAAIf,YAAY,EAAO;IAC5C,0BAAqB,GAAI,IAAIA,YAAY,EAAO;IAChD,6BAAwB,GAAG,IAAIA,YAAY,EAAE;IAWnD;IACA,IAAI,CAACgB,WAAW,GAAG;MACjBC,SAAS,EAAE,IAAI;MACfC,UAAU,EAAE,IAAI;MAChBC,SAAS,EAAC,EAAE;MACZC,KAAK,EAAC,EAAE;MACRC,OAAO,EAAE,E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QAC9CC,SAAS,EAAGtD,aAAa;QACzBwD,QAAQ,EAAE,qBAAqB;QAC/BD,cAAc,EAAE;UACdY,KAAK,EAAEF,IAAI,CAAChD,UAAU;UACtBmD,QAAQ,EAAEH,IAAI,CAACnD,KAAK;UACpBuD,UAAU,EAAEJ,IAAI,CAACjD;;OAEpB,CAAC;MACFmC,KAAK,CAACO,OAAO,EAAE;IAAC;EAClB;;;;;;;;;;;;;;;;;UA/HClE;EAAK;;UACLA;EAAK;;UACLC;EAAM;;UACNA;EAAM;;UACNA;EAAM;;AATIU,qBAAqB,eALjCZ,SAAS,CAAC;EACT+E,QAAQ,EAAE,+BAA+B;EACzCC,8BAA6C;;CAE9C,CAAC,GACWpE,qBAAqB;SAArBA,qBAAqB","names":["Component","Input","Output","EventEmitter","ModalController","NewPublicationPage","PublicationsService","ToastService","ThemeService","ViewMediaPage","PermissionService","HttpErrorHandle","PublicationDetailPage","constructor","modalController","publications","toastService","p","httpErrorHandle","publication","DateIndex","DocumentId","ProcessId","Title","Message","DatePublication","FileBase64","OriginalFileName","FileExtension","ngOnInit","getPublicationDetail","doRefresh","event","setTimeout","target","complete","error","showLoader","GetPublicationById","publicationId","subscribe","res","close","dismiss","deletePost","laoder","_this","loading","DeletePublication","folderId","toPromise","httpsSucessMessagge","goBackToViewPublications","emit","httpStatusHandle","remove","editPost","publicationType","window","innerWidth","modal","_this2","create","component","componentProps","cssClass","backdropDismiss","present","onDidDismiss","then","addNewPublication","goBack","_this3","openPreview","item","_this4","image","username","_updatedAt","selector","template"],"sourceRoot":"","sources":["C:\\Users\\eudes.inacio\\GabineteDigital\\gabinete-digital-fo\\src\\app\\shared\\publication\\view-publications\\publication-detail\\publication-detail.page.ts"],"sourcesContent":["import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';\r\nimport { ModalController } from '@ionic/angular';\r\nimport { Publication } from 'src/app/models/publication';\r\nimport { NewPublicationPage } from 'src/app/pages/publications/new-publication/new-publication.page';\r\nimport { PublicationsService } from 'src/app/services/publications.service';\r\nimport { ToastService } from 'src/app/services/toast.service';\r\nimport { ThemeService } from 'src/app/services/theme.service'\r\nimport { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';\r\nimport { PermissionService } from 'src/app/services/permission.service';\r\nimport { HttpErrorHandle } from 'src/app/services/http-error-handle.service';\r\n\r\n@Component({\r\n selector: 'app-publication-detail-shared',\r\n templateUrl: './publication-detail.page.html',\r\n styleUrls: ['./publication-detail.page.scss'],\r\n})\r\nexport class PublicationDetailPage implements OnInit {\r\n showLoader: boolean;\r\n /* folderId: string; */\r\n publication: Publication;\r\n\r\n @Input() publicationId: string;\r\n @Input() folderId: string;\r\n @Output() addNewPublication = new EventEmitter<any>();\r\n @Output() closeDesktopComponent = new EventEmitter<any>();\r\n @Output() goBackToViewPublications = new EventEmitter();\r\n\r\n constructor(\r\n private modalController: ModalController,\r\n private publications:PublicationsService,\r\n private toastService: ToastService,\r\n public ThemeService: ThemeService,\r\n public p:PermissionService,\r\n private httpErrorHandle: HttpErrorHandle\r\n ) {\r\n\r\n /* this.folderId = this.navParams.get('folderIdId'); */\r\n this.publication = {\r\n DateIndex: null,\r\n DocumentId: null,\r\n ProcessId:'',\r\n Title:'',\r\n Message: '',\r\n /* image: null, */\r\n DatePublication: null,\r\n FileBase64: '',\r\n OriginalFileName: '',\r\n FileExtension: '',\r\n };\r\n }\r\n\r\n ngOnInit() {\r\n this.getPublicationDetail();\r\n }\r\n doRefresh(event) {\r\n this.getPublicationDetail();\r\n\r\n setTimeout(() => {\r\n try {\r\n event?.target?.complete();\r\n} catch(error) {}\r\n }, 2000);\r\n }\r\n\r\n getPublicationDetail(){\r\n this.showLoader = true;\r\n this.publications.GetPublicationById(this.publicationId).subscribe(res=>{\r\n \r\n this.publication = {\r\n DateIndex: res.DateIndex,\r\n DocumentId: res.DocumentId,\r\n ProcessId:res.ProcessId,\r\n Title:res.Title,\r\n Message: res.Message,\r\n DatePublication: res.DatePublication,\r\n FileBase64: \"data:image/jpg;base64,\" + res.FileBase64,\r\n OriginalFileName: res.OriginalFileName,\r\n FileExtension: 'jpeg',\r\n }\r\n this.showLoader = false;\r\n });\r\n }\r\n\r\n close() {\r\n this.modalController.dismiss();\r\n }\r\n\r\n async deletePost(){\r\n\r\n const laoder = this.toastService.loading()\r\n\r\n try {\r\n await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise();\r\n this.httpErrorHandle.httpsSucessMessagge('Eliminar publicação')\r\n this.goBackToViewPublications.emit();\r\n } catch (error) {\r\n this.httpErrorHandle.httpStatusHandle(error)\r\n } finally {\r\n laoder.remove()\r\n }\r\n\r\n }\r\n\r\n async editPost(publicationType:any) {\r\n \r\n\r\n if(window.innerWidth < 701){\r\n const modal = await this.modalController.create({\r\n component: NewPublicationPage,\r\n componentProps:{\r\n publicationType: publicationType,\r\n publication: this.publication,\r\n },\r\n cssClass: 'new-publication',\r\n backdropDismiss: false\r\n });\r\n await modal.present();\r\n modal.onDidDismiss().then(()=>{\r\n setTimeout(() => {\r\n this.getPublicationDetail();\r\n }, 5000);\r\n });\r\n } else {\r\n this.addNewPublication.emit({\r\n publicationType: publicationType,\r\n folderId: this.folderId,\r\n publication: this.publication,\r\n })\r\n }\r\n\r\n }\r\n\r\n async goBack(){\r\n\r\n this.goBackToViewPublications.emit();\r\n }\r\n\r\n async openPreview(item) {\r\n const modal = await this.modalController.create({\r\n component: ViewMediaPage,\r\n cssClass: 'modal modal-desktop',\r\n componentProps: {\r\n image: item.FileBase64,\r\n username: item.Title,\r\n _updatedAt: item.DatePublication\r\n }\r\n });\r\n modal.present();\r\n }\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n}\r\n"]},"metadata":{},"sourceType":"module"}