Browse Source

Merge pull request #4778 from deaflynx/edge/fix-manage-device-credentials

Hide Manage credentials for 'edge_customer_user' device scope
pull/4851/head
Igor Kulikov 5 years ago
committed by GitHub
parent
commit
386ccd5dbb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ui-ngx/src/app/modules/home/pages/device/device.component.html
  2. 2
      ui-ngx/src/app/modules/home/pages/device/device.component.ts
  3. 2
      ui-ngx/src/app/modules/home/pages/device/devices-table-config.resolver.ts

2
ui-ngx/src/app/modules/home/pages/device/device.component.html

@ -38,7 +38,7 @@
[disabled]="(isLoading$ | async)"
(click)="onEntityAction($event, 'manageCredentials')"
[fxShow]="!isEdit">
{{ (deviceScope === 'customer_user' ? 'device.view-credentials' : 'device.manage-credentials') | translate }}
{{ ((deviceScope === 'customer_user' || deviceScope === 'edge_customer_user') ? 'device.view-credentials' : 'device.manage-credentials') | translate }}
</button>
<button mat-raised-button color="primary"
[disabled]="(isLoading$ | async)"

2
ui-ngx/src/app/modules/home/pages/device/device.component.ts

@ -48,7 +48,7 @@ export class DeviceComponent extends EntityComponent<DeviceInfo> {
deviceCredentials$: Subject<DeviceCredentials>;
deviceScope: 'tenant' | 'customer' | 'customer_user' | 'edge';
deviceScope: 'tenant' | 'customer' | 'customer_user' | 'edge' | 'edge_customer_user';
otaUpdateType = OtaUpdateType;

2
ui-ngx/src/app/modules/home/pages/device/devices-table-config.resolver.ts

@ -528,7 +528,7 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
data: {
deviceId: device.id.id,
isReadOnly: this.config.componentsData.deviceScope === 'customer_user'
isReadOnly: this.config.componentsData.deviceScope === 'customer_user' || this.config.componentsData.deviceScope === 'edge_customer_user'
}
}).afterClosed().subscribe(deviceCredentials => {
if (isDefinedAndNotNull(deviceCredentials)) {

Loading…
Cancel
Save