Showing
5 changed files
with
15 additions
and
11 deletions
@@ -86,12 +86,12 @@ | @@ -86,12 +86,12 @@ | ||
86 | </div> | 86 | </div> |
87 | <div fxLayout="row" fxLayoutAlign=" center" style="padding-bottom: 16px;"> | 87 | <div fxLayout="row" fxLayoutAlign=" center" style="padding-bottom: 16px;"> |
88 | <button mat-raised-button ngxClipboard | 88 | <button mat-raised-button ngxClipboard |
89 | - (cbOnSuccess)="onTokenCopied($event)" | ||
90 | - [cbContent]="token"> | 89 | + (cbOnSuccess)="onTokenCopied()" |
90 | + [cbContent]="jwtToken"> | ||
91 | <mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon> | 91 | <mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon> |
92 | <span>{{ 'profile.copy-jwt-token' | translate }}</span> | 92 | <span>{{ 'profile.copy-jwt-token' | translate }}</span> |
93 | </button> | 93 | </button> |
94 | - <span style="padding: 10px; opacity: 0.7;">{{getExpirationDate}}</span> | 94 | + <span class="profile-btn-subtext">{{ expirationJwtData }}</span> |
95 | </div> | 95 | </div> |
96 | <div fxLayout="row" class="layout-wrap"> | 96 | <div fxLayout="row" class="layout-wrap"> |
97 | <span fxFlex></span> | 97 | <span fxFlex></span> |
@@ -38,6 +38,10 @@ | @@ -38,6 +38,10 @@ | ||
38 | font-size: 16px; | 38 | font-size: 16px; |
39 | font-weight: 400; | 39 | font-weight: 400; |
40 | } | 40 | } |
41 | + .profile-btn-subtext { | ||
42 | + opacity: 0.7; | ||
43 | + padding: 10px; | ||
44 | + } | ||
41 | .tb-home-dashboard { | 45 | .tb-home-dashboard { |
42 | tb-dashboard-autocomplete { | 46 | tb-dashboard-autocomplete { |
43 | @media #{$mat-gt-sm} { | 47 | @media #{$mat-gt-sm} { |
@@ -34,7 +34,7 @@ import { AuthService } from '@core/auth/auth.service'; | @@ -34,7 +34,7 @@ import { AuthService } from '@core/auth/auth.service'; | ||
34 | import { ActivatedRoute } from '@angular/router'; | 34 | import { ActivatedRoute } from '@angular/router'; |
35 | import { isDefinedAndNotNull } from '@core/utils'; | 35 | import { isDefinedAndNotNull } from '@core/utils'; |
36 | import { getCurrentAuthUser } from '@core/auth/auth.selectors'; | 36 | import { getCurrentAuthUser } from '@core/auth/auth.selectors'; |
37 | -import {ActionNotificationShow} from "@core/notification/notification.actions"; | 37 | +import { ActionNotificationShow } from '@core/notification/notification.actions'; |
38 | import { DatePipe } from '@angular/common'; | 38 | import { DatePipe } from '@angular/common'; |
39 | 39 | ||
40 | @Component({ | 40 | @Component({ |
@@ -50,14 +50,14 @@ export class ProfileComponent extends PageComponent implements OnInit, HasConfir | @@ -50,14 +50,14 @@ export class ProfileComponent extends PageComponent implements OnInit, HasConfir | ||
50 | languageList = env.supportedLangs; | 50 | languageList = env.supportedLangs; |
51 | private readonly authUser: AuthUser; | 51 | private readonly authUser: AuthUser; |
52 | 52 | ||
53 | - get token() { | 53 | + get jwtToken(): string { |
54 | return `Bearer ${localStorage.getItem('jwt_token')}`; | 54 | return `Bearer ${localStorage.getItem('jwt_token')}`; |
55 | } | 55 | } |
56 | 56 | ||
57 | - get getExpirationDate() { | 57 | + get expirationJwtData(): string { |
58 | const expirationData = this.datePipe.transform(localStorage.getItem('jwt_token_expiration'), 'yyyy-MM-dd HH:mm:ss'); | 58 | const expirationData = this.datePipe.transform(localStorage.getItem('jwt_token_expiration'), 'yyyy-MM-dd HH:mm:ss'); |
59 | - return this.translate.instant('profile.valid-till', {expirationData}); | ||
60 | - }; | 59 | + return this.translate.instant('profile.valid-till', { expirationData }); |
60 | + } | ||
61 | 61 | ||
62 | constructor(protected store: Store<AppState>, | 62 | constructor(protected store: Store<AppState>, |
63 | private route: ActivatedRoute, | 63 | private route: ActivatedRoute, |
@@ -153,7 +153,7 @@ export class ProfileComponent extends PageComponent implements OnInit, HasConfir | @@ -153,7 +153,7 @@ export class ProfileComponent extends PageComponent implements OnInit, HasConfir | ||
153 | return this.authUser.authority === Authority.SYS_ADMIN; | 153 | return this.authUser.authority === Authority.SYS_ADMIN; |
154 | } | 154 | } |
155 | 155 | ||
156 | - onTokenCopied($event) { | 156 | + onTokenCopied() { |
157 | this.store.dispatch(new ActionNotificationShow({ | 157 | this.store.dispatch(new ActionNotificationShow({ |
158 | message: this.translate.instant('profile.tokenCopiedMessage'), | 158 | message: this.translate.instant('profile.tokenCopiedMessage'), |
159 | type: 'success', | 159 | type: 'success', |
@@ -1264,7 +1264,7 @@ | @@ -1264,7 +1264,7 @@ | ||
1264 | "change-password": "Изменить пароль", | 1264 | "change-password": "Изменить пароль", |
1265 | "current-password": "Текущий пароль", | 1265 | "current-password": "Текущий пароль", |
1266 | "copy-jwt-token": "Копировать JWT токен", | 1266 | "copy-jwt-token": "Копировать JWT токен", |
1267 | - "valid-till": "Годен до {{expirationData}}", | 1267 | + "valid-till": "Действителен до {{expirationData}}", |
1268 | "tokenCopiedMessage": "JWT токен скопирован в буфер обмена" | 1268 | "tokenCopiedMessage": "JWT токен скопирован в буфер обмена" |
1269 | }, | 1269 | }, |
1270 | "relation": { | 1270 | "relation": { |
@@ -1679,7 +1679,7 @@ | @@ -1679,7 +1679,7 @@ | ||
1679 | "change-password": "Змінити пароль", | 1679 | "change-password": "Змінити пароль", |
1680 | "current-password": "Поточний пароль", | 1680 | "current-password": "Поточний пароль", |
1681 | "copy-jwt-token": "Копіювати JWT токен", | 1681 | "copy-jwt-token": "Копіювати JWT токен", |
1682 | - "valid-till": "Придатний до {{expirationData}}", | 1682 | + "valid-till": "Дійсний до {{expirationData}}", |
1683 | "tokenCopiedMessage": "JWT токен скопійовано в буфер обміну" | 1683 | "tokenCopiedMessage": "JWT токен скопійовано в буфер обміну" |
1684 | }, | 1684 | }, |
1685 | "relation": { | 1685 | "relation": { |