Stop users from entering panel edit mode when dashboard editable is false, #1834

This commit is contained in:
Torkel Ödegaard
2015-04-27 10:56:36 +02:00
parent 29a7490af2
commit b0ef659add
2 changed files with 9 additions and 1 deletions

View File

@@ -70,6 +70,14 @@ function (angular, _, config) {
};
$scope.toggleFullscreen = function(edit) {
if (edit && $scope.dashboardMeta.canEdit === false) {
$scope.appEvent('alert-warning', [
'Dashboard not editable',
'Use Save As.. feature to create an editable copy of this dashboard.'
]);
return;
}
$scope.dashboardViewState.update({ fullscreen: true, edit: edit, panelId: $scope.panel.id });
};

View File

@@ -29,7 +29,7 @@ function (angular, app, $, _, kbn, moment, TimeSeries, PanelMeta) {
panelName: 'Graph',
editIcon: "fa fa-bar-chart",
fullscreen: true,
metricsEditor: true
metricsEditor: true,
});
$scope.panelMeta.addEditorTab('Axes & Grid', 'app/panels/graph/axisEditor.html');