Browse Source

Added Manage edge for customers and filter by type

pull/3811/head
Artem Babak 6 years ago
parent
commit
4b5ade990e
  1. 6
      ui-ngx/src/app/modules/home/pages/customer/customer.component.html
  2. 3
      ui-ngx/src/app/modules/home/pages/customer/customers-table-config.resolver.ts
  3. 2
      ui-ngx/src/app/modules/home/pages/dashboard/dashboards-table-config.resolver.ts
  4. 2
      ui-ngx/src/app/modules/home/pages/edge/edges-table-config.resolver.ts

6
ui-ngx/src/app/modules/home/pages/customer/customer.component.html

@ -40,6 +40,12 @@
[fxShow]="!isEdit"> [fxShow]="!isEdit">
{{'customer.manage-dashboards' | translate }} {{'customer.manage-dashboards' | translate }}
</button> </button>
<button mat-raised-button color="primary"
[disabled]="(isLoading$ | async)"
(click)="onEntityAction($event, 'manageEdges')"
[fxShow]="!isEdit">
{{'customer.manage-edges' | translate }}
</button>
<button mat-raised-button color="primary" <button mat-raised-button color="primary"
[disabled]="(isLoading$ | async)" [disabled]="(isLoading$ | async)"
(click)="onEntityAction($event, 'delete')" (click)="onEntityAction($event, 'delete')"

3
ui-ngx/src/app/modules/home/pages/customer/customers-table-config.resolver.ts

@ -179,6 +179,9 @@ export class CustomersTableConfigResolver implements Resolve<EntityTableConfig<C
case 'manageDashboards': case 'manageDashboards':
this.manageCustomerDashboards(action.event, action.entity); this.manageCustomerDashboards(action.event, action.entity);
return true; return true;
case 'manageEdges':
this.manageCustomerEdges(action.event, action.entity);
return true;
} }
return false; return false;
} }

2
ui-ngx/src/app/modules/home/pages/dashboard/dashboards-table-config.resolver.ts

@ -300,7 +300,7 @@ export class DashboardsTableConfigResolver implements Resolve<EntityTableConfig<
if (dashboardScope === 'edge') { if (dashboardScope === 'edge') {
actions.push( actions.push(
{ {
name: this.translate.instant('dashboard.unassign-dashboards-from-edge'), name: this.translate.instant('dashboard.unassign-dashboards'),
icon: 'portable_wifi_off', icon: 'portable_wifi_off',
isEnabled: true, isEnabled: true,
onAction: ($event, entities) => this.unassignDashboardsFromEdge($event, entities) onAction: ($event, entities) => this.unassignDashboardsFromEdge($event, entities)

2
ui-ngx/src/app/modules/home/pages/edge/edges-table-config.resolver.ts

@ -167,7 +167,7 @@ export class EdgesTableConfigResolver implements Resolve<EntityTableConfig<EdgeI
} }
if (edgeScope === 'customer') { if (edgeScope === 'customer') {
this.config.entitiesFetchFunction = pageLink => this.config.entitiesFetchFunction = pageLink =>
this.edgeService.getCustomerEdgeInfos(this.customerId, pageLink); this.edgeService.getCustomerEdgeInfos(this.customerId, pageLink, this.config.componentsData.edgeType);
this.config.deleteEntity = id => this.edgeService.unassignEdgeFromCustomer(id.id); this.config.deleteEntity = id => this.edgeService.unassignEdgeFromCustomer(id.id);
} }
} }

Loading…
Cancel
Save