Reactify Top Nav Menu (kbn_top_nav)#40262
Conversation
…op-nav/new-directive
…-nav/new-directive
…n-top-nav/new-directive
…op-nav/new-directive
…op-nav/new-directive
…op-nav/new-directive
…orm/kbn-top-nav/new-directive
Support search bar with no filter bar (TS)
💔 Build Failed |
lukeelmers
left a comment
There was a problem hiding this comment.
LGTM! (Pending a final 💚 build)
💚 Build Succeeded |
cchaos
left a comment
There was a problem hiding this comment.
When it comes to laying out the top nav menu along with the other global inputs like search, filters, and time, the design team feels it's best to always keep the top nav menu as it's own line at the very top. We will work on the styles of this menu bar to align it better throughout Kibana. However, we shouldn't be putting the time picker to the right of the nav bar. We understand that this creates some awkward space just below the menu bar, but we will work on that too.
So instead of supporting the "inline" behavior, you can just leave that empty space where the query bar should be.
src/legacy/core_plugins/data/public/query/query_bar/components/query_bar.test.tsx
Outdated
Show resolved
Hide resolved
src/legacy/core_plugins/data/public/search/search_bar/components/search_bar.test.tsx
Outdated
Show resolved
Hide resolved
src/legacy/core_plugins/data/public/search/search_bar/components/search_bar.test.tsx
Show resolved
Hide resolved
src/legacy/core_plugins/data/public/search/search_bar/components/search_bar.tsx
Outdated
Show resolved
Hide resolved
src/legacy/core_plugins/kibana/public/dashboard/top_nav/get_top_nav_config.ts
Outdated
Show resolved
Hide resolved
src/legacy/core_plugins/kibana_react/public/top_nav_menu/top_nav_menu.tsx
Outdated
Show resolved
Hide resolved
|
@cchaos Thanks! |
…bn-top-nav/new-directive
cchaos
left a comment
There was a problem hiding this comment.
Just a few last suggestions for the reset button markup. Other than that 👍
💚 Build Succeeded |
…op-nav/new-directive
…zozom/kibana into newplatform/kbn-top-nav/new-directive
💚 Build Succeeded |
* kbn top nav in discover * New top nav in dashboard and vis editor * Stop using template feature of kbn top nav * Changed console menu to new directive * Use search bar in top nav in discover and maps Support search bar with no filter bar (TS) * Moved storage instantiation to angular directive * Make index patterns optional (for timepicker only setup) * Moved discover result count away from top nav * Removed unused name attribute in top nav. Use app-name instead.
* kbn top nav in discover * New top nav in dashboard and vis editor * Stop using template feature of kbn top nav * Changed console menu to new directive * Use search bar in top nav in discover and maps Support search bar with no filter bar (TS) * Moved storage instantiation to angular directive * Make index patterns optional (for timepicker only setup) * Moved discover result count away from top nav * Removed unused name attribute in top nav. Use app-name instead.
|
@lizozom I just happened to notice one thing in Maps. It looks like in full screen the top nav bar doesn't go away anymore: |
…b-panel-for-stopping-jobs * 'master' of github.com:elastic/kibana: (58 commits) [DOCS] Timelion cleanup (elastic#41381) [Docs] Add simple phrase highlighting to Logs UI (elastic#41610) [Maps] Rename modules for clarity (elastic#41608) [Monitoring] Metricbeat migration net new user experience (elastic#39832) [Maps] Only color legend icon with dynamic color when dynamic config is complete (elastic#41607) [TSVB] [Markdown] markdown section do not render after change data parameter (elastic#41576) [Vega] (Step 2) Shim new platform - renaming vega -> vis_type_vega (elastic#41565) update dark mode tsvb test (elastic#41618) [i18n] .i18nrc file as the source of truth and enhance tooling (elastic#39774) Reactify Top Nav Menu (kbn_top_nav) (elastic#40262) fix(code/frontend): should update search results if search options change (elastic#41232) Use kibana-ci-proxy-cache for chrome and gecko drivers (elastic#41581) [SIEM] Fix draggables to work with escapeId for the ML severity column (elastic#41621) [Canvas] Updates esdocs default count to 1000 (elastic#41604) [Uptime] Fix duration chart for Safari (elastic#41619) [Canvas] Restores "Today" as a quick time range in time filter (elastic#41528) docs: lowercase app (elastic#41612) [Code] Update git repository update frequency (elastic#41541) Remove language=json on code blocks due to performance hit (elastic#41540) [DOCS] Update anchors and links for Elasticserach API relocation. (elastic#41372) ...
💚 Build Succeeded |
Summary
Implements #39981
Updates the top nav of:
Dev Docs
Top Nav Menuis a configurable component that conveniently renders the elements that are often shared by applications: Option menus, query input, filters and time range selection.Show a simple options menu
Define your navigation menu items as an array of
TopNavMenuDataelements and pass it down to theTopNavMenucomponent.Show a full menu with SearchBar
Search Bar is another convenience component that displays
FilterBar,QueryBarInputandEuiSuperDatePickerin a standard layout.This is the full configuration required to render all 3 components.
Migrating the Angular directive
The
kbn-top-navdirective is still defined, however, its API has slightly changed.While it will be deprecated during the lifetime of 7.x, you may still use it, if you take the following steps.
Key attribute is deprecated
Change the
keyattribute of the navigation configuration toid. It's a reserved React keyword and hence it's not supported by theTopNavMenucomponent. While the both attributes will work with the directive, it's better to update toidright away.Add a label
While the
TopNavMenuItemcomponent still currently falls back to using key\id iflabelis not provided, you should always specify alabel. This is becauselabelis ani18nstring andidis not.Transcluded views are deprecated
Either move them elsewhere or use the SearchBar options.
Template menu items are deprecated.
Render your views from your app's code and then use the menu's
runfunction to toggle visibility.Screenshots
Discover
New:

Old:

Still handled in Angular:
visualize (configurable components)
New:

New Markdown (autorefresh only):

New TSVB (timepicker only):

Old:

Still in Angular:
Most visualizations search bar has all 3 features: Timepicker, Filter Bar and Query input (This is true for: Area, Map, Gauge, Table, Goal, Heat map, Horizontal bar, Line, Metric, Pie, Region map, Tag cloud, Vertical bar, Vega).
However the following have exceptions: (why? @AlonaNadler)
dashboard
New:

Old:

maps (no filter bar)
New:

Old:

To make it more fun - filters are located inside the layer editing mode, and they use the QueryBar component.
console (menu only)
New:

Old:

timelion (timepicker only)
New:

Old:

Still in Angular
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers