diff --git a/public/app/features/dashboard/shareModalCtrl.js b/public/app/features/dashboard/shareModalCtrl.js index b723660abe7..97abf36c65a 100644 --- a/public/app/features/dashboard/shareModalCtrl.js +++ b/public/app/features/dashboard/shareModalCtrl.js @@ -26,7 +26,7 @@ function (angular, _, require, config) { $scope.modalTitle = 'Share Dashboard'; } - if (!$scope.dashboardMeta.isSnapshot) { + if (!$scope.dashboard.meta.isSnapshot) { $scope.tabs.push({title: 'Snapshot sharing', src: 'shareSnapshot.html'}); } diff --git a/public/app/features/panel/panel_ctrl.ts b/public/app/features/panel/panel_ctrl.ts index 70ffb0e8f4f..1b4749fd1cf 100644 --- a/public/app/features/panel/panel_ctrl.ts +++ b/public/app/features/panel/panel_ctrl.ts @@ -100,7 +100,7 @@ export class PanelCtrl { menu.push({text: 'View', click: 'ctrl.viewPanel(); dismiss();'}); menu.push({text: 'Edit', click: 'ctrl.editPanel(); dismiss();', role: 'Editor'}); menu.push({text: 'Duplicate', click: 'ctrl.duplicate()', role: 'Editor' }); - menu.push({text: 'Share', click: 'ctrl.share(); dismiss();'}); + menu.push({text: 'Share', click: 'ctrl.sharePanel(); dismiss();'}); return menu; } @@ -165,4 +165,15 @@ export class PanelCtrl { this.row.panels.splice(index, 0, newPanel); }); } + + sharePanel() { + var shareScope = this.$scope.$new(); + shareScope.panel = this.panel; + shareScope.dashboard = this.dashboard; + + this.publishAppEvent('show-modal', { + src: './app/features/dashboard/partials/shareModal.html', + scope: shareScope + }); + } } diff --git a/public/app/features/panel/partials/soloPanel.html b/public/app/features/panel/partials/soloPanel.html index b040bf8dc72..d2a4f38844f 100644 --- a/public/app/features/panel/partials/soloPanel.html +++ b/public/app/features/panel/partials/soloPanel.html @@ -2,7 +2,8 @@