|
|
|
@ -28,6 +28,7 @@ import { AssetService } from '@core/http/asset.service'; |
|
|
|
import { EntityViewService } from '@core/http/entity-view.service'; |
|
|
|
import { DialogComponent } from '@shared/components/dialog.component'; |
|
|
|
import { Router } from '@angular/router'; |
|
|
|
import { EdgeService } from "@core/http/edge.service"; |
|
|
|
|
|
|
|
export interface AssignToCustomerDialogData { |
|
|
|
entityIds: Array<EntityId>; |
|
|
|
@ -57,6 +58,7 @@ export class AssignToCustomerDialogComponent extends |
|
|
|
@Inject(MAT_DIALOG_DATA) public data: AssignToCustomerDialogData, |
|
|
|
private deviceService: DeviceService, |
|
|
|
private assetService: AssetService, |
|
|
|
private edgeService: EdgeService, |
|
|
|
private entityViewService: EntityViewService, |
|
|
|
@SkipSelf() private errorStateMatcher: ErrorStateMatcher, |
|
|
|
public dialogRef: MatDialogRef<AssignToCustomerDialogComponent, boolean>, |
|
|
|
@ -77,6 +79,10 @@ export class AssignToCustomerDialogComponent extends |
|
|
|
this.assignToCustomerTitle = 'asset.assign-asset-to-customer'; |
|
|
|
this.assignToCustomerText = 'asset.assign-to-customer-text'; |
|
|
|
break; |
|
|
|
case EntityType.EDGE: |
|
|
|
this.assignToCustomerTitle = 'edge.assign-edge-to-customer'; |
|
|
|
this.assignToCustomerText = 'edge.assign-to-customer-text'; |
|
|
|
break; |
|
|
|
case EntityType.ENTITY_VIEW: |
|
|
|
this.assignToCustomerTitle = 'entity-view.assign-entity-view-to-customer'; |
|
|
|
this.assignToCustomerText = 'entity-view.assign-to-customer-text'; |
|
|
|
@ -116,6 +122,8 @@ export class AssignToCustomerDialogComponent extends |
|
|
|
return this.deviceService.assignDeviceToCustomer(customerId, entityId); |
|
|
|
case EntityType.ASSET: |
|
|
|
return this.assetService.assignAssetToCustomer(customerId, entityId); |
|
|
|
case EntityType.EDGE: |
|
|
|
return this.edgeService.assignEdgeToCustomer(customerId, entityId); |
|
|
|
case EntityType.ENTITY_VIEW: |
|
|
|
return this.entityViewService.assignEntityViewToCustomer(customerId, entityId); |
|
|
|
} |
|
|
|
|