@indigina/kendo 2.0.35 → 2.0.36
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.
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
.k-tabstrip > .k-tabstrip-items-wrapper {
|
|
2
|
+
border-color: #e5e5e5;
|
|
3
|
+
|
|
4
|
+
> .k-tabstrip-items > .k-tabstrip-item {
|
|
5
|
+
position: relative;
|
|
6
|
+
border-color: #e5e5e5;
|
|
7
|
+
background-color: #eae8e8;
|
|
8
|
+
background-image: linear-gradient(to bottom, rgb(255 255 255 / 0.6), rgb(255 255 255 / 0));
|
|
9
|
+
|
|
10
|
+
&:hover {
|
|
11
|
+
border-color: #b6b6b6;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&.k-active {
|
|
15
|
+
z-index: 1;
|
|
16
|
+
background-color: #ffffff;
|
|
17
|
+
background-image: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&:focus:not(:focus-visible),
|
|
21
|
+
&.k-focus:not(:focus-visible) {
|
|
22
|
+
box-shadow: none;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.k-tabstrip > .k-tabstrip-content {
|
|
28
|
+
border-color: #e5e5e5;
|
|
29
|
+
|
|
30
|
+
&:focus:not(:focus-visible),
|
|
31
|
+
&.k-focus:not(:focus-visible) {
|
|
32
|
+
outline: none;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i1$3 from '@angular/common';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Input, Directive, Component, NgModule, EventEmitter, Output, ChangeDetectionStrategy, HostListener, Injectable, ViewChildren, ViewChild, inject, InjectionToken,
|
|
4
|
+
import { Input, Directive, Component, NgModule, EventEmitter, Output, ChangeDetectionStrategy, HostListener, Injectable, ViewChildren, Optional, Inject, ViewChild, inject, InjectionToken, input, output, provideAppInitializer } from '@angular/core';
|
|
5
5
|
import * as i1 from '@angular/forms';
|
|
6
6
|
import { UntypedFormControl, Validators, FormGroupDirective, ControlContainer, ReactiveFormsModule, FormsModule, UntypedFormGroup } from '@angular/forms';
|
|
7
7
|
import * as i2 from '@ngx-translate/core';
|
|
@@ -15,8 +15,8 @@ import * as i2$1 from '@progress/kendo-angular-inputs';
|
|
|
15
15
|
import { InputsModule } from '@progress/kendo-angular-inputs';
|
|
16
16
|
import * as i3$1 from '@progress/kendo-angular-label';
|
|
17
17
|
import { LabelModule } from '@progress/kendo-angular-label';
|
|
18
|
-
import { BehaviorSubject, Subject, of, throwError, map as map$1,
|
|
19
|
-
import { map, mergeMap, debounceTime, catchError, tap, filter, take, finalize } from 'rxjs/operators';
|
|
18
|
+
import { BehaviorSubject, Subject, of, throwError, defer, EMPTY, firstValueFrom, map as map$1, share, take as take$1, tap as tap$1, switchMap as switchMap$1, takeUntil, catchError as catchError$1 } from 'rxjs';
|
|
19
|
+
import { map, mergeMap, debounceTime, catchError, tap, switchMap, filter, take, finalize } from 'rxjs/operators';
|
|
20
20
|
import { toODataString, distinct, filterBy } from '@progress/kendo-data-query';
|
|
21
21
|
import * as i1$1 from '@progress/kendo-angular-notification';
|
|
22
22
|
import * as i1$2 from '@angular/router';
|
|
@@ -25,9 +25,8 @@ import XmlBeautify from 'xml-beautify';
|
|
|
25
25
|
import * as i1$4 from 'ngx-clipboard';
|
|
26
26
|
import { ClipboardModule } from 'ngx-clipboard';
|
|
27
27
|
import { TreeViewModule } from '@progress/kendo-angular-treeview';
|
|
28
|
-
import {
|
|
29
|
-
import
|
|
30
|
-
import { MsalBroadcastService, MsalService, MsalModule } from '@azure/msal-angular';
|
|
28
|
+
import { MsalService, MsalBroadcastService, MsalModule } from '@azure/msal-angular';
|
|
29
|
+
import { InteractionRequiredAuthError, InteractionStatus, EventType, BrowserCacheLocation, PublicClientApplication } from '@azure/msal-browser';
|
|
31
30
|
import * as signalR from '@microsoft/signalr';
|
|
32
31
|
import * as i3$2 from '@progress/kendo-angular-popup';
|
|
33
32
|
import { PopupModule } from '@progress/kendo-angular-popup';
|
|
@@ -767,34 +766,50 @@ class BaseAccountService {
|
|
|
767
766
|
.subscribe();
|
|
768
767
|
}
|
|
769
768
|
initialize(provider) {
|
|
770
|
-
this.getCurrentUser().subscribe(
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
this.signalRService.
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
769
|
+
this.getCurrentUser().subscribe({
|
|
770
|
+
next: (user) => {
|
|
771
|
+
if (!user) {
|
|
772
|
+
return;
|
|
773
|
+
}
|
|
774
|
+
const path = this.settingsService.getCallbackPath();
|
|
775
|
+
if (path) {
|
|
776
|
+
this.settingsService.clearCallbackPath();
|
|
777
|
+
window.location.href = window.location.origin + path;
|
|
778
|
+
return;
|
|
779
|
+
}
|
|
780
|
+
if (this.isAdmin(user) &&
|
|
781
|
+
!window.location.pathname.startsWith(adminUriPart)) {
|
|
782
|
+
window.location.href = `${window.location.origin}${adminUriPart}`;
|
|
783
|
+
return;
|
|
784
|
+
}
|
|
785
|
+
provider.getAccessToken().subscribe({
|
|
786
|
+
next: (token) => {
|
|
787
|
+
if (!token) {
|
|
788
|
+
return;
|
|
789
|
+
}
|
|
790
|
+
this.signalRService.startConnection(token);
|
|
791
|
+
this.signalRService
|
|
792
|
+
.on(EventNames.UserUpdated)
|
|
793
|
+
.subscribe(async () => {
|
|
794
|
+
provider.getAccessToken().subscribe({
|
|
795
|
+
next: (nextToken) => {
|
|
796
|
+
if (nextToken) {
|
|
797
|
+
this.signalRService.reconnect(nextToken);
|
|
798
|
+
}
|
|
799
|
+
},
|
|
800
|
+
error: () => undefined,
|
|
801
|
+
});
|
|
802
|
+
this.httpService
|
|
803
|
+
.get(endpoints.members.me)
|
|
804
|
+
.subscribe((user) => this.user.next(user));
|
|
805
|
+
});
|
|
806
|
+
},
|
|
807
|
+
error: () => undefined,
|
|
796
808
|
});
|
|
797
|
-
}
|
|
809
|
+
},
|
|
810
|
+
error: (error) => {
|
|
811
|
+
console.error(error);
|
|
812
|
+
},
|
|
798
813
|
});
|
|
799
814
|
}
|
|
800
815
|
getCurrentUser() {
|
|
@@ -802,7 +817,10 @@ class BaseAccountService {
|
|
|
802
817
|
if (this.user.getValue() || !provider.isUserLoggedIn()) {
|
|
803
818
|
return this.user;
|
|
804
819
|
}
|
|
805
|
-
return provider.getAccessToken().pipe(mergeMap(() => {
|
|
820
|
+
return provider.getAccessToken().pipe(mergeMap((token) => {
|
|
821
|
+
if (!token) {
|
|
822
|
+
return this.user;
|
|
823
|
+
}
|
|
806
824
|
return this.httpService.get(endpoints.members.me).pipe(map((user) => {
|
|
807
825
|
this.user.next(user);
|
|
808
826
|
return user;
|
|
@@ -1781,30 +1799,51 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
|
|
|
1781
1799
|
}] });
|
|
1782
1800
|
|
|
1783
1801
|
class AuthProvider {
|
|
1802
|
+
reauthenticate() {
|
|
1803
|
+
return defer(() => {
|
|
1804
|
+
this.login();
|
|
1805
|
+
return EMPTY;
|
|
1806
|
+
});
|
|
1807
|
+
}
|
|
1784
1808
|
}
|
|
1785
1809
|
|
|
1810
|
+
const userCanceledErrorCode = 'AADB2C90091';
|
|
1786
1811
|
class AzureB2CProvider extends AuthProvider {
|
|
1787
|
-
constructor(authService, settingsService, indiginaConfiguration) {
|
|
1812
|
+
constructor(authService, settingsService, indiginaConfiguration, broadcastService) {
|
|
1788
1813
|
super();
|
|
1789
1814
|
this.authService = authService;
|
|
1790
1815
|
this.settingsService = settingsService;
|
|
1791
1816
|
this.indiginaConfiguration = indiginaConfiguration;
|
|
1817
|
+
this.broadcastService = broadcastService;
|
|
1818
|
+
this.logoutInProgress = false;
|
|
1819
|
+
this.login$ = null;
|
|
1792
1820
|
this.isUserLoggedIn = () => !!this.authService.instance.getActiveAccount()?.localAccountId;
|
|
1793
1821
|
}
|
|
1794
1822
|
async initialize() {
|
|
1795
1823
|
await this.authService.instance.initialize();
|
|
1824
|
+
await firstValueFrom(defer(() => this.authService.handleRedirectObservable()).pipe(tap((result) => this.activateAccount(result)), switchMap(() => this.waitForIdle()), catchError((error) => this.handleRedirectError(error))));
|
|
1825
|
+
this.restoreCachedAccount();
|
|
1796
1826
|
return of(true);
|
|
1797
1827
|
}
|
|
1798
1828
|
login() {
|
|
1799
|
-
this.
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1829
|
+
this.startLogin(false).subscribe();
|
|
1830
|
+
}
|
|
1831
|
+
reauthenticate() {
|
|
1832
|
+
return this.startLogin(true);
|
|
1803
1833
|
}
|
|
1804
1834
|
logout() {
|
|
1805
|
-
this.
|
|
1806
|
-
|
|
1835
|
+
if (this.logoutInProgress) {
|
|
1836
|
+
return;
|
|
1837
|
+
}
|
|
1838
|
+
this.logoutInProgress = true;
|
|
1839
|
+
this.waitForIdle().pipe(switchMap(() => this.authService.logoutRedirect({
|
|
1807
1840
|
postLogoutRedirectUri: this.indiginaConfiguration.appSettings.azureB2C.logoutRedirectUri,
|
|
1841
|
+
}))).subscribe({
|
|
1842
|
+
next: () => this.settingsService.clearToken(),
|
|
1843
|
+
error: (error) => {
|
|
1844
|
+
this.logoutInProgress = false;
|
|
1845
|
+
console.error(error);
|
|
1846
|
+
},
|
|
1808
1847
|
});
|
|
1809
1848
|
}
|
|
1810
1849
|
getAccessToken() {
|
|
@@ -1817,23 +1856,94 @@ class AzureB2CProvider extends AuthProvider {
|
|
|
1817
1856
|
return token;
|
|
1818
1857
|
}), catchError((error) => {
|
|
1819
1858
|
if (error instanceof InteractionRequiredAuthError) {
|
|
1820
|
-
this.
|
|
1859
|
+
this.reauthenticate().subscribe();
|
|
1821
1860
|
}
|
|
1822
1861
|
return throwError(() => error);
|
|
1823
1862
|
}));
|
|
1824
1863
|
}
|
|
1864
|
+
waitForIdle() {
|
|
1865
|
+
return this.broadcastService.inProgress$.pipe(filter((status) => status === InteractionStatus.None), take(1));
|
|
1866
|
+
}
|
|
1867
|
+
activateAccount(result) {
|
|
1868
|
+
if (!result?.account) {
|
|
1869
|
+
return;
|
|
1870
|
+
}
|
|
1871
|
+
this.authService.instance.setActiveAccount(result.account);
|
|
1872
|
+
if (result.idToken) {
|
|
1873
|
+
this.settingsService.setToken(result.idToken);
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
handleRedirectError(error) {
|
|
1877
|
+
if (this.isUserCanceled(error)) {
|
|
1878
|
+
return this.waitForIdle();
|
|
1879
|
+
}
|
|
1880
|
+
console.error(error);
|
|
1881
|
+
return throwError(() => error);
|
|
1882
|
+
}
|
|
1883
|
+
isUserCanceled(error) {
|
|
1884
|
+
const authError = error;
|
|
1885
|
+
return `${authError?.errorMessage ?? ''} ${authError?.message ?? ''}`.includes(userCanceledErrorCode);
|
|
1886
|
+
}
|
|
1887
|
+
restoreCachedAccount() {
|
|
1888
|
+
if (this.authService.instance.getActiveAccount()) {
|
|
1889
|
+
return;
|
|
1890
|
+
}
|
|
1891
|
+
const [account] = this.authService.instance.getAllAccounts();
|
|
1892
|
+
if (account) {
|
|
1893
|
+
this.authService.instance.setActiveAccount(account);
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
startLogin(force) {
|
|
1897
|
+
if (this.logoutInProgress) {
|
|
1898
|
+
return EMPTY;
|
|
1899
|
+
}
|
|
1900
|
+
if (this.login$) {
|
|
1901
|
+
return this.login$;
|
|
1902
|
+
}
|
|
1903
|
+
this.login$ = this.waitForIdle().pipe(switchMap(() => {
|
|
1904
|
+
if (!force && this.isUserLoggedIn()) {
|
|
1905
|
+
return EMPTY;
|
|
1906
|
+
}
|
|
1907
|
+
return this.authService.loginRedirect({
|
|
1908
|
+
scopes: ['openid', 'offline_access', 'profile'],
|
|
1909
|
+
});
|
|
1910
|
+
}), map$1(() => undefined), catchError((error) => {
|
|
1911
|
+
console.error(error);
|
|
1912
|
+
return EMPTY;
|
|
1913
|
+
}), finalize(() => {
|
|
1914
|
+
this.login$ = null;
|
|
1915
|
+
}), share());
|
|
1916
|
+
return this.login$;
|
|
1917
|
+
}
|
|
1825
1918
|
}
|
|
1826
1919
|
|
|
1827
1920
|
class AuthProviderResolver {
|
|
1828
|
-
constructor(
|
|
1921
|
+
constructor(injector, customProvider) {
|
|
1829
1922
|
this.AuthProvider$ = new BehaviorSubject(null);
|
|
1830
|
-
this.
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
this.AuthProvider$.
|
|
1923
|
+
this.initializationStarted = false;
|
|
1924
|
+
this.getProvider = () => {
|
|
1925
|
+
this.ensureInitialized();
|
|
1926
|
+
return this.AuthProvider$.pipe(filter((x) => !!x));
|
|
1927
|
+
};
|
|
1928
|
+
this.provider =
|
|
1929
|
+
customProvider ?? new AzureB2CProvider(injector.get(MsalService), injector.get(SettingsService), injector.get(IndiginaConfiguration), injector.get(MsalBroadcastService));
|
|
1930
|
+
}
|
|
1931
|
+
ensureInitialized() {
|
|
1932
|
+
if (this.initializationStarted) {
|
|
1933
|
+
return;
|
|
1934
|
+
}
|
|
1935
|
+
this.initializationStarted = true;
|
|
1936
|
+
defer(() => this.provider.initialize()).subscribe({
|
|
1937
|
+
next: () => {
|
|
1938
|
+
this.AuthProvider$.next(this.provider);
|
|
1939
|
+
},
|
|
1940
|
+
error: (error) => {
|
|
1941
|
+
console.error(error);
|
|
1942
|
+
this.AuthProvider$.error(error);
|
|
1943
|
+
},
|
|
1834
1944
|
});
|
|
1835
1945
|
}
|
|
1836
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: AuthProviderResolver, deps: [{ token:
|
|
1946
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: AuthProviderResolver, deps: [{ token: i0.Injector }, { token: AuthProvider, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1837
1947
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: AuthProviderResolver, providedIn: 'root' }); }
|
|
1838
1948
|
}
|
|
1839
1949
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: AuthProviderResolver, decorators: [{
|
|
@@ -1841,7 +1951,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
|
|
|
1841
1951
|
args: [{
|
|
1842
1952
|
providedIn: 'root',
|
|
1843
1953
|
}]
|
|
1844
|
-
}], ctorParameters: () => [{ type:
|
|
1954
|
+
}], ctorParameters: () => [{ type: i0.Injector }, { type: AuthProvider, decorators: [{
|
|
1955
|
+
type: Optional
|
|
1956
|
+
}, {
|
|
1957
|
+
type: Inject,
|
|
1958
|
+
args: [AuthProvider]
|
|
1959
|
+
}] }] });
|
|
1845
1960
|
|
|
1846
1961
|
class SignalRService {
|
|
1847
1962
|
constructor(appSettings) {
|
|
@@ -2072,25 +2187,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
|
|
|
2072
2187
|
}]
|
|
2073
2188
|
}] });
|
|
2074
2189
|
|
|
2075
|
-
const resetPasswordCanceledErrorCode = 'AADB2C90091';
|
|
2076
2190
|
class AzureLoginCallbackComponent {
|
|
2077
2191
|
constructor() {
|
|
2078
2192
|
this.msalBroadcastService = inject(MsalBroadcastService);
|
|
2079
2193
|
this.router = inject(Router);
|
|
2080
|
-
this.settingsService = inject(SettingsService);
|
|
2081
2194
|
this.authService = inject(MsalService);
|
|
2195
|
+
this.resolver = inject(AuthProviderResolver);
|
|
2082
2196
|
}
|
|
2083
2197
|
ngOnInit() {
|
|
2084
|
-
this.
|
|
2085
|
-
|
|
2086
|
-
this.settingsService.setToken(result.idToken);
|
|
2087
|
-
this.authService.instance.setActiveAccount(result.account);
|
|
2088
|
-
}
|
|
2089
|
-
this.router.navigate(['home']);
|
|
2090
|
-
}, (error) => {
|
|
2091
|
-
if (error.errorMessage.includes(resetPasswordCanceledErrorCode)) {
|
|
2198
|
+
this.resolver.getProvider().pipe(take$1(1)).subscribe({
|
|
2199
|
+
next: () => {
|
|
2092
2200
|
this.router.navigate(['home']);
|
|
2093
|
-
}
|
|
2201
|
+
},
|
|
2202
|
+
error: () => {
|
|
2203
|
+
this.router.navigate(['home']);
|
|
2204
|
+
},
|
|
2094
2205
|
});
|
|
2095
2206
|
this.msalBroadcastService.msalSubject$.pipe(filter(({ eventType }) => eventType === EventType.ACQUIRE_TOKEN_FAILURE)).subscribe(() => this.authService.logoutRedirect());
|
|
2096
2207
|
}
|
|
@@ -2108,14 +2219,54 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
|
|
|
2108
2219
|
}]
|
|
2109
2220
|
}] });
|
|
2110
2221
|
|
|
2222
|
+
const defaultAzureB2CRedirectPath = '/azure/login/callback';
|
|
2223
|
+
const getAzureB2CRedirectUri = (config) => resolveConfiguredRedirectUri(config) || `${window.location.origin}${defaultAzureB2CRedirectPath}`;
|
|
2224
|
+
const isAzureB2CRedirect = (config) => {
|
|
2225
|
+
const expected = new URL(getAzureB2CRedirectUri(config), window.location.origin);
|
|
2226
|
+
return window.location.origin === expected.origin
|
|
2227
|
+
&& normalizePath(window.location.pathname) === normalizePath(expected.pathname);
|
|
2228
|
+
};
|
|
2229
|
+
const azureB2CRedirectBridge = {
|
|
2230
|
+
load: async () => {
|
|
2231
|
+
const { broadcastResponseToMainFrame } = await import('@azure/msal-browser/redirect-bridge');
|
|
2232
|
+
return broadcastResponseToMainFrame;
|
|
2233
|
+
},
|
|
2234
|
+
};
|
|
2235
|
+
const handleAzureB2CRedirectBridge = async (config) => {
|
|
2236
|
+
if (!isAzureB2CRedirect(config)) {
|
|
2237
|
+
return false;
|
|
2238
|
+
}
|
|
2239
|
+
const broadcastResponseToMainFrame = await azureB2CRedirectBridge.load();
|
|
2240
|
+
await broadcastResponseToMainFrame();
|
|
2241
|
+
return true;
|
|
2242
|
+
};
|
|
2243
|
+
const resolveConfiguredRedirectUri = (config) => {
|
|
2244
|
+
if (typeof config === 'string') {
|
|
2245
|
+
return config;
|
|
2246
|
+
}
|
|
2247
|
+
if (!config) {
|
|
2248
|
+
return undefined;
|
|
2249
|
+
}
|
|
2250
|
+
const value = config;
|
|
2251
|
+
return value.appSettings?.azureB2C?.redirectUri
|
|
2252
|
+
?? value.azureB2C?.redirectUri
|
|
2253
|
+
?? value.redirectUri;
|
|
2254
|
+
};
|
|
2255
|
+
const normalizePath = (path) => {
|
|
2256
|
+
let normalized = path;
|
|
2257
|
+
while (normalized.endsWith('/')) {
|
|
2258
|
+
normalized = normalized.slice(0, -1);
|
|
2259
|
+
}
|
|
2260
|
+
return normalized || '/';
|
|
2261
|
+
};
|
|
2262
|
+
|
|
2111
2263
|
const MSALInstanceFactory = (config) => {
|
|
2112
|
-
const defaultRedirectUri = `${window.location.origin}/azure/login/callback`;
|
|
2113
2264
|
const msalConfig = {
|
|
2114
2265
|
auth: {
|
|
2115
2266
|
clientId: config.appSettings.azureB2C.clientId,
|
|
2116
2267
|
authority: config.appSettings.azureB2C.authority,
|
|
2117
2268
|
knownAuthorities: config.appSettings.azureB2C.knownAuthorities,
|
|
2118
|
-
redirectUri: config
|
|
2269
|
+
redirectUri: getAzureB2CRedirectUri(config),
|
|
2119
2270
|
postLogoutRedirectUri: config.appSettings.azureB2C.logoutRedirectUri || window.location.origin,
|
|
2120
2271
|
},
|
|
2121
2272
|
cache: {
|
|
@@ -2957,17 +3108,19 @@ class EntityEditFormComponent {
|
|
|
2957
3108
|
this.createButtonText = createButtonTextFromRoute;
|
|
2958
3109
|
}
|
|
2959
3110
|
ngOnChanges() {
|
|
2960
|
-
if (this.entityId) {
|
|
2961
|
-
this.loadEntity(this.entityId);
|
|
3111
|
+
if (this.entityId !== undefined) {
|
|
3112
|
+
this.loadEntity(this.entityId ?? undefined);
|
|
2962
3113
|
}
|
|
2963
3114
|
}
|
|
2964
3115
|
ngOnDestroy() {
|
|
2965
3116
|
this.routeService?.unsubscribe();
|
|
2966
3117
|
}
|
|
2967
3118
|
ngOnInit() {
|
|
2968
|
-
if (
|
|
3119
|
+
if (this.entityId === undefined) {
|
|
2969
3120
|
this.routeService = this.route.params.subscribe((params) => {
|
|
2970
|
-
this.
|
|
3121
|
+
if (this.entityId === undefined) {
|
|
3122
|
+
this.loadEntity(params.id);
|
|
3123
|
+
}
|
|
2971
3124
|
});
|
|
2972
3125
|
}
|
|
2973
3126
|
}
|
|
@@ -3339,7 +3492,7 @@ class FieldMultiSelectComponent extends FieldComponent {
|
|
|
3339
3492
|
}
|
|
3340
3493
|
ngOnInit() {
|
|
3341
3494
|
super.ngOnInit();
|
|
3342
|
-
this.data$ = this.reload$.pipe(switchMap(() => this.loadData()), takeUntil(this.destroy$));
|
|
3495
|
+
this.data$ = this.reload$.pipe(switchMap$1(() => this.loadData()), takeUntil(this.destroy$));
|
|
3343
3496
|
}
|
|
3344
3497
|
loadData() {
|
|
3345
3498
|
if (this.data) {
|
|
@@ -4162,36 +4315,78 @@ const SKIP_AUTH_TOKEN = new HttpContextToken(() => false);
|
|
|
4162
4315
|
|
|
4163
4316
|
class AuthHeadersInterceptor {
|
|
4164
4317
|
constructor() {
|
|
4165
|
-
this.
|
|
4318
|
+
this.resolver = inject(AuthProviderResolver);
|
|
4166
4319
|
this.settingsService = inject(SettingsService);
|
|
4320
|
+
this.appSettings = inject(AppSettings);
|
|
4167
4321
|
this.isRedirecting = false;
|
|
4168
4322
|
}
|
|
4169
4323
|
intercept(req, next) {
|
|
4170
|
-
if (req.context.get(SKIP_AUTH_TOKEN)
|
|
4324
|
+
if (req.context.get(SKIP_AUTH_TOKEN) ||
|
|
4325
|
+
req.headers.has('Authorization') ||
|
|
4326
|
+
!this.isAuthApiRequest(req.url)) {
|
|
4171
4327
|
return next.handle(req);
|
|
4172
4328
|
}
|
|
4173
|
-
return this.
|
|
4174
|
-
if (
|
|
4175
|
-
this.
|
|
4329
|
+
return this.resolver.getProvider().pipe(take$1(1), switchMap$1((provider) => {
|
|
4330
|
+
if (!provider.isUserLoggedIn()) {
|
|
4331
|
+
return this.handleRequest(req, next, provider);
|
|
4176
4332
|
}
|
|
4177
|
-
return
|
|
4333
|
+
return provider.getAccessToken().pipe(switchMap$1((token) => {
|
|
4334
|
+
if (!token) {
|
|
4335
|
+
this.redirectToLogin(provider);
|
|
4336
|
+
return EMPTY;
|
|
4337
|
+
}
|
|
4338
|
+
return this.handleRequest(this.addAuthHeader(req, token), next, provider);
|
|
4339
|
+
}));
|
|
4178
4340
|
}));
|
|
4179
4341
|
}
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4342
|
+
isAuthApiRequest(requestUrl) {
|
|
4343
|
+
const apiUrl = this.appSettings.apiUrl;
|
|
4344
|
+
if (!apiUrl) {
|
|
4345
|
+
return false;
|
|
4346
|
+
}
|
|
4347
|
+
try {
|
|
4348
|
+
const request = new URL(requestUrl, window.location.origin);
|
|
4349
|
+
const api = new URL(apiUrl, window.location.origin);
|
|
4350
|
+
let apiPath = api.pathname;
|
|
4351
|
+
while (apiPath.endsWith('/')) {
|
|
4352
|
+
apiPath = apiPath.slice(0, -1);
|
|
4353
|
+
}
|
|
4354
|
+
if (!apiPath) {
|
|
4355
|
+
apiPath = '/';
|
|
4356
|
+
}
|
|
4357
|
+
const matchesPath = apiPath === '/' ||
|
|
4358
|
+
request.pathname === apiPath ||
|
|
4359
|
+
request.pathname.startsWith(`${apiPath}/`);
|
|
4360
|
+
return request.origin === api.origin && matchesPath;
|
|
4361
|
+
}
|
|
4362
|
+
catch {
|
|
4363
|
+
return false;
|
|
4364
|
+
}
|
|
4365
|
+
}
|
|
4366
|
+
handleRequest(request, next, provider) {
|
|
4367
|
+
return next.handle(request).pipe(catchError$1((error) => {
|
|
4368
|
+
if (error instanceof HttpErrorResponse &&
|
|
4369
|
+
error.status === HttpStatusCode.Unauthorized) {
|
|
4370
|
+
this.redirectToLogin(provider);
|
|
4371
|
+
}
|
|
4372
|
+
return throwError(() => error);
|
|
4373
|
+
}));
|
|
4184
4374
|
}
|
|
4185
|
-
redirectToLogin() {
|
|
4375
|
+
redirectToLogin(provider) {
|
|
4186
4376
|
if (this.isRedirecting) {
|
|
4187
4377
|
return;
|
|
4188
4378
|
}
|
|
4189
4379
|
this.isRedirecting = true;
|
|
4190
4380
|
this.settingsService.putCurrentCallbackPath();
|
|
4191
|
-
|
|
4381
|
+
defer(() => provider.reauthenticate() ?? EMPTY).subscribe({
|
|
4192
4382
|
error: () => {
|
|
4193
4383
|
this.isRedirecting = false;
|
|
4194
4384
|
},
|
|
4385
|
+
complete: () => {
|
|
4386
|
+
queueMicrotask(() => {
|
|
4387
|
+
this.isRedirecting = false;
|
|
4388
|
+
});
|
|
4389
|
+
},
|
|
4195
4390
|
});
|
|
4196
4391
|
}
|
|
4197
4392
|
addAuthHeader(req, token) {
|
|
@@ -4352,5 +4547,5 @@ function AppSettingsFactory(configuration) {
|
|
|
4352
4547
|
* Generated bundle index. Do not edit.
|
|
4353
4548
|
*/
|
|
4354
4549
|
|
|
4355
|
-
export { AccountMenuComponent, AccountMenuModule, AccountService, ActivityFilterComponent, ActivityFilterModule, ActivityFilterService, AppCoreModule, AppSettings, AppToastrService, AuthProvider, AuthProviderResolver, AzureLoginCallbackComponent, BaseAccountService, ConfirmDialogComponent, ConfirmDialogModule, ContentTypesFormat, CreateNewComponent, CurrentTimeZoneModule, CurrentTimezoneComponent, DebounceDirective, DebounceModule, EntityEditButtonsBarComponent, EntityEditButtonsBarModule, EntityEditComponent, EntityEditFormComponent, EntityEditFormModule, EntityListComponent, EntityListModule, EntityService, EventNames, ExcelExportButtonComponent, ExcelExportButtonModule, FieldCheckBoxInputComponent, FieldCheckBoxInputModule, FieldComponent, FieldDropdownComponent, FieldDropdownModule, FieldDropdownlistComponent, FieldDropdownlistModule, FieldFileSelectComponent, FieldFileSelectModule, FieldFileUploadComponent, FieldFileUploadModule, FieldInputComponent, FieldInputModule, FieldMultiSelectComponent, FieldMultiselectModule, FieldNumericTextBoxInputComponent, FieldNumericTextBoxInputModule, FieldTextAreaComponent, FieldTextAreaModule, FieldTypes, FilterTargets, FooterBarComponent, FooterBarModule, ForbiddenComponent, FormGroupWithErrors, GeneralErrorsComponent, GeneralErrorsModule, HttpCodes, HttpMethods, HttpService, IndiginaConfiguration, IndiginaTreeViewModule, LanguageSelectorComponent, LanguageSelectorModule, LiveUpdatesControlComponent, LiveUpdatesControlModule, LocaleSettingsService, MSALInstanceFactory, MemberTypes, MenuItemGroupComponent, ModalWindowComponent, ModalWindowModule, MulticheckFilterComponent, MulticheckFilterModule, NumberInputComponent, ObjectDropdownComponent, ObjectDropdownModule, Operators, PermissionTypes, PermissionsService, PrettifierFactory, ReEntrySubscription, RequirePermissionDirective, RequirePermissionModule, SKIP_AUTH_TOKEN, SettingsService, SideMenuComponent, SideMenuModule, SignalRService, TopBarModule, TopMenuComponent, TreeViewComponent, TreeViewNodeComponent, UserListAdminComponent, buildActivityEndpoints, buildEntityEndpoints, endpoints, getValueFromFilterByField, urlDeserialize, urlSerialize };
|
|
4550
|
+
export { AccountMenuComponent, AccountMenuModule, AccountService, ActivityFilterComponent, ActivityFilterModule, ActivityFilterService, AppCoreModule, AppSettings, AppToastrService, AuthProvider, AuthProviderResolver, AzureLoginCallbackComponent, BaseAccountService, ConfirmDialogComponent, ConfirmDialogModule, ContentTypesFormat, CreateNewComponent, CurrentTimeZoneModule, CurrentTimezoneComponent, DebounceDirective, DebounceModule, EntityEditButtonsBarComponent, EntityEditButtonsBarModule, EntityEditComponent, EntityEditFormComponent, EntityEditFormModule, EntityListComponent, EntityListModule, EntityService, EventNames, ExcelExportButtonComponent, ExcelExportButtonModule, FieldCheckBoxInputComponent, FieldCheckBoxInputModule, FieldComponent, FieldDropdownComponent, FieldDropdownModule, FieldDropdownlistComponent, FieldDropdownlistModule, FieldFileSelectComponent, FieldFileSelectModule, FieldFileUploadComponent, FieldFileUploadModule, FieldInputComponent, FieldInputModule, FieldMultiSelectComponent, FieldMultiselectModule, FieldNumericTextBoxInputComponent, FieldNumericTextBoxInputModule, FieldTextAreaComponent, FieldTextAreaModule, FieldTypes, FilterTargets, FooterBarComponent, FooterBarModule, ForbiddenComponent, FormGroupWithErrors, GeneralErrorsComponent, GeneralErrorsModule, HttpCodes, HttpMethods, HttpService, IndiginaConfiguration, IndiginaTreeViewModule, LanguageSelectorComponent, LanguageSelectorModule, LiveUpdatesControlComponent, LiveUpdatesControlModule, LocaleSettingsService, MSALInstanceFactory, MemberTypes, MenuItemGroupComponent, ModalWindowComponent, ModalWindowModule, MulticheckFilterComponent, MulticheckFilterModule, NumberInputComponent, ObjectDropdownComponent, ObjectDropdownModule, Operators, PermissionTypes, PermissionsService, PrettifierFactory, ReEntrySubscription, RequirePermissionDirective, RequirePermissionModule, SKIP_AUTH_TOKEN, SettingsService, SideMenuComponent, SideMenuModule, SignalRService, TopBarModule, TopMenuComponent, TreeViewComponent, TreeViewNodeComponent, UserListAdminComponent, buildActivityEndpoints, buildEntityEndpoints, endpoints, getValueFromFilterByField, handleAzureB2CRedirectBridge, urlDeserialize, urlSerialize };
|
|
4356
4551
|
//# sourceMappingURL=indigina-kendo.mjs.map
|