Commit 9ece45ca by carl bergquist

feat(top_nav): option to make dashboards editable again

closes #2587
closes #2554
parent f163ceff
...@@ -49,6 +49,21 @@ function (angular, _) { ...@@ -49,6 +49,21 @@ function (angular, _) {
$scope.appEvent('hide-dash-search'); $scope.appEvent('hide-dash-search');
}; };
$scope.makeEditable = function(evt) {
$scope.dashboard.editable = true;
var clone = $scope.dashboard.getSaveModelClone();
backendSrv.saveDashboard(clone, {overwrite: false}).then(function(data) {
$scope.dashboard.version = data.version;
$scope.appEvent('dashboard-saved', $scope.dashboard);
$scope.appEvent('alert-success', ['Dashboard saved', 'Saved as ' + clone.title]);
//force refresh whole page
window.location.href = window.location.href;
}, $scope.handleSaveDashError);
};
$scope.saveDashboard = function(options) { $scope.saveDashboard = function(options) {
if ($scope.dashboardMeta.canSave === false) { if ($scope.dashboardMeta.canSave === false) {
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment