mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
1 line
6.3 KiB
JSON
1 line
6.3 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 { Injectable } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { AlertController } from '@ionic/angular';\nimport { PermissionService } from '../services/permission.service';\nimport { SessionStore } from '../store/session.service';\nlet FirstEnterService = class FirstEnterService {\n constructor(router, p, alertController) {\n this.router = router;\n this.p = p;\n this.alertController = alertController;\n }\n enter() {\n if (this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)) {\n //When user has got access to Agenda but does not have their own calendar, goes to Agenda\n if (this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0) {\n this.router.navigate(['/home/agenda']);\n } else {\n this.router.navigate(['/home/events']);\n }\n } else if (this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access) || this.p.userPermission(this.p.permissionList.Chat.access)) {\n this.router.navigate(['/home/chat']);\n } else if (this.p.userPermission(this.p.permissionList.Actions.access)) {\n this.router.navigate(['/home/publications']);\n } else {\n this.alertController.create({\n cssClass: 'my-custom-class',\n header: 'Utilizador sem acesso a aplicação',\n buttons: [{\n text: 'Ok',\n handler: () => {}\n }]\n }).then( /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (alertPopup) {\n yield alertPopup.present();\n });\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }());\n }\n }\n};\nFirstEnterService.ctorParameters = () => [{\n type: Router\n}, {\n type: PermissionService\n}, {\n type: AlertController\n}];\nFirstEnterService = __decorate([Injectable({\n providedIn: 'root'\n})], FirstEnterService);\nexport { FirstEnterService };","map":{"version":3,"mappings":";;AAAA,SAASA,UAA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L,IAAI,CAACP,MAAM,CAACY,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC;KACrC,MACI,IAAG,IAAI,CAACX,CAAC,CAACG,cAAc,CAAC,IAAI,CAACH,CAAC,CAACI,cAAc,CAACS,OAAO,CAACP,MAAM,CAAC,EAAE;MACnE,IAAI,CAACP,MAAM,CAACY,QAAQ,CAAC,CAAC,oBAAoB,CAAC,CAAC;KAC7C,MAAM;MAEL,IAAI,CAACV,eAAe,CAACa,MAAM,CAAC;QAC1BC,QAAQ,EAAE,iBAAiB;QAC3BC,MAAM,EAAE,mCAAmC;QAC3CC,OAAO,EAAE,CAAC;UACRC,IAAI,EAAE,IAAI;UACVC,OAAO,EAAEA,MAAK,CAEd;SACD;OACF,CAAC,CAACC,IAAI;QAAA,6BAAE,WAAOC,UAAU,EAAI;UAC5B,MAAMA,UAAU,CAACC,OAAO,EAAE;QAC5B,CAAC;QAAA;UAAA;QAAA;MAAA,IAAC;;EAGN;;;;;;;;;AAtCWzB,iBAAiB,eAH7BL,UAAU,CAAC;EACV+B,UAAU,EAAE;CACb,CAAC,GACW1B,iBAAiB;SAAjBA,iBAAiB","names":["Injectable","Router","AlertController","PermissionService","SessionStore","FirstEnterService","constructor","router","p","alertController","enter","userPermission","permissionList","Agenda","access","Gabinete","user","OwnerCalendars","length","navigate","Chat","Actions","create","cssClass","header","buttons","text","handler","then","alertPopup","present","providedIn"],"sourceRoot":"","sources":["C:\\Users\\eudes.inacio\\GabineteDigital\\gabinete-digital-fo\\src\\app\\services\\first-enter.service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree } from '@angular/router';\r\n\r\nimport { AlertController, Platform } from '@ionic/angular';\r\nimport { PermissionService } from '../services/permission.service';\r\nimport { SessionStore } from '../store/session.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class FirstEnterService {\r\n\r\n constructor(private router:Router,\r\n public p: PermissionService,\r\n private alertController: AlertController) { }\r\n\r\n\r\n enter( ) {\r\n if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){\r\n //When user has got access to Agenda but does not have their own calendar, goes to Agenda\r\n if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0){\r\n this.router.navigate(['/home/agenda']);\r\n }\r\n else{\r\n this.router.navigate(['/home/events']);\r\n }\r\n }\r\n else if((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.access)){\r\n this.router.navigate(['/home/chat']);\r\n }\r\n else if(this.p.userPermission(this.p.permissionList.Actions.access)) {\r\n this.router.navigate(['/home/publications']);\r\n } else {\r\n\r\n this.alertController.create({\r\n cssClass: 'my-custom-class',\r\n header: 'Utilizador sem acesso a aplicação',\r\n buttons: [{\r\n text: 'Ok',\r\n handler: () => {\r\n\r\n }\r\n }]\r\n }).then( async (alertPopup) => {\r\n await alertPopup.present();\r\n })\r\n\r\n }\r\n }\r\n}\r\n"]},"metadata":{},"sourceType":"module"} |