@trudb/tru-common-lib 0.0.663 → 0.0.664
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/esm2020/lib/components/toolbar/user-profile/tru-toolbar-user-profile.mjs +16 -9
- package/fesm2015/trudb-tru-common-lib.mjs +100 -94
- package/fesm2015/trudb-tru-common-lib.mjs.map +1 -1
- package/fesm2020/trudb-tru-common-lib.mjs +98 -92
- package/fesm2020/trudb-tru-common-lib.mjs.map +1 -1
- package/lib/components/toolbar/user-profile/tru-toolbar-user-profile.d.ts +5 -1
- package/package.json +1 -1
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import { Component, ViewEncapsulation } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
import * as i1 from "../../../services/tru-app-environment";
|
|
4
|
-
import * as i2 from "
|
|
5
|
-
import * as i3 from "@angular/material/
|
|
6
|
-
import * as i4 from "@angular/material/
|
|
4
|
+
import * as i2 from "../../login/services/tru-auth";
|
|
5
|
+
import * as i3 from "@angular/material/menu";
|
|
6
|
+
import * as i4 from "@angular/material/button";
|
|
7
|
+
import * as i5 from "@angular/material/icon";
|
|
7
8
|
export class TruToolbarUserProfile {
|
|
8
|
-
constructor(appEnvironment) {
|
|
9
|
+
constructor(appEnvironment, auth) {
|
|
9
10
|
this.appEnvironment = appEnvironment;
|
|
11
|
+
this.auth = auth;
|
|
12
|
+
this.onChangePasswordButtonClicked = () => {
|
|
13
|
+
};
|
|
14
|
+
this.onLogoutButtonClicked = () => {
|
|
15
|
+
this.auth.logout();
|
|
16
|
+
};
|
|
10
17
|
}
|
|
11
18
|
}
|
|
12
|
-
TruToolbarUserProfile.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruToolbarUserProfile, deps: [{ token: i1.TruAppEnvironment }], target: i0.ɵɵFactoryTarget.Component });
|
|
13
|
-
TruToolbarUserProfile.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", type: TruToolbarUserProfile, selector: "tru-toolbar-user-profile", ngImport: i0, template: "<div class=\"tru-toolbar-user-profile\">\r\n <button mat-mini-fab color=\"primary\" class=\"tru-toolbar-user-profile-user-button\" [matMenuTriggerFor]=\"userMenu\">\r\n N\r\n </button>\r\n</div>\r\n<mat-menu #userMenu=\"matMenu\">\r\n <div class=\"tru-toolbar-user-profile-menu-container\">\r\n <mat-icon class=\"tru-toolbar-user-profile-menu-circle-icon\" [svgIcon]=\"'circle-icon'\">N</mat-icon>\r\n <span class=\"tru-toolbar-user-profile-menu-circle-icon-text\">N</span>\r\n <div class=\"tru-toolbar-user-profile-menu-text-container\">\r\n <p>Noah Dykoski</p>\r\n <p>noah@arkware.com</p>\r\n </div>\r\n <button class=\"tru-toolbar-user-profile-menu-logout-button\" mat-menu-item
|
|
19
|
+
TruToolbarUserProfile.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruToolbarUserProfile, deps: [{ token: i1.TruAppEnvironment }, { token: i2.TruAuth }], target: i0.ɵɵFactoryTarget.Component });
|
|
20
|
+
TruToolbarUserProfile.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", type: TruToolbarUserProfile, selector: "tru-toolbar-user-profile", ngImport: i0, template: "<div class=\"tru-toolbar-user-profile\">\r\n <button mat-mini-fab color=\"primary\" class=\"tru-toolbar-user-profile-user-button\" [matMenuTriggerFor]=\"userMenu\">\r\n N\r\n </button>\r\n</div>\r\n<mat-menu #userMenu=\"matMenu\">\r\n <div class=\"tru-toolbar-user-profile-menu-container\">\r\n <mat-icon class=\"tru-toolbar-user-profile-menu-circle-icon\" [svgIcon]=\"'circle-icon'\">N</mat-icon>\r\n <span class=\"tru-toolbar-user-profile-menu-circle-icon-text\">N</span>\r\n <div class=\"tru-toolbar-user-profile-menu-text-container\">\r\n <p>Noah Dykoski</p>\r\n <p>noah@arkware.com</p>\r\n </div>\r\n <button mat-menu-item\r\n (click)=\"onChangePasswordButtonClicked()\"\r\n class=\"tru-toolbar-user-profile-menu-logout-button\">\r\n Change Password\r\n </button>\r\n <button mat-menu-item\r\n (click)=\"onLogoutButtonClicked()\"\r\n class=\"tru-toolbar-user-profile-menu-logout-button\">\r\n Logout\r\n </button>\r\n </div>\r\n</mat-menu>\r\n", styles: [".tru-toolbar-user-profile{height:25px;float:right}.tru-toolbar-user-profile button{height:23px;width:23px;margin-right:10px;margin-top:1px;font-size:12px;box-shadow:none}.tru-toolbar-user-profile-menu-container{width:250px}.tru-toolbar-user-profile-menu-container mat-icon{height:50px;width:50px;margin:auto;display:flex;justify-content:center;color:#006dcc}.tru-toolbar-user-profile-menu-container p{margin:5px;font-size:14px;text-align:center}.tru-toolbar-user-profile-menu-container .tru-toolbar-user-profile-menu-logout-button{display:flex;justify-content:center}.tru-toolbar-user-profile-menu-text-container{margin-top:-15px}.tru-toolbar-user-profile-menu-circle-icon-text{color:#fff;font-weight:200;font-size:30px;margin-right:12px;display:block;margin-left:12px;display:flex;justify-content:center;position:relative;z-index:100;top:-35px}\n"], dependencies: [{ kind: "component", type: i3.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i3.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i3.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i4.MatMiniFabButton, selector: "button[mat-mini-fab]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
14
21
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruToolbarUserProfile, decorators: [{
|
|
15
22
|
type: Component,
|
|
16
|
-
args: [{ selector: 'tru-toolbar-user-profile', encapsulation: ViewEncapsulation.None, template: "<div class=\"tru-toolbar-user-profile\">\r\n <button mat-mini-fab color=\"primary\" class=\"tru-toolbar-user-profile-user-button\" [matMenuTriggerFor]=\"userMenu\">\r\n N\r\n </button>\r\n</div>\r\n<mat-menu #userMenu=\"matMenu\">\r\n <div class=\"tru-toolbar-user-profile-menu-container\">\r\n <mat-icon class=\"tru-toolbar-user-profile-menu-circle-icon\" [svgIcon]=\"'circle-icon'\">N</mat-icon>\r\n <span class=\"tru-toolbar-user-profile-menu-circle-icon-text\">N</span>\r\n <div class=\"tru-toolbar-user-profile-menu-text-container\">\r\n <p>Noah Dykoski</p>\r\n <p>noah@arkware.com</p>\r\n </div>\r\n <button class=\"tru-toolbar-user-profile-menu-logout-button\" mat-menu-item
|
|
17
|
-
}], ctorParameters: function () { return [{ type: i1.TruAppEnvironment }]; } });
|
|
18
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
23
|
+
args: [{ selector: 'tru-toolbar-user-profile', encapsulation: ViewEncapsulation.None, template: "<div class=\"tru-toolbar-user-profile\">\r\n <button mat-mini-fab color=\"primary\" class=\"tru-toolbar-user-profile-user-button\" [matMenuTriggerFor]=\"userMenu\">\r\n N\r\n </button>\r\n</div>\r\n<mat-menu #userMenu=\"matMenu\">\r\n <div class=\"tru-toolbar-user-profile-menu-container\">\r\n <mat-icon class=\"tru-toolbar-user-profile-menu-circle-icon\" [svgIcon]=\"'circle-icon'\">N</mat-icon>\r\n <span class=\"tru-toolbar-user-profile-menu-circle-icon-text\">N</span>\r\n <div class=\"tru-toolbar-user-profile-menu-text-container\">\r\n <p>Noah Dykoski</p>\r\n <p>noah@arkware.com</p>\r\n </div>\r\n <button mat-menu-item\r\n (click)=\"onChangePasswordButtonClicked()\"\r\n class=\"tru-toolbar-user-profile-menu-logout-button\">\r\n Change Password\r\n </button>\r\n <button mat-menu-item\r\n (click)=\"onLogoutButtonClicked()\"\r\n class=\"tru-toolbar-user-profile-menu-logout-button\">\r\n Logout\r\n </button>\r\n </div>\r\n</mat-menu>\r\n", styles: [".tru-toolbar-user-profile{height:25px;float:right}.tru-toolbar-user-profile button{height:23px;width:23px;margin-right:10px;margin-top:1px;font-size:12px;box-shadow:none}.tru-toolbar-user-profile-menu-container{width:250px}.tru-toolbar-user-profile-menu-container mat-icon{height:50px;width:50px;margin:auto;display:flex;justify-content:center;color:#006dcc}.tru-toolbar-user-profile-menu-container p{margin:5px;font-size:14px;text-align:center}.tru-toolbar-user-profile-menu-container .tru-toolbar-user-profile-menu-logout-button{display:flex;justify-content:center}.tru-toolbar-user-profile-menu-text-container{margin-top:-15px}.tru-toolbar-user-profile-menu-circle-icon-text{color:#fff;font-weight:200;font-size:30px;margin-right:12px;display:block;margin-left:12px;display:flex;justify-content:center;position:relative;z-index:100;top:-35px}\n"] }]
|
|
24
|
+
}], ctorParameters: function () { return [{ type: i1.TruAppEnvironment }, { type: i2.TruAuth }]; } });
|
|
25
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJ1LXRvb2xiYXItdXNlci1wcm9maWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdHJ1LWNvbW1vbi1saWIvc3JjL2xpYi9jb21wb25lbnRzL3Rvb2xiYXIvdXNlci1wcm9maWxlL3RydS10b29sYmFyLXVzZXItcHJvZmlsZS50cyIsIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3RydS1jb21tb24tbGliL3NyYy9saWIvY29tcG9uZW50cy90b29sYmFyL3VzZXItcHJvZmlsZS90cnUtdG9vbGJhci11c2VyLXByb2ZpbGUuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLGlCQUFpQixFQUFF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XByb2ZpbGUtbWVudS10ZXh0LWNvbnRhaW5lclwiPlxyXG4gICAgICA8cD5Ob2FoIER5a29za2k8L3A+XHJcbiAgICAgIDxwPm5vYWhAYXJrd2FyZS5jb208L3A+XHJcbiAgICA8L2Rpdj5cclxuICAgIDxidXR0b24gbWF0LW1lbnUtaXRlbVxyXG4gICAgICAgICAgICAoY2xpY2spPVwib25DaGFuZ2VQYXNzd29yZEJ1dHRvbkNsaWNrZWQoKVwiXHJcbiAgICAgICAgICAgIGNsYXNzPVwidHJ1LXRvb2xiYXItdXNlci1wcm9maWxlLW1lbnUtbG9nb3V0LWJ1dHRvblwiPlxyXG4gICAgICBDaGFuZ2UgUGFzc3dvcmRcclxuICAgIDwvYnV0dG9uPlxyXG4gICAgPGJ1dHRvbiBtYXQtbWVudS1pdGVtXHJcbiAgICAgICAgICAgIChjbGljayk9XCJvbkxvZ291dEJ1dHRvbkNsaWNrZWQoKVwiXHJcbiAgICAgICAgICAgIGNsYXNzPVwidHJ1LXRvb2xiYXItdXNlci1wcm9maWxlLW1lbnUtbG9nb3V0LWJ1dHRvblwiPlxyXG4gICAgICBMb2dvdXRcclxuICAgIDwvYnV0dG9uPlxyXG4gIDwvZGl2PlxyXG48L21hdC1tZW51PlxyXG4iXX0=
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, Input, Injectable, Component, Inject, HostListener, NgModule, EventEmitter, ViewEncapsulation, Output, APP_INITIALIZER, ViewChildren, ViewChild
|
|
2
|
+
import { Directive, Input, Injectable, Component, Inject, HostListener, NgModule, EventEmitter, ViewEncapsulation, Output, InjectionToken, APP_INITIALIZER, ViewChildren, ViewChild } from '@angular/core';
|
|
3
3
|
import { EntityAspect, MetadataStore, EntityManager, DataService, EntityQuery, Predicate, FetchStrategy, EntityState, EntityAction, BinaryPredicate, AndOrPredicate, breeze } from 'breeze-client';
|
|
4
4
|
import { BehaviorSubject, defer, from, of, Subject, Observable, skip, forkJoin, throwError } from 'rxjs';
|
|
5
5
|
import * as _ from 'underscore';
|
|
@@ -43,7 +43,7 @@ import { MatIconModule } from '@angular/material/icon';
|
|
|
43
43
|
import * as i5$1 from '@angular/material/input';
|
|
44
44
|
import { MatInputModule } from '@angular/material/input';
|
|
45
45
|
import { MatListModule } from '@angular/material/list';
|
|
46
|
-
import * as
|
|
46
|
+
import * as i3$3 from '@angular/material/menu';
|
|
47
47
|
import { MatMenuModule } from '@angular/material/menu';
|
|
48
48
|
import * as i5 from '@angular/material/core';
|
|
49
49
|
import { MatNativeDateModule, MatRippleModule, MatOptionModule } from '@angular/material/core';
|
|
@@ -71,12 +71,12 @@ import moment$1 from 'moment';
|
|
|
71
71
|
import * as i8 from 'ag-grid-angular';
|
|
72
72
|
import { AgGridModule } from 'ag-grid-angular';
|
|
73
73
|
import * as i3$2 from '@angular/material/form-field';
|
|
74
|
-
import * as i1$7 from '@angular/platform-browser';
|
|
75
|
-
import { BrowserModule } from '@angular/platform-browser';
|
|
76
|
-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
77
74
|
import { tap, map, catchError } from 'rxjs/operators';
|
|
78
75
|
import * as i1$6 from '@angular/router';
|
|
79
76
|
import { RouterModule } from '@angular/router';
|
|
77
|
+
import * as i1$7 from '@angular/platform-browser';
|
|
78
|
+
import { BrowserModule } from '@angular/platform-browser';
|
|
79
|
+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
80
80
|
|
|
81
81
|
class TruComponentConfigBase {
|
|
82
82
|
constructor() { }
|
|
@@ -3568,17 +3568,107 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImpor
|
|
|
3568
3568
|
}]
|
|
3569
3569
|
}] });
|
|
3570
3570
|
|
|
3571
|
+
const TRU_AUTH_CONFIG = {
|
|
3572
|
+
baseUrl: "https://localhost:44303",
|
|
3573
|
+
authUrl: "/api/auth",
|
|
3574
|
+
auth: "token",
|
|
3575
|
+
};
|
|
3576
|
+
const TRU_AUTH_STRATEGY = new InjectionToken("AuthStrategy");
|
|
3577
|
+
|
|
3578
|
+
class TruAuthCache {
|
|
3579
|
+
constructor() {
|
|
3580
|
+
this.prunables = [];
|
|
3581
|
+
}
|
|
3582
|
+
registerPrunable(prunable) {
|
|
3583
|
+
this.prunables.push(prunable);
|
|
3584
|
+
}
|
|
3585
|
+
pruneAll() {
|
|
3586
|
+
this.prunables.forEach((p) => p.pruneCache());
|
|
3587
|
+
}
|
|
3588
|
+
}
|
|
3589
|
+
TruAuthCache.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruAuthCache, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3590
|
+
TruAuthCache.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruAuthCache, providedIn: "root" });
|
|
3591
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruAuthCache, decorators: [{
|
|
3592
|
+
type: Injectable,
|
|
3593
|
+
args: [{
|
|
3594
|
+
providedIn: "root",
|
|
3595
|
+
}]
|
|
3596
|
+
}] });
|
|
3597
|
+
|
|
3598
|
+
class TruAuth {
|
|
3599
|
+
constructor(router, http, cache, environment, auth) {
|
|
3600
|
+
this.router = router;
|
|
3601
|
+
this.http = http;
|
|
3602
|
+
this.cache = cache;
|
|
3603
|
+
this.environment = environment;
|
|
3604
|
+
this.auth = auth;
|
|
3605
|
+
this.loggedIn = new BehaviorSubject(false);
|
|
3606
|
+
this.baseUrl = '';
|
|
3607
|
+
this.baseUrl = this.environment.appUri;
|
|
3608
|
+
}
|
|
3609
|
+
login(loginRequest) {
|
|
3610
|
+
return this.http
|
|
3611
|
+
.post(`${this.baseUrl}${TRU_AUTH_CONFIG.authUrl}/login`, loginRequest)
|
|
3612
|
+
.pipe(tap((data) => {
|
|
3613
|
+
this.auth.doLoginUser(data);
|
|
3614
|
+
this.loggedIn.next(true);
|
|
3615
|
+
}));
|
|
3616
|
+
}
|
|
3617
|
+
logout() {
|
|
3618
|
+
this.doLogoutUser();
|
|
3619
|
+
}
|
|
3620
|
+
isLoggedIn$() {
|
|
3621
|
+
return this.auth.getCurrentUser().pipe(map(() => true), catchError(() => of(false)));
|
|
3622
|
+
}
|
|
3623
|
+
get isLoggedIn() {
|
|
3624
|
+
if (!this.loggedIn.value) {
|
|
3625
|
+
this.loggedIn.next(this.auth.isLoggedIn());
|
|
3626
|
+
}
|
|
3627
|
+
return this.loggedIn.asObservable();
|
|
3628
|
+
}
|
|
3629
|
+
getCurrentUser$() {
|
|
3630
|
+
return this.auth.getCurrentUser();
|
|
3631
|
+
}
|
|
3632
|
+
doLogoutAndRedirectToLogin() {
|
|
3633
|
+
this.doLogoutUser();
|
|
3634
|
+
this.router.navigate([""]);
|
|
3635
|
+
}
|
|
3636
|
+
doLogoutUser() {
|
|
3637
|
+
this.cache.pruneAll();
|
|
3638
|
+
this.auth.doLogoutUser();
|
|
3639
|
+
}
|
|
3640
|
+
}
|
|
3641
|
+
TruAuth.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruAuth, deps: [{ token: i1$6.Router }, { token: i1$3.HttpClient }, { token: TruAuthCache }, { token: TruAppEnvironment }, { token: TRU_AUTH_STRATEGY }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3642
|
+
TruAuth.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruAuth, providedIn: "root" });
|
|
3643
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruAuth, decorators: [{
|
|
3644
|
+
type: Injectable,
|
|
3645
|
+
args: [{
|
|
3646
|
+
providedIn: "root",
|
|
3647
|
+
}]
|
|
3648
|
+
}], ctorParameters: function () {
|
|
3649
|
+
return [{ type: i1$6.Router }, { type: i1$3.HttpClient }, { type: TruAuthCache }, { type: TruAppEnvironment }, { type: undefined, decorators: [{
|
|
3650
|
+
type: Inject,
|
|
3651
|
+
args: [TRU_AUTH_STRATEGY]
|
|
3652
|
+
}] }];
|
|
3653
|
+
} });
|
|
3654
|
+
|
|
3571
3655
|
class TruToolbarUserProfile {
|
|
3572
|
-
constructor(appEnvironment) {
|
|
3656
|
+
constructor(appEnvironment, auth) {
|
|
3573
3657
|
this.appEnvironment = appEnvironment;
|
|
3658
|
+
this.auth = auth;
|
|
3659
|
+
this.onChangePasswordButtonClicked = () => {
|
|
3660
|
+
};
|
|
3661
|
+
this.onLogoutButtonClicked = () => {
|
|
3662
|
+
this.auth.logout();
|
|
3663
|
+
};
|
|
3574
3664
|
}
|
|
3575
3665
|
}
|
|
3576
|
-
TruToolbarUserProfile.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruToolbarUserProfile, deps: [{ token: TruAppEnvironment }], target: i0.ɵɵFactoryTarget.Component });
|
|
3577
|
-
TruToolbarUserProfile.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", type: TruToolbarUserProfile, selector: "tru-toolbar-user-profile", ngImport: i0, template: "<div class=\"tru-toolbar-user-profile\">\r\n <button mat-mini-fab color=\"primary\" class=\"tru-toolbar-user-profile-user-button\" [matMenuTriggerFor]=\"userMenu\">\r\n N\r\n </button>\r\n</div>\r\n<mat-menu #userMenu=\"matMenu\">\r\n <div class=\"tru-toolbar-user-profile-menu-container\">\r\n <mat-icon class=\"tru-toolbar-user-profile-menu-circle-icon\" [svgIcon]=\"'circle-icon'\">N</mat-icon>\r\n <span class=\"tru-toolbar-user-profile-menu-circle-icon-text\">N</span>\r\n <div class=\"tru-toolbar-user-profile-menu-text-container\">\r\n <p>Noah Dykoski</p>\r\n <p>noah@arkware.com</p>\r\n </div>\r\n <button class=\"tru-toolbar-user-profile-menu-logout-button\" mat-menu-item
|
|
3666
|
+
TruToolbarUserProfile.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruToolbarUserProfile, deps: [{ token: TruAppEnvironment }, { token: TruAuth }], target: i0.ɵɵFactoryTarget.Component });
|
|
3667
|
+
TruToolbarUserProfile.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", type: TruToolbarUserProfile, selector: "tru-toolbar-user-profile", ngImport: i0, template: "<div class=\"tru-toolbar-user-profile\">\r\n <button mat-mini-fab color=\"primary\" class=\"tru-toolbar-user-profile-user-button\" [matMenuTriggerFor]=\"userMenu\">\r\n N\r\n </button>\r\n</div>\r\n<mat-menu #userMenu=\"matMenu\">\r\n <div class=\"tru-toolbar-user-profile-menu-container\">\r\n <mat-icon class=\"tru-toolbar-user-profile-menu-circle-icon\" [svgIcon]=\"'circle-icon'\">N</mat-icon>\r\n <span class=\"tru-toolbar-user-profile-menu-circle-icon-text\">N</span>\r\n <div class=\"tru-toolbar-user-profile-menu-text-container\">\r\n <p>Noah Dykoski</p>\r\n <p>noah@arkware.com</p>\r\n </div>\r\n <button mat-menu-item\r\n (click)=\"onChangePasswordButtonClicked()\"\r\n class=\"tru-toolbar-user-profile-menu-logout-button\">\r\n Change Password\r\n </button>\r\n <button mat-menu-item\r\n (click)=\"onLogoutButtonClicked()\"\r\n class=\"tru-toolbar-user-profile-menu-logout-button\">\r\n Logout\r\n </button>\r\n </div>\r\n</mat-menu>\r\n", styles: [".tru-toolbar-user-profile{height:25px;float:right}.tru-toolbar-user-profile button{height:23px;width:23px;margin-right:10px;margin-top:1px;font-size:12px;box-shadow:none}.tru-toolbar-user-profile-menu-container{width:250px}.tru-toolbar-user-profile-menu-container mat-icon{height:50px;width:50px;margin:auto;display:flex;justify-content:center;color:#006dcc}.tru-toolbar-user-profile-menu-container p{margin:5px;font-size:14px;text-align:center}.tru-toolbar-user-profile-menu-container .tru-toolbar-user-profile-menu-logout-button{display:flex;justify-content:center}.tru-toolbar-user-profile-menu-text-container{margin-top:-15px}.tru-toolbar-user-profile-menu-circle-icon-text{color:#fff;font-weight:200;font-size:30px;margin-right:12px;display:block;margin-left:12px;display:flex;justify-content:center;position:relative;z-index:100;top:-35px}\n"], dependencies: [{ kind: "component", type: i3$3.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i3$3.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i3$3.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i3.MatMiniFabButton, selector: "button[mat-mini-fab]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
3578
3668
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruToolbarUserProfile, decorators: [{
|
|
3579
3669
|
type: Component,
|
|
3580
|
-
args: [{ selector: 'tru-toolbar-user-profile', encapsulation: ViewEncapsulation.None, template: "<div class=\"tru-toolbar-user-profile\">\r\n <button mat-mini-fab color=\"primary\" class=\"tru-toolbar-user-profile-user-button\" [matMenuTriggerFor]=\"userMenu\">\r\n N\r\n </button>\r\n</div>\r\n<mat-menu #userMenu=\"matMenu\">\r\n <div class=\"tru-toolbar-user-profile-menu-container\">\r\n <mat-icon class=\"tru-toolbar-user-profile-menu-circle-icon\" [svgIcon]=\"'circle-icon'\">N</mat-icon>\r\n <span class=\"tru-toolbar-user-profile-menu-circle-icon-text\">N</span>\r\n <div class=\"tru-toolbar-user-profile-menu-text-container\">\r\n <p>Noah Dykoski</p>\r\n <p>noah@arkware.com</p>\r\n </div>\r\n <button class=\"tru-toolbar-user-profile-menu-logout-button\" mat-menu-item
|
|
3581
|
-
}], ctorParameters: function () { return [{ type: TruAppEnvironment }]; } });
|
|
3670
|
+
args: [{ selector: 'tru-toolbar-user-profile', encapsulation: ViewEncapsulation.None, template: "<div class=\"tru-toolbar-user-profile\">\r\n <button mat-mini-fab color=\"primary\" class=\"tru-toolbar-user-profile-user-button\" [matMenuTriggerFor]=\"userMenu\">\r\n N\r\n </button>\r\n</div>\r\n<mat-menu #userMenu=\"matMenu\">\r\n <div class=\"tru-toolbar-user-profile-menu-container\">\r\n <mat-icon class=\"tru-toolbar-user-profile-menu-circle-icon\" [svgIcon]=\"'circle-icon'\">N</mat-icon>\r\n <span class=\"tru-toolbar-user-profile-menu-circle-icon-text\">N</span>\r\n <div class=\"tru-toolbar-user-profile-menu-text-container\">\r\n <p>Noah Dykoski</p>\r\n <p>noah@arkware.com</p>\r\n </div>\r\n <button mat-menu-item\r\n (click)=\"onChangePasswordButtonClicked()\"\r\n class=\"tru-toolbar-user-profile-menu-logout-button\">\r\n Change Password\r\n </button>\r\n <button mat-menu-item\r\n (click)=\"onLogoutButtonClicked()\"\r\n class=\"tru-toolbar-user-profile-menu-logout-button\">\r\n Logout\r\n </button>\r\n </div>\r\n</mat-menu>\r\n", styles: [".tru-toolbar-user-profile{height:25px;float:right}.tru-toolbar-user-profile button{height:23px;width:23px;margin-right:10px;margin-top:1px;font-size:12px;box-shadow:none}.tru-toolbar-user-profile-menu-container{width:250px}.tru-toolbar-user-profile-menu-container mat-icon{height:50px;width:50px;margin:auto;display:flex;justify-content:center;color:#006dcc}.tru-toolbar-user-profile-menu-container p{margin:5px;font-size:14px;text-align:center}.tru-toolbar-user-profile-menu-container .tru-toolbar-user-profile-menu-logout-button{display:flex;justify-content:center}.tru-toolbar-user-profile-menu-text-container{margin-top:-15px}.tru-toolbar-user-profile-menu-circle-icon-text{color:#fff;font-weight:200;font-size:30px;margin-right:12px;display:block;margin-left:12px;display:flex;justify-content:center;position:relative;z-index:100;top:-35px}\n"] }]
|
|
3671
|
+
}], ctorParameters: function () { return [{ type: TruAppEnvironment }, { type: TruAuth }]; } });
|
|
3582
3672
|
|
|
3583
3673
|
class TruToolbarUserProfileModule {
|
|
3584
3674
|
}
|
|
@@ -5705,90 +5795,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImpor
|
|
|
5705
5795
|
}]
|
|
5706
5796
|
}] });
|
|
5707
5797
|
|
|
5708
|
-
const TRU_AUTH_CONFIG = {
|
|
5709
|
-
baseUrl: "https://localhost:44303",
|
|
5710
|
-
authUrl: "/api/auth",
|
|
5711
|
-
auth: "token",
|
|
5712
|
-
};
|
|
5713
|
-
const TRU_AUTH_STRATEGY = new InjectionToken("AuthStrategy");
|
|
5714
|
-
|
|
5715
|
-
class TruAuthCache {
|
|
5716
|
-
constructor() {
|
|
5717
|
-
this.prunables = [];
|
|
5718
|
-
}
|
|
5719
|
-
registerPrunable(prunable) {
|
|
5720
|
-
this.prunables.push(prunable);
|
|
5721
|
-
}
|
|
5722
|
-
pruneAll() {
|
|
5723
|
-
this.prunables.forEach((p) => p.pruneCache());
|
|
5724
|
-
}
|
|
5725
|
-
}
|
|
5726
|
-
TruAuthCache.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruAuthCache, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5727
|
-
TruAuthCache.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruAuthCache, providedIn: "root" });
|
|
5728
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruAuthCache, decorators: [{
|
|
5729
|
-
type: Injectable,
|
|
5730
|
-
args: [{
|
|
5731
|
-
providedIn: "root",
|
|
5732
|
-
}]
|
|
5733
|
-
}] });
|
|
5734
|
-
|
|
5735
|
-
class TruAuth {
|
|
5736
|
-
constructor(router, http, cache, environment, auth) {
|
|
5737
|
-
this.router = router;
|
|
5738
|
-
this.http = http;
|
|
5739
|
-
this.cache = cache;
|
|
5740
|
-
this.environment = environment;
|
|
5741
|
-
this.auth = auth;
|
|
5742
|
-
this.loggedIn = new BehaviorSubject(false);
|
|
5743
|
-
this.baseUrl = '';
|
|
5744
|
-
this.baseUrl = this.environment.appUri;
|
|
5745
|
-
}
|
|
5746
|
-
login(loginRequest) {
|
|
5747
|
-
return this.http
|
|
5748
|
-
.post(`${this.baseUrl}${TRU_AUTH_CONFIG.authUrl}/login`, loginRequest)
|
|
5749
|
-
.pipe(tap((data) => {
|
|
5750
|
-
this.auth.doLoginUser(data);
|
|
5751
|
-
this.loggedIn.next(true);
|
|
5752
|
-
}));
|
|
5753
|
-
}
|
|
5754
|
-
logout() {
|
|
5755
|
-
this.doLogoutUser();
|
|
5756
|
-
}
|
|
5757
|
-
isLoggedIn$() {
|
|
5758
|
-
return this.auth.getCurrentUser().pipe(map(() => true), catchError(() => of(false)));
|
|
5759
|
-
}
|
|
5760
|
-
get isLoggedIn() {
|
|
5761
|
-
if (!this.loggedIn.value) {
|
|
5762
|
-
this.loggedIn.next(this.auth.isLoggedIn());
|
|
5763
|
-
}
|
|
5764
|
-
return this.loggedIn.asObservable();
|
|
5765
|
-
}
|
|
5766
|
-
getCurrentUser$() {
|
|
5767
|
-
return this.auth.getCurrentUser();
|
|
5768
|
-
}
|
|
5769
|
-
doLogoutAndRedirectToLogin() {
|
|
5770
|
-
this.doLogoutUser();
|
|
5771
|
-
this.router.navigate([""]);
|
|
5772
|
-
}
|
|
5773
|
-
doLogoutUser() {
|
|
5774
|
-
this.cache.pruneAll();
|
|
5775
|
-
this.auth.doLogoutUser();
|
|
5776
|
-
}
|
|
5777
|
-
}
|
|
5778
|
-
TruAuth.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruAuth, deps: [{ token: i1$6.Router }, { token: i1$3.HttpClient }, { token: TruAuthCache }, { token: TruAppEnvironment }, { token: TRU_AUTH_STRATEGY }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5779
|
-
TruAuth.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruAuth, providedIn: "root" });
|
|
5780
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruAuth, decorators: [{
|
|
5781
|
-
type: Injectable,
|
|
5782
|
-
args: [{
|
|
5783
|
-
providedIn: "root",
|
|
5784
|
-
}]
|
|
5785
|
-
}], ctorParameters: function () {
|
|
5786
|
-
return [{ type: i1$6.Router }, { type: i1$3.HttpClient }, { type: TruAuthCache }, { type: TruAppEnvironment }, { type: undefined, decorators: [{
|
|
5787
|
-
type: Inject,
|
|
5788
|
-
args: [TRU_AUTH_STRATEGY]
|
|
5789
|
-
}] }];
|
|
5790
|
-
} });
|
|
5791
|
-
|
|
5792
5798
|
class TruLogin {
|
|
5793
5799
|
constructor(auth) {
|
|
5794
5800
|
this.auth = auth;
|