Commit 185e7a08749b858158e3fccd901554fb27eb896a

Authored by Artem Babak
1 parent 29f64d93

Entities table config: fixed addEnabled, detailsReadonly for edge_customer_user

@@ -104,7 +104,7 @@ export class AssetsTableConfigResolver implements Resolve<EntityTableConfig<Asse @@ -104,7 +104,7 @@ export class AssetsTableConfigResolver implements Resolve<EntityTableConfig<Asse
104 )); 104 ));
105 }; 105 };
106 this.config.onEntityAction = action => this.onAssetAction(action); 106 this.config.onEntityAction = action => this.onAssetAction(action);
107 - this.config.detailsReadonly = () => this.config.componentsData.assetScope === 'customer_user'; 107 + this.config.detailsReadonly = () => (this.config.componentsData.assetScope === 'customer_user' || this.config.componentsData.assetScope === 'edge_customer_user');
108 108
109 this.config.headerComponent = AssetTableHeaderComponent; 109 this.config.headerComponent = AssetTableHeaderComponent;
110 110
@@ -151,7 +151,7 @@ export class AssetsTableConfigResolver implements Resolve<EntityTableConfig<Asse @@ -151,7 +151,7 @@ export class AssetsTableConfigResolver implements Resolve<EntityTableConfig<Asse
151 this.config.cellActionDescriptors = this.configureCellActions(this.config.componentsData.assetScope); 151 this.config.cellActionDescriptors = this.configureCellActions(this.config.componentsData.assetScope);
152 this.config.groupActionDescriptors = this.configureGroupActions(this.config.componentsData.assetScope); 152 this.config.groupActionDescriptors = this.configureGroupActions(this.config.componentsData.assetScope);
153 this.config.addActionDescriptors = this.configureAddActions(this.config.componentsData.assetScope); 153 this.config.addActionDescriptors = this.configureAddActions(this.config.componentsData.assetScope);
154 - this.config.addEnabled = this.config.componentsData.assetScope !== 'customer_user'; 154 + this.config.addEnabled = !(this.config.componentsData.assetScope === 'customer_user' || this.config.componentsData.assetScope === 'edge_customer_user');
155 this.config.entitiesDeleteEnabled = this.config.componentsData.assetScope === 'tenant'; 155 this.config.entitiesDeleteEnabled = this.config.componentsData.assetScope === 'tenant';
156 this.config.deleteEnabled = () => this.config.componentsData.assetScope === 'tenant'; 156 this.config.deleteEnabled = () => this.config.componentsData.assetScope === 'tenant';
157 return this.config; 157 return this.config;
@@ -103,7 +103,7 @@ export class DashboardsTableConfigResolver implements Resolve<EntityTableConfig< @@ -103,7 +103,7 @@ export class DashboardsTableConfigResolver implements Resolve<EntityTableConfig<
103 return this.dashboardService.saveDashboard(dashboard as Dashboard); 103 return this.dashboardService.saveDashboard(dashboard as Dashboard);
104 }; 104 };
105 this.config.onEntityAction = action => this.onDashboardAction(action); 105 this.config.onEntityAction = action => this.onDashboardAction(action);
106 - this.config.detailsReadonly = () => this.config.componentsData.dashboardScope === 'customer_user'; 106 + this.config.detailsReadonly = () => (this.config.componentsData.dashboardScope === 'customer_user' || this.config.componentsData.dashboardScope === 'edge_customer_user');
107 } 107 }
108 108
109 resolve(route: ActivatedRouteSnapshot): Observable<EntityTableConfig<DashboardInfo | Dashboard>> { 109 resolve(route: ActivatedRouteSnapshot): Observable<EntityTableConfig<DashboardInfo | Dashboard>> {
@@ -147,7 +147,7 @@ export class DashboardsTableConfigResolver implements Resolve<EntityTableConfig< @@ -147,7 +147,7 @@ export class DashboardsTableConfigResolver implements Resolve<EntityTableConfig<
147 this.config.cellActionDescriptors = this.configureCellActions(this.config.componentsData.dashboardScope); 147 this.config.cellActionDescriptors = this.configureCellActions(this.config.componentsData.dashboardScope);
148 this.config.groupActionDescriptors = this.configureGroupActions(this.config.componentsData.dashboardScope); 148 this.config.groupActionDescriptors = this.configureGroupActions(this.config.componentsData.dashboardScope);
149 this.config.addActionDescriptors = this.configureAddActions(this.config.componentsData.dashboardScope); 149 this.config.addActionDescriptors = this.configureAddActions(this.config.componentsData.dashboardScope);
150 - this.config.addEnabled = this.config.componentsData.dashboardScope !== 'customer_user'; 150 + this.config.addEnabled = !(this.config.componentsData.dashboardScope === 'customer_user' || this.config.componentsData.dashboardScope === 'edge_customer_user');
151 this.config.entitiesDeleteEnabled = this.config.componentsData.dashboardScope === 'tenant'; 151 this.config.entitiesDeleteEnabled = this.config.componentsData.dashboardScope === 'tenant';
152 this.config.deleteEnabled = () => this.config.componentsData.dashboardScope === 'tenant'; 152 this.config.deleteEnabled = () => this.config.componentsData.dashboardScope === 'tenant';
153 return this.config; 153 return this.config;
@@ -112,7 +112,7 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev @@ -112,7 +112,7 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev
112 )); 112 ));
113 }; 113 };
114 this.config.onEntityAction = action => this.onDeviceAction(action); 114 this.config.onEntityAction = action => this.onDeviceAction(action);
115 - this.config.detailsReadonly = () => this.config.componentsData.deviceScope === 'customer_user'; 115 + this.config.detailsReadonly = () => (this.config.componentsData.deviceScope === 'customer_user' || this.config.componentsData.deviceScope === 'edge_customer_user');
116 116
117 this.config.headerComponent = DeviceTableHeaderComponent; 117 this.config.headerComponent = DeviceTableHeaderComponent;
118 118
@@ -161,7 +161,7 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev @@ -161,7 +161,7 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev
161 this.config.cellActionDescriptors = this.configureCellActions(this.config.componentsData.deviceScope); 161 this.config.cellActionDescriptors = this.configureCellActions(this.config.componentsData.deviceScope);
162 this.config.groupActionDescriptors = this.configureGroupActions(this.config.componentsData.deviceScope); 162 this.config.groupActionDescriptors = this.configureGroupActions(this.config.componentsData.deviceScope);
163 this.config.addActionDescriptors = this.configureAddActions(this.config.componentsData.deviceScope); 163 this.config.addActionDescriptors = this.configureAddActions(this.config.componentsData.deviceScope);
164 - this.config.addEnabled = this.config.componentsData.deviceScope !== 'customer_user'; 164 + this.config.addEnabled = !(this.config.componentsData.deviceScope === 'customer_user' || this.config.componentsData.deviceScope === 'edge_customer_user');
165 this.config.entitiesDeleteEnabled = this.config.componentsData.deviceScope === 'tenant'; 165 this.config.entitiesDeleteEnabled = this.config.componentsData.deviceScope === 'tenant';
166 this.config.deleteEnabled = () => this.config.componentsData.deviceScope === 'tenant'; 166 this.config.deleteEnabled = () => this.config.componentsData.deviceScope === 'tenant';
167 return this.config; 167 return this.config;
@@ -104,7 +104,7 @@ export class EntityViewsTableConfigResolver implements Resolve<EntityTableConfig @@ -104,7 +104,7 @@ export class EntityViewsTableConfigResolver implements Resolve<EntityTableConfig
104 )); 104 ));
105 }; 105 };
106 this.config.onEntityAction = action => this.onEntityViewAction(action); 106 this.config.onEntityAction = action => this.onEntityViewAction(action);
107 - this.config.detailsReadonly = () => this.config.componentsData.entityViewScope === 'customer_user'; 107 + this.config.detailsReadonly = () => (this.config.componentsData.entityViewScope === 'customer_user' || this.config.componentsData.entityViewScope === 'edge_customer_user');
108 108
109 this.config.headerComponent = EntityViewTableHeaderComponent; 109 this.config.headerComponent = EntityViewTableHeaderComponent;
110 110
@@ -152,7 +152,7 @@ export class EntityViewsTableConfigResolver implements Resolve<EntityTableConfig @@ -152,7 +152,7 @@ export class EntityViewsTableConfigResolver implements Resolve<EntityTableConfig
152 this.config.cellActionDescriptors = this.configureCellActions(this.config.componentsData.entityViewScope); 152 this.config.cellActionDescriptors = this.configureCellActions(this.config.componentsData.entityViewScope);
153 this.config.groupActionDescriptors = this.configureGroupActions(this.config.componentsData.entityViewScope); 153 this.config.groupActionDescriptors = this.configureGroupActions(this.config.componentsData.entityViewScope);
154 this.config.addActionDescriptors = this.configureAddActions(this.config.componentsData.entityViewScope); 154 this.config.addActionDescriptors = this.configureAddActions(this.config.componentsData.entityViewScope);
155 - this.config.addEnabled = this.config.componentsData.entityViewScope !== 'customer_user'; 155 + this.config.addEnabled = !(this.config.componentsData.entityViewScope === 'customer_user' || this.config.componentsData.entityViewScope !== 'edge_customer_user');
156 this.config.entitiesDeleteEnabled = this.config.componentsData.entityViewScope === 'tenant'; 156 this.config.entitiesDeleteEnabled = this.config.componentsData.entityViewScope === 'tenant';
157 this.config.deleteEnabled = () => this.config.componentsData.entityViewScope === 'tenant'; 157 this.config.deleteEnabled = () => this.config.componentsData.entityViewScope === 'tenant';
158 return this.config; 158 return this.config;