open-nomad/ui/app/templates/components
Buck Doyle 6d037633da
ui: Change global search to use fuzzy search API (#10412)
This updates the UI to use the new fuzzy search API. It’s a drop-in
replacement so the / shortcut to jump to search is preserved, and
results can be cycled through and chosen via arrow keys and the
enter key.

It doesn’t use everything returned by the API:
* deployments and evaluations: these match by id, doesn’t seem like
  people would know those or benefit from quick navigation to them
* namespaces: doesn’t seem useful as they currently function
* scaling policies
* tasks: the response doesn’t include an allocation id, which means they
  can’t be navigated to in the UI without an additional query
* CSI volumes: aren’t actually returned by the API

Since there’s no API to check the server configuration and know whether
the feature has been disabled, this adds another query in
route:application#beforeModel that acts as feature detection: if the
attempt to query fails (500), the global search field is hidden.

Upon having added another query on load, I realised that beforeModel was
being triggered any time service:router#transitionTo was being called,
which happens upon navigating to a search result, for instance, because
of refreshModel being present on the region query parameter. This PR
adds a check for transition.queryParamsOnly and skips rerunning the
onload queries (token permissions check, license check, fuzzy search
feature detection).

Implementation notes:

* there are changes to unrelated tests to ignore the on-load feature
  detection query
* some lifecycle-related guards against undefined were required to
  address failures when navigating to an allocation
* the minimum search length of 2 characters is hard-coded as there’s
  currently no way to determine min_term_length in the UI
2021-04-28 13:31:05 -05:00
..
exec
fs Merge pull request #9074 from Liraim/fix_download 2020-11-04 10:09:35 -08:00
global-search ui: Change global search to use fuzzy search API (#10412) 2021-04-28 13:31:05 -05:00
job-deployment
job-page Add button to fail running deployments (#9831) 2021-02-10 08:38:37 -06:00
list-accordion
list-pagination
list-table Add DAS UI code from enterprise (#9192) 2020-10-29 07:46:42 -05:00
topo-viz Use common helpers and utils for formatting hertz 2021-03-31 09:29:14 -07:00
agent-monitor.hbs Update to v4 of Ember Power Select (#10226) 2021-03-26 08:55:12 -05:00
allocation-row.hbs Replace all instances of the warning icon with the Structure alert-triangle icon 2020-10-26 15:07:12 -07:00
allocation-stat.hbs Replace all instances of the warning icon with the Structure alert-triangle icon 2020-10-26 15:07:12 -07:00
allocation-subnav.hbs
app-breadcrumbs.hbs
attributes-section.hbs
attributes-table.hbs
client-node-row.hbs Replace all instances of the warning icon with the Structure alert-triangle icon 2020-10-26 15:07:12 -07:00
client-subnav.hbs
copy-button.hbs Add DAS subroute and copy button (#9201) 2020-11-04 12:22:24 -06:00
distribution-bar.hbs Unify the distribution bar tooltip and the line chart tooltip styles/patterns 2021-03-08 15:41:04 -08:00
drain-popover.hbs Update to v4 of Ember Power Select (#10226) 2021-03-26 08:55:12 -05:00
exec-terminal.hbs
flex-masonry.hbs Reset inline styles on flex-masonry elements when columns is set to 1 2020-10-23 14:17:03 -07:00
forbidden-message.hbs Add exchange of one-time token on UI load (#10066) 2021-04-01 13:21:30 -05:00
gauge-chart.hbs
global-header.hbs ui: Change global search to use fuzzy search API (#10412) 2021-04-28 13:31:05 -05:00
gutter-menu.hbs Update to v4 of Ember Power Select (#10226) 2021-03-26 08:55:12 -05:00
hamburger-menu.hbs
image-file.hbs
job-deployment-details.hbs
job-deployment.hbs
job-deployments-stream.hbs
job-diff-fields-and-objects.hbs
job-diff.hbs
job-editor.hbs
job-row.hbs
job-subnav.hbs
job-version.hbs Add job version revert buttons (#10336) 2021-04-20 08:33:16 -05:00
job-versions-stream.hbs Add job version revert buttons (#10336) 2021-04-20 08:33:16 -05:00
json-viewer.hbs
lifecycle-chart-row.hbs
lifecycle-chart.hbs Revert "Temporarily remove poststop from the UI" 2020-11-12 09:16:52 -08:00
line-chart.hbs No longer include an automatic tooltip in LineChart 2021-03-08 21:02:01 -08:00
list-accordion.hbs
list-pagination.hbs
list-table.hbs
loading-spinner.hbs Update loading spinner to be logo-based (#9106) 2020-10-15 16:05:58 -05:00
multi-select-dropdown.hbs Update Ember/Ember CLI to 3.20 (#9641) 2021-02-17 15:01:44 -06:00
nomad-logo.hbs
page-layout.hbs
page-size-select.hbs Update to v4 of Ember Power Select (#10226) 2021-03-26 08:55:12 -05:00
placement-failure.hbs
plugin-allocation-row.hbs Replace all instances of the warning icon with the Structure alert-triangle icon 2020-10-26 15:07:12 -07:00
popover-menu.hbs
proxy-tag.hbs
region-switcher.hbs Update to v4 of Ember Power Select (#10226) 2021-03-26 08:55:12 -05:00
reschedule-event-row.hbs
reschedule-event-timeline.hbs Replace all instances of the warning icon with the Structure alert-triangle icon 2020-10-26 15:07:12 -07:00
scale-events-accordion.hbs
scale-events-chart.hbs No longer include an automatic tooltip in LineChart 2021-03-08 21:02:01 -08:00
search-box.hbs
server-agent-row.hbs
server-subnav.hbs
stats-time-series.hbs Refactor stats-time-series to allow for multiple series 2021-03-24 13:52:51 -07:00
stepper-input.hbs
streaming-file.hbs
svg-patterns.hbs Add DAS UI code from enterprise (#9192) 2020-10-29 07:46:42 -05:00
task-group-row.hbs Use common helpers and utils for formatting hertz 2021-03-31 09:29:14 -07:00
task-log.hbs
task-row.hbs Use common helpers and utils for formatting hertz 2021-03-31 09:29:14 -07:00
task-subnav.hbs
toggle.hbs
topo-viz.hbs Use common helpers and utils for formatting hertz 2021-03-31 09:29:14 -07:00
two-step-button.hbs Add button to fail running deployments (#9831) 2021-02-10 08:38:37 -06:00