From 6aef1f84cb31ba6f64c0d3042e992d88cf9868d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20A=C3=A7=C4=B1kportal=C4=B1?= Date: Tue, 28 Jul 2020 07:35:00 +0200 Subject: [PATCH] Dashboard: Implement Duplicate DashboardLink Feature (#26600) * Dashboard: Implement duplicate dashboard link feature * Dashboard: Change duplicate and remove button types of DashboardLinks --- docs/sources/linking/dashboard-links.md | 6 +++++- .../components/DashLinks/DashLinksEditorCtrl.ts | 5 +++++ .../dashboard/components/DashLinks/editor.html | 11 ++++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/docs/sources/linking/dashboard-links.md b/docs/sources/linking/dashboard-links.md index 3f5ea6e04e1..6f0b9084d81 100644 --- a/docs/sources/linking/dashboard-links.md +++ b/docs/sources/linking/dashboard-links.md @@ -62,6 +62,10 @@ To change or update an existing dashboard link, follow this procedure. 1. In Dashboard Settings, on the Links tab, click the existing link that you want to edit. 1. Change the settings and then click **Update**. +## Duplicate a dashboard link + +To duplicate an existing dashboard link, click the duplicate icon next to the existing link that you want to duplicate. + ## Delete a dashboard link -To delete an existing dashboard link, click the red **X** next to the existing link that you want to delete. \ No newline at end of file +To delete an existing dashboard link, click the trash icon next to the duplicate icon that you want to delete. diff --git a/public/app/features/dashboard/components/DashLinks/DashLinksEditorCtrl.ts b/public/app/features/dashboard/components/DashLinks/DashLinksEditorCtrl.ts index 7e0e3be661b..9445041594b 100644 --- a/public/app/features/dashboard/components/DashLinks/DashLinksEditorCtrl.ts +++ b/public/app/features/dashboard/components/DashLinks/DashLinksEditorCtrl.ts @@ -74,6 +74,11 @@ export class DashLinksEditorCtrl { _.move(this.dashboard.links, index, index + dir); } + duplicateLink(link: any, index: number) { + this.dashboard.links.splice(index, 0, link); + this.dashboard.updateSubmenuVisibility(); + } + deleteLink(index: number) { this.dashboard.links.splice(index, 1); this.dashboard.updateSubmenuVisibility(); diff --git a/public/app/features/dashboard/components/DashLinks/editor.html b/public/app/features/dashboard/components/DashLinks/editor.html index 0aa73c8192d..dcfad1a33d9 100644 --- a/public/app/features/dashboard/components/DashLinks/editor.html +++ b/public/app/features/dashboard/components/DashLinks/editor.html @@ -39,7 +39,7 @@ - + {{ link.type }} @@ -68,8 +68,13 @@ - - + + + + + + +