Jelajahi Sumber

feat(dashboard): Automatically go into panel edit mode after adding a new panel to the dashboard

Torkel Ödegaard 10 tahun lalu
induk
melakukan
bbdf75bdfa
2 mengubah file dengan 4 tambahan dan 3 penghapusan
  1. 1 1
      public/app/core/settings.js
  2. 3 2
      public/app/features/dashboard/rowCtrl.js

+ 1 - 1
public/app/core/settings.js

@@ -15,7 +15,7 @@ function (_) {
         'text':       { path: 'app/panels/text',       name: 'Text' },
         'dashlist':   { path: 'app/panels/dashlist',   name: 'Dashboard list' },
       },
-      new_panel_title: 'no title (click here)',
+      new_panel_title: 'Panel Title',
       plugins: {},
       playlist_timespan: "1m",
       unsaved_changes_warning: true,

+ 3 - 2
public/app/features/dashboard/rowCtrl.js

@@ -91,13 +91,14 @@ function (angular, _, config) {
         error: false,
         span: _as < defaultSpan && _as > 0 ? _as : defaultSpan,
         editable: true,
-        type: type
+        type: type,
+        isNew: true,
       };
 
       $scope.addPanel(panel);
 
       $timeout(function() {
-        $scope.$broadcast('render');
+        $scope.dashboardViewState.update({fullscreen: true, edit: true, panelId: panel.id });
       });
     };