mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
1 line
14 KiB
JSON
1 line
14 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 \"./event-list.page.html?ngResource\";\nimport __NG_CLI_RESOURCE__1 from \"./event-list.page.scss?ngResource\";\nimport { Component, Input, EventEmitter, Output } from '@angular/core';\nimport { ProcessesService } from 'src/app/services/processes.service';\nimport { NavigationEnd, Router } from '@angular/router';\nimport { SortService } from 'src/app/services/functions/sort.service';\nimport { SessionStore } from 'src/app/store/session.service';\nimport { EventsService } from 'src/app/services/events.service';\nimport { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service';\nimport { environment } from 'src/environments/environment';\nlet EventListPage = class EventListPage {\n constructor(processes, router, sortService, eventService) {\n this.processes = processes;\n this.router = router;\n this.sortService = sortService;\n this.eventService = eventService;\n this.eventsList = [];\n this.eventoaprovacaostore = EventoAprovacaoStore;\n this.environment = environment;\n this.cloneAllmobileComponent = new EventEmitter();\n this.approveEventDismiss = new EventEmitter();\n this.loggeduser = SessionStore.user;\n }\n ngAfterViewInit() {\n if (!this.segment) {\n if (this.eventService.calendarNamesAry.includes('Meu calendario')) {\n this.segment = 'Meu calendario';\n } else {\n this.segment = this.eventService.calendarNamesAry[0].OwnerUserId;\n }\n // const pr = this.eventService.calendarNamesAry.find( e => e.Role == 'Presidente da República')\n // if(pr) {\n // this.segment = pr.OwnerUserId\n // }\n }\n }\n\n ngOnInit() {\n const pathname = window.location.pathname;\n this.router.events.forEach(event => {\n if (event instanceof NavigationEnd && event.url == pathname) {\n this.LoadToApproveEvents();\n }\n });\n }\n ngOnChanges() {\n this.LoadToApproveEvents();\n setTimeout(() => {\n this.LoadToApproveEventsNoLoader();\n }, 3000);\n }\n segmentChanged(ev) {\n this.LoadToApproveEvents();\n }\n toDateString(e) {\n return new Date(e).toDateString();\n }\n LoadToApproveEvents() {\n var _this = this;\n return _asyncToGenerator(function* () {\n if (SessionStore.user.Profile == 'PR') {\n return false;\n }\n _this.showLoader = true;\n const segment = _this.segment;\n if (_this.segment == 'Meu calendario') {\n // color\n _this.color = 'mdgpr';\n let genericEvents = yield _this.processes.eventsToApprove(SessionStore.user.UserId, 'mobile agenda').toPromise();\n try {\n _this.eventsList = _this.sortService.sortArrayByDate(genericEvents).reverse();\n } catch (error) {\n _this.eventsList = [];\n _this.showLoader = false;\n }\n _this.eventoaprovacaostore.save(segment, _this.eventsList);\n } else if (segment) {\n // console.log('segment', segment)\n _this.color = 'pr';\n let allEvents = yield _this.processes.eventsToApprove(segment, 'agenda desktop').toPromise();\n try {\n _this.eventsList = _this.sortService.sortArrayByDate(allEvents).reverse();\n } catch (error) {\n _this.eventsList = [];\n _this.showLoader = false;\n }\n _this.eventsList = _this.eventsList;\n _this.eventsList = _this.eventsList;\n _this.eventoaprovacaostore.save(segment, _this.eventsList);\n }\n _this.showLoader = false;\n })();\n }\n LoadToApproveEventsNoLoader() {\n var _this2 = this;\n return _asyncToGenerator(function* () {\n _this2.LoadToApproveEvents();\n })();\n }\n openApproveModal(eventSerialNumber, data) {\n var _this3 = this;\n return _asyncToGenerator(function* () {\n _this3.approveEventDismiss.emit({\n \"
|