mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
1 line
28 KiB
JSON
1 line
28 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 \"./view-publications.page.html?ngResource\";\nimport __NG_CLI_RESOURCE__1 from \"./view-publications.page.scss?ngResource\";\nimport { Component, Input, Output, EventEmitter } from '@angular/core';\nimport { ModalController } from '@ionic/angular';\nimport { PublicationFolder } from 'src/app/models/publicationfolder';\nimport { PublicationsService } from 'src/app/services/publications.service';\nimport { NewPublicationPage } from 'src/app/pages/publications/new-publication/new-publication.page';\nimport { PublicationPipe } from 'src/app/pipes/publication.pipe';\nimport { ThemeService } from 'src/app/services/theme.service';\nimport { ToastService } from 'src/app/services/toast.service';\nimport { EditActionPage } from 'src/app/pages/publications/edit-action/edit-action.page';\nimport { Storage } from '@ionic/storage';\nimport { PermissionService } from 'src/app/services/permission.service';\nimport { HttpErrorHandle } from 'src/app/services/http-error-handle.service';\nlet ViewPublicationsPage = class ViewPublicationsPage {\n constructor(modalController, publications, ThemeService, toastService, storage, p, httpErrorHandle) {\n this.modalController = modalController;\n this.publications = publications;\n this.ThemeService = ThemeService;\n this.toastService = toastService;\n this.storage = storage;\n this.p = p;\n this.httpErrorHandle = httpErrorHandle;\n this.publicationList = {};\n this.publicationItem = {};\n this.getpublication = [];\n this.addNewPublication = new EventEmitter();\n this.editPublication = new EventEmitter();\n this.openPublicationDetails = new EventEmitter();\n this.goBackToViewPublications = new EventEmitter();\n this.closeDesktopComponent = new EventEmitter();\n this.goBacktoPublicationDetails = new EventEmitter();\n this.getActions = new EventEmitter();\n this.publicationPipe = new PublicationPipe();\n this.doRefresh = event => {\n this.getPublicationDetail();\n this.getPublicationsIds();\n };\n this.createPublicationList();\n }\n ngOnInit() {\n if (typeof this.folderId == 'object') {\n this.folderId = this.folderId['ProcessId'];\n }\n this.createPublicationList();\n window['app-view-publications-page-doRefresh'] = this.doRefresh;\n this.getFromDB();\n }\n ngOnChanges(changes) {\n if (typeof this.folderId == 'object') {\n this.folderId = this.folderId['ProcessId'];\n }\n if (!this.publicationList[this.folderId]) {\n this.publicationItem[this.folderId] = new PublicationFolder();\n }\n this.createPublicationList();\n this.getFromDB();\n this.getPublicationDetail();\n this.getPublicationsIds();\n }\n createPublicationList(folderId = this.folderId) {\n if (!this.publicationList[this.folderId]) {\n this.publicationList[this.folderId] = [];\n }\n if (!this.publicationItem[this.folderId]) {\n this.publicationItem[this.folderId] = new PublicationFolder();\n }\n }\n close() {\n this.closeDesktopComponent.emit();\n }\n getPublicationDetail() {\n const folderId = this.folderId;\n this.publications.GetPresidentialAction(folderId).subscribe(res => {\n this.publicationItem[folderId] = res;\n this.storage.set(folderId + \"name\", res);\n }, error => {\n this.showLoader = false;\n // this.httpErroHandle.httpStatusHandle(error)\n });\n }\n\n getPublicationsIds() {\n var _this = this;\n return _asyncToGenerator(function* () {\n _this.showLoader = true;\n const folderId = _this.folderId;\n try {\n const publicationIds = yield _this.publications.GetPublicationsList(folderId).toPromise();\n _this.createPublicationList(folderId);\n let loadLater = [];\n for (let publicationId of publicationIds) {\n if (!_this.publicationIsPres
|