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

1 line
16 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 } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { ModalController } from '@ionic/angular';\nimport { PublicationsService } from 'src/app/services/publications.service';\nimport { ToastService } from 'src/app/services/toast.service';\nimport { NewPublicationPage } from '../../new-publication/new-publication.page';\nimport { ThemeService } from 'src/app/services/theme.service';\nimport { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';\nimport { RouteService } from 'src/app/services/route.service';\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, activatedRoute, RouteService, ThemeService, p, httpErrorHandle) {\n this.modalController = modalController;\n this.publications = publications;\n this.toastService = toastService;\n this.activatedRoute = activatedRoute;\n this.RouteService = RouteService;\n this.ThemeService = ThemeService;\n this.p = p;\n this.httpErrorHandle = httpErrorHandle;\n this.isModal = false;\n this.activatedRoute.paramMap.subscribe(params => {\n // console.log(params[\"params\"])\n if (params[\"params\"]) {\n this.folderId = params[\"params\"].folderId;\n this.publicationId = params[\"params\"].publicationId;\n this.isModal = params[\"params\"].isModal;\n // \n }\n });\n\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 = 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 }, error => {\n this.httpErrorHandle.httpStatusHandle(error);\n this.goBack();\n });\n }\n close() {\n this.modalController.dismiss();\n }\n goBack() {\n if (!window.location.href.includes('/home/publications/view-publications')) {\n this.close();\n } else {\n this.RouteService.goBack();\n }\n }\n deletePost() {\n var _this = this;\n return _asyncToGenerator(function* () {\n const loader = _this.toastService.loading();\n try {\n yield _this.publications.DeletePublication(_this.folderId, _this.publicationId).toPromise();\n _this.httpErrorHandle.httpsSucessMessagge('Eliminar publicação');\n if (window['app-view-publications-page-doRefresh']) {\n window['app-view-publications-page-doRefresh']();\n }\n _this.goBack();\n } catch (error) {\n _this.httpErrorHandle.httpStatusHandle(error);\n } finally {\n loader.remove();\n }\n })();\n }\n editPost(publicationType) {\n var _this2 = this;\n return _asyncToGenerator(function* () {\n const modal = yield _this2.modalController.create({\n component: NewPublicationPage,\n componentProps: {\n publicationType: publicationType,\n publication: _this2.publication,\n folderId: _this2.folderId\n },\n cssClass: 'new-publication modal modal-desktop',\n backdropDismiss: false\n });\n yield modal.present();\n modal.onDidDismiss().then(() => {\n setTimeout(() => {\n _this2.getPublicationDetail();\n }, 5000);\n });\n })();\n }\n openPreview(item) {\n var _this3 = this;\n return _asyncToGenerator(function* () {\n const modal = yield _this3.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: ActivatedRoute\n}, {\n type: RouteService\n}, {\n type: ThemeService\n}, {\n type: PermissionService\n}, {\n type: HttpErrorHandle\n}];\nPublicationDetailPage = __decorate([Component({\n selector: 'app-publication-detail',\n template: __NG_CLI_RESOURCE__0,\n styles: [__NG_CLI_RESOURCE__1]\n})], PublicationDetailPage);\nexport { PublicationDetailPage };","map":{"version":3,"mappings":";;;;AAAA,SAASA,SAAS,QAAgB,eAAe;AACjD,SAASC,cAAc,QAAgB,iBAAiB;AACxD,SAA8BC,eAAe,QAAQ,gBAAgB;AAErE,SAASC,mBAAmB,QAAQ,uCAAuC;AAC3E,SAASC,YAAY,QAAQ,gCAAgC;AAC7D,SAASC,kBAAkB,QAAQ,4CAA4C;AAC/E,SAASC,YAAY,QAAQ,gCAAgC;AAC7D,SAASC,aAAa,QAAQ,2CAA2C;AACzE,SAASC,YAAY,QAAQ,gCAAgC;AAC7D,SAASC,iBAAiB,QAAQ,qCAAqC;AACvE,SAASC,eAAe,QAAQ,4CAA4C;AAOrE,IAAMC,qBAAqB,GAA3B,MAAMA,qBAAqB;EAOhCC,YACUC,eAAgC,EAChCC,YAAgC,EAChCC,YAA0B,EAC1BC,cAA8B,EAC9BR,YAA0B,EAC3BF,YAA0B,EAC1BW,CAAmB,EAClBC,eAAgC;IAPhC,oBAAe,GAAfL,eAAe;IACf,iBAAY,GAAZC,YAAY;IACZ,iBAAY,GAAZC,YAAY;IACZ,mBAAc,GAAdC,cAAc;IACd,iBAAY,GAAZR,YAAY;IACb,iBAAY,GAAZF,YAAY;IACZ,MAAC,GAADW,CAAC;IACA,oBAAe,GAAfC,eAAe;IAVzB,YAAO,GAAG,KAAK;IAaX,IAAI,CAACF,cAAc,CAACG,QAAQ,CAACC,SAAS,CAACC,MAAM,IAAG;MAC9C;MACA,IA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AC9CC,SAAS,EAAE9D,kBAAkB;QAC7B+D,cAAc,EAAC;UACbL,eAAe,EAAEA,eAAe;UAChCtC,WAAW,EAAEwC,MAAI,CAACxC,WAAW;UAC7BH,QAAQ,EAAE2C,MAAI,CAAC3C;SAChB;QACD+C,QAAQ,EAAE,qCAAqC;QAC/CC,eAAe,EAAE;OAClB,CAAC;MACF,MAAMN,KAAK,CAACO,OAAO,EAAE;MACrBP,KAAK,CAACQ,YAAY,EAAE,CAACC,IAAI,CAAC,MAAI;QAC5BlC,UAAU,CAAC,MAAK;UACd0B,MAAI,CAAC7B,oBAAoB,EAAE;QAC/B,CAAC,EAAE,IAAI,CAAC;MACR,CAAC,CAAC;IAAC;EACL;EAEMsC,WAAWA,CAACC,IAAI;IAAA;IAAA;MACpB,MAAMX,KAAK,SAASY,MAAI,CAAC/D,eAAe,CAACqD,MAAM,CAAC;QAC9CC,SAAS,EAAG5D,aAAa;QACzB8D,QAAQ,EAAE,qBAAqB;QAC/BD,cAAc,EAAE;UACdS,KAAK,EAAEF,IAAI,CAAC3C,UAAU;UACtB8C,QAAQ,EAAEH,IAAI,CAAC9C,KAAK;UACpBkD,UAAU,EAAEJ,IAAI,CAAC5C;;OAEpB,CAAC;MACFiC,KAAK,CAACO,OAAO,EAAE;IAAC;EAClB;;;;;;;;;;;;;;;;;;;AAjJW5D,qBAAqB,eALjCX,SAAS,CAAC;EACTgF,QAAQ,EAAE,wBAAwB;EAClCC,8BAA6C;;CAE9C,CAAC,GACWtE,qBAAqB;SAArBA,qBAAqB","names":["Component","ActivatedRoute","ModalController","PublicationsService","ToastService","NewPublicationPage","ThemeService","ViewMediaPage","RouteService","PermissionService","HttpErrorHandle","PublicationDetailPage","constructor","modalController","publications","toastService","activatedRoute","p","httpErrorHandle","paramMap","subscribe","params","folderId","publicationId","isModal","publication","DateIndex","DocumentId","ProcessId","Title","Message","DatePublication","FileBase64","OriginalFileName","FileExtension","ngOnInit","getPublicationDetail","doRefresh","event","setTimeout","target","complete","error","showLoader","GetPublicationById","res","httpStatusHandle","goBack","close","dismiss","window","location","href","includes","deletePost","loader","_this","loading","DeletePublication","toPromise","httpsSucessMessagge","remove","editPost","publicationType","modal","_this2","create","component","componentProps","cssClass","backdropDismiss","present","onDidDismiss","then","openPreview","item","_this3","image","username","_updatedAt","selector","template"],"sourceRoot":"","sources":["C:\\Users\\eudes.inacio\\GabineteDigital\\gabinete-digital-fo\\src\\app\\pages\\publications\\view-publications\\publication-detail\\publication-detail.page.ts"],"sourcesContent":["import { Component, OnInit } from '@angular/core';\r\nimport { ActivatedRoute, Router } from '@angular/router';\r\nimport { AnimationController, ModalController } from '@ionic/angular';\r\nimport { Publication } from 'src/app/models/publication';\r\nimport { PublicationsService } from 'src/app/services/publications.service';\r\nimport { ToastService } from 'src/app/services/toast.service';\r\nimport { NewPublicationPage } from '../../new-publication/new-publication.page';\r\nimport { ThemeService } from 'src/app/services/theme.service'\r\nimport { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';\r\nimport { RouteService } from 'src/app/services/route.service';\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',\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 publicationId: string;\r\n folderId: string;\r\n publication: Publication;\r\n isModal = false\r\n\r\n constructor(\r\n private modalController: ModalController,\r\n private publications:PublicationsService,\r\n private toastService: ToastService,\r\n private activatedRoute: ActivatedRoute,\r\n private RouteService: RouteService,\r\n public ThemeService: ThemeService,\r\n public p:PermissionService,\r\n private httpErrorHandle: HttpErrorHandle\r\n ) {\r\n\r\n this.activatedRoute.paramMap.subscribe(params => {\r\n // console.log(params[\"params\"])\r\n if(params[\"params\"]) {\r\n this.folderId = params[\"params\"].folderId;\r\n this.publicationId = params[\"params\"].publicationId;\r\n this.isModal = params[\"params\"].isModal;\r\n // \r\n }\r\n });\r\n\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 \r\n this.publications.GetPublicationById(this.publicationId).subscribe(res => {\r\n \r\n /* this.publication = res; */\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 }, (error) => {\r\n this.httpErrorHandle.httpStatusHandle(error)\r\n this.goBack();\r\n });\r\n }\r\n\r\n close() {\r\n this.modalController.dismiss();\r\n }\r\n\r\n goBack() {\r\n if(!window.location.href.includes('/home/publications/view-publications')) {\r\n this.close()\r\n } else {\r\n this.RouteService.goBack();\r\n }\r\n\r\n }\r\n\r\n async deletePost() {\r\n\r\n const loader = 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\r\n if(window['app-view-publications-page-doRefresh']) {\r\n window['app-view-publications-page-doRefresh']()\r\n }\r\n\r\n this.goBack();\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\r\n async editPost(publicationType:any) {\r\n \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 folderId: this.folderId\r\n },\r\n cssClass: 'new-publication modal modal-desktop',\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 }\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"]},"metadata":{},"sourceType":"module"}