1 | import { Injectable, ɵɵdefineInjectable, ɵɵinject, Component, Input, NgModule } from '@angular/core';
|
2 | import { get, each, union, find, includes } from 'lodash';
|
3 | import { of } from 'rxjs';
|
4 | import { mergeMap, map, delay } from 'rxjs/operators';
|
5 | import { HttpHeaders, HttpClient, HttpClientModule } from '@angular/common/http';
|
6 | import * as momentJS from 'moment';
|
7 | import { CommonModule } from '@angular/common';
|
8 | import { StackModule, SearchModule, IconModule, FrameModule, TopbarModule, NavigationModule, ButtonModule, PageModule, BadgeModule, AvatarModule } from '@kushki/ng-suka';
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | const PermissionsEnum = {
|
16 | VIEWUSERS: 'viewUsers',
|
17 | VIEWTRANSACTIONS: 'viewTransactions',
|
18 | VIEWSMARTLINKS: 'viewSmartLinks',
|
19 | LISTSMARTLINKS: 'listSmartLinks',
|
20 | VIEWBANK: 'viewBank',
|
21 | CREATEALLUSERS: 'createAllUsers',
|
22 | VOIDANDREFUND: 'voidAndRefund',
|
23 | PROCESSORSCRUD: 'processorsCrud',
|
24 | ACCESSUSERMASTER: 'accessUserMaster',
|
25 | ACCESSUSERMAKER: 'accessUserMaker',
|
26 | ACCESSUSERREADER: 'accessUserReader',
|
27 | ACCESSADMIN: 'accessAdmin',
|
28 | AGENTSNR: 'agentSnr',
|
29 | COORDINATORSNR: 'coordinatorSnr',
|
30 | REVIEWERMGUAYAQUIL: 'reviewerMguayaquil',
|
31 | ADMINCONCILIATION: 'adminConciliation',
|
32 | };
|
33 |
|
34 | const HOME = {
|
35 | title: 'Inicio',
|
36 | icon: 'home',
|
37 | link: '/dashboard',
|
38 | home: true,
|
39 | };
|
40 |
|
41 | const MERCHANTS = {
|
42 | title: 'Comercios',
|
43 | icon: 'shopping-bag',
|
44 | link: '/merchants',
|
45 | home: true,
|
46 | };
|
47 |
|
48 | const TRANSACTIONS = {
|
49 | title: 'Transacciones',
|
50 | icon: 'dollar-sign',
|
51 | link: '/transactions',
|
52 | home: true,
|
53 | };
|
54 |
|
55 | const DISPERSION = {
|
56 | title: 'Dispersión',
|
57 | icon: 'maximize',
|
58 | link: '/dispersion',
|
59 | home: true,
|
60 | };
|
61 |
|
62 | const USERS = {
|
63 | title: 'Usuarios',
|
64 | icon: 'user',
|
65 | link: '/users',
|
66 | home: true,
|
67 | };
|
68 |
|
69 | const ALLIES = {
|
70 | title: 'Aliados',
|
71 | icon: 'users',
|
72 | link: '/resellers',
|
73 | home: true,
|
74 | };
|
75 |
|
76 | const SUBSCRIPTIONS = {
|
77 | title: 'Suscripciones',
|
78 | icon: 'repeat',
|
79 | link: '/subscriptions',
|
80 | home: true,
|
81 | };
|
82 |
|
83 | const SMARTLINKS = {
|
84 | title: 'Smartlinks',
|
85 | icon: 'columns',
|
86 | link: '/smartlinks',
|
87 | home: true,
|
88 | };
|
89 |
|
90 | const BILLING_DASHBOARD = {
|
91 | title: 'Facturación',
|
92 | icon: 'book-open',
|
93 | link: '/billing-dashboard',
|
94 | home: true,
|
95 | };
|
96 |
|
97 | const SNR = {
|
98 | title: 'SNR',
|
99 | icon: 'file-minus',
|
100 | link: '/snr',
|
101 | home: true,
|
102 | };
|
103 |
|
104 | const MGUAYAQUIL = {
|
105 | title: 'Municipio de Guayaquil',
|
106 | icon: 'file-minus',
|
107 | link: '/municipio-guayaquil',
|
108 | home: true,
|
109 | };
|
110 |
|
111 | const CONCILIATION_DASHBOARD = {
|
112 | title: 'Informes',
|
113 | icon: 'file-text',
|
114 | link: '/reports',
|
115 | home: true,
|
116 | };
|
117 |
|
118 | const MENU_BACKOFFICE_ADMIN = [
|
119 | HOME,
|
120 | MERCHANTS,
|
121 | TRANSACTIONS,
|
122 | BILLING_DASHBOARD,
|
123 | DISPERSION,
|
124 | USERS,
|
125 | ALLIES,
|
126 | CONCILIATION_DASHBOARD
|
127 | ];
|
128 |
|
129 | const MENU_BACKOFFICE_USER_MASTER = [
|
130 | HOME,
|
131 | MERCHANTS,
|
132 | TRANSACTIONS,
|
133 | USERS,
|
134 | SUBSCRIPTIONS,
|
135 | CONCILIATION_DASHBOARD
|
136 | ];
|
137 |
|
138 | const MENU_BACKOFFICE_USER_MAKER = [
|
139 | HOME,
|
140 | USERS,
|
141 | SUBSCRIPTIONS
|
142 | ];
|
143 |
|
144 | const MENU_BACKOFFICE_USER_READER = [
|
145 | HOME,
|
146 | TRANSACTIONS
|
147 | ];
|
148 |
|
149 | const MENU_WEBCHECKOUT_BASIC = [
|
150 | SMARTLINKS
|
151 | ];
|
152 |
|
153 | const MENU_WEBCHECKOUT_MASTER = [
|
154 | SMARTLINKS
|
155 | ];
|
156 |
|
157 | const MENU_BACKOFFICE_BANK = [
|
158 | HOME
|
159 | ];
|
160 |
|
161 | const MENU_SNR = [
|
162 | SNR
|
163 | ];
|
164 |
|
165 | const MENU_MGUAYAQUIL = [
|
166 | MGUAYAQUIL
|
167 | ];
|
168 |
|
169 | const MENU_BACKOFFICE_RESELLER = [];
|
170 |
|
171 | const PERMISSIONS_BACKOFFICE_ADMIN = [
|
172 | PermissionsEnum.VIEWUSERS,
|
173 | PermissionsEnum.CREATEALLUSERS,
|
174 | PermissionsEnum.PROCESSORSCRUD,
|
175 | PermissionsEnum.ACCESSADMIN,
|
176 | PermissionsEnum.ADMINCONCILIATION
|
177 | ];
|
178 |
|
179 | const PERMISSIONS_BACKOFFICE_BANK = [
|
180 | PermissionsEnum.VIEWBANK
|
181 | ];
|
182 |
|
183 | const PERMISSIONS_BACKOFFICE_USER_MASTER = [
|
184 | PermissionsEnum.VIEWUSERS,
|
185 | PermissionsEnum.VIEWTRANSACTIONS,
|
186 | PermissionsEnum.VOIDANDREFUND,
|
187 | PermissionsEnum.ACCESSUSERMASTER,
|
188 | PermissionsEnum.ADMINCONCILIATION
|
189 | ];
|
190 |
|
191 | const PERMISSIONS_BACKOFFICE_USERMAKER = [
|
192 | PermissionsEnum.VIEWTRANSACTIONS,
|
193 | PermissionsEnum.VOIDANDREFUND,
|
194 | ];
|
195 |
|
196 | const PERMISSIONS_BACKOFFICE_USER_READER = [
|
197 | PermissionsEnum.VIEWTRANSACTIONS
|
198 | ];
|
199 |
|
200 | const PERMISSIONS_WEBCHECKOUT_BASIC = [
|
201 | PermissionsEnum.VIEWSMARTLINKS
|
202 | ];
|
203 |
|
204 | const PERMISSIONS_WEBCHECKOUT_MASTER = [
|
205 | PermissionsEnum.VIEWSMARTLINKS,
|
206 | PermissionsEnum.LISTSMARTLINKS
|
207 | ];
|
208 |
|
209 | const PERMISSIONS_SNR_AGENT = [
|
210 | PermissionsEnum.AGENTSNR
|
211 | ];
|
212 |
|
213 | const PERMISSIONS_SNR_COORDINATOR = [
|
214 | PermissionsEnum.COORDINATORSNR,
|
215 | PermissionsEnum.AGENTSNR
|
216 | ];
|
217 |
|
218 | const PERMISSIONS_MGUAYAQUIL_REVIEWER = [
|
219 | PermissionsEnum.REVIEWERMGUAYAQUIL
|
220 | ];
|
221 |
|
222 | const PERMISSIONS_RESELLER = [];
|
223 |
|
224 | const ROL_BACKOFFICE_ADMIN = {
|
225 | name: 'KSH_ADMIN',
|
226 | cognito_group: 'BackofficeAdmin',
|
227 | permissions: PERMISSIONS_BACKOFFICE_ADMIN,
|
228 | menu: MENU_BACKOFFICE_ADMIN,
|
229 | };
|
230 |
|
231 | const ROLL_BACKOFICCE_USER_MASTER = {
|
232 | name: 'KSH_USER_MASTER',
|
233 | cognito_group: 'BackofficeUserMaster',
|
234 | permissions: PERMISSIONS_BACKOFFICE_USER_MASTER,
|
235 | menu: MENU_BACKOFFICE_USER_MASTER,
|
236 | };
|
237 |
|
238 | const ROL_BACKOFFICE_USER_MAKER = {
|
239 | name: 'KSH_USER_MAKER',
|
240 | cognito_group: 'BackofficeUserMaker',
|
241 | permissions: PERMISSIONS_BACKOFFICE_USERMAKER,
|
242 | menu: MENU_BACKOFFICE_USER_MAKER,
|
243 | };
|
244 |
|
245 | const ROL_BACKOFFICE_USER_READER = {
|
246 | name: 'KSH_USER_READER',
|
247 | cognito_group: 'BackofficeUserReader',
|
248 | permissions: PERMISSIONS_BACKOFFICE_USER_READER,
|
249 | menu: MENU_BACKOFFICE_USER_READER,
|
250 | };
|
251 |
|
252 | const ROL_WEBCHECKOUT_BASIC = {
|
253 | name: 'KSH_WEBCHECKOUT',
|
254 | cognito_group: 'WebcheckoutBasic',
|
255 | permissions: PERMISSIONS_WEBCHECKOUT_BASIC,
|
256 | menu: MENU_WEBCHECKOUT_BASIC,
|
257 | };
|
258 |
|
259 | const ROL_WEBCHECKOUT_MASTER = {
|
260 | name: 'KSH_WEBCHECKOUT_MASTER',
|
261 | cognito_group: 'WebcheckoutMaster',
|
262 | permissions: PERMISSIONS_WEBCHECKOUT_MASTER,
|
263 | menu: MENU_WEBCHECKOUT_MASTER,
|
264 | };
|
265 |
|
266 | const ROL_SNR_AGENT = {
|
267 | name: 'KSH_SNR_AGENT',
|
268 | cognito_group: 'SnrAgent',
|
269 | permissions: PERMISSIONS_SNR_AGENT,
|
270 | menu: MENU_SNR,
|
271 | };
|
272 |
|
273 | const ROL_SNR_COORDINATOR = {
|
274 | name: 'KSH_SNR_COORDINATOR',
|
275 | cognito_group: 'SnrCoordinator',
|
276 | permissions: PERMISSIONS_SNR_COORDINATOR,
|
277 | menu: MENU_SNR,
|
278 | };
|
279 |
|
280 | const ROL_MGUAYAQUIL_REVIEWER = {
|
281 | name: 'KSH_MGUAYAQUIL_REVIEWER',
|
282 | cognito_group: 'MguayaquilReviewer',
|
283 | permissions: PERMISSIONS_MGUAYAQUIL_REVIEWER,
|
284 | menu: MENU_MGUAYAQUIL,
|
285 | };
|
286 |
|
287 | const ROL_BACKOFFICE_BANK = {
|
288 | name: 'KSH_BANK',
|
289 | cognito_group: 'BackofficeBank',
|
290 | permissions: PERMISSIONS_BACKOFFICE_BANK,
|
291 | menu: MENU_BACKOFFICE_BANK,
|
292 | };
|
293 |
|
294 | const SYSTEM_ROLES = [
|
295 | ROL_BACKOFFICE_ADMIN,
|
296 | ROLL_BACKOFICCE_USER_MASTER,
|
297 | ROL_WEBCHECKOUT_BASIC,
|
298 | ROL_WEBCHECKOUT_MASTER,
|
299 | ROL_BACKOFFICE_USER_READER,
|
300 | ROL_BACKOFFICE_USER_MAKER,
|
301 | ROL_BACKOFFICE_BANK,
|
302 | ROL_SNR_AGENT,
|
303 | ROL_SNR_COORDINATOR,
|
304 | ROL_MGUAYAQUIL_REVIEWER
|
305 | ];
|
306 |
|
307 |
|
308 |
|
309 | class RoleService {
|
310 | |
311 |
|
312 |
|
313 | constructor(_http) {
|
314 | this._http = _http;
|
315 | this.kushkiRoles = SYSTEM_ROLES;
|
316 | this._cognitoGroups = '[cognito:groups]';
|
317 | if (this.hasPayload())
|
318 | this.payload = JSON.parse(localStorage.getItem("payload"));
|
319 | }
|
320 | |
321 |
|
322 |
|
323 | hasPayload() {
|
324 | return localStorage.getItem("payload") !== null;
|
325 | }
|
326 | |
327 |
|
328 |
|
329 | getEmail() {
|
330 | return get(this.payload, 'email', '');
|
331 | }
|
332 | /**
|
333 | * @return {?}
|
334 | */
|
335 | getTimeZone() {
|
336 | if (this.hasTimeZone())
|
337 | return localStorage.getItem("time-zone");
|
338 | return "UTC-05 (Bogota, Quito, Lima)";
|
339 | }
|
340 | |
341 |
|
342 |
|
343 | hasTimeZone() {
|
344 | return localStorage.getItem("time-zone") !== null;
|
345 | }
|
346 | |
347 |
|
348 |
|
349 | hasSystemTimeZone() {
|
350 | return this.payload.zoneinfo !== undefined;
|
351 | }
|
352 | |
353 |
|
354 |
|
355 | isJWTExpired() {
|
356 |
|
357 |
|
358 | const moment = momentJS;
|
359 |
|
360 | const now_date = moment();
|
361 |
|
362 | const expire = this._getExpiration();
|
363 | return now_date.isAfter(expire);
|
364 | }
|
365 | |
366 |
|
367 |
|
368 | getUsername() {
|
369 | return get(this.payload, '[cognito:username]', '');
|
370 | }
|
371 | /**
|
372 | * @return {?}
|
373 | */
|
374 | getCompleteUserName() {
|
375 | return get(this.payload, '[name]', '').concat(" ").concat(get(this.payload, '[family_name]', ''));
|
376 | }
|
377 | /**
|
378 | * @return {?}
|
379 | */
|
380 | getJWTLeftTime() {
|
381 |
|
382 |
|
383 | const moment = momentJS;
|
384 |
|
385 | const now_date = moment();
|
386 |
|
387 | const expire = this._getExpiration();
|
388 | return moment.duration(expire.diff(now_date)).asMilliseconds();
|
389 | }
|
390 | |
391 |
|
392 |
|
393 |
|
394 | getMerchant(envName) {
|
395 | return of(1).pipe(mergeMap(( |
396 |
|
397 |
|
398 | () => {
|
399 |
|
400 | const url = envName === 'primary' ? 'https://api.kushkipagos.com' : `https://api-${envName}.kushkipagos.com`;
|
401 |
|
402 | const headers = new HttpHeaders({
|
403 | Authorization: localStorage.getItem('jwt')
|
404 | });
|
405 | return this._http
|
406 | .get(`${url}/merchant/v1/merchant`, { headers }).pipe(map(( |
407 |
|
408 |
|
409 |
|
410 | (rs) => rs)));
|
411 | })));
|
412 | }
|
413 | |
414 |
|
415 |
|
416 | isAdmin() {
|
417 | return get(this.payload, this._cognitoGroups, []).includes("BackofficeAdmin");
|
418 | }
|
419 | /**
|
420 | * @param {?} rol
|
421 | * @return {?}
|
422 | */
|
423 | checkRol(rol) {
|
424 | return get(this.payload, this._cognitoGroups, []).includes(rol);
|
425 | }
|
426 | /**
|
427 | * @return {?}
|
428 | */
|
429 | getRoles() {
|
430 | return get(this.payload, this._cognitoGroups, []);
|
431 | }
|
432 | /**
|
433 | * @return {?}
|
434 | */
|
435 | getMerchantId() {
|
436 | return get(this.payload, 'preferred_username', '');
|
437 | }
|
438 | /**
|
439 | * @return {?}
|
440 | */
|
441 | getMenus() {
|
442 |
|
443 | const roles = this._getRolByArrayofNames(get(this.payload, this._cognitoGroups, []));
|
444 | return get(roles, 'menu', []);
|
445 | }
|
446 | /**
|
447 | * @param {?} country
|
448 | * @return {?}
|
449 | */
|
450 | setTimeZone(country) {
|
451 | if (!this.hasTimeZone())
|
452 | this.setSystemTimeZone(country);
|
453 | }
|
454 | |
455 |
|
456 |
|
457 |
|
458 | setSystemTimeZone(country) {
|
459 | if (!this.hasSystemTimeZone())
|
460 | localStorage.setItem("time-zone", RoleService._getZoneCountry(country));
|
461 | else
|
462 | localStorage.setItem("time-zone", get(this.payload, "zoneinfo", RoleService._getZoneCountry(country)));
|
463 | }
|
464 | /**
|
465 | * @private
|
466 | * @param {?} rolName
|
467 | * @return {?}
|
468 | */
|
469 | _getRolByArrayofNames(rolName) {
|
470 |
|
471 | const rols = {
|
472 | name: null,
|
473 | menu: [],
|
474 | permissions: [],
|
475 | rols: null,
|
476 | };
|
477 | each(rolName, ( |
478 |
|
479 |
|
480 |
|
481 | (rol) => {
|
482 |
|
483 | const rol_selected = this._getRolByName(rol);
|
484 | if (rol_selected === undefined)
|
485 | return;
|
486 | rols.permissions = union(rol_selected.permissions, rols.permissions);
|
487 | rols.menu = this._mergeMenuItems(rol_selected.menu, rols.menu);
|
488 | rols.rols = Object.assign({}, rols.rols, { [rol_selected.name]: rol_selected.permissions });
|
489 | }));
|
490 | return rols;
|
491 | }
|
492 | |
493 |
|
494 |
|
495 |
|
496 | _getExpiration() {
|
497 |
|
498 | const moment = momentJS;
|
499 |
|
500 | const expiration_field = "exp";
|
501 | return moment(Number(JSON.parse(localStorage.getItem("payload"))[expiration_field]) * 1000);
|
502 | }
|
503 | |
504 |
|
505 |
|
506 |
|
507 |
|
508 | _getRolByName(query) {
|
509 | return find(this.kushkiRoles, ( |
510 |
|
511 |
|
512 |
|
513 | (rol) => rol.cognito_group === query));
|
514 | }
|
515 | |
516 |
|
517 |
|
518 |
|
519 |
|
520 |
|
521 | _mergeMenuItems(first, second) {
|
522 |
|
523 | const menus = first;
|
524 |
|
525 | let selected_menu = null;
|
526 | each(second, ( |
527 |
|
528 |
|
529 |
|
530 | (menu) => {
|
531 | selected_menu = find(menus, { title: menu.title });
|
532 | if (selected_menu === undefined)
|
533 | menus.push(menu);
|
534 | }));
|
535 | return menus;
|
536 | }
|
537 | |
538 |
|
539 |
|
540 |
|
541 |
|
542 | static _getZoneCountry(country) {
|
543 | switch (country) {
|
544 | case "Brazil":
|
545 | return "UTC-03 (SaoPaulo)";
|
546 | case "Chile":
|
547 | return "UTC-04 (Santiago)";
|
548 | case "Mexico":
|
549 | return "UTC-06 (Ciudad de México)";
|
550 | default:
|
551 | return "UTC-05 (Bogota, Quito, Lima)";
|
552 | }
|
553 | }
|
554 | }
|
555 | RoleService.decorators = [
|
556 | { type: Injectable, args: [{ providedIn: 'root' },] }
|
557 | ];
|
558 |
|
559 | RoleService.ctorParameters = () => [
|
560 | { type: HttpClient }
|
561 | ];
|
562 | RoleService.ngInjectableDef = ɵɵdefineInjectable({ factory: function RoleService_Factory() { return new RoleService(ɵɵinject(HttpClient)); }, token: RoleService, providedIn: "root" });
|
563 |
|
564 |
|
565 |
|
566 |
|
567 |
|
568 |
|
569 |
|
570 |
|
571 | class NavComponent {
|
572 | |
573 |
|
574 |
|
575 | constructor(_roleService) {
|
576 | this._roleService = _roleService;
|
577 | this.testEnvironments = ['ci', 'qa', 'uat'];
|
578 | this.menus = [];
|
579 | this.merchantName = '';
|
580 | this.isAdmin = false;
|
581 | this.merchantId = '';
|
582 | }
|
583 | |
584 |
|
585 |
|
586 | ngOnInit() {
|
587 | this.initializeValues();
|
588 | if (!this._roleService.hasPayload() || this._roleService.isJWTExpired())
|
589 | this.logout();
|
590 |
|
591 | const time_left = this._roleService.getJWTLeftTime();
|
592 | this.subscription = of(1).pipe(delay(time_left)).subscribe(( |
593 |
|
594 |
|
595 | () => this.logout()));
|
596 | }
|
597 | |
598 |
|
599 |
|
600 | initializeValues() {
|
601 | this.name = this._roleService.getCompleteUserName();
|
602 | this.testMode = includes(this.testEnvironments, this.environment);
|
603 | this.menus = this._roleService.getMenus();
|
604 | this.isAdmin = this._roleService.isAdmin();
|
605 | this.merchantName = this.isAdmin ? "Admin" : "";
|
606 | if (!this.isAdmin) {
|
607 | this.merchantId = this._roleService.getMerchantId();
|
608 | this._roleService.getMerchant(this.environment).subscribe(( |
609 |
|
610 |
|
611 |
|
612 | (merchant) => {
|
613 | this.merchantName = merchant.name;
|
614 | this._roleService.setTimeZone(merchant.country);
|
615 | }));
|
616 | }
|
617 | else
|
618 | this._roleService.setTimeZone("Ecuador");
|
619 | this.loadZendeskWidget();
|
620 | }
|
621 | |
622 |
|
623 |
|
624 | ngOnDestroy() {
|
625 | this.removeWidget();
|
626 | if (this.subscription !== undefined)
|
627 | this.subscription.unsubscribe();
|
628 | }
|
629 | |
630 |
|
631 |
|
632 | logout() {
|
633 | localStorage.clear();
|
634 | window.location.href = "/auth";
|
635 | }
|
636 | |
637 |
|
638 |
|
639 | profile() {
|
640 | window.location.href = "/users/profile";
|
641 | }
|
642 | |
643 |
|
644 |
|
645 | removeWidget() {
|
646 |
|
647 | const body = ( (document.body));
|
648 |
|
649 | const widget = document.getElementById('ze-snippet');
|
650 | if (widget !== null)
|
651 | body.removeChild(widget);
|
652 | }
|
653 | |
654 |
|
655 |
|
656 | loadZendeskWidget() {
|
657 |
|
658 | const body = ( (document.body));
|
659 |
|
660 | const script = document.createElement('script');
|
661 | script.id = 'ze-snippet';
|
662 | script.src = 'https://static.zdassets.com/ekr/snippet.js?key=e56c3e14-8e11-434f-a50e-f2a91186d6c7';
|
663 | script.async = false;
|
664 | script.defer = true;
|
665 | body.appendChild(script);
|
666 | }
|
667 | }
|
668 | NavComponent.decorators = [
|
669 | { type: Component, args: [{
|
670 | selector: 'backoffice-nav',
|
671 | template: "<suka-frame>\n <suka-topbar\n [logoSrc]=\"'https://kushki-static.s3.amazonaws.com/spa-backoffice/logo_ksh.png'\"\n >\n <suka-topbar-navigation>\n <suka-topbar-item> {{ merchantName }} </suka-topbar-item>\n <suka-topbar-item *ngIf=\"testMode\"> <suka-badge type=\"attention\"> Modo Prueba </suka-badge> </suka-topbar-item>\n </suka-topbar-navigation>\n <suka-topbar-global>\n <suka-topbar-menu>\n <suka-avatar\n [name]=\"name\"\n size=\"md\"\n color=\"cyan\"\n ></suka-avatar> {{ name }}\n <suka-topbar-item (click)=\"profile()\" icon=\"user\">Mi Perfil</suka-topbar-item>\n <suka-topbar-item (click)=\"logout()\" icon=\"log-out\">Log Out</suka-topbar-item>\n </suka-topbar-menu>\n </suka-topbar-global>\n </suka-topbar>\n\n <suka-navigation>\n <suka-navigation-item\n *ngFor=\"let menu of menus\"\n [href]=\"(menu.link === '/merchants' && !isAdmin) ? (menu.link + '/profile/' + merchantId) : menu.link\"\n [active]=\"menu.link === activeRoute\"\n >\n <suka-icon [icon]=\"menu.icon\"></suka-icon>\n {{ (menu.title === 'Comercios' && !isAdmin) ? \"Perfil\" : menu.title }}\n </suka-navigation-item>\n </suka-navigation>\n\n <suka-page\n [breadcrumb]=\"false\"\n >\n <ng-content></ng-content>\n </suka-page>\n</suka-frame>\n<script id=\"ze-snippet\" src=\"https://static.zdassets.com/ekr/snippet.js?key=e56c3e14-8e11-434f-a50e-f2a91186d6c7\"> </script>\n",
|
672 | styles: [""]
|
673 | }] }
|
674 | ];
|
675 |
|
676 | NavComponent.ctorParameters = () => [
|
677 | { type: RoleService }
|
678 | ];
|
679 | NavComponent.propDecorators = {
|
680 | environment: [{ type: Input }],
|
681 | activeRoute: [{ type: Input }]
|
682 | };
|
683 |
|
684 |
|
685 |
|
686 |
|
687 |
|
688 | class BackofficeNavigationModule {
|
689 | }
|
690 | BackofficeNavigationModule.decorators = [
|
691 | { type: NgModule, args: [{
|
692 | declarations: [NavComponent],
|
693 | imports: [
|
694 | StackModule,
|
695 | SearchModule,
|
696 | IconModule,
|
697 | FrameModule,
|
698 | TopbarModule,
|
699 | NavigationModule,
|
700 | ButtonModule,
|
701 | PageModule,
|
702 | BadgeModule,
|
703 | AvatarModule,
|
704 | CommonModule,
|
705 | HttpClientModule
|
706 | ],
|
707 | exports: [NavComponent]
|
708 | },] }
|
709 | ];
|
710 |
|
711 | export { BackofficeNavigationModule, MENU_BACKOFFICE_ADMIN, MENU_BACKOFFICE_BANK, MENU_BACKOFFICE_RESELLER, MENU_BACKOFFICE_USER_MAKER, MENU_BACKOFFICE_USER_MASTER, MENU_BACKOFFICE_USER_READER, MENU_MGUAYAQUIL, MENU_SNR, MENU_WEBCHECKOUT_BASIC, MENU_WEBCHECKOUT_MASTER, NavComponent, PERMISSIONS_BACKOFFICE_ADMIN, PERMISSIONS_BACKOFFICE_BANK, PERMISSIONS_BACKOFFICE_USERMAKER, PERMISSIONS_BACKOFFICE_USER_MASTER, PERMISSIONS_BACKOFFICE_USER_READER, PERMISSIONS_MGUAYAQUIL_REVIEWER, PERMISSIONS_RESELLER, PERMISSIONS_SNR_AGENT, PERMISSIONS_SNR_COORDINATOR, PERMISSIONS_WEBCHECKOUT_BASIC, PERMISSIONS_WEBCHECKOUT_MASTER, PermissionsEnum, ROLL_BACKOFICCE_USER_MASTER, ROL_BACKOFFICE_ADMIN, ROL_BACKOFFICE_BANK, ROL_BACKOFFICE_USER_MAKER, ROL_BACKOFFICE_USER_READER, ROL_MGUAYAQUIL_REVIEWER, ROL_SNR_AGENT, ROL_SNR_COORDINATOR, ROL_WEBCHECKOUT_BASIC, ROL_WEBCHECKOUT_MASTER, RoleService, SYSTEM_ROLES };
|
712 |
|