6d037633da
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 |
||
---|---|---|
.. | ||
exec | ||
fs | ||
global-search | ||
job-deployment | ||
job-page | ||
list-accordion | ||
list-pagination | ||
list-table | ||
topo-viz | ||
agent-monitor.hbs | ||
allocation-row.hbs | ||
allocation-stat.hbs | ||
allocation-subnav.hbs | ||
app-breadcrumbs.hbs | ||
attributes-section.hbs | ||
attributes-table.hbs | ||
client-node-row.hbs | ||
client-subnav.hbs | ||
copy-button.hbs | ||
distribution-bar.hbs | ||
drain-popover.hbs | ||
exec-terminal.hbs | ||
flex-masonry.hbs | ||
forbidden-message.hbs | ||
gauge-chart.hbs | ||
global-header.hbs | ||
gutter-menu.hbs | ||
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 | ||
job-versions-stream.hbs | ||
json-viewer.hbs | ||
lifecycle-chart-row.hbs | ||
lifecycle-chart.hbs | ||
line-chart.hbs | ||
list-accordion.hbs | ||
list-pagination.hbs | ||
list-table.hbs | ||
loading-spinner.hbs | ||
multi-select-dropdown.hbs | ||
nomad-logo.hbs | ||
page-layout.hbs | ||
page-size-select.hbs | ||
placement-failure.hbs | ||
plugin-allocation-row.hbs | ||
popover-menu.hbs | ||
proxy-tag.hbs | ||
region-switcher.hbs | ||
reschedule-event-row.hbs | ||
reschedule-event-timeline.hbs | ||
scale-events-accordion.hbs | ||
scale-events-chart.hbs | ||
search-box.hbs | ||
server-agent-row.hbs | ||
server-subnav.hbs | ||
stats-time-series.hbs | ||
stepper-input.hbs | ||
streaming-file.hbs | ||
svg-patterns.hbs | ||
task-group-row.hbs | ||
task-log.hbs | ||
task-row.hbs | ||
task-subnav.hbs | ||
toggle.hbs | ||
topo-viz.hbs | ||
two-step-button.hbs |