@onecx/angular-integration-interface 4.43.1 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/{esm2020 → esm2022}/lib/services/app-state.service.mjs +4 -4
- package/esm2022/lib/services/configuration.service.mjs +79 -0
- package/esm2022/lib/services/initialize-module-guard.service.mjs +60 -0
- package/esm2022/lib/services/portal-message.service.mjs +49 -0
- package/{esm2020 → esm2022}/lib/services/remote-components.service.mjs +4 -4
- package/{esm2020 → esm2022}/lib/services/theme.service.mjs +5 -5
- package/esm2022/lib/services/user.service.mjs +86 -0
- package/esm2022/lib/services/workspace.service.mjs +124 -0
- package/esm2022/lib/utils/add-initialize-module-guard.utils.mjs +17 -0
- package/{esm2020 → esm2022}/mocks/app-state-service-mock.mjs +4 -4
- package/esm2022/mocks/fake-topic.mjs +25 -0
- package/{fesm2015 → fesm2022}/onecx-angular-integration-interface-mocks.mjs +3 -3
- package/{fesm2015 → fesm2022}/onecx-angular-integration-interface-mocks.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/onecx-angular-integration-interface.mjs +38 -33
- package/fesm2022/onecx-angular-integration-interface.mjs.map +1 -0
- package/lib/services/portal-message.service.d.ts +3 -1
- package/package.json +10 -18
- package/esm2020/lib/services/configuration.service.mjs +0 -79
- package/esm2020/lib/services/initialize-module-guard.service.mjs +0 -60
- package/esm2020/lib/services/portal-message.service.mjs +0 -44
- package/esm2020/lib/services/user.service.mjs +0 -86
- package/esm2020/lib/services/workspace.service.mjs +0 -124
- package/esm2020/lib/utils/add-initialize-module-guard.utils.mjs +0 -17
- package/esm2020/mocks/fake-topic.mjs +0 -25
- package/fesm2015/onecx-angular-integration-interface.mjs +0 -533
- package/fesm2015/onecx-angular-integration-interface.mjs.map +0 -1
- package/fesm2020/onecx-angular-integration-interface-mocks.mjs +0 -71
- package/fesm2020/onecx-angular-integration-interface-mocks.mjs.map +0 -1
- package/fesm2020/onecx-angular-integration-interface.mjs.map +0 -1
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/api/constants.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/api/iauth.service.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/api/injection-tokens.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/model/config-key.model.mjs +0 -0
- /package/{esm2020 → esm2022}/mocks/index.mjs +0 -0
- /package/{esm2020 → esm2022}/mocks/mock-user-service.mjs +0 -0
- /package/{esm2020 → esm2022}/mocks/onecx-angular-integration-interface-mocks.mjs +0 -0
- /package/{esm2020 → esm2022}/onecx-angular-integration-interface.mjs +0 -0
@@ -1,44 +0,0 @@
|
|
1
|
-
import { Injectable } from '@angular/core';
|
2
|
-
import { TranslateService } from '@ngx-translate/core';
|
3
|
-
import { combineLatest, of } from 'rxjs';
|
4
|
-
import { MessageTopic } from '@onecx/integration-interface';
|
5
|
-
import * as i0 from "@angular/core";
|
6
|
-
import * as i1 from "@ngx-translate/core";
|
7
|
-
export class PortalMessageService {
|
8
|
-
constructor(translateService) {
|
9
|
-
this.translateService = translateService;
|
10
|
-
this.message$ = new MessageTopic();
|
11
|
-
}
|
12
|
-
success(msg) {
|
13
|
-
this.addTranslated('success', msg);
|
14
|
-
}
|
15
|
-
info(msg) {
|
16
|
-
this.addTranslated('info', msg);
|
17
|
-
}
|
18
|
-
error(msg) {
|
19
|
-
this.addTranslated('error', msg);
|
20
|
-
}
|
21
|
-
warning(msg) {
|
22
|
-
this.addTranslated('warning', msg);
|
23
|
-
}
|
24
|
-
addTranslated(severity, msg) {
|
25
|
-
combineLatest([
|
26
|
-
msg.summaryKey ? this.translateService.get(msg.summaryKey || '', msg.summaryParameters) : of(undefined),
|
27
|
-
msg.detailKey ? this.translateService.get(msg.detailKey, msg.detailParameters) : of(undefined),
|
28
|
-
]).subscribe(([summaryTranslation, detailTranslation]) => {
|
29
|
-
this.message$.publish({
|
30
|
-
...msg,
|
31
|
-
severity: severity,
|
32
|
-
summary: summaryTranslation,
|
33
|
-
detail: detailTranslation,
|
34
|
-
});
|
35
|
-
});
|
36
|
-
}
|
37
|
-
}
|
38
|
-
PortalMessageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PortalMessageService, deps: [{ token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
39
|
-
PortalMessageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PortalMessageService, providedIn: 'any' });
|
40
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PortalMessageService, decorators: [{
|
41
|
-
type: Injectable,
|
42
|
-
args: [{ providedIn: 'any' }]
|
43
|
-
}], ctorParameters: function () { return [{ type: i1.TranslateService }]; } });
|
44
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicG9ydGFsLW1lc3NhZ2Uuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvYW5ndWxhci1pbnRlZ3JhdGlvbi1pbnRlcmZhY2Uvc3JjL2xpYi9zZXJ2aWNlcy9wb3J0YWwtbWVzc2FnZS5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUE7QUFDMUMsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0scUJBQXFCLENBQUE7QUFDdEQsT0FBTyxFQUFFLGFBQWEsRUFBRSxFQUFFLEVBQUUsTUFBTSxNQUFNLENBQUE7QUFDeEMsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLDhCQUE4QixDQUFBOzs7QUFtQjNELE1BQU0sT0FBTyxvQkFBb0I7SUFDL0IsWUFBb0IsZ0JBQWtDO1FBQWxDLHFCQUFnQixHQUFoQixnQkFBZ0IsQ0FBa0I7UUFFdEQs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aW9uXTogc3RyaW5nW10pID0+IHtcbiAgICAgIHRoaXMubWVzc2FnZSQucHVibGlzaCh7XG4gICAgICAgIC4uLm1zZyxcbiAgICAgICAgc2V2ZXJpdHk6IHNldmVyaXR5LFxuICAgICAgICBzdW1tYXJ5OiBzdW1tYXJ5VHJhbnNsYXRpb24sXG4gICAgICAgIGRldGFpbDogZGV0YWlsVHJhbnNsYXRpb24sXG4gICAgICB9KVxuICAgIH0pXG4gIH1cbn1cbiJdfQ==
|
@@ -1,86 +0,0 @@
|
|
1
|
-
import { Injectable } from '@angular/core';
|
2
|
-
import { BehaviorSubject, map, filter, firstValueFrom, skip } from 'rxjs';
|
3
|
-
import { PermissionsTopic, UserProfileTopic } from '@onecx/integration-interface';
|
4
|
-
import { DEFAULT_LANG } from '../api/constants';
|
5
|
-
import * as i0 from "@angular/core";
|
6
|
-
export class UserService {
|
7
|
-
constructor() {
|
8
|
-
this.profile$ = new UserProfileTopic();
|
9
|
-
this.permissions$ = new BehaviorSubject([]);
|
10
|
-
this.lang$ = new BehaviorSubject(this.determineLanguage() ?? DEFAULT_LANG);
|
11
|
-
this.permissionsTopic$ = new PermissionsTopic();
|
12
|
-
this.profile$
|
13
|
-
.pipe(map((profile) => profile.accountSettings?.localeAndTimeSettings?.locale ?? this.determineLanguage() ?? DEFAULT_LANG))
|
14
|
-
.subscribe(this.lang$);
|
15
|
-
this.oldStylePermissionsInitialized = firstValueFrom(this.permissions$.pipe(skip(1)));
|
16
|
-
this.profile$
|
17
|
-
.pipe(map((profile) => this.extractPermissions(profile)), filter((permissions) => !!permissions))
|
18
|
-
.subscribe(this.permissions$);
|
19
|
-
}
|
20
|
-
ngOnDestroy() {
|
21
|
-
this.profile$.destroy();
|
22
|
-
}
|
23
|
-
hasPermission(permissionKey) {
|
24
|
-
const oldConceptResult = this.permissions$.getValue()
|
25
|
-
? this.permissions$.getValue()?.includes(permissionKey)
|
26
|
-
: false;
|
27
|
-
const result = this.permissionsTopic$.getValue()
|
28
|
-
? this.permissionsTopic$.getValue()?.includes(permissionKey)
|
29
|
-
: oldConceptResult;
|
30
|
-
if (!result) {
|
31
|
-
console.log(`👮♀️ No permission for: ${permissionKey}`);
|
32
|
-
}
|
33
|
-
return !!result;
|
34
|
-
}
|
35
|
-
determineLanguage() {
|
36
|
-
if (typeof window === 'undefined' || typeof window.navigator === 'undefined') {
|
37
|
-
return undefined;
|
38
|
-
}
|
39
|
-
let browserLang = window.navigator.languages ? window.navigator.languages[0] : null;
|
40
|
-
browserLang = browserLang || window.navigator.language;
|
41
|
-
if (typeof browserLang === 'undefined') {
|
42
|
-
return undefined;
|
43
|
-
}
|
44
|
-
if (browserLang.indexOf('-') !== -1) {
|
45
|
-
browserLang = browserLang.split('-')[0];
|
46
|
-
}
|
47
|
-
if (browserLang.indexOf('_') !== -1) {
|
48
|
-
browserLang = browserLang.split('_')[0];
|
49
|
-
}
|
50
|
-
return browserLang;
|
51
|
-
}
|
52
|
-
extractPermissions(userProfile) {
|
53
|
-
if (userProfile) {
|
54
|
-
if (userProfile.memberships) {
|
55
|
-
const permissions = [];
|
56
|
-
userProfile.memberships.forEach((m) => {
|
57
|
-
m.roleMemberships?.forEach((r) => {
|
58
|
-
r.permissions?.forEach((p) => {
|
59
|
-
if (p) {
|
60
|
-
if (p.key !== undefined) {
|
61
|
-
permissions.push(p.key);
|
62
|
-
}
|
63
|
-
}
|
64
|
-
});
|
65
|
-
});
|
66
|
-
});
|
67
|
-
return permissions;
|
68
|
-
}
|
69
|
-
}
|
70
|
-
return null;
|
71
|
-
}
|
72
|
-
get isInitialized() {
|
73
|
-
return Promise.all([
|
74
|
-
Promise.race([this.permissionsTopic$.isInitialized, this.oldStylePermissionsInitialized]),
|
75
|
-
this.profile$.isInitialized,
|
76
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
77
|
-
]).then(() => { });
|
78
|
-
}
|
79
|
-
}
|
80
|
-
UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
81
|
-
UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService, providedIn: 'root' });
|
82
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService, decorators: [{
|
83
|
-
type: Injectable,
|
84
|
-
args: [{ providedIn: 'root' }]
|
85
|
-
}], ctorParameters: function () { return []; } });
|
86
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlci5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9hbmd1bGFyLWludGVncmF0aW9uLWludGVyZmFjZS9zcmMvbGliL3NlcnZpY2VzL3VzZXIuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFhLE1BQU0sZUFBZSxDQUFBO0FBQ3JELE9BQU8sRUFBRSxlQUFlLEVBQUUsR0FBRyxFQUFFLE1BQU0sRUFBRSxjQUFjLEVBQUUsSUFBSSxFQUFFLE1BQU0sTUFBTSxDQUFBO0FBQ3pFLE9BQU8sRUFBRSxnQkFBZ0IsRUFBZSxnQkFBZ0IsRUFBRSxNQUFNLDhCQUE4QixDQUFBO0FBQzlGLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQTs7QUFHL0MsTUFBTSxPQUFPLFdBQVc7SUFRdEI7UUFQQSxhQUFRLEdBQUcsSUFBSSxnQkFBZ0IsRUFBRSxDQUFBO1FBQ2pDLGlCQUFZLEdBQUcsSUFBSSxlQUFlLENBQVcsRUFBRSxDQUFDLENBQUE7UUFDaEQsVUFBSyxHQUFHLElBQUksZUFBZSxDQUFDLElBQUksQ0FBQyxpQkFBaUIs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mRlZmluZWRcbiAgICB9XG5cbiAgICBpZiAoYnJvd3NlckxhbmcuaW5kZXhPZignLScpICE9PSAtMSkge1xuICAgICAgYnJvd3NlckxhbmcgPSBicm93c2VyTGFuZy5zcGxpdCgnLScpWzBdXG4gICAgfVxuXG4gICAgaWYgKGJyb3dzZXJMYW5nLmluZGV4T2YoJ18nKSAhPT0gLTEpIHtcbiAgICAgIGJyb3dzZXJMYW5nID0gYnJvd3Nlckxhbmcuc3BsaXQoJ18nKVswXVxuICAgIH1cblxuICAgIHJldHVybiBicm93c2VyTGFuZ1xuICB9XG5cbiAgcHJpdmF0ZSBleHRyYWN0UGVybWlzc2lvbnModXNlclByb2ZpbGU6IFVzZXJQcm9maWxlKSB7XG4gICAgaWYgKHVzZXJQcm9maWxlKSB7XG4gICAgICBpZiAodXNlclByb2ZpbGUubWVtYmVyc2hpcHMpIHtcbiAgICAgICAgY29uc3QgcGVybWlzc2lvbnM6IHN0cmluZ1tdID0gW11cbiAgICAgICAgdXNlclByb2ZpbGUubWVtYmVyc2hpcHMuZm9yRWFjaCgobSkgPT4ge1xuICAgICAgICAgIG0ucm9sZU1lbWJlcnNoaXBzPy5mb3JFYWNoKChyKSA9PiB7XG4gICAgICAgICAgICByLnBlcm1pc3Npb25zPy5mb3JFYWNoKChwKSA9PiB7XG4gICAgICAgICAgICAgIGlmIChwKSB7XG4gICAgICAgICAgICAgICAgaWYgKHAua2V5ICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgIHBlcm1pc3Npb25zLnB1c2gocC5rZXkpXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KVxuICAgICAgICAgIH0pXG4gICAgICAgIH0pXG4gICAgICAgIHJldHVybiBwZXJtaXNzaW9uc1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gbnVsbFxuICB9XG5cbiAgZ2V0IGlzSW5pdGlhbGl6ZWQoKTogUHJvbWlzZTx2b2lkPiB7XG4gICAgcmV0dXJuIFByb21pc2UuYWxsKFtcbiAgICAgIFByb21pc2UucmFjZShbdGhpcy5wZXJtaXNzaW9uc1RvcGljJC5pc0luaXRpYWxpemVkLCB0aGlzLm9sZFN0eWxlUGVybWlzc2lvbnNJbml0aWFsaXplZF0pLFxuICAgICAgdGhpcy5wcm9maWxlJC5pc0luaXRpYWxpemVkLFxuICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1lbXB0eS1mdW5jdGlvblxuICAgIF0pLnRoZW4oKCkgPT4ge30pXG4gIH1cbn1cbiJdfQ==
|
@@ -1,124 +0,0 @@
|
|
1
|
-
import { Injectable } from '@angular/core';
|
2
|
-
import { AppStateService } from './app-state.service';
|
3
|
-
import { map } from 'rxjs';
|
4
|
-
import { Location } from '@angular/common';
|
5
|
-
import * as i0 from "@angular/core";
|
6
|
-
import * as i1 from "./app-state.service";
|
7
|
-
export class WorkspaceService {
|
8
|
-
constructor(appStateService) {
|
9
|
-
this.appStateService = appStateService;
|
10
|
-
this.aliasStart = '[[';
|
11
|
-
this.aliasEnd = ']]';
|
12
|
-
this.paramStart = '{';
|
13
|
-
this.paramEnd = '}';
|
14
|
-
}
|
15
|
-
getUrl(appId, productName, endpointName, params = {}) {
|
16
|
-
return this.appStateService.currentWorkspace$.pipe(map((workspace) => {
|
17
|
-
const finalUrl = this.constructRouteUrl(workspace, appId, productName, endpointName, params);
|
18
|
-
return finalUrl;
|
19
|
-
}));
|
20
|
-
}
|
21
|
-
constructBaseUrlFromWorkspace(workspace) {
|
22
|
-
if (workspace.baseUrl === undefined) {
|
23
|
-
console.log('WARNING: There was no baseUrl for received workspace.');
|
24
|
-
return '';
|
25
|
-
}
|
26
|
-
return workspace.baseUrl;
|
27
|
-
}
|
28
|
-
constructRouteUrl(workspace, appId, productName, endpointName, params) {
|
29
|
-
const route = this.filterRouteFromList(workspace.routes, appId, productName);
|
30
|
-
let url = this.constructBaseUrlFromWorkspace(workspace);
|
31
|
-
if (!route) {
|
32
|
-
console.log(`WARNING: No route.baseUrl could be found for given appId "${appId}" and productName "${productName}"`);
|
33
|
-
return url;
|
34
|
-
}
|
35
|
-
if (route.baseUrl !== undefined && route.baseUrl.length > 0) {
|
36
|
-
url = route.baseUrl;
|
37
|
-
}
|
38
|
-
url = Location.joinWithSlash(url, this.constructEndpointUrl(route, endpointName, params));
|
39
|
-
return url;
|
40
|
-
}
|
41
|
-
constructEndpointUrl(route, endpointName, params) {
|
42
|
-
if (!route.endpoints) {
|
43
|
-
return '';
|
44
|
-
}
|
45
|
-
const finalEndpoint = this.dissolveEndpoint(endpointName, route.endpoints);
|
46
|
-
if (!finalEndpoint || finalEndpoint.path === undefined) {
|
47
|
-
console.log('WARNING: No endpoint or endpoint.path could be found');
|
48
|
-
return '';
|
49
|
-
}
|
50
|
-
const paramsFilled = this.fillParamsForPath(finalEndpoint.path, params);
|
51
|
-
if (paramsFilled === undefined) {
|
52
|
-
console.log('WARNING: Params could not be filled correctly');
|
53
|
-
return '';
|
54
|
-
}
|
55
|
-
return paramsFilled;
|
56
|
-
}
|
57
|
-
filterRouteFromList(routes, appId, productName) {
|
58
|
-
if (!routes) {
|
59
|
-
return undefined;
|
60
|
-
}
|
61
|
-
const productRoutes = routes.filter((route) => route.appId === appId && route.productName === productName);
|
62
|
-
if (productRoutes.length === 0) {
|
63
|
-
return undefined;
|
64
|
-
}
|
65
|
-
if (productRoutes.length > 1) {
|
66
|
-
console.log('WARNING: There were more than one route. First route has been used.');
|
67
|
-
}
|
68
|
-
return productRoutes[0];
|
69
|
-
}
|
70
|
-
dissolveEndpoint(endpointName, endpoints) {
|
71
|
-
let endpoint = endpoints.find((ep) => ep.name === endpointName);
|
72
|
-
if (!endpoint) {
|
73
|
-
return undefined;
|
74
|
-
}
|
75
|
-
while (endpoint.path?.includes(this.aliasStart)) {
|
76
|
-
const path = endpoint.path;
|
77
|
-
const startIdx = path.indexOf(this.aliasStart) + this.aliasStart.length;
|
78
|
-
const endIdx = path.lastIndexOf(this.aliasEnd);
|
79
|
-
if (endIdx <= startIdx) {
|
80
|
-
return undefined;
|
81
|
-
}
|
82
|
-
const aliasName = path.substring(startIdx, endIdx);
|
83
|
-
endpoint = endpoints.find((ep) => ep.name === aliasName);
|
84
|
-
if (!endpoint) {
|
85
|
-
return undefined;
|
86
|
-
}
|
87
|
-
}
|
88
|
-
return endpoint;
|
89
|
-
}
|
90
|
-
fillParamsForPath(path, params) {
|
91
|
-
while (path.includes(this.paramStart)) {
|
92
|
-
const paramName = path.substring(path.indexOf(this.paramStart) + this.paramStart.length, path.indexOf(this.paramEnd));
|
93
|
-
const paramValue = this.getStringFromUnknown(params[paramName]);
|
94
|
-
if (paramValue != undefined && paramValue.length > 0) {
|
95
|
-
path = path.replace(this.paramStart.concat(paramName).concat(this.paramEnd), paramValue);
|
96
|
-
}
|
97
|
-
else {
|
98
|
-
console.log(`WARNING: Searched param "${paramName}" was not found in given param list `);
|
99
|
-
return '';
|
100
|
-
}
|
101
|
-
}
|
102
|
-
return path;
|
103
|
-
}
|
104
|
-
getStringFromUnknown(value) {
|
105
|
-
if (value === null || value === undefined) {
|
106
|
-
return '';
|
107
|
-
}
|
108
|
-
else if (typeof value === 'string') {
|
109
|
-
return value;
|
110
|
-
}
|
111
|
-
else {
|
112
|
-
return String(value);
|
113
|
-
}
|
114
|
-
}
|
115
|
-
}
|
116
|
-
WorkspaceService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WorkspaceService, deps: [{ token: i1.AppStateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
117
|
-
WorkspaceService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WorkspaceService, providedIn: 'root' });
|
118
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WorkspaceService, decorators: [{
|
119
|
-
type: Injectable,
|
120
|
-
args: [{
|
121
|
-
providedIn: 'root',
|
122
|
-
}]
|
123
|
-
}], ctorParameters: function () { return [{ type: i1.AppStateService }]; } });
|
124
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid29ya3NwYWNlLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2FuZ3VsYXItaW50ZWdyYXRpb24taW50ZXJmYWNlL3NyYy9saWIvc2VydmljZXMvd29ya3NwYWNlLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQTtBQUMxQyxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0scUJBQXFCLENBQUE7QUFDckQsT0FBTyxFQUFjLEdBQUcsRUFBRSxNQUFNLE1BQU0sQ0FBQTtBQUd0QyxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0saUJBQWlCLENBQUE7OztBQUsxQyxNQUFNLE9BQU8sZ0JBQWdCO0lBTTNCLFlBQXNCLGVBQWdDO1FBQWhDLG9CQUFlLEdBQWYsZUFBZSxDQUFpQjtRQUw5QyxlQUFVLEdBQUcsSUFBSSxDQUFBO1FBQ2pCLGFBQVEsR0FBRyxJQUFJLENBQUE7UUFDZixlQUFVLEdBQUcsR0FBRyxDQUFBO1FBQ2hCLGFBQVEsR0FBRyxHQUFHLENBQUE7SUFFbUMsQ0FBQztJQUUxRCxNQUFNLENBQ0osS0FBYSxFQUNiLFdBQW1CLEVBQ25CLFlBQW9CLEVBQ3BCLFNBQWtDLEVBQUU7UUFFcEMsT0FBTyxJQUFJLENBQUMsZUFBZSxDQUFDLGlCQUFpQixDQUFDLElBQUksQ0FDaEQsR0FBRyxDQUFDLENBQUMsU0FBUyxFQUFFLEVBQUU7WUFDaEIsTUFBTSxRQUFRLEdBQ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lZCBwYXJhbSBcIiR7cGFyYW1OYW1lfVwiIHdhcyBub3QgZm91bmQgaW4gZ2l2ZW4gcGFyYW0gbGlzdCBgKVxuICAgICAgICByZXR1cm4gJydcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIHBhdGhcbiAgfVxuXG4gIHByaXZhdGUgZ2V0U3RyaW5nRnJvbVVua25vd24odmFsdWU6IHVua25vd24pOiBzdHJpbmcge1xuICAgIGlmICh2YWx1ZSA9PT0gbnVsbCB8fCB2YWx1ZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICByZXR1cm4gJydcbiAgICB9IGVsc2UgaWYgKHR5cGVvZiB2YWx1ZSA9PT0gJ3N0cmluZycpIHtcbiAgICAgIHJldHVybiB2YWx1ZVxuICAgIH0gZWxzZSB7XG4gICAgICByZXR1cm4gU3RyaW5nKHZhbHVlKVxuICAgIH1cbiAgfVxufVxuIl19
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import { InitializeModuleGuard } from '../services/initialize-module-guard.service';
|
2
|
-
export function addInitializeModuleGuard(routes, initializeModuleGuard = InitializeModuleGuard) {
|
3
|
-
return routes.map((r) => {
|
4
|
-
if (r.redirectTo) {
|
5
|
-
return r;
|
6
|
-
}
|
7
|
-
const route = {
|
8
|
-
canActivate: [],
|
9
|
-
...r,
|
10
|
-
};
|
11
|
-
if (!route.canActivate.includes(initializeModuleGuard)) {
|
12
|
-
route.canActivate.push(initializeModuleGuard);
|
13
|
-
}
|
14
|
-
return route;
|
15
|
-
});
|
16
|
-
}
|
17
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkLWluaXRpYWxpemUtbW9kdWxlLWd1YXJkLnV0aWxzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9hbmd1bGFyLWludGVncmF0aW9uLWludGVyZmFjZS9zcmMvbGliL3V0aWxzL2FkZC1pbml0aWF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GVGbiA9IEluaXRpYWxpemVNb2R1bGVHdWFyZFxuKTogUm91dGVbXSB7XG4gIHJldHVybiByb3V0ZXMubWFwKChyKSA9PiB7XG4gICAgaWYgKHIucmVkaXJlY3RUbykge1xuICAgICAgcmV0dXJuIHJcbiAgICB9XG4gICAgY29uc3Qgcm91dGUgPSB7XG4gICAgICBjYW5BY3RpdmF0ZTogW10sXG4gICAgICAuLi5yLFxuICAgIH1cbiAgICBpZiAoIXJvdXRlLmNhbkFjdGl2YXRlLmluY2x1ZGVzKGluaXRpYWxpemVNb2R1bGVHdWFyZCkpIHtcbiAgICAgIHJvdXRlLmNhbkFjdGl2YXRlLnB1c2goaW5pdGlhbGl6ZU1vZHVsZUd1YXJkKVxuICAgIH1cbiAgICByZXR1cm4gcm91dGVcbiAgfSlcbn0iXX0=
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import { BehaviorSubject, ReplaySubject } from 'rxjs';
|
2
|
-
export class FakeTopic {
|
3
|
-
constructor(initialValue = undefined) {
|
4
|
-
if (initialValue !== undefined) {
|
5
|
-
this.state = new BehaviorSubject(initialValue);
|
6
|
-
}
|
7
|
-
else {
|
8
|
-
this.state = new ReplaySubject(1);
|
9
|
-
}
|
10
|
-
}
|
11
|
-
asObservable() {
|
12
|
-
return this.state.asObservable();
|
13
|
-
}
|
14
|
-
subscribe(observerOrNext, error, complete) {
|
15
|
-
return this.asObservable().subscribe(observerOrNext, error, complete);
|
16
|
-
}
|
17
|
-
pipe(...operations) {
|
18
|
-
return this.asObservable().pipe(...operations);
|
19
|
-
}
|
20
|
-
publish(value) {
|
21
|
-
this.state.next(value);
|
22
|
-
return Promise.resolve();
|
23
|
-
}
|
24
|
-
}
|
25
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFrZS10b3BpYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvYW5ndWxhci1pbnR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