Browse Source

Fixed Assign to customer

pull/3811/head
deaflynx 6 years ago
parent
commit
8945f5b32c
  1. 8
      ui-ngx/src/app/modules/home/dialogs/assign-to-customer-dialog.component.ts
  2. 2
      ui-ngx/src/app/modules/home/pages/home-pages.module.ts

8
ui-ngx/src/app/modules/home/dialogs/assign-to-customer-dialog.component.ts

@ -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);
}

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

@ -29,6 +29,7 @@ import { EntityViewModule } from '@modules/home/pages/entity-view/entity-view.mo
import { RuleChainModule } from '@modules/home/pages/rulechain/rulechain.module';
import { WidgetLibraryModule } from '@modules/home/pages/widget/widget-library.module';
import { DashboardModule } from '@modules/home/pages/dashboard/dashboard.module';
import { EdgeModule } from "@home/pages/edge/edge.module";
@NgModule({
exports: [
@ -38,6 +39,7 @@ import { DashboardModule } from '@modules/home/pages/dashboard/dashboard.module'
TenantModule,
DeviceModule,
AssetModule,
EdgeModule,
EntityViewModule,
CustomerModule,
RuleChainModule,

Loading…
Cancel
Save