@trudb/tru-common-lib 0.2.522 → 0.2.529
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/fesm2022/trudb-tru-common-lib.mjs +112 -76
- package/fesm2022/trudb-tru-common-lib.mjs.map +1 -1
- package/lib/base-views/detail/tru-detail-view-base.d.ts +1 -0
- package/lib/components/data-grid/tru-data-grid.d.ts +1 -0
- package/lib/components/login/classes/tru-auth-strategy-provider.d.ts +2 -1
- package/lib/components/login/classes/tru-auth-windows-strategy.d.ts +9 -0
- package/lib/components/login/services/tru-auth.d.ts +1 -1
- package/lib/components/login/tru-login.d.ts +6 -2
- package/lib/services/tru-app-environment.d.ts +2 -2
- package/package.json +1 -1
|
@@ -4068,7 +4068,7 @@ class TruAuth {
|
|
|
4068
4068
|
});
|
|
4069
4069
|
}
|
|
4070
4070
|
userClaims() {
|
|
4071
|
-
if (this.appEnvironment.authType === 'session') {
|
|
4071
|
+
if (this.appEnvironment.authType === 'session' || this.appEnvironment.authType === 'windows') {
|
|
4072
4072
|
return this.http
|
|
4073
4073
|
.get(`${this.baseUrl}${TRU_AUTH_CONFIG.authUrl}/userClaims`)
|
|
4074
4074
|
.pipe(tap((userClaims) => {
|
|
@@ -4824,6 +4824,35 @@ class TruDetailViewBase {
|
|
|
4824
4824
|
this.desktopViewEventNotifier = desktopViewEventNotifier;
|
|
4825
4825
|
this.util = util;
|
|
4826
4826
|
}
|
|
4827
|
+
onDocumentKeydown = (event) => {
|
|
4828
|
+
if (this.view.active && this.view.window.active) {
|
|
4829
|
+
let keySequence = this.util.getKeySequence(event);
|
|
4830
|
+
if (keySequence === 'ctrl+i' || keySequence === 'meta+i') {
|
|
4831
|
+
//this.onAddEntity();
|
|
4832
|
+
event.preventDefault();
|
|
4833
|
+
}
|
|
4834
|
+
if (keySequence === 'ctrl+d' || keySequence === 'meta+d') {
|
|
4835
|
+
this.onDeleteEntity();
|
|
4836
|
+
event.preventDefault();
|
|
4837
|
+
}
|
|
4838
|
+
if (keySequence === 'ctrl+up' || keySequence === 'meta+up') {
|
|
4839
|
+
this.onFirstEntity();
|
|
4840
|
+
event.preventDefault();
|
|
4841
|
+
}
|
|
4842
|
+
if (keySequence === 'ctrl+left' || keySequence === 'meta+left') {
|
|
4843
|
+
this.onPreviousEntity();
|
|
4844
|
+
event.preventDefault();
|
|
4845
|
+
}
|
|
4846
|
+
if (keySequence === 'ctrl+right' || keySequence === 'meta+right') {
|
|
4847
|
+
this.onNextEntity();
|
|
4848
|
+
event.preventDefault();
|
|
4849
|
+
}
|
|
4850
|
+
if (keySequence === 'ctrl+down' || keySequence === 'meta+down') {
|
|
4851
|
+
this.onLastEntity();
|
|
4852
|
+
event.preventDefault();
|
|
4853
|
+
}
|
|
4854
|
+
}
|
|
4855
|
+
};
|
|
4827
4856
|
calculateNextIndex = () => {
|
|
4828
4857
|
let nextIndex = 0;
|
|
4829
4858
|
var removedRecords = this.recordsBeforeRevert - this.entities.length;
|
|
@@ -4925,38 +4954,7 @@ class TruDetailViewBase {
|
|
|
4925
4954
|
if (this.active)
|
|
4926
4955
|
this.setEntityDisplayValues(this.tableName);
|
|
4927
4956
|
}));
|
|
4928
|
-
this.subs.push(fromEvent(document, 'keydown').subscribe(
|
|
4929
|
-
if (this.view.active && this.view.window.active) {
|
|
4930
|
-
let keySequence = this.util.getKeySequence(event);
|
|
4931
|
-
if (keySequence === 'ctrl+i' || keySequence === 'meta+i') {
|
|
4932
|
-
//this.onAddEntity();
|
|
4933
|
-
event.preventDefault();
|
|
4934
|
-
}
|
|
4935
|
-
if (keySequence === 'ctrl+d' || keySequence === 'meta+d') {
|
|
4936
|
-
this.onDeleteEntity();
|
|
4937
|
-
event.preventDefault();
|
|
4938
|
-
}
|
|
4939
|
-
if (keySequence === 'ctrl+up' || keySequence === 'meta+up') {
|
|
4940
|
-
this.onFirstEntity();
|
|
4941
|
-
event.preventDefault();
|
|
4942
|
-
}
|
|
4943
|
-
if (keySequence === 'ctrl+left' || keySequence === 'meta+left') {
|
|
4944
|
-
this.onPreviousEntity();
|
|
4945
|
-
event.preventDefault();
|
|
4946
|
-
}
|
|
4947
|
-
if (keySequence === 'ctrl+right' || keySequence === 'meta+right') {
|
|
4948
|
-
this.onNextEntity();
|
|
4949
|
-
event.preventDefault();
|
|
4950
|
-
}
|
|
4951
|
-
if (keySequence === 'ctrl+down' || keySequence === 'meta+down') {
|
|
4952
|
-
this.onLastEntity();
|
|
4953
|
-
event.preventDefault();
|
|
4954
|
-
}
|
|
4955
|
-
var targetIsControl = this.util.targetIsControl(event.target);
|
|
4956
|
-
if (!targetIsControl && event.ctrlKey || event.altKey)
|
|
4957
|
-
event.preventDefault();
|
|
4958
|
-
}
|
|
4959
|
-
}));
|
|
4957
|
+
this.subs.push(fromEvent(document, 'keydown').subscribe(this.onDocumentKeydown));
|
|
4960
4958
|
}
|
|
4961
4959
|
setNavigationIndex(index) {
|
|
4962
4960
|
this.navigationIndex = index;
|
|
@@ -8641,6 +8639,30 @@ class TruDataGrid {
|
|
|
8641
8639
|
this.desktopViewEventNotifier = desktopViewEventNotifier;
|
|
8642
8640
|
this.tabGroupEventNotifier = tabGroupEventNotifier;
|
|
8643
8641
|
}
|
|
8642
|
+
onDocumentKeydown = (event) => {
|
|
8643
|
+
if (this.config.view.active && this.config.view.window.active) {
|
|
8644
|
+
if (event.code === 'Space' && event.target.classList.contains('ag-cell-value')) {
|
|
8645
|
+
event.preventDefault();
|
|
8646
|
+
}
|
|
8647
|
+
let keySequence = this.util.getKeySequence(event);
|
|
8648
|
+
if (keySequence === 'ctrl+i' || keySequence === 'meta+i') {
|
|
8649
|
+
this.onAdd();
|
|
8650
|
+
event.preventDefault();
|
|
8651
|
+
}
|
|
8652
|
+
if (keySequence === 'ctrl+d' || keySequence === 'meta+d') {
|
|
8653
|
+
this.onDelete();
|
|
8654
|
+
event.preventDefault();
|
|
8655
|
+
}
|
|
8656
|
+
if (keySequence === 'ctrl+k' || keySequence === 'meta+k') {
|
|
8657
|
+
this.onKeep();
|
|
8658
|
+
event.preventDefault();
|
|
8659
|
+
}
|
|
8660
|
+
if (keySequence === 'ctrl+r' || keySequence === 'meta+r') {
|
|
8661
|
+
this.onRemove();
|
|
8662
|
+
event.preventDefault();
|
|
8663
|
+
}
|
|
8664
|
+
}
|
|
8665
|
+
};
|
|
8644
8666
|
enhanceRowDataForEntity = (entity) => {
|
|
8645
8667
|
let rowData = this.config.resultConfig.rowDataEnhancer(entity);
|
|
8646
8668
|
rowData.$entity = entity;
|
|
@@ -8772,33 +8794,7 @@ class TruDataGrid {
|
|
|
8772
8794
|
}
|
|
8773
8795
|
this.api.refreshCells({ force: true });
|
|
8774
8796
|
}));
|
|
8775
|
-
this.subs.push(fromEvent(document, 'keydown').subscribe(
|
|
8776
|
-
if (this.config.view.active && this.config.view.window.active) {
|
|
8777
|
-
if (event.code === 'Space' && event.target.classList.contains('ag-cell-value')) {
|
|
8778
|
-
event.preventDefault();
|
|
8779
|
-
}
|
|
8780
|
-
let keySequence = this.util.getKeySequence(event);
|
|
8781
|
-
if (keySequence === 'ctrl+i' || keySequence === 'meta+i') {
|
|
8782
|
-
this.onAdd();
|
|
8783
|
-
event.preventDefault();
|
|
8784
|
-
}
|
|
8785
|
-
if (keySequence === 'ctrl+d' || keySequence === 'meta+d') {
|
|
8786
|
-
this.onDelete();
|
|
8787
|
-
event.preventDefault();
|
|
8788
|
-
}
|
|
8789
|
-
if (keySequence === 'ctrl+k' || keySequence === 'meta+k') {
|
|
8790
|
-
this.onKeep();
|
|
8791
|
-
event.preventDefault();
|
|
8792
|
-
}
|
|
8793
|
-
if (keySequence === 'ctrl+r' || keySequence === 'meta+r') {
|
|
8794
|
-
this.onRemove();
|
|
8795
|
-
event.preventDefault();
|
|
8796
|
-
}
|
|
8797
|
-
var targetIsControl = this.util.targetIsControl(event.target);
|
|
8798
|
-
if (!targetIsControl && event.ctrlKey || event.altKey)
|
|
8799
|
-
event.preventDefault();
|
|
8800
|
-
}
|
|
8801
|
-
}));
|
|
8797
|
+
this.subs.push(fromEvent(document, 'keydown').subscribe(this.onDocumentKeydown));
|
|
8802
8798
|
this.subs.push(fromEvent(document, 'mousedown').subscribe((event) => {
|
|
8803
8799
|
if (this.config.view.active &&
|
|
8804
8800
|
this.config.view.window.active &&
|
|
@@ -9119,9 +9115,10 @@ class TruDataGrid {
|
|
|
9119
9115
|
this.firstSearchRan = true;
|
|
9120
9116
|
this.api?.hideOverlay();
|
|
9121
9117
|
this.api?.showLoadingOverlay();
|
|
9122
|
-
let
|
|
9123
|
-
|
|
9124
|
-
|
|
9118
|
+
let parentIsUnsaved = !!this.entity && this.entity.Ref < 0;
|
|
9119
|
+
let parentWasLoaded = !!this.entity && this.loadedEntities.indexOf(this.entity.Ref) > -1;
|
|
9120
|
+
let canSearchLocally = this.config.resultConfig.canSearchLocally !== false;
|
|
9121
|
+
let searchLocally = parentIsUnsaved || (canSearchLocally && parentWasLoaded);
|
|
9125
9122
|
let joins = [];
|
|
9126
9123
|
if (searchLocally) {
|
|
9127
9124
|
joins.push(this.dataContext.entityAccess().searchCacheOnly(this.config.resultConfig.entityType, setupQuery, this.config.resultConfig.expands));
|
|
@@ -9144,7 +9141,7 @@ class TruDataGrid {
|
|
|
9144
9141
|
},
|
|
9145
9142
|
complete: () => {
|
|
9146
9143
|
if (this.gridType !== TruDataGridTypes.Search)
|
|
9147
|
-
this.loadedEntities.push(this.entity
|
|
9144
|
+
this.loadedEntities.push(this.entity.Ref);
|
|
9148
9145
|
this.api.hideOverlay();
|
|
9149
9146
|
if (this.rowData === null || !this.rowData.length) {
|
|
9150
9147
|
this.api.showNoRowsOverlay();
|
|
@@ -10657,9 +10654,6 @@ class TruDesktopWindow {
|
|
|
10657
10654
|
this.lastView();
|
|
10658
10655
|
event.preventDefault();
|
|
10659
10656
|
}
|
|
10660
|
-
var targetIsControl = this.util.targetIsControl(event.target);
|
|
10661
|
-
if (!targetIsControl && event.ctrlKey || event.altKey)
|
|
10662
|
-
event.preventDefault();
|
|
10663
10657
|
};
|
|
10664
10658
|
/**
|
|
10665
10659
|
* @tru.doc watch
|
|
@@ -11531,8 +11525,6 @@ class TruDesktop {
|
|
|
11531
11525
|
onKeyDown = (event) => {
|
|
11532
11526
|
if (event.key === 'Control' || event.key === 'Shift')
|
|
11533
11527
|
return;
|
|
11534
|
-
if (event.altKey)
|
|
11535
|
-
event.preventDefault();
|
|
11536
11528
|
var keySequence = this.util.getKeySequence(event);
|
|
11537
11529
|
if (keySequence === 'alt+m') { //Maximize
|
|
11538
11530
|
var activeWindow = this.getActiveWindow();
|
|
@@ -11596,10 +11588,6 @@ class TruDesktop {
|
|
|
11596
11588
|
this.restoreSavedPosition(activeWindow);
|
|
11597
11589
|
event.preventDefault();
|
|
11598
11590
|
}
|
|
11599
|
-
if (keySequence === 'alt+d') { //Toggle Desktop
|
|
11600
|
-
//this.desktopShown = this.hideShowAll();
|
|
11601
|
-
event.preventDefault();
|
|
11602
|
-
}
|
|
11603
11591
|
if (event.shiftKey)
|
|
11604
11592
|
this.shiftPressed = true;
|
|
11605
11593
|
if (event.altKey)
|
|
@@ -12060,13 +12048,26 @@ class TruLogin {
|
|
|
12060
12048
|
this.appEnvironment = appEnvironment;
|
|
12061
12049
|
this.title = appEnvironment.loginFormTitle;
|
|
12062
12050
|
}
|
|
12051
|
+
ngOnInit() {
|
|
12052
|
+
if (this.isWindowsAuth)
|
|
12053
|
+
this.loginWithWindows();
|
|
12054
|
+
}
|
|
12063
12055
|
get f() {
|
|
12064
12056
|
return this.loginForm.controls;
|
|
12065
12057
|
}
|
|
12058
|
+
get isWindowsAuth() {
|
|
12059
|
+
return this.appEnvironment.authType === 'windows';
|
|
12060
|
+
}
|
|
12066
12061
|
isDisabled = () => {
|
|
12062
|
+
if (this.isWindowsAuth)
|
|
12063
|
+
return this.isLoggingIn;
|
|
12067
12064
|
return !this.f.username.value || !this.f.password.value || this.isLoggingIn;
|
|
12068
12065
|
};
|
|
12069
12066
|
onSubmit() {
|
|
12067
|
+
if (this.isWindowsAuth) {
|
|
12068
|
+
this.loginWithWindows();
|
|
12069
|
+
return;
|
|
12070
|
+
}
|
|
12070
12071
|
const loginRequest = {
|
|
12071
12072
|
username: this.f.username.value,
|
|
12072
12073
|
password: this.f.password.value
|
|
@@ -12089,12 +12090,32 @@ class TruLogin {
|
|
|
12089
12090
|
});
|
|
12090
12091
|
}
|
|
12091
12092
|
}
|
|
12093
|
+
loginWithWindows() {
|
|
12094
|
+
this.isLoggingIn = true;
|
|
12095
|
+
this.auth
|
|
12096
|
+
.login(null).pipe(finalize(() => {
|
|
12097
|
+
this.isLoggingIn = false;
|
|
12098
|
+
}))
|
|
12099
|
+
.subscribe(() => {
|
|
12100
|
+
this.isLoggingIn = false;
|
|
12101
|
+
}, (error) => {
|
|
12102
|
+
if (error.status === 401) {
|
|
12103
|
+
this.loginError = "Windows authentication failed";
|
|
12104
|
+
}
|
|
12105
|
+
else if (error.status === 403) {
|
|
12106
|
+
this.loginError = error.error || "Your Windows account is not authorized for this application";
|
|
12107
|
+
}
|
|
12108
|
+
else {
|
|
12109
|
+
this.loginError = "Invalid Login - Error: " + error.status;
|
|
12110
|
+
}
|
|
12111
|
+
});
|
|
12112
|
+
}
|
|
12092
12113
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TruLogin, deps: [{ token: TruAuth }, { token: TruAppEnvironment }], target: i0.ɵɵFactoryTarget.Component });
|
|
12093
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: TruLogin, isStandalone: false, selector: "tru-login", ngImport: i0, template: "<div class=\"login-wrapper\">\r\n <form [formGroup]=\"loginForm\" (ngSubmit)=\"onSubmit()\">\r\n <mat-card class=\"animate-login\">\r\n <mat-card-header>\r\n <mat-card-title> {{title}} </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <mat-form-field>\r\n
|
|
12114
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: TruLogin, isStandalone: false, selector: "tru-login", ngImport: i0, template: "<div class=\"login-wrapper\">\r\n <form [formGroup]=\"loginForm\" (ngSubmit)=\"onSubmit()\">\r\n <mat-card class=\"animate-login\">\r\n <mat-card-header>\r\n <mat-card-title> {{title}} </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <ng-container *ngIf=\"isWindowsAuth; else passwordLogin\"></ng-container>\r\n <ng-template #passwordLogin>\r\n <mat-form-field>\r\n <mat-label>Username</mat-label>\r\n <input matInput formControlName=\"username\" placeholder=\"Username\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <mat-label>Password</mat-label>\r\n <input matInput type=\"password\" formControlName=\"password\" placeholder=\"Password\" [type]=\"passwordVisible ? 'text' : 'password'\">\r\n <button class=\"visibility-button\" [disableRipple]=\"true\" type=\"button\" mat-icon-button matSuffix (click)=\"passwordVisible = !passwordVisible\">\r\n <mat-icon class=\"visibility\" *ngIf=\"passwordVisible\" [svgIcon]=\"'visibility-icon'\">visibility-icon</mat-icon>\r\n <mat-icon class=\"visibility-off\" *ngIf=\"!passwordVisible\" [svgIcon]=\"'visibility-off-icon'\">visibility-off-icon</mat-icon>\r\n </button>\r\n </mat-form-field>\r\n </ng-template>\r\n <div *ngIf=\"loginError\" class=\"animate-login-error animated rubberBand\">\r\n <p style=\"color: red; font-weight: bold;\"> {{ loginError }}</p>\r\n </div>\r\n </mat-card-content>\r\n <mat-card-actions *ngIf=\"!isWindowsAuth\">\r\n <button mat-raised-button color=\"primary\" type=\"submit\" [disabled]=\"isDisabled()\">Login</button>\r\n </mat-card-actions>\r\n </mat-card>\r\n </form>\r\n</div>\r\n", styles: [".login-container{display:flex;justify-content:center;align-items:center;height:100vh;margin:0;padding:0}.login-input{margin-bottom:20px}.animate-login{display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%;margin-top:50px}.wrapper{display:flex;justify-content:center;align-items:center;height:100vh}mat-card{max-width:300px;width:100%;max-height:300px;padding:20px}.form-group{width:100%;max-width:400px;margin-bottom:20px}.login-wrapper{display:flex;justify-content:center;align-items:center;height:100vh}::ng-deep .login-wrapper .mat-mdc-text-field-wrapper{padding:0 16px!important}::ng-deep .login-wrapper .mat-mdc-icon-button.mat-mdc-button-base{height:20px;width:20px;padding:0!important}::ng-deep .login-wrapper .mat-icon{height:20px;width:30px;vertical-align:middle}::ng-deep .login-wrapper .material-icons{font-size:18px}::ng-deep .login-wrapper .visibility svg{fill:#006dcc;height:18px;width:18px;margin-top:5px}::ng-deep .login-wrapper .visibility-off svg{fill:#787878;height:18px;width:18px;margin-top:5px}::ng-deep .login-wrapper .visibility-button{--mat-text-button-state-layer-color: none}::ng-deep .login-wrapper button:focus{outline:none!important}::ng-deep .login-wrapper .mat-button-focus-overlay{display:none!important}::ng-deep .login-wrapper .mat-mdc-button-persistent-ripple{display:none!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i5$3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i5$3.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i5$3.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i5$3.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i5$3.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i7.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i7.MatLabel, selector: "mat-label" }, { kind: "directive", type: i7.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i8.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i8.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i8.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
|
|
12094
12115
|
}
|
|
12095
12116
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TruLogin, decorators: [{
|
|
12096
12117
|
type: Component,
|
|
12097
|
-
args: [{ selector: 'tru-login', standalone: false, template: "<div class=\"login-wrapper\">\r\n <form [formGroup]=\"loginForm\" (ngSubmit)=\"onSubmit()\">\r\n <mat-card class=\"animate-login\">\r\n <mat-card-header>\r\n <mat-card-title> {{title}} </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <mat-form-field>\r\n
|
|
12118
|
+
args: [{ selector: 'tru-login', standalone: false, template: "<div class=\"login-wrapper\">\r\n <form [formGroup]=\"loginForm\" (ngSubmit)=\"onSubmit()\">\r\n <mat-card class=\"animate-login\">\r\n <mat-card-header>\r\n <mat-card-title> {{title}} </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <ng-container *ngIf=\"isWindowsAuth; else passwordLogin\"></ng-container>\r\n <ng-template #passwordLogin>\r\n <mat-form-field>\r\n <mat-label>Username</mat-label>\r\n <input matInput formControlName=\"username\" placeholder=\"Username\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <mat-label>Password</mat-label>\r\n <input matInput type=\"password\" formControlName=\"password\" placeholder=\"Password\" [type]=\"passwordVisible ? 'text' : 'password'\">\r\n <button class=\"visibility-button\" [disableRipple]=\"true\" type=\"button\" mat-icon-button matSuffix (click)=\"passwordVisible = !passwordVisible\">\r\n <mat-icon class=\"visibility\" *ngIf=\"passwordVisible\" [svgIcon]=\"'visibility-icon'\">visibility-icon</mat-icon>\r\n <mat-icon class=\"visibility-off\" *ngIf=\"!passwordVisible\" [svgIcon]=\"'visibility-off-icon'\">visibility-off-icon</mat-icon>\r\n </button>\r\n </mat-form-field>\r\n </ng-template>\r\n <div *ngIf=\"loginError\" class=\"animate-login-error animated rubberBand\">\r\n <p style=\"color: red; font-weight: bold;\"> {{ loginError }}</p>\r\n </div>\r\n </mat-card-content>\r\n <mat-card-actions *ngIf=\"!isWindowsAuth\">\r\n <button mat-raised-button color=\"primary\" type=\"submit\" [disabled]=\"isDisabled()\">Login</button>\r\n </mat-card-actions>\r\n </mat-card>\r\n </form>\r\n</div>\r\n", styles: [".login-container{display:flex;justify-content:center;align-items:center;height:100vh;margin:0;padding:0}.login-input{margin-bottom:20px}.animate-login{display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%;margin-top:50px}.wrapper{display:flex;justify-content:center;align-items:center;height:100vh}mat-card{max-width:300px;width:100%;max-height:300px;padding:20px}.form-group{width:100%;max-width:400px;margin-bottom:20px}.login-wrapper{display:flex;justify-content:center;align-items:center;height:100vh}::ng-deep .login-wrapper .mat-mdc-text-field-wrapper{padding:0 16px!important}::ng-deep .login-wrapper .mat-mdc-icon-button.mat-mdc-button-base{height:20px;width:20px;padding:0!important}::ng-deep .login-wrapper .mat-icon{height:20px;width:30px;vertical-align:middle}::ng-deep .login-wrapper .material-icons{font-size:18px}::ng-deep .login-wrapper .visibility svg{fill:#006dcc;height:18px;width:18px;margin-top:5px}::ng-deep .login-wrapper .visibility-off svg{fill:#787878;height:18px;width:18px;margin-top:5px}::ng-deep .login-wrapper .visibility-button{--mat-text-button-state-layer-color: none}::ng-deep .login-wrapper button:focus{outline:none!important}::ng-deep .login-wrapper .mat-button-focus-overlay{display:none!important}::ng-deep .login-wrapper .mat-mdc-button-persistent-ripple{display:none!important}\n"] }]
|
|
12098
12119
|
}], ctorParameters: () => [{ type: TruAuth }, { type: TruAppEnvironment }] });
|
|
12099
12120
|
|
|
12100
12121
|
class TruAuthJwtStrategy {
|
|
@@ -12171,7 +12192,7 @@ class TruAuthInterceptor {
|
|
|
12171
12192
|
intercept(request, next) {
|
|
12172
12193
|
if (this.appEnvironment.authType === 'jwt')
|
|
12173
12194
|
request = this.addToken(request, String(this.jwt.getToken()));
|
|
12174
|
-
if (this.appEnvironment.authType === 'session')
|
|
12195
|
+
if (this.appEnvironment.authType === 'session' || this.appEnvironment.authType === 'windows')
|
|
12175
12196
|
request = request.clone({
|
|
12176
12197
|
withCredentials: true
|
|
12177
12198
|
});
|
|
@@ -12254,6 +12275,19 @@ class TruAuthSessionStrategy {
|
|
|
12254
12275
|
}
|
|
12255
12276
|
}
|
|
12256
12277
|
|
|
12278
|
+
class TruAuthWindowsStrategy {
|
|
12279
|
+
doLoginUser(user) {
|
|
12280
|
+
}
|
|
12281
|
+
doLogoutUser() {
|
|
12282
|
+
}
|
|
12283
|
+
createUser(user) {
|
|
12284
|
+
return of({});
|
|
12285
|
+
}
|
|
12286
|
+
isLoggedIn() {
|
|
12287
|
+
return false;
|
|
12288
|
+
}
|
|
12289
|
+
}
|
|
12290
|
+
|
|
12257
12291
|
const TruAuthStrategyProvider = {
|
|
12258
12292
|
provide: TRU_AUTH_STRATEGY,
|
|
12259
12293
|
deps: [HttpClient, TruAppEnvironment],
|
|
@@ -12263,6 +12297,8 @@ const TruAuthStrategyProvider = {
|
|
|
12263
12297
|
return new TruAuthSessionStrategy(http);
|
|
12264
12298
|
case "jwt":
|
|
12265
12299
|
return new TruAuthJwtStrategy();
|
|
12300
|
+
case "windows":
|
|
12301
|
+
return new TruAuthWindowsStrategy();
|
|
12266
12302
|
default:
|
|
12267
12303
|
throw new Error("Invalid auth strategy");
|
|
12268
12304
|
}
|