Explorar el Código

change(plugin page): changed tab order on plugin page, closes #6123

Torkel Ödegaard hace 9 años
padre
commit
cace1d6b8f

+ 3 - 3
public/app/features/plugins/partials/plugin_edit.html

@@ -30,12 +30,12 @@
   </div>
   </div>
 
 
   <div class="page-body">
   <div class="page-body">
-    <div class="tab-content page-content-with-sidebar" ng-if="ctrl.tabIndex === 0">
+    <div class="tab-content page-content-with-sidebar" ng-if="ctrl.tabs[ctrl.tabIndex] === 'Readme'">
       <div ng-bind-html="ctrl.readmeHtml" class="plugin-markdown-readme">
       <div ng-bind-html="ctrl.readmeHtml" class="plugin-markdown-readme">
       </div>
       </div>
     </div>
     </div>
 
 
-    <div class="tab-content page-content-with-sidebar" ng-if="ctrl.tabIndex === 1">
+    <div class="tab-content page-content-with-sidebar" ng-if="ctrl.tabs[ctrl.tabIndex] === 'Config'">
       <div ng-if="ctrl.model.id">
       <div ng-if="ctrl.model.id">
         <plugin-component type="app-config-ctrl"></plugin-component>
         <plugin-component type="app-config-ctrl"></plugin-component>
 
 
@@ -47,7 +47,7 @@
       </div>
       </div>
     </div>
     </div>
 
 
-    <div class="tab-content page-content-with-sidebar" ng-if="ctrl.tabIndex === 2">
+    <div class="tab-content page-content-with-sidebar" ng-if="ctrl.tabs[ctrl.tabIndex] === 'Dashboards'">
 			<dashboard-import-list plugin="ctrl.model"></dashboard-import-list>
 			<dashboard-import-list plugin="ctrl.model"></dashboard-import-list>
     </div>
     </div>
 
 

+ 5 - 5
public/app/features/plugins/plugin_edit_ctrl.ts

@@ -27,7 +27,7 @@ export class PluginEditCtrl {
     this.model = {};
     this.model = {};
     this.pluginId = $routeParams.pluginId;
     this.pluginId = $routeParams.pluginId;
     this.tabIndex = 0;
     this.tabIndex = 0;
-    this.tabs = ['Overview'];
+    this.tabs = ['Readme'];
 
 
     this.preUpdateHook = () => Promise.resolve();
     this.preUpdateHook = () => Promise.resolve();
     this.postUpdateHook = () => Promise.resolve();
     this.postUpdateHook = () => Promise.resolve();
@@ -48,13 +48,13 @@ export class PluginEditCtrl {
       });
       });
 
 
       if (this.model.type === 'app') {
       if (this.model.type === 'app') {
-        this.tabIndex = 1;
-        this.tabs.push('Config');
-
         this.hasDashboards = _.find(result.includes, {type: 'dashboard'});
         this.hasDashboards = _.find(result.includes, {type: 'dashboard'});
         if (this.hasDashboards) {
         if (this.hasDashboards) {
-          this.tabs.push('Dashboards');
+          this.tabs.unshift('Dashboards');
         }
         }
+
+        this.tabs.unshift('Config');
+        this.tabIndex = 0;
       }
       }
 
 
       return this.initReadme();
       return this.initReadme();