ngx-vector-components 6.58.0 → 6.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/assets/styles/_primeng-custom-theme.scss +11 -7
- package/fesm2022/ngx-vector-components.mjs +114 -16
- package/fesm2022/ngx-vector-components.mjs.map +1 -1
- package/lib/components/top-bar/top-bar.component.d.ts +2 -0
- package/lib/guards/crud-list-has-items.guard.d.ts +7 -0
- package/lib/guards/has-permission.guard.d.ts +7 -1
- package/lib/guards/token-is-present.guard.d.ts +12 -1
- package/lib/services/profile.service.d.ts +16 -0
- package/lib/services/storage.service.d.ts +17 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [6.59.0] (26/11/2026)
|
|
4
|
+
|
|
5
|
+
### Fix
|
|
6
|
+
|
|
7
|
+
- Corrects duplicating a tab, reloading the page or opening a screen from its URL left the top bar and the menu on screen but no content. Three guards were reading state that only exists in memory:
|
|
8
|
+
- `ProfileService.ensureProfileLoaded()`: fetches the profile when it is missing, and resolves synchronously when it is already loaded, so navigation gains no latency. It was only loaded through `getTokenByGuid`, so a start without a token in the URL never fetched permissions again (`profile.service.ts`)
|
|
9
|
+
- `hasPermissionGuard`: waits for the profile before deciding. A missing profile is not a denied permission (`has-permission.guard.ts`)
|
|
10
|
+
- `crudListHasItemsGuard`: a route carrying a URL parameter goes through, since the screen loads from that id and does not depend on `dataset$`, which starts empty on every load (`crud-list-has-items.guard.ts`)
|
|
11
|
+
- `StorageService`: `refreshToken` and `username` moved from sessionStorage to localStorage, next to the token they renew. Firefox and Safari do not copy the session when a tab is duplicated, so the new tab had no way to renew the token and the first 401 logged the user out. Values left in the old place are migrated on read (`storage.service.ts`)
|
|
12
|
+
|
|
13
|
+
## [6.58.1] (26/11/2026)
|
|
14
|
+
|
|
15
|
+
### Fix
|
|
16
|
+
|
|
17
|
+
- Corrects the positioning and alignment error of the Popover component and removes the arrows inserted via the berofe of the Tooltips and Popovers in `TopBarComponent` (`top-bar.component.ts`) and Prime Custom Theme file (`_primeng-custom-theme.scss`).
|
|
18
|
+
|
|
3
19
|
## [6.58.0] (25/11/2026)
|
|
4
20
|
|
|
5
21
|
### Feat
|
|
@@ -823,17 +823,21 @@ p-radiobutton.ng-touched.ng-invalid .p-radiobutton-box {
|
|
|
823
823
|
}
|
|
824
824
|
}
|
|
825
825
|
|
|
826
|
-
.p-
|
|
827
|
-
|
|
826
|
+
.p-popover::before,
|
|
827
|
+
.p-popover::after {
|
|
828
|
+
display: none !important;
|
|
828
829
|
}
|
|
829
830
|
|
|
830
|
-
.p-
|
|
831
|
-
|
|
831
|
+
.p-popover {
|
|
832
|
+
border-radius: 12px !important;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
.p-tooltip-arrow {
|
|
836
|
+
display: none !important;
|
|
832
837
|
}
|
|
833
838
|
|
|
834
|
-
.p-
|
|
835
|
-
|
|
836
|
-
border-bottom-color: #01529b !important;
|
|
839
|
+
.p-tooltip .p-tooltip-text {
|
|
840
|
+
border-radius: 8px !important;
|
|
837
841
|
}
|
|
838
842
|
|
|
839
843
|
.p-dialog:not(.p-confirm-dialog) {
|
|
@@ -63,7 +63,7 @@ import { Tabs, TabsModule as TabsModule$1 } from 'primeng/tabs';
|
|
|
63
63
|
import { DateTime } from 'luxon';
|
|
64
64
|
import * as i1$5 from '@angular/common/http';
|
|
65
65
|
import { HttpHeaders, HttpClient, HttpResponse } from '@angular/common/http';
|
|
66
|
-
import { switchMap, map, tap,
|
|
66
|
+
import { switchMap, map, tap, catchError, shareReplay, debounceTime, finalize, filter, take } from 'rxjs/operators';
|
|
67
67
|
import * as i1$7 from '@angular/platform-browser';
|
|
68
68
|
import * as i1$8 from 'primeng/drawer';
|
|
69
69
|
import { DrawerModule as DrawerModule$1 } from 'primeng/drawer';
|
|
@@ -2408,23 +2408,52 @@ class StorageService {
|
|
|
2408
2408
|
removeToken() {
|
|
2409
2409
|
localStorage.removeItem('token');
|
|
2410
2410
|
}
|
|
2411
|
+
/**
|
|
2412
|
+
* No localStorage, ao lado do {@link getToken}: os dois formam o par de
|
|
2413
|
+
* renovacao e precisam sobreviver juntos. No sessionStorage, uma aba
|
|
2414
|
+
* duplicada no Firefox ou no Safari — que nao copiam a sessao — subia com o
|
|
2415
|
+
* token de acesso mas sem como renova-lo, e o primeiro 401 caia no logout.
|
|
2416
|
+
*
|
|
2417
|
+
* O {@link getUsername} acompanha porque `getTokenByRefreshToken` o envia no
|
|
2418
|
+
* corpo da renovacao.
|
|
2419
|
+
*/
|
|
2411
2420
|
getRefreshToken() {
|
|
2412
|
-
return
|
|
2421
|
+
return this.readMigratingFromSession('refreshToken');
|
|
2413
2422
|
}
|
|
2414
2423
|
setRefreshToken(refreshToken) {
|
|
2415
|
-
|
|
2424
|
+
localStorage.setItem('refreshToken', refreshToken);
|
|
2416
2425
|
}
|
|
2417
2426
|
removeRefreshToken() {
|
|
2418
|
-
|
|
2427
|
+
localStorage.removeItem('refreshToken');
|
|
2419
2428
|
}
|
|
2420
2429
|
getUsername() {
|
|
2421
|
-
return
|
|
2430
|
+
return this.readMigratingFromSession('username');
|
|
2422
2431
|
}
|
|
2423
2432
|
setUsername(username) {
|
|
2424
|
-
|
|
2433
|
+
localStorage.setItem('username', username);
|
|
2425
2434
|
}
|
|
2426
2435
|
removeUsername() {
|
|
2427
|
-
|
|
2436
|
+
localStorage.removeItem('username');
|
|
2437
|
+
}
|
|
2438
|
+
/**
|
|
2439
|
+
* Le do localStorage e, se a chave ainda estiver no sessionStorage de uma
|
|
2440
|
+
* sessao anterior a mudanca de lugar, move antes de devolver — sem isso, todo
|
|
2441
|
+
* usuario logado no deploy cairia na primeira renovacao de token.
|
|
2442
|
+
*
|
|
2443
|
+
* Pode sair quando nao houver mais sessoes dessa epoca em circulacao.
|
|
2444
|
+
*/
|
|
2445
|
+
readMigratingFromSession(key) {
|
|
2446
|
+
const stored = localStorage.getItem(key);
|
|
2447
|
+
if (stored) {
|
|
2448
|
+
return stored;
|
|
2449
|
+
}
|
|
2450
|
+
const legacy = sessionStorage.getItem(key);
|
|
2451
|
+
if (!legacy) {
|
|
2452
|
+
return '';
|
|
2453
|
+
}
|
|
2454
|
+
localStorage.setItem(key, legacy);
|
|
2455
|
+
sessionStorage.removeItem(key);
|
|
2456
|
+
return legacy;
|
|
2428
2457
|
}
|
|
2429
2458
|
getUserId() {
|
|
2430
2459
|
const userId = sessionStorage.getItem('userId');
|
|
@@ -2920,6 +2949,32 @@ class ProfileService {
|
|
|
2920
2949
|
this.moduleProfile$.next(allModules);
|
|
2921
2950
|
}));
|
|
2922
2951
|
}
|
|
2952
|
+
/**
|
|
2953
|
+
* Garante o perfil disponível antes de alguém decidir com base nele.
|
|
2954
|
+
*
|
|
2955
|
+
* Com ele em mãos devolve de forma síncrona, sem requisição — o caminho da
|
|
2956
|
+
* maioria das navegações. Sem ele, busca uma vez: o `getTokenByGuid` era o
|
|
2957
|
+
* único lugar que carregava o perfil, então uma aplicação que subia sem token
|
|
2958
|
+
* na URL não tinha como buscá-lo de novo.
|
|
2959
|
+
*
|
|
2960
|
+
* O `shareReplay` faz navegações simultâneas dividirem a mesma requisição.
|
|
2961
|
+
* Erro devolve indefinido, e quem chamou decide negando; o cache é descartado
|
|
2962
|
+
* nesse caso, senão uma falha passageira ficaria gravada e nenhuma navegação
|
|
2963
|
+
* seguinte tentaria de novo.
|
|
2964
|
+
*/
|
|
2965
|
+
ensureProfileLoaded() {
|
|
2966
|
+
if (this.moduleProfile$.value) {
|
|
2967
|
+
return of(this.moduleProfile$.value);
|
|
2968
|
+
}
|
|
2969
|
+
if (!this.storageService.getToken()) {
|
|
2970
|
+
return of(undefined);
|
|
2971
|
+
}
|
|
2972
|
+
this.profileRequest$ ??= this.getUserProfile().pipe(map(() => this.moduleProfile$.value), catchError(() => {
|
|
2973
|
+
this.profileRequest$ = undefined;
|
|
2974
|
+
return of(undefined);
|
|
2975
|
+
}), shareReplay(1));
|
|
2976
|
+
return this.profileRequest$;
|
|
2977
|
+
}
|
|
2923
2978
|
userHasPermission(action) {
|
|
2924
2979
|
if (!action) {
|
|
2925
2980
|
return true;
|
|
@@ -7468,6 +7523,19 @@ class TopBarComponent {
|
|
|
7468
7523
|
toggleMenu() {
|
|
7469
7524
|
this.menuService.toggleMenu$.next();
|
|
7470
7525
|
}
|
|
7526
|
+
alignPopoverToTriggerEdge(popover) {
|
|
7527
|
+
const container = popover.container;
|
|
7528
|
+
const target = popover.target;
|
|
7529
|
+
if (!container || !target?.getBoundingClientRect) {
|
|
7530
|
+
return;
|
|
7531
|
+
}
|
|
7532
|
+
const targetRect = target.getBoundingClientRect();
|
|
7533
|
+
const isOnRightHalf = targetRect.left + targetRect.width / 2 > window.innerWidth / 2;
|
|
7534
|
+
const left = isOnRightHalf
|
|
7535
|
+
? targetRect.right + window.scrollX - container.offsetWidth
|
|
7536
|
+
: targetRect.left + window.scrollX;
|
|
7537
|
+
container.style.left = `${Math.max(0, left)}px`;
|
|
7538
|
+
}
|
|
7471
7539
|
logout() {
|
|
7472
7540
|
this.authService.logout();
|
|
7473
7541
|
}
|
|
@@ -7517,11 +7585,11 @@ class TopBarComponent {
|
|
|
7517
7585
|
this.onClick.emit(notification?.link || '');
|
|
7518
7586
|
}
|
|
7519
7587
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TopBarComponent, deps: [{ token: MenuService }, { token: AuthService }, { token: i1$2.Router }, { token: ProfileService }, { token: StorageService }, { token: NotificationsService }, { token: ErrorMessageService }, { token: APP_NAME }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7520
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: TopBarComponent, isStandalone: false, selector: "vector-top-bar", inputs: { fintech: "fintech", accountService: "accountService", showHelpCentral: "showHelpCentral", showProfile: "showProfile" }, outputs: { onClick: "onClick" }, ngImport: i0, template: "<div class=\"top-bar-container\">\n <div id=\"menu-toggle\" class=\"menu-toggle\" (click)=\"toggleMenu()\">\n <div class=\"menu-icon\"></div>\n </div>\n\n @if (showsAccountData && !doingOnboarding && !isAdmin) {\n <div class=\"left-items-container\">\n <span>Banco {{ currentAccount()?.bankCode }}</span>\n <span class=\"separator\"></span>\n <span>AG {{ currentAccount()?.agency }}</span>\n <span class=\"separator\"></span>\n <span>CC {{ currentAccount()?.accountNumber }}</span>\n <span class=\"separator\"></span>\n <span\n >{{ currentAccount()?.accountType === 'CURRENT_ACCOUNT_PF' ? 'CPF' : 'CNPJ' }}\n {{ maskUtil.formatDocument(currentAccount()?.document) }}</span\n >\n <span class=\"separator\"></span>\n <div class=\"change-account-button cursor-pointer\" (click)=\"changeAccountMenu.toggle($event)\">\n <span class=\"mr-2\">Alternar conta</span>\n <span\n class=\"fas\"\n [ngClass]=\"{ 'fa-angle-down': !openedChangeAccountMenu, 'fa-angle-up': openedChangeAccountMenu }\"\n ></span>\n </div>\n </div>\n }\n\n @if (!isAdmin && !doingOnboarding) {\n <div class=\"right-items-container\" [ngClass]=\"{ 'hidden-items': hideElements }\">\n @if (showHelpCentral) {\n <div class=\"help-central\">\n <span>{{ 'app.label.help_central' | translate }}:</span>\n @for (item of helpCentralIcons; track item) {\n <a target=\"_blank\" [ngClass]=\"{ hidden: !item.active }\" [attr.href]=\"item.url\">\n <i [class]=\"item.icon\"></i>\n </a>\n }\n </div>\n }\n\n @if (!fintech) {\n <span (click)=\"notifications.toggle($event)\" class=\"fas fa-bell notifications-icon\">\n @if ((notificationsList | unreadNotifications).length) {\n <span class=\"notifications-indicator\"> </span>\n }\n </span>\n }\n\n <span class=\"separator\"></span>\n <div\n #menuContainer\n class=\"menu-container\"\n (click)=\"menu.toggle($event)\"\n pTooltip=\"Enter your username\"\n tooltipPosition=\"bottom\"\n tooltipEvent=\"click\"\n >\n <span class=\"user-name\">{{ currentAccount()?.name || vectorFirstName() || '' }}</span>\n <span class=\"fas\" [ngClass]=\"{ 'fa-angle-down': !openedMenu, 'fa-angle-up': openedMenu }\"></span>\n </div>\n </div>\n }\n</div>\n\n<p-popover #menu (onHide)=\"openedMenu = false\" (onShow)=\"openedMenu = true\" styleClass=\"background-white\">\n <ng-template #content>\n @if (showsAccountData) {\n <div class=\"account-info\">\n <div class=\"account-info-row\">\n <div class=\"account-info-item\">\n <span>Banco: </span>\n <span class=\"account-info-value\">{{ currentAccount()?.bank }}</span>\n </div>\n\n <span class=\"separator\"></span>\n <div class=\"account-info-item\">\n <span>AG: </span>\n <span class=\"account-info-value\">{{ currentAccount()?.agency }}</span>\n </div>\n </div>\n <div class=\"account-info-row\">\n <div class=\"account-info-item\">\n <span>CC: </span>\n <span class=\"account-info-value\">{{ currentAccount()?.accountNumber }}</span>\n </div>\n <span class=\"separator\"></span>\n <div class=\"account-info-item\">\n <span>{{ currentAccount()?.accountType === 'CURRENT_ACCOUNT_PF' ? 'CPF' : 'CNPJ' }}: </span>\n <span class=\"account-info-value\"> {{ maskUtil.formatDocument(currentAccount()?.document) }}</span>\n </div>\n </div>\n @if (otherAccounts?.length) {\n <div class=\"change-account-mobile\" (click)=\"changeAccountMenu.toggle($event)\">\n <span class=\"change-account-mobile-label\">Alternar conta</span>\n <span\n class=\"fas\"\n [ngClass]=\"{ 'fa-angle-down': !openedChangeAccountMenu, 'fa-angle-up': openedChangeAccountMenu }\"\n ></span>\n </div>\n }\n </div>\n }\n <ul class=\"user-menu\">\n @if (fintech) {\n <li (click)=\"goToTermsOfUse(); menu.hide()\">\n <span class=\"user-menu-icon\"><i class=\"fas fa-file-contract\"></i></span>\n <span>Termos de Uso</span>\n </li>\n }\n @if (fintech) {\n <li (click)=\"goToPasswordChange(); menu.hide()\">\n <span class=\"user-menu-icon\"><i class=\"fas fa-key\"></i></span>\n <span>Alterar Senha</span>\n </li>\n }\n @if (showProfile) {\n <li (click)=\"goToProfile(); menu.hide()\">\n <span class=\"user-menu-icon\"><i class=\"ph-bold ph-user\"></i></span>\n <span>Perfil</span>\n </li>\n }\n @if (isLogtech) {\n <li (click)=\"termsOfUse(); menu.hide()\">\n <span class=\"user-menu-icon\"><i class=\"ph-bold ph-file-text\"></i></span>\n <span>Termos de uso</span>\n </li>\n }\n <li class=\"menu-separator\"></li>\n <li (click)=\"logout()\">\n <span class=\"user-menu-icon\"><i class=\"ph-bold ph-sign-out\"></i></span>\n <span>Sair</span>\n </li>\n </ul>\n </ng-template>\n</p-popover>\n\n<p-popover #changeAccountMenu (onHide)=\"openedChangeAccountMenu = false\" (onShow)=\"openedChangeAccountMenu = true\">\n <ng-template #content>\n @for (account of otherAccounts; track account) {\n <div class=\"account-info change-account-info\" (click)=\"changeAccount(account)\">\n <div class=\"account-info-row\">\n <div class=\"account-info-item\">\n <span>Banco: </span>\n <span class=\"account-info-value\">{{ account?.bank }}</span>\n </div>\n\n <span class=\"separator\"></span>\n <div class=\"account-info-item\">\n <span>AG: </span>\n <span class=\"account-info-value\">{{ account?.agency }}</span>\n </div>\n </div>\n <div class=\"account-info-row\">\n <div class=\"account-info-item\">\n <span>CC: </span>\n <span class=\"account-info-value\">{{ account?.accountNumber }}</span>\n </div>\n <span class=\"separator\"></span>\n <div class=\"account-info-item\">\n <span>{{ account?.accountType === 'CURRENT_ACCOUNT_PF' ? 'CPF' : 'CNPJ' }}: </span>\n <span class=\"account-info-value\"> {{ account?.document | formatDocument }}</span>\n </div>\n </div>\n </div>\n }\n <div>\n <hr />\n <p class=\"text-center add-account\" (click)=\"goToOnboarding(); changeAccountMenu.hide()\">\n Adicionar uma nova conta\n </p>\n </div>\n </ng-template>\n</p-popover>\n\n<p-popover\n #notifications\n (onHide)=\"showNotifications = false\"\n (onShow)=\"showNotifications = true\"\n styleClass=\"background-white\"\n>\n <ng-template #content>\n <div class=\"notifications-header\">\n <div class=\"notifications-vector-logo\"></div>\n <span class=\"notifications-title\">\n {{ 'app.label.notifications' | translate }}\n </span>\n </div>\n <ul class=\"notifications-list\">\n @for (notification of notificationsList; track $index) {\n <li (click)=\"handleClick(notification); notifications.hide()\" class=\"notification-item\">\n <span class=\"notification-title\">\n {{ notification.title }}\n @if (!notification.wasRead) {\n <span class=\"notification-item-indicator\"></span>\n }\n </span>\n @if (notification.description) {\n <span>{{ notification.description }}</span>\n <em class=\"fas fa-chevron-right\"></em>\n }\n </li>\n }\n </ul>\n </ng-template>\n</p-popover>\n", styles: [".fas{color:#fff}.top-bar-container{height:81px;background-color:var(--theme-light);display:flex;flex:1;align-items:center;padding:15px;color:#fff;font-size:1em;font-weight:600;box-shadow:2px 2px 4px #00000029}.top-bar-container .menu-toggle{cursor:pointer;margin-right:10px;padding:8px}.top-bar-container .menu-toggle .menu-icon{background:url('data:image/svg+xml,<svg width=\"21\" height=\"14\" viewBox=\"0 0 21 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">%0A<path d=\"M0 13.846H15V11.538H0V13.846ZM0 8.077H11.538V5.769H0V8.077ZM0 0V2.308H15V0H0ZM20.769 11.065L16.638 6.923L20.769 2.781L19.142 1.154L13.373 6.923L19.142 12.692L20.769 11.065Z\" fill=\"white\"/>%0A</svg>%0A');background-repeat:no-repeat;background-size:cover;width:20.77px;height:13.85px}.top-bar-container .menu-toggle span{font-size:1.3em}.top-bar-container .left-items-container{display:flex;align-items:center;flex-direction:row}.top-bar-container .right-items-container{flex:1;display:flex;flex-direction:row;justify-content:flex-end;align-items:center}.top-bar-container .right-items-container .help-central{display:flex;align-items:center;gap:20px;font-size:1rem;margin-right:35px}.top-bar-container .right-items-container .help-central em{font-size:1.3rem}.top-bar-container .right-items-container .help-central a{outline:none;border:none;text-decoration:none;color:transparent}.top-bar-container .right-items-container .help-central a i{color:#fff;font-size:1.1em}.top-bar-container .right-items-container .help-central a i:hover{color:#7de5ec}@media screen and (max-width:441px){.top-bar-container .right-items-container .help-central span{display:none}.top-bar-container .right-items-container .help-central em{font-size:1rem}}.top-bar-container .right-items-container .menu-container{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;cursor:pointer}.top-bar-container .right-items-container .menu-container .user-name{margin-right:15px}.top-bar-container .right-items-container .notifications-icon{position:relative;cursor:pointer}.top-bar-container .right-items-container .notifications-indicator{position:absolute;right:-8px;top:-8px;width:12px;height:12px;border-radius:50%;background-color:var(--error-color)}.separator{height:100%;margin-left:15px;margin-right:15px}.separator:after{content:\"\";height:100%;border-right:2px solid #ffffff}.account-info{display:flex;flex-direction:column;background-color:var(--theme-primary);border-radius:var(--border-radius);color:#fff;padding:5px;width:300px}.account-info .account-info-row{display:flex;flex-direction:row;align-items:center}.account-info .account-info-row .account-info-item{flex:1}.account-info .account-info-row .account-info-item:first-child{flex:.6}.account-info .account-info-row .account-info-item .account-info-value{font-weight:200}.account-info .change-account-mobile{font-size:.8em;align-items:center;display:flex}.account-info .change-account-mobile .change-account-mobile-label{margin-right:5px}.change-account-info{background-color:unset;cursor:pointer}.change-account-info:hover{background-color:var(--theme-primary)}.user-menu{padding:0;margin:0;list-style:none;color:var(--theme-medium)}.user-menu li{display:flex;flex-direction:row;align-items:center;gap:10px;padding:8px 16px;font-weight:600;text-transform:uppercase;cursor:pointer;border-radius:5px;transition:background-color .15s ease,color .15s ease}.user-menu li:hover,.user-menu li:focus{background-color:var(--theme-medium);color:#fff;outline:none}.user-menu li:hover .user-menu-icon i,.user-menu li:focus .user-menu-icon i{color:#fff}.user-menu li.menu-separator{margin:5px auto;padding:0;border-top:1px solid #eeeeee;height:2px}.user-menu li.menu-separator:hover{cursor:default;background:none!important;outline:none}.user-menu li .user-menu-icon{display:flex;align-items:center;justify-content:center;width:20px;height:20px}.user-menu li .user-menu-icon i{color:var(--theme-medium);font-size:1.1em;transition:color .15s ease}.add-account{color:#fff;font-size:1.1em;padding:10px;margin:0;font-weight:400;letter-spacing:.25px;cursor:pointer}@media screen and (max-width:441px){.hidden-items{display:none!important}}.notifications-header{display:flex;align-items:center;gap:8px}.notifications-header .notifications-vector-logo{background-image:url(/assets/images/vector_logo_horizontal.svg);background-repeat:no-repeat;background-position:right;background-size:cover;height:12px;width:30px}.notifications-header .notifications-title{text-transform:uppercase;color:var(--gray-dark);font-weight:600}::ng-deep .p-overlaypanel.background-white{border-radius:8px!important;background-color:#fff!important;border:1px solid #d9dbe9!important;box-shadow:0 1px 2px #1f29371a,0 2px 4px #1f29371a,0 4px 8px #1f29371a,0 8px 16px #1f29371a!important;padding:3px!important}::ng-deep .p-overlaypanel.background-white:before,::ng-deep .p-overlaypanel.background-white:after{display:none!important}::ng-deep .p-overlaypanel.background-white .p-overlaypanel-content{padding:8px 0!important}.notifications-list{max-height:400px;overflow:auto;margin-top:10px}.notifications-list .notification-item{cursor:pointer;position:relative;padding:5px 10px;border-radius:5px;text-align:center;transition:background-color .15s ease,color .15s ease}.notifications-list .notification-item:hover,.notifications-list .notification-item:focus{background-color:var(--theme-medium)!important;color:#fff;outline:none}.notifications-list .notification-item:hover .notification-title,.notifications-list .notification-item:focus .notification-title{color:#fff}.notifications-list .notification-item:hover em,.notifications-list .notification-item:focus em{color:#fff}.notifications-list .notification-item .notification-title{font-weight:600;text-transform:uppercase;position:relative;display:inline-block;color:var(--theme-medium)}.notifications-list .notification-item .notification-title .notification-item-indicator{position:absolute;top:-4px;right:-12px;width:8px;height:8px;border-radius:50%;background-color:var(--error-color);margin:0}.notifications-list .notification-item span{font-weight:500;margin-right:20px}.notifications-list .notification-item em{position:absolute;right:10px;bottom:10px;color:var(--theme-primary)}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: i6.Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }, { kind: "pipe", type: FormatDocumentPipe, name: "formatDocument" }, { kind: "pipe", type: UnreadNotificationsPipe, name: "unreadNotifications" }, { kind: "pipe", type: i1$3.TranslatePipe, name: "translate" }] }); }
|
|
7588
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: TopBarComponent, isStandalone: false, selector: "vector-top-bar", inputs: { fintech: "fintech", accountService: "accountService", showHelpCentral: "showHelpCentral", showProfile: "showProfile" }, outputs: { onClick: "onClick" }, ngImport: i0, template: "<div class=\"top-bar-container\">\n <div id=\"menu-toggle\" class=\"menu-toggle\" (click)=\"toggleMenu()\">\n <div class=\"menu-icon\"></div>\n </div>\n\n @if (showsAccountData && !doingOnboarding && !isAdmin) {\n <div class=\"left-items-container\">\n <span>Banco {{ currentAccount()?.bankCode }}</span>\n <span class=\"separator\"></span>\n <span>AG {{ currentAccount()?.agency }}</span>\n <span class=\"separator\"></span>\n <span>CC {{ currentAccount()?.accountNumber }}</span>\n <span class=\"separator\"></span>\n <span\n >{{ currentAccount()?.accountType === 'CURRENT_ACCOUNT_PF' ? 'CPF' : 'CNPJ' }}\n {{ maskUtil.formatDocument(currentAccount()?.document) }}</span\n >\n <span class=\"separator\"></span>\n <div class=\"change-account-button cursor-pointer\" (click)=\"changeAccountMenu.toggle($event)\">\n <span class=\"mr-2\">Alternar conta</span>\n <span\n class=\"fas\"\n [ngClass]=\"{ 'fa-angle-down': !openedChangeAccountMenu, 'fa-angle-up': openedChangeAccountMenu }\"\n ></span>\n </div>\n </div>\n }\n\n @if (!isAdmin && !doingOnboarding) {\n <div class=\"right-items-container\" [ngClass]=\"{ 'hidden-items': hideElements }\">\n @if (showHelpCentral) {\n <div class=\"help-central\">\n <span>{{ 'app.label.help_central' | translate }}:</span>\n @for (item of helpCentralIcons; track item) {\n <a target=\"_blank\" [ngClass]=\"{ hidden: !item.active }\" [attr.href]=\"item.url\">\n <i [class]=\"item.icon\"></i>\n </a>\n }\n </div>\n }\n\n @if (!fintech) {\n <span (click)=\"notifications.toggle($event)\" class=\"fas fa-bell notifications-icon\">\n @if ((notificationsList | unreadNotifications).length) {\n <span class=\"notifications-indicator\"> </span>\n }\n </span>\n }\n\n <span class=\"separator\"></span>\n <div\n #menuContainer\n class=\"menu-container\"\n (click)=\"menu.toggle($event)\"\n pTooltip=\"Enter your username\"\n tooltipPosition=\"bottom\"\n tooltipEvent=\"click\"\n >\n <span class=\"user-name\">{{ currentAccount()?.name || vectorFirstName() || '' }}</span>\n <span class=\"fas\" [ngClass]=\"{ 'fa-angle-down': !openedMenu, 'fa-angle-up': openedMenu }\"></span>\n </div>\n </div>\n }\n</div>\n\n<p-popover\n #menu\n (onHide)=\"openedMenu = false\"\n (onShow)=\"openedMenu = true; alignPopoverToTriggerEdge(menu)\"\n styleClass=\"background-white\"\n>\n <ng-template #content>\n @if (showsAccountData) {\n <div class=\"account-info\">\n <div class=\"account-info-row\">\n <div class=\"account-info-item\">\n <span>Banco: </span>\n <span class=\"account-info-value\">{{ currentAccount()?.bank }}</span>\n </div>\n\n <span class=\"separator\"></span>\n <div class=\"account-info-item\">\n <span>AG: </span>\n <span class=\"account-info-value\">{{ currentAccount()?.agency }}</span>\n </div>\n </div>\n <div class=\"account-info-row\">\n <div class=\"account-info-item\">\n <span>CC: </span>\n <span class=\"account-info-value\">{{ currentAccount()?.accountNumber }}</span>\n </div>\n <span class=\"separator\"></span>\n <div class=\"account-info-item\">\n <span>{{ currentAccount()?.accountType === 'CURRENT_ACCOUNT_PF' ? 'CPF' : 'CNPJ' }}: </span>\n <span class=\"account-info-value\"> {{ maskUtil.formatDocument(currentAccount()?.document) }}</span>\n </div>\n </div>\n @if (otherAccounts?.length) {\n <div class=\"change-account-mobile\" (click)=\"changeAccountMenu.toggle($event)\">\n <span class=\"change-account-mobile-label\">Alternar conta</span>\n <span\n class=\"fas\"\n [ngClass]=\"{ 'fa-angle-down': !openedChangeAccountMenu, 'fa-angle-up': openedChangeAccountMenu }\"\n ></span>\n </div>\n }\n </div>\n }\n <ul class=\"user-menu\">\n @if (fintech) {\n <li (click)=\"goToTermsOfUse(); menu.hide()\">\n <span class=\"user-menu-icon\"><i class=\"fas fa-file-contract\"></i></span>\n <span>Termos de Uso</span>\n </li>\n }\n @if (fintech) {\n <li (click)=\"goToPasswordChange(); menu.hide()\">\n <span class=\"user-menu-icon\"><i class=\"fas fa-key\"></i></span>\n <span>Alterar Senha</span>\n </li>\n }\n @if (showProfile) {\n <li (click)=\"goToProfile(); menu.hide()\">\n <span class=\"user-menu-icon\"><i class=\"ph-bold ph-user\"></i></span>\n <span>Perfil</span>\n </li>\n }\n @if (isLogtech) {\n <li (click)=\"termsOfUse(); menu.hide()\">\n <span class=\"user-menu-icon\"><i class=\"ph-bold ph-file-text\"></i></span>\n <span>Termos de uso</span>\n </li>\n }\n <li class=\"menu-separator\"></li>\n <li (click)=\"logout()\">\n <span class=\"user-menu-icon\"><i class=\"ph-bold ph-sign-out\"></i></span>\n <span>Sair</span>\n </li>\n </ul>\n </ng-template>\n</p-popover>\n\n<p-popover\n #changeAccountMenu\n (onHide)=\"openedChangeAccountMenu = false\"\n (onShow)=\"openedChangeAccountMenu = true; alignPopoverToTriggerEdge(changeAccountMenu)\"\n>\n <ng-template #content>\n @for (account of otherAccounts; track account) {\n <div class=\"account-info change-account-info\" (click)=\"changeAccount(account)\">\n <div class=\"account-info-row\">\n <div class=\"account-info-item\">\n <span>Banco: </span>\n <span class=\"account-info-value\">{{ account?.bank }}</span>\n </div>\n\n <span class=\"separator\"></span>\n <div class=\"account-info-item\">\n <span>AG: </span>\n <span class=\"account-info-value\">{{ account?.agency }}</span>\n </div>\n </div>\n <div class=\"account-info-row\">\n <div class=\"account-info-item\">\n <span>CC: </span>\n <span class=\"account-info-value\">{{ account?.accountNumber }}</span>\n </div>\n <span class=\"separator\"></span>\n <div class=\"account-info-item\">\n <span>{{ account?.accountType === 'CURRENT_ACCOUNT_PF' ? 'CPF' : 'CNPJ' }}: </span>\n <span class=\"account-info-value\"> {{ account?.document | formatDocument }}</span>\n </div>\n </div>\n </div>\n }\n <div>\n <hr />\n <p class=\"text-center add-account\" (click)=\"goToOnboarding(); changeAccountMenu.hide()\">\n Adicionar uma nova conta\n </p>\n </div>\n </ng-template>\n</p-popover>\n\n<p-popover\n #notifications\n (onHide)=\"showNotifications = false\"\n (onShow)=\"showNotifications = true; alignPopoverToTriggerEdge(notifications)\"\n styleClass=\"background-white\"\n>\n <ng-template #content>\n <div class=\"notifications-header\">\n <div class=\"notifications-vector-logo\"></div>\n <span class=\"notifications-title\">\n {{ 'app.label.notifications' | translate }}\n </span>\n </div>\n <ul class=\"notifications-list\">\n @for (notification of notificationsList; track $index) {\n <li (click)=\"handleClick(notification); notifications.hide()\" class=\"notification-item\">\n <span class=\"notification-title\">\n {{ notification.title }}\n @if (!notification.wasRead) {\n <span class=\"notification-item-indicator\"></span>\n }\n </span>\n @if (notification.description) {\n <span>{{ notification.description }}</span>\n <em class=\"fas fa-chevron-right\"></em>\n }\n </li>\n }\n </ul>\n </ng-template>\n</p-popover>\n", styles: [".fas{color:#fff}.top-bar-container{height:81px;background-color:var(--theme-light);display:flex;flex:1;align-items:center;padding:15px;color:#fff;font-size:1em;font-weight:600;box-shadow:2px 2px 4px #00000029}.top-bar-container .menu-toggle{cursor:pointer;margin-right:10px;padding:8px}.top-bar-container .menu-toggle .menu-icon{background:url('data:image/svg+xml,<svg width=\"21\" height=\"14\" viewBox=\"0 0 21 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">%0A<path d=\"M0 13.846H15V11.538H0V13.846ZM0 8.077H11.538V5.769H0V8.077ZM0 0V2.308H15V0H0ZM20.769 11.065L16.638 6.923L20.769 2.781L19.142 1.154L13.373 6.923L19.142 12.692L20.769 11.065Z\" fill=\"white\"/>%0A</svg>%0A');background-repeat:no-repeat;background-size:cover;width:20.77px;height:13.85px}.top-bar-container .menu-toggle span{font-size:1.3em}.top-bar-container .left-items-container{display:flex;align-items:center;flex-direction:row}.top-bar-container .right-items-container{flex:1;display:flex;flex-direction:row;justify-content:flex-end;align-items:center}.top-bar-container .right-items-container .help-central{display:flex;align-items:center;gap:20px;font-size:1rem;margin-right:35px}.top-bar-container .right-items-container .help-central em{font-size:1.3rem}.top-bar-container .right-items-container .help-central a{outline:none;border:none;text-decoration:none;color:transparent}.top-bar-container .right-items-container .help-central a i{color:#fff;font-size:1.1em}.top-bar-container .right-items-container .help-central a i:hover{color:#7de5ec}@media screen and (max-width:441px){.top-bar-container .right-items-container .help-central span{display:none}.top-bar-container .right-items-container .help-central em{font-size:1rem}}.top-bar-container .right-items-container .menu-container{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;cursor:pointer}.top-bar-container .right-items-container .menu-container .user-name{margin-right:15px}.top-bar-container .right-items-container .notifications-icon{position:relative;cursor:pointer}.top-bar-container .right-items-container .notifications-indicator{position:absolute;right:-8px;top:-8px;width:12px;height:12px;border-radius:50%;background-color:var(--error-color)}.separator{height:100%;margin-left:15px;margin-right:15px}.separator:after{content:\"\";height:100%;border-right:2px solid #ffffff}.account-info{display:flex;flex-direction:column;background-color:var(--theme-primary);border-radius:var(--border-radius);color:#fff;padding:5px;width:300px}.account-info .account-info-row{display:flex;flex-direction:row;align-items:center}.account-info .account-info-row .account-info-item{flex:1}.account-info .account-info-row .account-info-item:first-child{flex:.6}.account-info .account-info-row .account-info-item .account-info-value{font-weight:200}.account-info .change-account-mobile{font-size:.8em;align-items:center;display:flex}.account-info .change-account-mobile .change-account-mobile-label{margin-right:5px}.change-account-info{background-color:unset;cursor:pointer}.change-account-info:hover{background-color:var(--theme-primary)}.user-menu{padding:0;margin:0;list-style:none;color:var(--theme-medium)}.user-menu li{display:flex;flex-direction:row;align-items:center;gap:10px;padding:8px 16px;font-weight:600;text-transform:uppercase;cursor:pointer;border-radius:5px;transition:background-color .15s ease,color .15s ease}.user-menu li:hover,.user-menu li:focus{background-color:var(--theme-medium);color:#fff;outline:none}.user-menu li:hover .user-menu-icon i,.user-menu li:focus .user-menu-icon i{color:#fff}.user-menu li.menu-separator{margin:5px auto;padding:0;border-top:1px solid #eeeeee;height:2px}.user-menu li.menu-separator:hover{cursor:default;background:none!important;outline:none}.user-menu li .user-menu-icon{display:flex;align-items:center;justify-content:center;width:20px;height:20px}.user-menu li .user-menu-icon i{color:var(--theme-medium);font-size:1.1em;transition:color .15s ease}.add-account{color:#fff;font-size:1.1em;padding:10px;margin:0;font-weight:400;letter-spacing:.25px;cursor:pointer}@media screen and (max-width:441px){.hidden-items{display:none!important}}.notifications-header{display:flex;align-items:center;gap:8px}.notifications-header .notifications-vector-logo{background-image:url(/assets/images/vector_logo_horizontal.svg);background-repeat:no-repeat;background-position:right;background-size:cover;height:12px;width:30px}.notifications-header .notifications-title{text-transform:uppercase;color:var(--gray-dark);font-weight:600}::ng-deep .p-popover.background-white{background-color:#fff!important;border:1px solid #d9dbe9!important;box-shadow:0 1px 2px #1f29371a,0 2px 4px #1f29371a,0 4px 8px #1f29371a,0 8px 16px #1f29371a!important;padding:3px!important}::ng-deep .p-popover.background-white .p-popover-content{padding:8px 0!important}.notifications-list{max-height:400px;overflow:auto;margin-top:10px}.notifications-list .notification-item{cursor:pointer;position:relative;padding:5px 10px;border-radius:5px;text-align:center;transition:background-color .15s ease,color .15s ease}.notifications-list .notification-item:hover,.notifications-list .notification-item:focus{background-color:var(--theme-medium)!important;color:#fff;outline:none}.notifications-list .notification-item:hover .notification-title,.notifications-list .notification-item:focus .notification-title{color:#fff}.notifications-list .notification-item:hover em,.notifications-list .notification-item:focus em{color:#fff}.notifications-list .notification-item .notification-title{font-weight:600;text-transform:uppercase;position:relative;display:inline-block;color:var(--theme-medium)}.notifications-list .notification-item .notification-title .notification-item-indicator{position:absolute;top:-4px;right:-12px;width:8px;height:8px;border-radius:50%;background-color:var(--error-color);margin:0}.notifications-list .notification-item span{font-weight:500;margin-right:20px}.notifications-list .notification-item em{position:absolute;right:10px;bottom:10px;color:var(--theme-primary)}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: i6.Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }, { kind: "pipe", type: FormatDocumentPipe, name: "formatDocument" }, { kind: "pipe", type: UnreadNotificationsPipe, name: "unreadNotifications" }, { kind: "pipe", type: i1$3.TranslatePipe, name: "translate" }] }); }
|
|
7521
7589
|
}
|
|
7522
7590
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TopBarComponent, decorators: [{
|
|
7523
7591
|
type: Component,
|
|
7524
|
-
args: [{ standalone: false, selector: 'vector-top-bar', template: "<div class=\"top-bar-container\">\n <div id=\"menu-toggle\" class=\"menu-toggle\" (click)=\"toggleMenu()\">\n <div class=\"menu-icon\"></div>\n </div>\n\n @if (showsAccountData && !doingOnboarding && !isAdmin) {\n <div class=\"left-items-container\">\n <span>Banco {{ currentAccount()?.bankCode }}</span>\n <span class=\"separator\"></span>\n <span>AG {{ currentAccount()?.agency }}</span>\n <span class=\"separator\"></span>\n <span>CC {{ currentAccount()?.accountNumber }}</span>\n <span class=\"separator\"></span>\n <span\n >{{ currentAccount()?.accountType === 'CURRENT_ACCOUNT_PF' ? 'CPF' : 'CNPJ' }}\n {{ maskUtil.formatDocument(currentAccount()?.document) }}</span\n >\n <span class=\"separator\"></span>\n <div class=\"change-account-button cursor-pointer\" (click)=\"changeAccountMenu.toggle($event)\">\n <span class=\"mr-2\">Alternar conta</span>\n <span\n class=\"fas\"\n [ngClass]=\"{ 'fa-angle-down': !openedChangeAccountMenu, 'fa-angle-up': openedChangeAccountMenu }\"\n ></span>\n </div>\n </div>\n }\n\n @if (!isAdmin && !doingOnboarding) {\n <div class=\"right-items-container\" [ngClass]=\"{ 'hidden-items': hideElements }\">\n @if (showHelpCentral) {\n <div class=\"help-central\">\n <span>{{ 'app.label.help_central' | translate }}:</span>\n @for (item of helpCentralIcons; track item) {\n <a target=\"_blank\" [ngClass]=\"{ hidden: !item.active }\" [attr.href]=\"item.url\">\n <i [class]=\"item.icon\"></i>\n </a>\n }\n </div>\n }\n\n @if (!fintech) {\n <span (click)=\"notifications.toggle($event)\" class=\"fas fa-bell notifications-icon\">\n @if ((notificationsList | unreadNotifications).length) {\n <span class=\"notifications-indicator\"> </span>\n }\n </span>\n }\n\n <span class=\"separator\"></span>\n <div\n #menuContainer\n class=\"menu-container\"\n (click)=\"menu.toggle($event)\"\n pTooltip=\"Enter your username\"\n tooltipPosition=\"bottom\"\n tooltipEvent=\"click\"\n >\n <span class=\"user-name\">{{ currentAccount()?.name || vectorFirstName() || '' }}</span>\n <span class=\"fas\" [ngClass]=\"{ 'fa-angle-down': !openedMenu, 'fa-angle-up': openedMenu }\"></span>\n </div>\n </div>\n }\n</div>\n\n<p-popover #menu (onHide)=\"openedMenu = false\" (onShow)=\"openedMenu = true\" styleClass=\"background-white\">\n <ng-template #content>\n @if (showsAccountData) {\n <div class=\"account-info\">\n <div class=\"account-info-row\">\n <div class=\"account-info-item\">\n <span>Banco: </span>\n <span class=\"account-info-value\">{{ currentAccount()?.bank }}</span>\n </div>\n\n <span class=\"separator\"></span>\n <div class=\"account-info-item\">\n <span>AG: </span>\n <span class=\"account-info-value\">{{ currentAccount()?.agency }}</span>\n </div>\n </div>\n <div class=\"account-info-row\">\n <div class=\"account-info-item\">\n <span>CC: </span>\n <span class=\"account-info-value\">{{ currentAccount()?.accountNumber }}</span>\n </div>\n <span class=\"separator\"></span>\n <div class=\"account-info-item\">\n <span>{{ currentAccount()?.accountType === 'CURRENT_ACCOUNT_PF' ? 'CPF' : 'CNPJ' }}: </span>\n <span class=\"account-info-value\"> {{ maskUtil.formatDocument(currentAccount()?.document) }}</span>\n </div>\n </div>\n @if (otherAccounts?.length) {\n <div class=\"change-account-mobile\" (click)=\"changeAccountMenu.toggle($event)\">\n <span class=\"change-account-mobile-label\">Alternar conta</span>\n <span\n class=\"fas\"\n [ngClass]=\"{ 'fa-angle-down': !openedChangeAccountMenu, 'fa-angle-up': openedChangeAccountMenu }\"\n ></span>\n </div>\n }\n </div>\n }\n <ul class=\"user-menu\">\n @if (fintech) {\n <li (click)=\"goToTermsOfUse(); menu.hide()\">\n <span class=\"user-menu-icon\"><i class=\"fas fa-file-contract\"></i></span>\n <span>Termos de Uso</span>\n </li>\n }\n @if (fintech) {\n <li (click)=\"goToPasswordChange(); menu.hide()\">\n <span class=\"user-menu-icon\"><i class=\"fas fa-key\"></i></span>\n <span>Alterar Senha</span>\n </li>\n }\n @if (showProfile) {\n <li (click)=\"goToProfile(); menu.hide()\">\n <span class=\"user-menu-icon\"><i class=\"ph-bold ph-user\"></i></span>\n <span>Perfil</span>\n </li>\n }\n @if (isLogtech) {\n <li (click)=\"termsOfUse(); menu.hide()\">\n <span class=\"user-menu-icon\"><i class=\"ph-bold ph-file-text\"></i></span>\n <span>Termos de uso</span>\n </li>\n }\n <li class=\"menu-separator\"></li>\n <li (click)=\"logout()\">\n <span class=\"user-menu-icon\"><i class=\"ph-bold ph-sign-out\"></i></span>\n <span>Sair</span>\n </li>\n </ul>\n </ng-template>\n</p-popover>\n\n<p-popover #changeAccountMenu (onHide)=\"openedChangeAccountMenu = false\" (onShow)=\"openedChangeAccountMenu = true\">\n <ng-template #content>\n @for (account of otherAccounts; track account) {\n <div class=\"account-info change-account-info\" (click)=\"changeAccount(account)\">\n <div class=\"account-info-row\">\n <div class=\"account-info-item\">\n <span>Banco: </span>\n <span class=\"account-info-value\">{{ account?.bank }}</span>\n </div>\n\n <span class=\"separator\"></span>\n <div class=\"account-info-item\">\n <span>AG: </span>\n <span class=\"account-info-value\">{{ account?.agency }}</span>\n </div>\n </div>\n <div class=\"account-info-row\">\n <div class=\"account-info-item\">\n <span>CC: </span>\n <span class=\"account-info-value\">{{ account?.accountNumber }}</span>\n </div>\n <span class=\"separator\"></span>\n <div class=\"account-info-item\">\n <span>{{ account?.accountType === 'CURRENT_ACCOUNT_PF' ? 'CPF' : 'CNPJ' }}: </span>\n <span class=\"account-info-value\"> {{ account?.document | formatDocument }}</span>\n </div>\n </div>\n </div>\n }\n <div>\n <hr />\n <p class=\"text-center add-account\" (click)=\"goToOnboarding(); changeAccountMenu.hide()\">\n Adicionar uma nova conta\n </p>\n </div>\n </ng-template>\n</p-popover>\n\n<p-popover\n #notifications\n (onHide)=\"showNotifications = false\"\n (onShow)=\"showNotifications = true\"\n styleClass=\"background-white\"\n>\n <ng-template #content>\n <div class=\"notifications-header\">\n <div class=\"notifications-vector-logo\"></div>\n <span class=\"notifications-title\">\n {{ 'app.label.notifications' | translate }}\n </span>\n </div>\n <ul class=\"notifications-list\">\n @for (notification of notificationsList; track $index) {\n <li (click)=\"handleClick(notification); notifications.hide()\" class=\"notification-item\">\n <span class=\"notification-title\">\n {{ notification.title }}\n @if (!notification.wasRead) {\n <span class=\"notification-item-indicator\"></span>\n }\n </span>\n @if (notification.description) {\n <span>{{ notification.description }}</span>\n <em class=\"fas fa-chevron-right\"></em>\n }\n </li>\n }\n </ul>\n </ng-template>\n</p-popover>\n", styles: [".fas{color:#fff}.top-bar-container{height:81px;background-color:var(--theme-light);display:flex;flex:1;align-items:center;padding:15px;color:#fff;font-size:1em;font-weight:600;box-shadow:2px 2px 4px #00000029}.top-bar-container .menu-toggle{cursor:pointer;margin-right:10px;padding:8px}.top-bar-container .menu-toggle .menu-icon{background:url('data:image/svg+xml,<svg width=\"21\" height=\"14\" viewBox=\"0 0 21 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">%0A<path d=\"M0 13.846H15V11.538H0V13.846ZM0 8.077H11.538V5.769H0V8.077ZM0 0V2.308H15V0H0ZM20.769 11.065L16.638 6.923L20.769 2.781L19.142 1.154L13.373 6.923L19.142 12.692L20.769 11.065Z\" fill=\"white\"/>%0A</svg>%0A');background-repeat:no-repeat;background-size:cover;width:20.77px;height:13.85px}.top-bar-container .menu-toggle span{font-size:1.3em}.top-bar-container .left-items-container{display:flex;align-items:center;flex-direction:row}.top-bar-container .right-items-container{flex:1;display:flex;flex-direction:row;justify-content:flex-end;align-items:center}.top-bar-container .right-items-container .help-central{display:flex;align-items:center;gap:20px;font-size:1rem;margin-right:35px}.top-bar-container .right-items-container .help-central em{font-size:1.3rem}.top-bar-container .right-items-container .help-central a{outline:none;border:none;text-decoration:none;color:transparent}.top-bar-container .right-items-container .help-central a i{color:#fff;font-size:1.1em}.top-bar-container .right-items-container .help-central a i:hover{color:#7de5ec}@media screen and (max-width:441px){.top-bar-container .right-items-container .help-central span{display:none}.top-bar-container .right-items-container .help-central em{font-size:1rem}}.top-bar-container .right-items-container .menu-container{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;cursor:pointer}.top-bar-container .right-items-container .menu-container .user-name{margin-right:15px}.top-bar-container .right-items-container .notifications-icon{position:relative;cursor:pointer}.top-bar-container .right-items-container .notifications-indicator{position:absolute;right:-8px;top:-8px;width:12px;height:12px;border-radius:50%;background-color:var(--error-color)}.separator{height:100%;margin-left:15px;margin-right:15px}.separator:after{content:\"\";height:100%;border-right:2px solid #ffffff}.account-info{display:flex;flex-direction:column;background-color:var(--theme-primary);border-radius:var(--border-radius);color:#fff;padding:5px;width:300px}.account-info .account-info-row{display:flex;flex-direction:row;align-items:center}.account-info .account-info-row .account-info-item{flex:1}.account-info .account-info-row .account-info-item:first-child{flex:.6}.account-info .account-info-row .account-info-item .account-info-value{font-weight:200}.account-info .change-account-mobile{font-size:.8em;align-items:center;display:flex}.account-info .change-account-mobile .change-account-mobile-label{margin-right:5px}.change-account-info{background-color:unset;cursor:pointer}.change-account-info:hover{background-color:var(--theme-primary)}.user-menu{padding:0;margin:0;list-style:none;color:var(--theme-medium)}.user-menu li{display:flex;flex-direction:row;align-items:center;gap:10px;padding:8px 16px;font-weight:600;text-transform:uppercase;cursor:pointer;border-radius:5px;transition:background-color .15s ease,color .15s ease}.user-menu li:hover,.user-menu li:focus{background-color:var(--theme-medium);color:#fff;outline:none}.user-menu li:hover .user-menu-icon i,.user-menu li:focus .user-menu-icon i{color:#fff}.user-menu li.menu-separator{margin:5px auto;padding:0;border-top:1px solid #eeeeee;height:2px}.user-menu li.menu-separator:hover{cursor:default;background:none!important;outline:none}.user-menu li .user-menu-icon{display:flex;align-items:center;justify-content:center;width:20px;height:20px}.user-menu li .user-menu-icon i{color:var(--theme-medium);font-size:1.1em;transition:color .15s ease}.add-account{color:#fff;font-size:1.1em;padding:10px;margin:0;font-weight:400;letter-spacing:.25px;cursor:pointer}@media screen and (max-width:441px){.hidden-items{display:none!important}}.notifications-header{display:flex;align-items:center;gap:8px}.notifications-header .notifications-vector-logo{background-image:url(/assets/images/vector_logo_horizontal.svg);background-repeat:no-repeat;background-position:right;background-size:cover;height:12px;width:30px}.notifications-header .notifications-title{text-transform:uppercase;color:var(--gray-dark);font-weight:600}::ng-deep .p-overlaypanel.background-white{border-radius:8px!important;background-color:#fff!important;border:1px solid #d9dbe9!important;box-shadow:0 1px 2px #1f29371a,0 2px 4px #1f29371a,0 4px 8px #1f29371a,0 8px 16px #1f29371a!important;padding:3px!important}::ng-deep .p-overlaypanel.background-white:before,::ng-deep .p-overlaypanel.background-white:after{display:none!important}::ng-deep .p-overlaypanel.background-white .p-overlaypanel-content{padding:8px 0!important}.notifications-list{max-height:400px;overflow:auto;margin-top:10px}.notifications-list .notification-item{cursor:pointer;position:relative;padding:5px 10px;border-radius:5px;text-align:center;transition:background-color .15s ease,color .15s ease}.notifications-list .notification-item:hover,.notifications-list .notification-item:focus{background-color:var(--theme-medium)!important;color:#fff;outline:none}.notifications-list .notification-item:hover .notification-title,.notifications-list .notification-item:focus .notification-title{color:#fff}.notifications-list .notification-item:hover em,.notifications-list .notification-item:focus em{color:#fff}.notifications-list .notification-item .notification-title{font-weight:600;text-transform:uppercase;position:relative;display:inline-block;color:var(--theme-medium)}.notifications-list .notification-item .notification-title .notification-item-indicator{position:absolute;top:-4px;right:-12px;width:8px;height:8px;border-radius:50%;background-color:var(--error-color);margin:0}.notifications-list .notification-item span{font-weight:500;margin-right:20px}.notifications-list .notification-item em{position:absolute;right:10px;bottom:10px;color:var(--theme-primary)}\n"] }]
|
|
7592
|
+
args: [{ standalone: false, selector: 'vector-top-bar', template: "<div class=\"top-bar-container\">\n <div id=\"menu-toggle\" class=\"menu-toggle\" (click)=\"toggleMenu()\">\n <div class=\"menu-icon\"></div>\n </div>\n\n @if (showsAccountData && !doingOnboarding && !isAdmin) {\n <div class=\"left-items-container\">\n <span>Banco {{ currentAccount()?.bankCode }}</span>\n <span class=\"separator\"></span>\n <span>AG {{ currentAccount()?.agency }}</span>\n <span class=\"separator\"></span>\n <span>CC {{ currentAccount()?.accountNumber }}</span>\n <span class=\"separator\"></span>\n <span\n >{{ currentAccount()?.accountType === 'CURRENT_ACCOUNT_PF' ? 'CPF' : 'CNPJ' }}\n {{ maskUtil.formatDocument(currentAccount()?.document) }}</span\n >\n <span class=\"separator\"></span>\n <div class=\"change-account-button cursor-pointer\" (click)=\"changeAccountMenu.toggle($event)\">\n <span class=\"mr-2\">Alternar conta</span>\n <span\n class=\"fas\"\n [ngClass]=\"{ 'fa-angle-down': !openedChangeAccountMenu, 'fa-angle-up': openedChangeAccountMenu }\"\n ></span>\n </div>\n </div>\n }\n\n @if (!isAdmin && !doingOnboarding) {\n <div class=\"right-items-container\" [ngClass]=\"{ 'hidden-items': hideElements }\">\n @if (showHelpCentral) {\n <div class=\"help-central\">\n <span>{{ 'app.label.help_central' | translate }}:</span>\n @for (item of helpCentralIcons; track item) {\n <a target=\"_blank\" [ngClass]=\"{ hidden: !item.active }\" [attr.href]=\"item.url\">\n <i [class]=\"item.icon\"></i>\n </a>\n }\n </div>\n }\n\n @if (!fintech) {\n <span (click)=\"notifications.toggle($event)\" class=\"fas fa-bell notifications-icon\">\n @if ((notificationsList | unreadNotifications).length) {\n <span class=\"notifications-indicator\"> </span>\n }\n </span>\n }\n\n <span class=\"separator\"></span>\n <div\n #menuContainer\n class=\"menu-container\"\n (click)=\"menu.toggle($event)\"\n pTooltip=\"Enter your username\"\n tooltipPosition=\"bottom\"\n tooltipEvent=\"click\"\n >\n <span class=\"user-name\">{{ currentAccount()?.name || vectorFirstName() || '' }}</span>\n <span class=\"fas\" [ngClass]=\"{ 'fa-angle-down': !openedMenu, 'fa-angle-up': openedMenu }\"></span>\n </div>\n </div>\n }\n</div>\n\n<p-popover\n #menu\n (onHide)=\"openedMenu = false\"\n (onShow)=\"openedMenu = true; alignPopoverToTriggerEdge(menu)\"\n styleClass=\"background-white\"\n>\n <ng-template #content>\n @if (showsAccountData) {\n <div class=\"account-info\">\n <div class=\"account-info-row\">\n <div class=\"account-info-item\">\n <span>Banco: </span>\n <span class=\"account-info-value\">{{ currentAccount()?.bank }}</span>\n </div>\n\n <span class=\"separator\"></span>\n <div class=\"account-info-item\">\n <span>AG: </span>\n <span class=\"account-info-value\">{{ currentAccount()?.agency }}</span>\n </div>\n </div>\n <div class=\"account-info-row\">\n <div class=\"account-info-item\">\n <span>CC: </span>\n <span class=\"account-info-value\">{{ currentAccount()?.accountNumber }}</span>\n </div>\n <span class=\"separator\"></span>\n <div class=\"account-info-item\">\n <span>{{ currentAccount()?.accountType === 'CURRENT_ACCOUNT_PF' ? 'CPF' : 'CNPJ' }}: </span>\n <span class=\"account-info-value\"> {{ maskUtil.formatDocument(currentAccount()?.document) }}</span>\n </div>\n </div>\n @if (otherAccounts?.length) {\n <div class=\"change-account-mobile\" (click)=\"changeAccountMenu.toggle($event)\">\n <span class=\"change-account-mobile-label\">Alternar conta</span>\n <span\n class=\"fas\"\n [ngClass]=\"{ 'fa-angle-down': !openedChangeAccountMenu, 'fa-angle-up': openedChangeAccountMenu }\"\n ></span>\n </div>\n }\n </div>\n }\n <ul class=\"user-menu\">\n @if (fintech) {\n <li (click)=\"goToTermsOfUse(); menu.hide()\">\n <span class=\"user-menu-icon\"><i class=\"fas fa-file-contract\"></i></span>\n <span>Termos de Uso</span>\n </li>\n }\n @if (fintech) {\n <li (click)=\"goToPasswordChange(); menu.hide()\">\n <span class=\"user-menu-icon\"><i class=\"fas fa-key\"></i></span>\n <span>Alterar Senha</span>\n </li>\n }\n @if (showProfile) {\n <li (click)=\"goToProfile(); menu.hide()\">\n <span class=\"user-menu-icon\"><i class=\"ph-bold ph-user\"></i></span>\n <span>Perfil</span>\n </li>\n }\n @if (isLogtech) {\n <li (click)=\"termsOfUse(); menu.hide()\">\n <span class=\"user-menu-icon\"><i class=\"ph-bold ph-file-text\"></i></span>\n <span>Termos de uso</span>\n </li>\n }\n <li class=\"menu-separator\"></li>\n <li (click)=\"logout()\">\n <span class=\"user-menu-icon\"><i class=\"ph-bold ph-sign-out\"></i></span>\n <span>Sair</span>\n </li>\n </ul>\n </ng-template>\n</p-popover>\n\n<p-popover\n #changeAccountMenu\n (onHide)=\"openedChangeAccountMenu = false\"\n (onShow)=\"openedChangeAccountMenu = true; alignPopoverToTriggerEdge(changeAccountMenu)\"\n>\n <ng-template #content>\n @for (account of otherAccounts; track account) {\n <div class=\"account-info change-account-info\" (click)=\"changeAccount(account)\">\n <div class=\"account-info-row\">\n <div class=\"account-info-item\">\n <span>Banco: </span>\n <span class=\"account-info-value\">{{ account?.bank }}</span>\n </div>\n\n <span class=\"separator\"></span>\n <div class=\"account-info-item\">\n <span>AG: </span>\n <span class=\"account-info-value\">{{ account?.agency }}</span>\n </div>\n </div>\n <div class=\"account-info-row\">\n <div class=\"account-info-item\">\n <span>CC: </span>\n <span class=\"account-info-value\">{{ account?.accountNumber }}</span>\n </div>\n <span class=\"separator\"></span>\n <div class=\"account-info-item\">\n <span>{{ account?.accountType === 'CURRENT_ACCOUNT_PF' ? 'CPF' : 'CNPJ' }}: </span>\n <span class=\"account-info-value\"> {{ account?.document | formatDocument }}</span>\n </div>\n </div>\n </div>\n }\n <div>\n <hr />\n <p class=\"text-center add-account\" (click)=\"goToOnboarding(); changeAccountMenu.hide()\">\n Adicionar uma nova conta\n </p>\n </div>\n </ng-template>\n</p-popover>\n\n<p-popover\n #notifications\n (onHide)=\"showNotifications = false\"\n (onShow)=\"showNotifications = true; alignPopoverToTriggerEdge(notifications)\"\n styleClass=\"background-white\"\n>\n <ng-template #content>\n <div class=\"notifications-header\">\n <div class=\"notifications-vector-logo\"></div>\n <span class=\"notifications-title\">\n {{ 'app.label.notifications' | translate }}\n </span>\n </div>\n <ul class=\"notifications-list\">\n @for (notification of notificationsList; track $index) {\n <li (click)=\"handleClick(notification); notifications.hide()\" class=\"notification-item\">\n <span class=\"notification-title\">\n {{ notification.title }}\n @if (!notification.wasRead) {\n <span class=\"notification-item-indicator\"></span>\n }\n </span>\n @if (notification.description) {\n <span>{{ notification.description }}</span>\n <em class=\"fas fa-chevron-right\"></em>\n }\n </li>\n }\n </ul>\n </ng-template>\n</p-popover>\n", styles: [".fas{color:#fff}.top-bar-container{height:81px;background-color:var(--theme-light);display:flex;flex:1;align-items:center;padding:15px;color:#fff;font-size:1em;font-weight:600;box-shadow:2px 2px 4px #00000029}.top-bar-container .menu-toggle{cursor:pointer;margin-right:10px;padding:8px}.top-bar-container .menu-toggle .menu-icon{background:url('data:image/svg+xml,<svg width=\"21\" height=\"14\" viewBox=\"0 0 21 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">%0A<path d=\"M0 13.846H15V11.538H0V13.846ZM0 8.077H11.538V5.769H0V8.077ZM0 0V2.308H15V0H0ZM20.769 11.065L16.638 6.923L20.769 2.781L19.142 1.154L13.373 6.923L19.142 12.692L20.769 11.065Z\" fill=\"white\"/>%0A</svg>%0A');background-repeat:no-repeat;background-size:cover;width:20.77px;height:13.85px}.top-bar-container .menu-toggle span{font-size:1.3em}.top-bar-container .left-items-container{display:flex;align-items:center;flex-direction:row}.top-bar-container .right-items-container{flex:1;display:flex;flex-direction:row;justify-content:flex-end;align-items:center}.top-bar-container .right-items-container .help-central{display:flex;align-items:center;gap:20px;font-size:1rem;margin-right:35px}.top-bar-container .right-items-container .help-central em{font-size:1.3rem}.top-bar-container .right-items-container .help-central a{outline:none;border:none;text-decoration:none;color:transparent}.top-bar-container .right-items-container .help-central a i{color:#fff;font-size:1.1em}.top-bar-container .right-items-container .help-central a i:hover{color:#7de5ec}@media screen and (max-width:441px){.top-bar-container .right-items-container .help-central span{display:none}.top-bar-container .right-items-container .help-central em{font-size:1rem}}.top-bar-container .right-items-container .menu-container{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;cursor:pointer}.top-bar-container .right-items-container .menu-container .user-name{margin-right:15px}.top-bar-container .right-items-container .notifications-icon{position:relative;cursor:pointer}.top-bar-container .right-items-container .notifications-indicator{position:absolute;right:-8px;top:-8px;width:12px;height:12px;border-radius:50%;background-color:var(--error-color)}.separator{height:100%;margin-left:15px;margin-right:15px}.separator:after{content:\"\";height:100%;border-right:2px solid #ffffff}.account-info{display:flex;flex-direction:column;background-color:var(--theme-primary);border-radius:var(--border-radius);color:#fff;padding:5px;width:300px}.account-info .account-info-row{display:flex;flex-direction:row;align-items:center}.account-info .account-info-row .account-info-item{flex:1}.account-info .account-info-row .account-info-item:first-child{flex:.6}.account-info .account-info-row .account-info-item .account-info-value{font-weight:200}.account-info .change-account-mobile{font-size:.8em;align-items:center;display:flex}.account-info .change-account-mobile .change-account-mobile-label{margin-right:5px}.change-account-info{background-color:unset;cursor:pointer}.change-account-info:hover{background-color:var(--theme-primary)}.user-menu{padding:0;margin:0;list-style:none;color:var(--theme-medium)}.user-menu li{display:flex;flex-direction:row;align-items:center;gap:10px;padding:8px 16px;font-weight:600;text-transform:uppercase;cursor:pointer;border-radius:5px;transition:background-color .15s ease,color .15s ease}.user-menu li:hover,.user-menu li:focus{background-color:var(--theme-medium);color:#fff;outline:none}.user-menu li:hover .user-menu-icon i,.user-menu li:focus .user-menu-icon i{color:#fff}.user-menu li.menu-separator{margin:5px auto;padding:0;border-top:1px solid #eeeeee;height:2px}.user-menu li.menu-separator:hover{cursor:default;background:none!important;outline:none}.user-menu li .user-menu-icon{display:flex;align-items:center;justify-content:center;width:20px;height:20px}.user-menu li .user-menu-icon i{color:var(--theme-medium);font-size:1.1em;transition:color .15s ease}.add-account{color:#fff;font-size:1.1em;padding:10px;margin:0;font-weight:400;letter-spacing:.25px;cursor:pointer}@media screen and (max-width:441px){.hidden-items{display:none!important}}.notifications-header{display:flex;align-items:center;gap:8px}.notifications-header .notifications-vector-logo{background-image:url(/assets/images/vector_logo_horizontal.svg);background-repeat:no-repeat;background-position:right;background-size:cover;height:12px;width:30px}.notifications-header .notifications-title{text-transform:uppercase;color:var(--gray-dark);font-weight:600}::ng-deep .p-popover.background-white{background-color:#fff!important;border:1px solid #d9dbe9!important;box-shadow:0 1px 2px #1f29371a,0 2px 4px #1f29371a,0 4px 8px #1f29371a,0 8px 16px #1f29371a!important;padding:3px!important}::ng-deep .p-popover.background-white .p-popover-content{padding:8px 0!important}.notifications-list{max-height:400px;overflow:auto;margin-top:10px}.notifications-list .notification-item{cursor:pointer;position:relative;padding:5px 10px;border-radius:5px;text-align:center;transition:background-color .15s ease,color .15s ease}.notifications-list .notification-item:hover,.notifications-list .notification-item:focus{background-color:var(--theme-medium)!important;color:#fff;outline:none}.notifications-list .notification-item:hover .notification-title,.notifications-list .notification-item:focus .notification-title{color:#fff}.notifications-list .notification-item:hover em,.notifications-list .notification-item:focus em{color:#fff}.notifications-list .notification-item .notification-title{font-weight:600;text-transform:uppercase;position:relative;display:inline-block;color:var(--theme-medium)}.notifications-list .notification-item .notification-title .notification-item-indicator{position:absolute;top:-4px;right:-12px;width:8px;height:8px;border-radius:50%;background-color:var(--error-color);margin:0}.notifications-list .notification-item span{font-weight:500;margin-right:20px}.notifications-list .notification-item em{position:absolute;right:10px;bottom:10px;color:var(--theme-primary)}\n"] }]
|
|
7525
7593
|
}], ctorParameters: () => [{ type: MenuService }, { type: AuthService }, { type: i1$2.Router }, { type: ProfileService }, { type: StorageService }, { type: NotificationsService }, { type: ErrorMessageService }, { type: undefined, decorators: [{
|
|
7526
7594
|
type: Inject,
|
|
7527
7595
|
args: [APP_NAME]
|
|
@@ -7591,7 +7659,17 @@ function provideVectorPrimeNG() {
|
|
|
7591
7659
|
});
|
|
7592
7660
|
}
|
|
7593
7661
|
|
|
7662
|
+
/**
|
|
7663
|
+
* Deixa a rota abrir quando a lista do CRUD já foi carregada em memória.
|
|
7664
|
+
*
|
|
7665
|
+
* Rota com parâmetro passa direto: a tela se carrega pelo id da URL e não
|
|
7666
|
+
* depende do `dataset$`, que nasce vazio a cada carga. Sem essa saída, abrir um
|
|
7667
|
+
* detalhe por link, favorito ou aba duplicada voltava para a listagem.
|
|
7668
|
+
*/
|
|
7594
7669
|
const crudListHasItemsGuard = (routeSnapshot) => {
|
|
7670
|
+
if (Object.keys(routeSnapshot.params).length) {
|
|
7671
|
+
return true;
|
|
7672
|
+
}
|
|
7595
7673
|
const serviceType = routeSnapshot.data['service'];
|
|
7596
7674
|
if (!serviceType) {
|
|
7597
7675
|
console.error('You forgot to add the service declaration to route "data" property.');
|
|
@@ -7636,15 +7714,21 @@ const getTokenByGuidGuard = (route) => {
|
|
|
7636
7714
|
return false;
|
|
7637
7715
|
};
|
|
7638
7716
|
|
|
7717
|
+
/**
|
|
7718
|
+
* Libera a rota conforme as permissões do perfil.
|
|
7719
|
+
*
|
|
7720
|
+
* Espera o perfil antes de decidir: ausente não é o mesmo que negado. Com ele
|
|
7721
|
+
* já carregado, `ensureProfileLoaded` responde de forma síncrona.
|
|
7722
|
+
*/
|
|
7639
7723
|
const hasPermissionGuard = (routeSnapshot) => {
|
|
7640
7724
|
const profileService = inject(ProfileService);
|
|
7641
7725
|
const router = inject(Router);
|
|
7642
7726
|
const appName = inject(APP_NAME);
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7727
|
+
return profileService
|
|
7728
|
+
.ensureProfileLoaded()
|
|
7729
|
+
.pipe(map(() => profileService.userHasPermission(routeSnapshot.data['permission'])
|
|
7730
|
+
? true
|
|
7731
|
+
: router.createUrlTree([appName.toLowerCase()])));
|
|
7648
7732
|
};
|
|
7649
7733
|
|
|
7650
7734
|
const roleGuard = (routeSnapshot) => {
|
|
@@ -7657,15 +7741,29 @@ const roleGuard = (routeSnapshot) => {
|
|
|
7657
7741
|
return router.createUrlTree(['']);
|
|
7658
7742
|
};
|
|
7659
7743
|
|
|
7744
|
+
/**
|
|
7745
|
+
* Exige token para a rota e garante o perfil carregado antes de ativá-la.
|
|
7746
|
+
*
|
|
7747
|
+
* O perfil entra aqui, e não só nos guards de permissão, porque
|
|
7748
|
+
* `getUserProfile()` grava o `userInfo` que dezenas de componentes leem ao
|
|
7749
|
+
* montar. Numa aba duplicada no Firefox ou no Safari, que não copiam o
|
|
7750
|
+
* sessionStorage, eles estouravam com o dado vazio.
|
|
7751
|
+
*
|
|
7752
|
+
* Cobre as rotas raiz, logo vale para todas as telas abaixo. Com o perfil em
|
|
7753
|
+
* mãos a resposta é síncrona.
|
|
7754
|
+
*/
|
|
7660
7755
|
const tokenIsPresentGuard = (routeSnapshot) => {
|
|
7661
7756
|
const storageService = inject(StorageService);
|
|
7662
7757
|
const authService = inject(AuthService);
|
|
7758
|
+
const profileService = inject(ProfileService);
|
|
7759
|
+
// Este caminho ja carrega o perfil: `getTokenByGuid` encadeia `getUserProfile`.
|
|
7663
7760
|
if (routeSnapshot.queryParams['tokenGuid']) {
|
|
7664
7761
|
return firstValueFrom(authService.getTokenByGuid(routeSnapshot.queryParams['tokenGuid'])).then((response) => !!response.accessToken);
|
|
7665
7762
|
}
|
|
7666
|
-
|
|
7667
|
-
return
|
|
7763
|
+
if (!storageService.getToken()) {
|
|
7764
|
+
return false;
|
|
7668
7765
|
}
|
|
7766
|
+
return profileService.ensureProfileLoaded().pipe(map(() => true));
|
|
7669
7767
|
};
|
|
7670
7768
|
|
|
7671
7769
|
class HttpInterceptorProvider {
|