open-consul/ui-v2/app/helpers
John Cowen 40e632a955
ui: Enable recovery from an unreachable datacenter (500 error) (#7404)
For URL maintenance reasons we store the last visited DC in
localStorage incase you come back to a page (for example settings) that
doesn't have a dc in the URL.

A problem arises here if the last DC you tried to visit is unreachable.

The first fix here clears out the last visited DC from localStorage if
the API has errored out.

Secondly, our `href-mut` helper which mutates the current current and
replaces 'parts' in the URL rather than the whole thing functioned by
detecting the current route/URL you are on an 'mutating' that. A problem
arose here as even though you might be on the `/ui/dc-1/services` URL the
actual route is the 'error' route which does not have a URL that can be
changed properly.

The second fix here uses route.currentRoute.name over route.currentRouteName.

The latter is equal to error when an error occurs whereas the former gives you the name of the route before the error happened, which is actually what we want/the intent here.

ie. when `router.currentRouteName === 'error'` then
`router.currentRoute.name === Name Of Route Before It Errored` it seems
2020-03-09 09:10:47 +00:00
..
policy UI: ACL Roles (#5635) 2019-05-01 18:22:37 +00:00
service UI: External Source markers (#4640) 2018-09-12 20:23:39 +01:00
token ui: Make empty Rules ('') take priority over a `Legacy: true` (#4899) 2018-11-06 18:08:10 +00:00
atob.js UI V2 (#4086) 2018-05-10 19:52:53 +01:00
css-var.js ui: Discovery Chain (#6746) 2019-12-18 12:26:47 +00:00
default.js ui: Adds a `default` view helper for providing a default value (#4650) 2018-09-12 20:38:57 +01:00
difference.js UI: New ACLs (#4789) 2018-10-19 08:45:05 -07:00
dom-position.js ui: Discovery Chain (#6746) 2019-12-18 12:26:47 +00:00
env.js ui: Improve configuration/env/feature flag usage (also add build time year detection) (#7072) 2020-01-21 17:52:40 +00:00
format-number.js UI: Reduce in-development deprecations (also use toLocaleString) (#4677) 2018-10-01 13:42:42 +01:00
href-mut.js ui: Enable recovery from an unreachable datacenter (500 error) (#7404) 2020-03-09 09:10:47 +00:00
href-to.js ui: Namespace Support (#6639) 2019-12-18 12:26:47 +00:00
is-href.js ui: Namespace Support (#6639) 2019-12-18 12:26:47 +00:00
last.js ui: Some trivial test additions, support env var passing of port numbers (#4728) 2018-10-26 17:50:43 +01:00
left-trim.js Adds filtering to the KV listing page 2018-06-12 11:24:35 +01:00
object-entries.js ui: Adds readonly meta data to the serviceInstance and node detail pages (#6196) 2019-08-02 13:53:52 +02:00
right-trim.js Adds filtering to the KV listing page 2018-06-12 11:24:35 +01:00
route-match.js ui: Discovery Chain (#6746) 2019-12-18 12:26:47 +00:00
slugify.js UI V2 (#4086) 2018-05-10 19:52:53 +01:00
split.js ui: Some trivial test additions, support env var passing of port numbers (#4728) 2018-10-26 17:50:43 +01:00
starts-with.js ui: Adds a `sort-control` component for asc/desc sorting of columns etc (#6034) 2019-09-04 08:35:16 +00:00
svg-curve.js ui: Discovery Chain (#6746) 2019-12-18 12:26:47 +00:00
tween-to.js ui: Discovery Chain (#6746) 2019-12-18 12:26:47 +00:00