Commit a6a0a65d25da57fd9f37414548283716b1572344

Authored by Artem Babak
1 parent fee5034e

Added route for edge dashboard

... ... @@ -357,7 +357,10 @@ export class DashboardsTableConfigResolver implements Resolve<EntityTableConfig<
357 357 }
358 358 if (this.config.componentsData.dashboardScope === 'customer') {
359 359 this.router.navigateByUrl(`customers/${this.config.componentsData.customerId}/dashboards/${dashboard.id.id}`);
360   - } else {
  360 + } else if (this.config.componentsData.dashboardScope === 'edge') {
  361 + this.router.navigateByUrl(`edges/${this.config.componentsData.edgeId}/dashboards/${dashboard.id.id}`);
  362 + }
  363 + else {
361 364 this.router.navigateByUrl(`dashboards/${dashboard.id.id}`);
362 365 }
363 366 }
... ...
... ... @@ -24,6 +24,9 @@ import { DevicesTableConfigResolver } from "@home/pages/device/devices-table-con
24 24 import { EntityViewsTableConfigResolver } from "@home/pages/entity-view/entity-views-table-config.resolver";
25 25 import { DashboardsTableConfigResolver } from "@home/pages/dashboard/dashboards-table-config.resolver";
26 26 import { RuleChainsTableConfigResolver } from "@home/pages/rulechain/rulechains-table-config.resolver";
  27 +import { DashboardPageComponent } from "@home/pages/dashboard/dashboard-page.component";
  28 +import { dashboardBreadcumbLabelFunction, DashboardResolver } from "@home/pages/dashboard/dashboard-routing.module";
  29 +import { BreadCrumbConfig } from "@shared/components/breadcrumb";
27 30
28 31 const routes: Routes = [
29 32 {
... ... @@ -108,19 +111,43 @@ const routes: Routes = [
108 111 },
109 112 {
110 113 path: ':edgeId/dashboards',
111   - component: EntitiesTableComponent,
112 114 data: {
113   - auth: [Authority.TENANT_ADMIN, Authority.CUSTOMER_USER],
114   - dashboardsType: 'edge',
115 115 breadcrumb: {
116 116 label: 'edge.dashboards',
117 117 icon: 'dashboard'
118 118 }
119 119 },
120   - resolve: {
121   - entitiesTableConfig: DashboardsTableConfigResolver
122   - }
123   - }]
  120 + children: [
  121 + {
  122 + path: '',
  123 + component: EntitiesTableComponent,
  124 + data: {
  125 + auth: [Authority.TENANT_ADMIN],
  126 + dashboardsType: 'edge'
  127 + },
  128 + resolve: {
  129 + entitiesTableConfig: DashboardsTableConfigResolver
  130 + },
  131 + },
  132 + {
  133 + path: ':dashboardId',
  134 + component: DashboardPageComponent,
  135 + data: {
  136 + breadcrumb: {
  137 + labelFunction: dashboardBreadcumbLabelFunction,
  138 + icon: 'dashboard'
  139 + } as BreadCrumbConfig<DashboardPageComponent>,
  140 + auth: [Authority.TENANT_ADMIN, Authority.CUSTOMER_USER],
  141 + title: 'edge.dashboard',
  142 + widgetEditMode: false
  143 + },
  144 + resolve: {
  145 + dashboard: DashboardResolver
  146 + }
  147 + }
  148 + ]
  149 + },
  150 + ]
124 151 }]
125 152
126 153 @NgModule({
... ...
... ... @@ -1005,7 +1005,8 @@
1005 1005 "any-edge": "Any edge",
1006 1006 "no-edge-types-matching": "No edge types matching '{{entitySubtype}}' were found.",
1007 1007 "edge-type-list-empty": "No device types selected.",
1008   - "edge-types": "Edge types"
  1008 + "edge-types": "Edge types",
  1009 + "dashboard": "Edge dashboard"
1009 1010 },
1010 1011 "error": {
1011 1012 "unable-to-connect": "Unable to connect to the server! Please check your internet connection.",
... ...