consul/ui-v2/app/services/repository
John Cowen 5f625666b4
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
..
nspace ui: Improve configuration/env/feature flag usage (also add build time year detection) (#7072) 2020-01-21 17:52:40 +00:00
type ui: Namespace Support (#6639) 2019-12-18 12:26:47 +00:00
acl.js ui: UI Release Merge (ui-staging merge) (#6527) 2019-09-30 14:47:49 +01:00
coordinate.js ui: Coordinates don't require a nspace, so don't expect one in the repo (#7378) 2020-03-04 18:12:47 +00:00
dc.js ui: Enable recovery from an unreachable datacenter (500 error) (#7404) 2020-03-09 09:10:47 +00:00
discovery-chain.js ui: Discovery Chain (#6746) 2019-12-18 12:26:47 +00:00
intention.js ui: Move repo services to repository/ folder and standardize naming (#4694) 2018-10-26 17:36:15 +01:00
kv.js ui: Namespace Support (#6639) 2019-12-18 12:26:47 +00:00
node.js ui: UI Release Merge (ui-staging merge) (#6527) 2019-09-30 14:47:49 +01:00
nspace.js ui: Namespace Support (#6639) 2019-12-18 12:26:47 +00:00
policy.js ui: UI Release Merge (ui-staging merge) (#6527) 2019-09-30 14:47:49 +01:00
proxy.js ui: Namespace Support (#6639) 2019-12-18 12:26:47 +00:00
role.js UI: ACL Roles (#5635) 2019-05-01 18:22:37 +00:00
service.js ui: Namespace Support (#6639) 2019-12-18 12:26:47 +00:00
session.js ui: Namespace Support (#6639) 2019-12-18 12:26:47 +00:00
token.js ui: Namespace Support (#6639) 2019-12-18 12:26:47 +00:00