Commit 185e7a08749b858158e3fccd901554fb27eb896a
1 parent
29f64d93
Entities table config: fixed addEnabled, detailsReadonly for edge_customer_user
Showing
4 changed files
with
8 additions
and
8 deletions
... | ... | @@ -104,7 +104,7 @@ export class AssetsTableConfigResolver implements Resolve<EntityTableConfig<Asse |
104 | 104 | )); |
105 | 105 | }; |
106 | 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 | 109 | this.config.headerComponent = AssetTableHeaderComponent; |
110 | 110 | |
... | ... | @@ -151,7 +151,7 @@ export class AssetsTableConfigResolver implements Resolve<EntityTableConfig<Asse |
151 | 151 | this.config.cellActionDescriptors = this.configureCellActions(this.config.componentsData.assetScope); |
152 | 152 | this.config.groupActionDescriptors = this.configureGroupActions(this.config.componentsData.assetScope); |
153 | 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 | 155 | this.config.entitiesDeleteEnabled = this.config.componentsData.assetScope === 'tenant'; |
156 | 156 | this.config.deleteEnabled = () => this.config.componentsData.assetScope === 'tenant'; |
157 | 157 | return this.config; | ... | ... |
... | ... | @@ -103,7 +103,7 @@ export class DashboardsTableConfigResolver implements Resolve<EntityTableConfig< |
103 | 103 | return this.dashboardService.saveDashboard(dashboard as Dashboard); |
104 | 104 | }; |
105 | 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 | 109 | resolve(route: ActivatedRouteSnapshot): Observable<EntityTableConfig<DashboardInfo | Dashboard>> { |
... | ... | @@ -147,7 +147,7 @@ export class DashboardsTableConfigResolver implements Resolve<EntityTableConfig< |
147 | 147 | this.config.cellActionDescriptors = this.configureCellActions(this.config.componentsData.dashboardScope); |
148 | 148 | this.config.groupActionDescriptors = this.configureGroupActions(this.config.componentsData.dashboardScope); |
149 | 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 | 151 | this.config.entitiesDeleteEnabled = this.config.componentsData.dashboardScope === 'tenant'; |
152 | 152 | this.config.deleteEnabled = () => this.config.componentsData.dashboardScope === 'tenant'; |
153 | 153 | return this.config; | ... | ... |
... | ... | @@ -112,7 +112,7 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev |
112 | 112 | )); |
113 | 113 | }; |
114 | 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 | 117 | this.config.headerComponent = DeviceTableHeaderComponent; |
118 | 118 | |
... | ... | @@ -161,7 +161,7 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev |
161 | 161 | this.config.cellActionDescriptors = this.configureCellActions(this.config.componentsData.deviceScope); |
162 | 162 | this.config.groupActionDescriptors = this.configureGroupActions(this.config.componentsData.deviceScope); |
163 | 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 | 165 | this.config.entitiesDeleteEnabled = this.config.componentsData.deviceScope === 'tenant'; |
166 | 166 | this.config.deleteEnabled = () => this.config.componentsData.deviceScope === 'tenant'; |
167 | 167 | return this.config; | ... | ... |
... | ... | @@ -104,7 +104,7 @@ export class EntityViewsTableConfigResolver implements Resolve<EntityTableConfig |
104 | 104 | )); |
105 | 105 | }; |
106 | 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 | 109 | this.config.headerComponent = EntityViewTableHeaderComponent; |
110 | 110 | |
... | ... | @@ -152,7 +152,7 @@ export class EntityViewsTableConfigResolver implements Resolve<EntityTableConfig |
152 | 152 | this.config.cellActionDescriptors = this.configureCellActions(this.config.componentsData.entityViewScope); |
153 | 153 | this.config.groupActionDescriptors = this.configureGroupActions(this.config.componentsData.entityViewScope); |
154 | 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 | 156 | this.config.entitiesDeleteEnabled = this.config.componentsData.entityViewScope === 'tenant'; |
157 | 157 | this.config.deleteEnabled = () => this.config.componentsData.entityViewScope === 'tenant'; |
158 | 158 | return this.config; | ... | ... |