@c8y/ngx-components 1017.0.262 → 1017.0.263
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/ecosystem/shared/ecosystem.service.d.ts +1 -1
- package/esm2020/core/common/permissions.service.mjs +2 -4
- package/esm2020/ecosystem/shared/ecosystem.service.mjs +7 -9
- package/esm2020/sub-assets/add-group/add-group.component.mjs +3 -4
- package/esm2020/sub-assets/sub-assets.component.mjs +2 -5
- package/fesm2015/c8y-ngx-components-ecosystem-shared.mjs +6 -8
- package/fesm2015/c8y-ngx-components-ecosystem-shared.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-sub-assets.mjs +3 -7
- package/fesm2015/c8y-ngx-components-sub-assets.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components.mjs +1 -3
- package/fesm2015/c8y-ngx-components.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-ecosystem-shared.mjs +6 -8
- package/fesm2020/c8y-ngx-components-ecosystem-shared.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-sub-assets.mjs +3 -7
- package/fesm2020/c8y-ngx-components-sub-assets.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components.mjs +1 -3
- package/fesm2020/c8y-ngx-components.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -11,8 +11,8 @@ import * as i3 from '@c8y/client';
|
|
|
11
11
|
import { ApplicationAvailability, ApplicationType } from '@c8y/client';
|
|
12
12
|
import { saveAs } from 'file-saver';
|
|
13
13
|
import { groupBy, uniqBy, get, pick, kebabCase, cloneDeep } from 'lodash-es';
|
|
14
|
-
import { BehaviorSubject, merge, combineLatest } from 'rxjs';
|
|
15
|
-
import { debounceTime, take, distinctUntilKeyChanged,
|
|
14
|
+
import { BehaviorSubject, defer, merge, combineLatest } from 'rxjs';
|
|
15
|
+
import { map, shareReplay, debounceTime, take, distinctUntilKeyChanged, tap, filter, switchMap } from 'rxjs/operators';
|
|
16
16
|
import { gt, coerce } from 'semver';
|
|
17
17
|
import * as i2$1 from '@ngx-translate/core';
|
|
18
18
|
import * as i3$1 from '@angular/common';
|
|
@@ -186,6 +186,7 @@ class EcosystemService {
|
|
|
186
186
|
this.inventoryService = inventoryService;
|
|
187
187
|
this.appDeleted = new EventEmitter();
|
|
188
188
|
this.progress = new BehaviorSubject(null);
|
|
189
|
+
this.appsGroupedByContextPath$ = defer(() => this.getWebApplications()).pipe(map(webApps => groupBy(webApps, 'contextPath')), shareReplay({ bufferSize: 1, refCount: true }));
|
|
189
190
|
}
|
|
190
191
|
getUniqueAppConfig(srcApp, existingApps) {
|
|
191
192
|
let app = {
|
|
@@ -261,7 +262,6 @@ class EcosystemService {
|
|
|
261
262
|
return __awaiter(this, void 0, void 0, function* () {
|
|
262
263
|
const apps = (yield this.getApplications(customFilter)).data;
|
|
263
264
|
const webApps = apps.filter(app => this.isApplication(app));
|
|
264
|
-
this.appsGroupedByContextPath = groupBy(webApps, 'contextPath');
|
|
265
265
|
return webApps.sort((a, b) => a.name.localeCompare(b.name));
|
|
266
266
|
});
|
|
267
267
|
}
|
|
@@ -311,7 +311,7 @@ class EcosystemService {
|
|
|
311
311
|
}
|
|
312
312
|
canDeleteApp(app) {
|
|
313
313
|
return __awaiter(this, void 0, void 0, function* () {
|
|
314
|
-
return (this.isOwner(app) && (
|
|
314
|
+
return (this.isOwner(app) && (!this.isCurrentApp(app) || (yield this.hasSubscribedAppParent(app))));
|
|
315
315
|
});
|
|
316
316
|
}
|
|
317
317
|
isOwner(app) {
|
|
@@ -677,10 +677,8 @@ class EcosystemService {
|
|
|
677
677
|
hasSubscribedAppParent(app) {
|
|
678
678
|
var _a;
|
|
679
679
|
return __awaiter(this, void 0, void 0, function* () {
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
}
|
|
683
|
-
return app.contextPath && ((_a = this.appsGroupedByContextPath[app.contextPath]) === null || _a === void 0 ? void 0 : _a.length) === 2;
|
|
680
|
+
const appsGroupedByContextPath = yield this.appsGroupedByContextPath$.pipe(take(1)).toPromise();
|
|
681
|
+
return app.contextPath && ((_a = appsGroupedByContextPath[app.contextPath]) === null || _a === void 0 ? void 0 : _a.length) === 2;
|
|
684
682
|
});
|
|
685
683
|
}
|
|
686
684
|
/**
|