From e9d5e037e817b57303c4497b42b28ee9403dd65f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 2 Jun 2017 14:00:42 +0200 Subject: [PATCH] ux: merge branch navbarv2, new navbar with dashboard search available on all pages, closes #6475 --- public/app/core/components/grafana_app.ts | 19 +- public/app/core/components/help/help.html | 4 +- public/app/core/components/navbar/navbar.html | 35 ++- public/app/core/components/navbar/navbar.ts | 27 +- public/app/core/components/search/search.html | 98 ++++---- public/app/core/components/search/search.ts | 5 + public/app/core/controllers/error_ctrl.js | 4 +- public/app/core/core.ts | 3 + public/app/core/nav_model_srv.ts | 209 ++++++++++++++++ public/app/core/routes/routes.ts | 4 + public/app/core/services/keybindingSrv.ts | 6 +- public/app/features/admin/admin.ts | 14 +- public/app/features/admin/adminEditOrgCtrl.js | 4 +- .../app/features/admin/adminEditUserCtrl.js | 3 +- .../app/features/admin/adminListOrgsCtrl.js | 3 +- .../features/admin/admin_list_users_ctrl.ts | 4 +- .../features/admin/partials/admin_home.html | 3 +- .../app/features/admin/partials/edit_org.html | 7 +- .../features/admin/partials/edit_user.html | 7 +- .../app/features/admin/partials/new_user.html | 7 +- public/app/features/admin/partials/orgs.html | 7 +- .../app/features/admin/partials/settings.html | 3 +- public/app/features/admin/partials/stats.html | 3 +- public/app/features/admin/partials/users.html | 15 +- .../app/features/alerting/alert_list_ctrl.ts | 11 +- .../alerting/notification_edit_ctrl.ts | 5 +- .../alerting/notifications_list_ctrl.ts | 9 +- .../alerting/partials/alert_list.html | 3 +- .../alerting/partials/notification_edit.html | 7 +- .../alerting/partials/notifications_list.html | 3 +- .../features/dashboard/dashnav/dashnav.html | 75 ++---- .../app/features/dashboard/dashnav/dashnav.ts | 178 ++++++------- public/app/features/dashboard/viewStateSrv.js | 9 +- .../app/features/org/change_password_ctrl.js | 3 +- public/app/features/org/newOrgCtrl.js | 3 +- public/app/features/org/orgApiKeysCtrl.js | 3 +- public/app/features/org/orgDetailsCtrl.js | 3 +- public/app/features/org/org_users_ctrl.ts | 4 +- .../org/partials/change_password.html | 3 +- public/app/features/org/partials/newOrg.html | 3 +- .../app/features/org/partials/orgApiKeys.html | 3 +- .../app/features/org/partials/orgDetails.html | 3 +- .../app/features/org/partials/orgUsers.html | 3 +- public/app/features/org/partials/profile.html | 5 +- public/app/features/org/profile_ctrl.ts | 4 +- .../features/playlist/partials/playlist.html | 3 +- .../features/playlist/partials/playlists.html | 3 +- .../features/playlist/playlist_edit_ctrl.ts | 29 ++- public/app/features/playlist/playlist_srv.ts | 6 +- .../app/features/playlist/playlists_ctrl.ts | 14 +- .../specs/playlist_edit_ctrl_specs.ts | 6 +- public/app/features/plugins/ds_edit_ctrl.ts | 236 +++++++++--------- public/app/features/plugins/ds_list_ctrl.ts | 42 ++-- .../features/plugins/partials/ds_edit.html | 3 +- .../features/plugins/partials/ds_list.html | 6 +- .../plugins/partials/plugin_edit.html | 3 +- .../plugins/partials/plugin_list.html | 3 +- .../plugins/partials/plugin_page.html | 3 +- .../app/features/plugins/plugin_edit_ctrl.ts | 19 +- .../app/features/plugins/plugin_list_ctrl.ts | 4 +- .../app/features/plugins/plugin_page_ctrl.ts | 45 +++- .../features/snapshot/partials/snapshots.html | 3 +- public/app/features/snapshot/snapshot_ctrl.ts | 11 +- .../app/features/styleguide/styleguide.html | 3 +- public/app/features/styleguide/styleguide.ts | 4 +- public/app/partials/dashboard.html | 3 +- public/app/partials/error.html | 3 +- public/sass/_old_responsive.scss | 4 +- public/sass/components/_dropdown.scss | 16 +- public/sass/components/_navbar.scss | 46 +++- public/sass/components/_search.scss | 105 +++++--- public/sass/components/_sidemenu.scss | 8 +- public/sass/components/_view_states.scss | 2 +- 73 files changed, 923 insertions(+), 544 deletions(-) create mode 100644 public/app/core/nav_model_srv.ts diff --git a/public/app/core/components/grafana_app.ts b/public/app/core/components/grafana_app.ts index f48d941a8ba..5a677094754 100644 --- a/public/app/core/components/grafana_app.ts +++ b/public/app/core/components/grafana_app.ts @@ -105,10 +105,14 @@ export function grafanaAppDirective(playlistSrv, contextSrv) { if (pageClass) { body.removeClass(pageClass); } - pageClass = data.$$route.pageClass; - if (pageClass) { - body.addClass(pageClass); + + if (data.$$route) { + pageClass = data.$$route.pageClass; + if (pageClass) { + body.addClass(pageClass); + } } + $("#tooltip, .tooltip").remove(); // check for kiosk url param @@ -194,6 +198,15 @@ export function grafanaAppDirective(playlistSrv, contextSrv) { }); } } + + // hide menus + var openMenus = body.find('.navbar-page-btn--open'); + if (openMenus.length > 0) { + if (target.parents('.navbar-page-btn--open').length === 0) { + openMenus.removeClass('navbar-page-btn--open'); + } + } + // hide sidemenu if (!ignoreSideMenuHide && !contextSrv.pinned && body.find('.sidemenu').length > 0) { if (target.parents('.sidemenu').length === 0) { diff --git a/public/app/core/components/help/help.html b/public/app/core/components/help/help.html index 3356f21d452..c07d57a0ffc 100644 --- a/public/app/core/components/help/help.html +++ b/public/app/core/components/help/help.html @@ -1,7 +1,7 @@