Commit 8945f5b32c640ab524c75ecd4ed8b3a740c676f4

Authored by deaflynx
1 parent 5a07a7ac

Fixed Assign to customer

... ... @@ -28,6 +28,7 @@ import { AssetService } from '@core/http/asset.service';
28 28 import { EntityViewService } from '@core/http/entity-view.service';
29 29 import { DialogComponent } from '@shared/components/dialog.component';
30 30 import { Router } from '@angular/router';
  31 +import { EdgeService } from "@core/http/edge.service";
31 32
32 33 export interface AssignToCustomerDialogData {
33 34 entityIds: Array<EntityId>;
... ... @@ -57,6 +58,7 @@ export class AssignToCustomerDialogComponent extends
57 58 @Inject(MAT_DIALOG_DATA) public data: AssignToCustomerDialogData,
58 59 private deviceService: DeviceService,
59 60 private assetService: AssetService,
  61 + private edgeService: EdgeService,
60 62 private entityViewService: EntityViewService,
61 63 @SkipSelf() private errorStateMatcher: ErrorStateMatcher,
62 64 public dialogRef: MatDialogRef<AssignToCustomerDialogComponent, boolean>,
... ... @@ -77,6 +79,10 @@ export class AssignToCustomerDialogComponent extends
77 79 this.assignToCustomerTitle = 'asset.assign-asset-to-customer';
78 80 this.assignToCustomerText = 'asset.assign-to-customer-text';
79 81 break;
  82 + case EntityType.EDGE:
  83 + this.assignToCustomerTitle = 'edge.assign-edge-to-customer';
  84 + this.assignToCustomerText = 'edge.assign-to-customer-text';
  85 + break;
80 86 case EntityType.ENTITY_VIEW:
81 87 this.assignToCustomerTitle = 'entity-view.assign-entity-view-to-customer';
82 88 this.assignToCustomerText = 'entity-view.assign-to-customer-text';
... ... @@ -116,6 +122,8 @@ export class AssignToCustomerDialogComponent extends
116 122 return this.deviceService.assignDeviceToCustomer(customerId, entityId);
117 123 case EntityType.ASSET:
118 124 return this.assetService.assignAssetToCustomer(customerId, entityId);
  125 + case EntityType.EDGE:
  126 + return this.edgeService.assignEdgeToCustomer(customerId, entityId);
119 127 case EntityType.ENTITY_VIEW:
120 128 return this.entityViewService.assignEntityViewToCustomer(customerId, entityId);
121 129 }
... ...
... ... @@ -29,6 +29,7 @@ import { EntityViewModule } from '@modules/home/pages/entity-view/entity-view.mo
29 29 import { RuleChainModule } from '@modules/home/pages/rulechain/rulechain.module';
30 30 import { WidgetLibraryModule } from '@modules/home/pages/widget/widget-library.module';
31 31 import { DashboardModule } from '@modules/home/pages/dashboard/dashboard.module';
  32 +import { EdgeModule } from "@home/pages/edge/edge.module";
32 33
33 34 @NgModule({
34 35 exports: [
... ... @@ -38,6 +39,7 @@ import { DashboardModule } from '@modules/home/pages/dashboard/dashboard.module'
38 39 TenantModule,
39 40 DeviceModule,
40 41 AssetModule,
  42 + EdgeModule,
41 43 EntityViewModule,
42 44 CustomerModule,
43 45 RuleChainModule,
... ...