open-nomad/ui/tests/acceptance
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
..
behaviors Format all bytes using helpers, even the ones that are already MiBs 2021-03-31 09:29:02 -07:00
allocation-detail-test.js ui: Change global search to use fuzzy search API (#10412) 2021-04-28 13:31:05 -05:00
allocation-fs-test.js
application-errors-test.js
client-detail-test.js ui: Change global search to use fuzzy search API (#10412) 2021-04-28 13:31:05 -05:00
client-monitor-test.js
clients-list-test.js Change down to highest-priority composite status (#9927) 2021-02-01 12:00:34 -06:00
exec-test.js
job-allocations-test.js
job-definition-test.js
job-deployments-test.js
job-detail-test.js Update to v4 of Ember Power Select (#10226) 2021-03-26 08:55:12 -05:00
job-evaluations-test.js
job-run-test.js
job-versions-test.js Add job version revert buttons (#10336) 2021-04-20 08:33:16 -05:00
jobs-list-test.js
namespaces-test.js Update to v4 of Ember Power Select (#10226) 2021-03-26 08:55:12 -05:00
optimize-test.js Aggregate the BANs in the cluster details panel 2021-03-31 09:29:14 -07:00
plugin-allocations-test.js
plugin-detail-test.js Use common helpers and utils for formatting hertz 2021-03-31 09:29:14 -07:00
plugins-list-test.js
regions-test.js ui: Change global search to use fuzzy search API (#10412) 2021-04-28 13:31:05 -05:00
search-test.js ui: Change global search to use fuzzy search API (#10412) 2021-04-28 13:31:05 -05:00
server-detail-test.js
server-monitor-test.js
servers-list-test.js
task-detail-test.js
task-fs-test.js
task-group-detail-test.js Use common helpers and utils for formatting hertz 2021-03-31 09:29:14 -07:00
task-logs-test.js
token-test.js Add removal of OTT query parameter with delay (#10319) 2021-04-13 11:56:59 -05:00
topology-test.js Aggregate the BANs in the cluster details panel 2021-03-31 09:29:14 -07:00
volume-detail-test.js Use common helpers and utils for formatting hertz 2021-03-31 09:29:14 -07:00
volumes-list-test.js