Pārlūkot izejas kodu

WIP: fixes after navbar changes

Fixes for merge conflicts and navbar metadata
added for user group pages.
Daniel Lee 8 gadi atpakaļ
vecāks
revīzija
96afb91ac4

+ 1 - 1
public/app/core/components/search/search.html

@@ -101,7 +101,7 @@
 
 		<a class="btn btn-inverse" href="dashboard/new/?editview=import" ng-show="ctrl.contextSrv.isEditor" ng-click="ctrl.isOpen = false;">
 			<i class="fa fa-upload"></i>
-			>&nbsp; Import Dashboard
+			&nbsp; Import Dashboard
 		</a>
 
 			<a class="search-button-row-explore-link" target="_blank" href="https://grafana.com/dashboards?utm_source=grafana_search">

+ 1 - 1
public/app/core/components/search/search.ts

@@ -159,7 +159,7 @@ export class SearchCtrl {
   }
 
   showNewFolderModal() {
-    this.$scope.appEvent('show-modal', {
+    appEvents.emit('show-modal', {
       templateHtml: '<folder-modal></folder-modal>',
       modalClass: 'modal--narrow'
     });

+ 1 - 0
public/app/core/nav_model_srv.ts

@@ -96,6 +96,7 @@ export class NavModelSrv {
         {title: 'Preferences', active: subPage === 0, url: 'org', icon: 'fa fa-fw fa-cog'},
         {title: 'Org Users', active: subPage === 1, url: 'org/users', icon: 'fa fa-fw fa-users'},
         {title: 'API Keys', active: subPage === 2, url: 'org/apikeys', icon: 'fa fa-fw fa-key'},
+        {title: 'Org User Groups', active: subPage === 3, url: 'org/user-groups', icon: 'fa fa-fw fa-users'},
       ]
     };
   }

+ 1 - 1
public/app/features/dashboard/dashnav/dashnav.ts

@@ -101,7 +101,7 @@ export class DashNavCtrl {
 
       if (alerts > 0) {
         confirmText = 'DELETE';
-        text2 = `This dashboad contains ${alerts} alerts. Deleting this dashboad will also delete those alerts`;
+        text2 = `This dashboard contains ${alerts} alerts. Deleting this dashboad will also delete those alerts`;
       }
 
       appEvents.emit('confirm-modal', {

+ 1 - 0
public/app/features/dashboard/model.ts

@@ -36,6 +36,7 @@ export class DashboardModel {
   meta: any;
   events: any;
   editMode: boolean;
+  parentId: number;
 
   constructor(data, meta?) {
     if (!data) {

+ 1 - 6
public/app/features/org/partials/edit_user_group.html

@@ -1,9 +1,4 @@
-<navbar icon="fa fa-fw fa-cogs" title="User Group" title-url="user-group">
-	<a href="org/user-groups" class="navbar-page-btn">
-		<i class="icon-gf icon-gf-users"></i>
-		User Groups
-	</a>
-</navbar>
+<navbar model="ctrl.navModel"></navbar>
 
 <div class="page-container">
 	<div class="page-header">

+ 7 - 8
public/app/features/org/partials/user_groups.html

@@ -1,5 +1,4 @@
-<navbar icon="icon-gf icon-gf-users" title="User Groups" title-url="org">
-</navbar>
+<navbar model="ctrl.navModel"></navbar>
 
 <div class="page-container">
 	<div class="page-header">
@@ -10,12 +9,12 @@
       Create User Group
     </a>
   </div>
-  <div class="search-field-wrapper pull-right width-18">
-    <span style="position: relative;">
-      <input  type="text" placeholder="Find User Group by name" tabindex="1" give-focus="true"
-      ng-model="ctrl.query" ng-model-options="{ debounce: 500 }" spellcheck='false' ng-change="ctrl.get()" />
-    </span>
-  </div>
+    <div class="gf-form pull-right width-15 gf-form-group">
+      <span style="position: relative;">
+        <input type="text" class="gf-form-input" placeholder="Find User Group by name" tabindex="1" give-focus="true"
+          ng-model="ctrl.query" ng-model-options="{ debounce: 500 }" spellcheck='false' ng-change="ctrl.get()" />
+      </span>
+    </div>
   <div class="admin-list-table">
     <table class="filter-table form-inline">
       <thead>

+ 3 - 1
public/app/features/org/user_group_details_ctrl.ts

@@ -9,8 +9,10 @@ export default class UserGroupDetailsCtrl {
   userName = '';
   usersSearchCache: User[] = [];
   searchUsers: any;
+  navModel: any;
 
-  constructor(private $scope, private $http, private backendSrv, private $routeParams) {
+  constructor(private $scope, private $http, private backendSrv, private $routeParams, navModelSrv) {
+    this.navModel = navModelSrv.getOrgNav(3);
     this.get();
     this.usersSearchCache = [];
     this.searchUsers = (queryStr, callback) => {

+ 4 - 2
public/app/features/org/user_groups_ctrl.ts

@@ -2,7 +2,7 @@
 
 import coreModule from 'app/core/core_module';
 
-export default class UserGroupsCtrl {
+export class UserGroupsCtrl {
   userGroups: any;
   pages = [];
   perPage = 50;
@@ -11,9 +11,11 @@ export default class UserGroupsCtrl {
   showPaging = false;
   query: any = '';
   userGroupName: any = '';
+  navModel: any;
 
   /** @ngInject */
-  constructor(private $scope, private $http, private backendSrv, private $location) {
+  constructor(private $scope, private $http, private backendSrv, private $location, navModelSrv) {
+    this.navModel = navModelSrv.getOrgNav(3);
     this.get();
   }