From 2bfded3c5f1d02c6f2f24444af22fc339a5ce12f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 15 Jan 2016 14:42:59 +0100 Subject: [PATCH] ux(): general ux polish --- public/app/core/directives/topnav.js | 6 ++-- public/app/core/services/context_srv.js | 28 +---------------- .../features/datasources/partials/edit.html | 9 +++--- .../datasources/partials/http_settings.html | 2 +- .../features/datasources/partials/list.html | 18 ++++++----- .../app/features/org/partials/orgUsers.html | 5 ++- .../features/playlist/partials/playlist.html | 31 +++++++++++-------- .../features/playlist/partials/playlists.html | 20 ++++++------ .../features/playlist/playlist_edit_ctrl.js | 3 +- .../elasticsearch/partials/edit_view.html | 5 +-- .../datasource/influxdb/partials/config.html | 2 +- public/less/gfbox.less | 5 +-- public/less/variables.dark.less | 2 +- 13 files changed, 57 insertions(+), 79 deletions(-) diff --git a/public/app/core/directives/topnav.js b/public/app/core/directives/topnav.js index c9141b5d6b2..e8874d38027 100644 --- a/public/app/core/directives/topnav.js +++ b/public/app/core/directives/topnav.js @@ -11,7 +11,7 @@ function (coreModule) { scope: { title: "@", section: "@", - titleAction: "&", + titleUrl: "@", subnav: "=", }, template: @@ -35,7 +35,7 @@ function (coreModule) { '' + '' + - '' + + '' + '{{title}}' + '' + '' + @@ -45,7 +45,7 @@ function (coreModule) { scope.contextSrv = contextSrv; scope.toggle = function() { - $rootScope.appEvent('toggle-sidemenu'); + contextSrv.toggleSideMenu(); }; } }; diff --git a/public/app/core/services/context_srv.js b/public/app/core/services/context_srv.js index 27077eb39d2..b4fd396d455 100644 --- a/public/app/core/services/context_srv.js +++ b/public/app/core/services/context_srv.js @@ -8,8 +8,7 @@ define([ function (angular, _, coreModule, store, config) { 'use strict'; - coreModule.default.service('contextSrv', function($rootScope, $timeout) { - var self = this; + coreModule.default.service('contextSrv', function() { function User() { if (config.bootData.user) { @@ -17,30 +16,16 @@ function (angular, _, coreModule, store, config) { } } - // events - $rootScope.$on('toggle-sidemenu', function() { - self.toggleSideMenu(); - }); - this.hasRole = function(role) { return this.user.orgRole === role; }; this.setSideMenuState = function(state) { this.sidemenu = state; - store.set('grafana.sidemenu', state); }; this.toggleSideMenu = function() { this.setSideMenuState(!this.sidemenu); - - $timeout(function() { - $rootScope.$broadcast("render"); - }, 50); - }; - - this.getSidemenuDefault = function() { - return this.hasRole('Admin'); }; this.version = config.buildInfo.version; @@ -48,17 +33,6 @@ function (angular, _, coreModule, store, config) { this.user = new User(); this.isSignedIn = this.user.isSignedIn; this.isGrafanaAdmin = this.user.isGrafanaAdmin; - this.sidemenu = store.getBool('grafana.sidemenu', this.getSidemenuDefault()); - - if (this.isSignedIn && !store.exists('grafana.sidemenu')) { - // If the sidemenu has never been set before, set it to false. - // This will result in this.sidemenu and the localStorage grafana.sidemenu - // to be out of sync if the user has an admin role. But this is - // intentional and results in the user seeing the sidemenu only on - // their first login. - store.set('grafana.sidemenu', false); - } - this.isEditor = this.hasRole('Editor') || this.hasRole('Admin'); }); }); diff --git a/public/app/features/datasources/partials/edit.html b/public/app/features/datasources/partials/edit.html index 24375506b85..c36932bff5b 100644 --- a/public/app/features/datasources/partials/edit.html +++ b/public/app/features/datasources/partials/edit.html @@ -1,8 +1,7 @@ - + @@ -59,7 +58,7 @@ - Cancel + Cancel
diff --git a/public/app/features/datasources/partials/http_settings.html b/public/app/features/datasources/partials/http_settings.html index bd70e419326..d0d4206c579 100644 --- a/public/app/features/datasources/partials/http_settings.html +++ b/public/app/features/datasources/partials/http_settings.html @@ -1,5 +1,5 @@
-
Http settings
+

Http settings

    diff --git a/public/app/features/datasources/partials/list.html b/public/app/features/datasources/partials/list.html index 45fe5143a18..018ec4fb146 100644 --- a/public/app/features/datasources/partials/list.html +++ b/public/app/features/datasources/partials/list.html @@ -1,16 +1,18 @@ - - + -
    +
    -

    Data sources

    + + + + Add data source + + +

    Data sources

    - No datasources defined + No data sources defined
    diff --git a/public/app/features/org/partials/orgUsers.html b/public/app/features/org/partials/orgUsers.html index c6404e1f22f..072cacaf3cf 100644 --- a/public/app/features/org/partials/orgUsers.html +++ b/public/app/features/org/partials/orgUsers.html @@ -7,13 +7,12 @@
    -

    Organization users

    - - +

    Organization users


    diff --git a/public/app/features/playlist/partials/playlist.html b/public/app/features/playlist/partials/playlist.html index 077ef5cbdd0..bc011013032 100644 --- a/public/app/features/playlist/partials/playlist.html +++ b/public/app/features/playlist/partials/playlist.html @@ -1,18 +1,23 @@ - + + +

    New playlist

    Edit playlist

    -
    1. Name and interval
    +

    Name and interval

    • - Title + Name
    • @@ -23,7 +28,7 @@
      • - Interval + Interval
      • @@ -34,11 +39,14 @@

      -
      2. Add dashboards
      +

      Add dashboards

        +
      • + Search +
      • -
      • - -
      @@ -57,9 +62,9 @@
    -
    +
    -
    Search results ({{filteredPlaylistItems.length}})
    +
    Search results ({{filteredPlaylistItems.length}})
    - + @@ -80,7 +85,7 @@
    @@ -72,7 +77,7 @@
    Search results empty
    -
    Playlist dashboards
    +
    Added dashboards
    @@ -111,7 +116,7 @@ ng-disabled="playlistEditForm.$invalid || isPlaylistEmpty()" ng-click="savePlaylist(playlist, playlistItems)">Save diff --git a/public/app/features/playlist/partials/playlists.html b/public/app/features/playlist/partials/playlists.html index fcf888b7aa9..fe56e515688 100644 --- a/public/app/features/playlist/partials/playlists.html +++ b/public/app/features/playlist/partials/playlists.html @@ -2,24 +2,26 @@
    + + +

    Saved playlists

    - -
    - - +
    - - + + -
    TitleUrlNameStart url
    - {{playlist.title}} + + {{playlist.title}} playlists/play/{{playlist.id}} diff --git a/public/app/features/playlist/playlist_edit_ctrl.js b/public/app/features/playlist/playlist_edit_ctrl.js index 610558cc5fa..4efda3695eb 100644 --- a/public/app/features/playlist/playlist_edit_ctrl.js +++ b/public/app/features/playlist/playlist_edit_ctrl.js @@ -35,11 +35,10 @@ function (angular, config, _) { }; $scope.search = function() { - var query = {starred: true, limit: 10}; + var query = {limit: 10}; if ($scope.searchQuery) { query.query = $scope.searchQuery; - query.starred = false; } $scope.loading = true; diff --git a/public/app/plugins/datasource/elasticsearch/partials/edit_view.html b/public/app/plugins/datasource/elasticsearch/partials/edit_view.html index 63a70ab8912..bf43012c72e 100644 --- a/public/app/plugins/datasource/elasticsearch/partials/edit_view.html +++ b/public/app/plugins/datasource/elasticsearch/partials/edit_view.html @@ -1,6 +1,6 @@ -
    Elasticsearch details
    +

    Elasticsearch details

      @@ -43,7 +43,8 @@

    -
    Default query settings
    + +

    Default query settings

      diff --git a/public/app/plugins/datasource/influxdb/partials/config.html b/public/app/plugins/datasource/influxdb/partials/config.html index 8a85ec2a16a..9d1c967c668 100644 --- a/public/app/plugins/datasource/influxdb/partials/config.html +++ b/public/app/plugins/datasource/influxdb/partials/config.html @@ -1,6 +1,6 @@ -
      InfluxDB Details
      +

      InfluxDB Details

        diff --git a/public/less/gfbox.less b/public/less/gfbox.less index 55330d26513..5a250484a14 100644 --- a/public/less/gfbox.less +++ b/public/less/gfbox.less @@ -69,11 +69,8 @@ } .page-container { - margin: 15px; - background: @grafanaPanelBackground; position: relative; - border: @grafanaPanelBorder; - padding: 20px 20px 60px 49px; + padding: 20px 20px 60px 81px; } .page { diff --git a/public/less/variables.dark.less b/public/less/variables.dark.less index 38dd14f7336..b22d3b96992 100644 --- a/public/less/variables.dark.less +++ b/public/less/variables.dark.less @@ -75,7 +75,7 @@ @altFontFamily: @serifFontFamily; @headingsFontFamily: inherit; // empty to use BS default, @baseFontFamily -@headingsFontWeight: bold; // instead of browser default, bold +@headingsFontWeight: normal; // instead of browser default, bold @headingsColor: darken(@white,11%); // empty to use BS default, @textColor @inputText: @black;