From 77e73516e6b9ef744438cf568cbe4c85d2e4aaba Mon Sep 17 00:00:00 2001 From: Artem Babak Date: Wed, 9 Dec 2020 17:46:23 +0200 Subject: [PATCH] Edge's dashboards - fix for card buttons --- ui/src/app/dashboard/dashboard-fieldset.tpl.html | 5 ++++- ui/src/app/dashboard/dashboard.directive.js | 2 ++ ui/src/app/dashboard/dashboards.controller.js | 5 +++++ ui/src/app/dashboard/dashboards.tpl.html | 4 +++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ui/src/app/dashboard/dashboard-fieldset.tpl.html b/ui/src/app/dashboard/dashboard-fieldset.tpl.html index bf3283b857..d3eb314917 100644 --- a/ui/src/app/dashboard/dashboard-fieldset.tpl.html +++ b/ui/src/app/dashboard/dashboard-fieldset.tpl.html @@ -16,7 +16,7 @@ --> {{ 'dashboard.export' | translate }} {{ 'dashboard.delete' | translate }} +{{ 'edge.unassign-from-edge' | translate }} diff --git a/ui/src/app/dashboard/dashboard.directive.js b/ui/src/app/dashboard/dashboard.directive.js index 37e3485d31..2d5b942410 100644 --- a/ui/src/app/dashboard/dashboard.directive.js +++ b/ui/src/app/dashboard/dashboard.directive.js @@ -48,12 +48,14 @@ export default function DashboardDirective($compile, $templateCache, $translate, dashboard: '=', isEdit: '=', customerId: '=', + edgeId: '=', dashboardScope: '=', theForm: '=', onMakePublic: '&', onMakePrivate: '&', onManageAssignedCustomers: '&', onUnassignFromCustomer: '&', + onUnassignFromEdge: '&', onExportDashboard: '&', onDeleteDashboard: '&' } diff --git a/ui/src/app/dashboard/dashboards.controller.js b/ui/src/app/dashboard/dashboards.controller.js index 964f440afe..f5fc50d538 100644 --- a/ui/src/app/dashboard/dashboards.controller.js +++ b/ui/src/app/dashboard/dashboards.controller.js @@ -129,6 +129,7 @@ export function DashboardsController(userService, dashboardService, customerServ vm.manageAssignedCustomers = manageAssignedCustomers; vm.unassignFromCustomer = unassignFromCustomer; vm.exportDashboard = exportDashboard; + vm.unassignFromEdge = unassignFromEdge; initController(); @@ -156,6 +157,10 @@ export function DashboardsController(userService, dashboardService, customerServ ); } + if (edgeId) { + vm.edgeId = edgeId; + } + if (vm.dashboardsScope === 'tenant') { fetchDashboardsFunction = function (pageLink) { return dashboardService.getTenantDashboards(pageLink); diff --git a/ui/src/app/dashboard/dashboards.tpl.html b/ui/src/app/dashboard/dashboards.tpl.html index 2fb4e35e72..02f6ef8101 100644 --- a/ui/src/app/dashboard/dashboards.tpl.html +++ b/ui/src/app/dashboard/dashboards.tpl.html @@ -26,12 +26,14 @@ is-edit="vm.grid.detailsConfig.isDetailsEditMode" dashboard-scope="vm.dashboardsScope" customer-id="vm.customerId" + edge-id="vm.edgeId" the-form="vm.grid.detailsForm" on-make-public="vm.makePublic(event, vm.grid.detailsConfig.currentItem)" on-make-private="vm.makePrivate(event, vm.grid.detailsConfig.currentItem)" on-manage-assigned-customers="vm.manageAssignedCustomers(event, vm.grid.detailsConfig.currentItem)" on-unassign-from-customer="vm.unassignFromCustomer(event, vm.grid.detailsConfig.currentItem, vm.customerId)" - on-export-dashboard="vm.exportDashboard(event, vm.grid.detailsConfig.currentItem)" + on-unassign-from-edge="vm.unassignFromEdge(event, vm.grid.detailsConfig.currentItem, vm.edgeId)" + on-export-dashboard="vm.exportDashboard(event, vm.grid.detailsConfig.currentItem)" on-delete-dashboard="vm.grid.deleteItem(event, vm.grid.detailsConfig.currentItem)">