diff --git a/ui-ngx/src/app/modules/home/pages/customer/customer-routing.module.ts b/ui-ngx/src/app/modules/home/pages/customer/customer-routing.module.ts index f3ec436a1e..732f14184c 100644 --- a/ui-ngx/src/app/modules/home/pages/customer/customer-routing.module.ts +++ b/ui-ngx/src/app/modules/home/pages/customer/customer-routing.module.ts @@ -27,6 +27,7 @@ import { DashboardsTableConfigResolver } from '@modules/home/pages/dashboard/das import { DashboardPageComponent } from '@home/pages/dashboard/dashboard-page.component'; import { BreadCrumbConfig } from '@shared/components/breadcrumb'; import { dashboardBreadcumbLabelFunction, DashboardResolver } from '@home/pages/dashboard/dashboard-routing.module'; +import {EdgesTableConfigResolver} from "@home/pages/edge/edges-table-config.resolver"; const routes: Routes = [ { @@ -96,6 +97,22 @@ const routes: Routes = [ entitiesTableConfig: AssetsTableConfigResolver } }, + { + path: ':customerId/edges', + component: EntitiesTableComponent, + data: { + auth: [Authority.TENANT_ADMIN], + title: 'customer.edges', + edgesType: 'customer', + breadcrumb: { + label: 'customer.edges', + icon: 'router' + } + }, + resolve: { + entitiesTableConfig: EdgesTableConfigResolver + } + }, { path: ':customerId/dashboards', data: { diff --git a/ui-ngx/src/app/modules/home/pages/customer/customers-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/customer/customers-table-config.resolver.ts index 2e0b0abe14..dccad6bd2a 100644 --- a/ui-ngx/src/app/modules/home/pages/customer/customers-table-config.resolver.ts +++ b/ui-ngx/src/app/modules/home/pages/customer/customers-table-config.resolver.ts @@ -95,7 +95,18 @@ export class CustomersTableConfigResolver implements Resolve true, onAction: ($event, entity) => this.manageCustomerDashboards($event, entity) - } + }, + { + name: this.translate.instant('customer.manage-customer-edges'), + nameFunction: (customer) => { + return customer.additionalInfo && customer.additionalInfo.isPublic + ? this.translate.instant('customer.manage-public-edges') + : this.translate.instant('customer.manage-customer-edges'); + }, + icon: 'router', + isEnabled: (customer) => true, + onAction: ($event, entity) => this.manageCustomerEdges($event, entity) + }, ); this.config.deleteEntityTitle = customer => this.translate.instant('customer.delete-customer-title', { customerTitle: customer.title }); @@ -147,6 +158,13 @@ export class CustomersTableConfigResolver implements Resolve): boolean { switch (action.action) { case 'manageUsers': diff --git a/ui-ngx/src/app/modules/home/pages/edge/edge-routing.module.ts b/ui-ngx/src/app/modules/home/pages/edge/edge-routing.module.ts index 71e275f4b2..4d101d81fe 100644 --- a/ui-ngx/src/app/modules/home/pages/edge/edge-routing.module.ts +++ b/ui-ngx/src/app/modules/home/pages/edge/edge-routing.module.ts @@ -40,7 +40,7 @@ const routes: Routes = [ component: EntitiesTableComponent, data: { auth: [Authority.TENANT_ADMIN, Authority.CUSTOMER_USER], - edgeScope: 'tenant' + edgesType: 'tenant' }, resolve: { entitiesTableConfig: EdgesTableConfigResolver diff --git a/ui-ngx/src/app/modules/home/pages/edge/edges-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/edge/edges-table-config.resolver.ts index 895274d10c..88dca0316c 100644 --- a/ui-ngx/src/app/modules/home/pages/edge/edges-table-config.resolver.ts +++ b/ui-ngx/src/app/modules/home/pages/edge/edges-table-config.resolver.ts @@ -107,7 +107,7 @@ export class EdgesTableConfigResolver implements Resolve> { const routeParams = route.params; this.config.componentsData = { - edgeScope: route.data.edgeScope, + edgeScope: route.data.edgesType, edgeType: '' }; this.customerId = routeParams.customerId; diff --git a/ui-ngx/src/app/shared/models/edge.models.ts b/ui-ngx/src/app/shared/models/edge.models.ts index 45eacb74fb..a0d916f378 100644 --- a/ui-ngx/src/app/shared/models/edge.models.ts +++ b/ui-ngx/src/app/shared/models/edge.models.ts @@ -36,7 +36,6 @@ export interface Edge extends BaseData { export interface EdgeInfo extends Edge { customerTitle: string; customerIsPublic: boolean; - // assignedCustomers?: Array //TODO: deaflynx check usage } export interface EdgeSearchQuery extends EntitySearchQuery { diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json index 456aabec31..cf22707d93 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -422,6 +422,7 @@ "devices": "Customer Devices", "entity-views": "Customer Entity Views", "assets": "Customer Assets", + "edges": "Customer Edges", "public-dashboards": "Public Dashboards", "public-devices": "Public Devices", "public-assets": "Public Assets", @@ -436,6 +437,8 @@ "manage-public-dashboards": "Manage public dashboards", "manage-customer-assets": "Manage customer assets", "manage-public-assets": "Manage public assets", + "manage-customer-edges": "Manage customer edges", + "manage-public-edges": "Manage customer edges", "add-customer-text": "Add new customer", "no-customers-text": "No customers found", "customer-details": "Customer details", @@ -446,6 +449,7 @@ "delete-customers-text": "Be careful, after the confirmation all selected customers will be removed and all related data will become unrecoverable.", "manage-users": "Manage users", "manage-assets": "Manage assets", + "manage-edges": "Manage edges", "manage-devices": "Manage devices", "manage-dashboards": "Manage dashboards", "title": "Title", @@ -980,7 +984,9 @@ "set-root-rule-chain-to-edges-text": "Set root rule chain for { count, plural, 1 {1 edge} other {# edges} }", "status": "Received by edge", "success": "Deployed", - "failed": "Pending" + "failed": "Pending", + "search": "Search edges", + "selected-edges": "{ count, plural, 1 {1 edge} other {# edges} } selected" }, "error": { "unable-to-connect": "Unable to connect to the server! Please check your internet connection.",