From 185e7a08749b858158e3fccd901554fb27eb896a Mon Sep 17 00:00:00 2001 From: Artem Babak Date: Tue, 13 Apr 2021 12:53:39 +0300 Subject: [PATCH 1/3] Entities table config: fixed addEnabled, detailsReadonly for edge_customer_user --- .../modules/home/pages/asset/assets-table-config.resolver.ts | 4 ++-- .../home/pages/dashboard/dashboards-table-config.resolver.ts | 4 ++-- .../home/pages/device/devices-table-config.resolver.ts | 4 ++-- .../pages/entity-view/entity-views-table-config.resolver.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ui-ngx/src/app/modules/home/pages/asset/assets-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/asset/assets-table-config.resolver.ts index 57f4a18205..4ea3a459cd 100644 --- a/ui-ngx/src/app/modules/home/pages/asset/assets-table-config.resolver.ts +++ b/ui-ngx/src/app/modules/home/pages/asset/assets-table-config.resolver.ts @@ -104,7 +104,7 @@ export class AssetsTableConfigResolver implements Resolve this.onAssetAction(action); - this.config.detailsReadonly = () => this.config.componentsData.assetScope === 'customer_user'; + this.config.detailsReadonly = () => (this.config.componentsData.assetScope === 'customer_user' || this.config.componentsData.assetScope === 'edge_customer_user'); this.config.headerComponent = AssetTableHeaderComponent; @@ -151,7 +151,7 @@ export class AssetsTableConfigResolver implements Resolve this.config.componentsData.assetScope === 'tenant'; return this.config; diff --git a/ui-ngx/src/app/modules/home/pages/dashboard/dashboards-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/dashboard/dashboards-table-config.resolver.ts index 61422f1fa3..0a85c81375 100644 --- a/ui-ngx/src/app/modules/home/pages/dashboard/dashboards-table-config.resolver.ts +++ b/ui-ngx/src/app/modules/home/pages/dashboard/dashboards-table-config.resolver.ts @@ -103,7 +103,7 @@ export class DashboardsTableConfigResolver implements Resolve this.onDashboardAction(action); - this.config.detailsReadonly = () => this.config.componentsData.dashboardScope === 'customer_user'; + this.config.detailsReadonly = () => (this.config.componentsData.dashboardScope === 'customer_user' || this.config.componentsData.dashboardScope === 'edge_customer_user'); } resolve(route: ActivatedRouteSnapshot): Observable> { @@ -147,7 +147,7 @@ export class DashboardsTableConfigResolver implements Resolve this.config.componentsData.dashboardScope === 'tenant'; return this.config; diff --git a/ui-ngx/src/app/modules/home/pages/device/devices-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/device/devices-table-config.resolver.ts index 1349ffae1e..36b93fa697 100644 --- a/ui-ngx/src/app/modules/home/pages/device/devices-table-config.resolver.ts +++ b/ui-ngx/src/app/modules/home/pages/device/devices-table-config.resolver.ts @@ -112,7 +112,7 @@ export class DevicesTableConfigResolver implements Resolve this.onDeviceAction(action); - this.config.detailsReadonly = () => this.config.componentsData.deviceScope === 'customer_user'; + this.config.detailsReadonly = () => (this.config.componentsData.deviceScope === 'customer_user' || this.config.componentsData.deviceScope === 'edge_customer_user'); this.config.headerComponent = DeviceTableHeaderComponent; @@ -161,7 +161,7 @@ export class DevicesTableConfigResolver implements Resolve this.config.componentsData.deviceScope === 'tenant'; return this.config; diff --git a/ui-ngx/src/app/modules/home/pages/entity-view/entity-views-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/entity-view/entity-views-table-config.resolver.ts index 5243a55a83..04c7469f71 100644 --- a/ui-ngx/src/app/modules/home/pages/entity-view/entity-views-table-config.resolver.ts +++ b/ui-ngx/src/app/modules/home/pages/entity-view/entity-views-table-config.resolver.ts @@ -104,7 +104,7 @@ export class EntityViewsTableConfigResolver implements Resolve this.onEntityViewAction(action); - this.config.detailsReadonly = () => this.config.componentsData.entityViewScope === 'customer_user'; + this.config.detailsReadonly = () => (this.config.componentsData.entityViewScope === 'customer_user' || this.config.componentsData.entityViewScope === 'edge_customer_user'); this.config.headerComponent = EntityViewTableHeaderComponent; @@ -152,7 +152,7 @@ export class EntityViewsTableConfigResolver implements Resolve this.config.componentsData.entityViewScope === 'tenant'; return this.config; From 790cef385df52f8e34e023da441b95ccf473ee0b Mon Sep 17 00:00:00 2001 From: Artem Babak Date: Tue, 13 Apr 2021 12:56:48 +0300 Subject: [PATCH 2/3] Edge component: hide sensitive buttons for customer_user/customer --- .../home/pages/edge/edge.component.html | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ui-ngx/src/app/modules/home/pages/edge/edge.component.html b/ui-ngx/src/app/modules/home/pages/edge/edge.component.html index 3177c5194f..6ae548acb2 100644 --- a/ui-ngx/src/app/modules/home/pages/edge/edge.component.html +++ b/ui-ngx/src/app/modules/home/pages/edge/edge.component.html @@ -44,31 +44,31 @@ @@ -85,7 +85,7 @@ ngxClipboard (cbOnSuccess)="onEdgeInfoCopied('key')" [cbContent]="entity?.routingKey" - [fxShow]="!isEdit && (edgeScope === 'tenant' || edgeScope === 'customer')"> + [fxShow]="!isEdit && edgeScope !== 'customer_user'"> edge.copy-edge-key @@ -93,7 +93,7 @@ ngxClipboard (cbOnSuccess)="onEdgeInfoCopied('secret')" [cbContent]="entity?.secret" - [fxShow]="!isEdit && (edgeScope === 'tenant' || edgeScope === 'customer')"> + [fxShow]="!isEdit && edgeScope !== 'customer_user'"> edge.copy-edge-secret @@ -101,7 +101,7 @@ ngxClipboard [disabled]="(isLoading$ | async)" (click)="onEntityAction($event, 'syncEdge')" - [fxShow]="!isEdit && (edgeScope === 'tenant' || edgeScope === 'customer')"> + [fxShow]="!isEdit && edgeScope !== 'customer_user'"> edge.sync @@ -132,7 +132,7 @@ [required]="true" [entityType]="entityType.EDGE"> -
+
edge.edge-license-key @@ -142,7 +142,7 @@
-
+
edge.cloud-endpoint-hint
edge.cloud-endpoint @@ -153,7 +153,7 @@
-
+
edge.edge-key @@ -164,7 +164,7 @@
-
+
edge.edge-secret From d60bb58fe2b523f5b42e5adf47ed0e146a5b0d72 Mon Sep 17 00:00:00 2001 From: Artem Babak Date: Tue, 13 Apr 2021 12:58:00 +0300 Subject: [PATCH 3/3] Fixed translation: unassign edges --- .../modules/home/pages/edge/edges-table-config.resolver.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui-ngx/src/app/modules/home/pages/edge/edges-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/edge/edges-table-config.resolver.ts index 96251948d5..6cbeff0efe 100644 --- a/ui-ngx/src/app/modules/home/pages/edge/edges-table-config.resolver.ts +++ b/ui-ngx/src/app/modules/home/pages/edge/edges-table-config.resolver.ts @@ -477,8 +477,8 @@ export class EdgesTableConfigResolver implements Resolve