-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ui: Improved main navigation #7673
Conversation
5b72dd3
to
a8a30bd
Compare
a8a30bd
to
5b72dd3
Compare
5b72dd3
to
8c32ba9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
token: service('repository/token'), | ||
type: service('data-source/protocols/http/blocking'), | ||
source: function(src, configuration) { | ||
const [, dc /*nspace*/, , model, ...rest] = src.split('/'); | ||
const [, , /*nspace*/ dc, model, ...rest] = src.split('/'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you leave an extra comma here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh no hehehe, I just tried to fix this about 4 times before I realised prettier is 'unfixing' it for me whenever I commit! 🤣
I've got a PR coming soon that uncomments this nspace
so the problem will go away when I PR that.
bd11bc1
to
566e833
Compare
* Make datacenter queries use query vs findAll like the rest of the app * Make sure we have an element to pass to isInViewport * Make sure href-mut doesn't error even if the currentRoute === null * More post test cleanup and Safari fix (safari requires http:// URLs) * Reverse order of datasource nspace/dc's and add a namespace source * Rearrange routes/templates/controllers to only use HashicorpConsul once * Add datasources and correct token namespace detection/redirection * Remove old dc findAll adapter method * Add more comments around the 'child route/parent controller' vars
* Make datacenter queries use query vs findAll like the rest of the app * Make sure we have an element to pass to isInViewport * Make sure href-mut doesn't error even if the currentRoute === null * More post test cleanup and Safari fix (safari requires http:// URLs) * Reverse order of datasource nspace/dc's and add a namespace source * Rearrange routes/templates/controllers to only use HashicorpConsul once * Add datasources and correct token namespace detection/redirection * Remove old dc findAll adapter method * Add more comments around the 'child route/parent controller' vars
* Make datacenter queries use query vs findAll like the rest of the app * Make sure we have an element to pass to isInViewport * Make sure href-mut doesn't error even if the currentRoute === null * More post test cleanup and Safari fix (safari requires http:// URLs) * Reverse order of datasource nspace/dc's and add a namespace source * Rearrange routes/templates/controllers to only use HashicorpConsul once * Add datasources and correct token namespace detection/redirection * Remove old dc findAll adapter method * Add more comments around the 'child route/parent controller' vars
This PR reduces the individual places where we use our 'app chrome' component (
<HashicorpConsul />
).Previously it individually wrapped the loading state, the app itself, the app error state and then individually the settings page. This was all due to not knowing important data required for the main navigation such as the current DC and current namespace until the user had entered the DC route.
We now get around this restriction by passing data up from the child DC route to the parent application controller (thanks @meirish for the suggestion!)
As a consequence of this we have moved the loading of Datacenters and Namespace up to the application route, which is almost never reloaded/refreshed. We therefore use our new
<Datasource />
component to only reload datacenters and namespaces when the menus themselves are opened.<Datasource />
s work just like<img />
tags, so you can set theirloading=""
to beloading="eager"
orloading="lazy"
for lazy loading, just like<img />
tags.We also move our Datacenter adapter to use
query
like the rest of the adapters in the UI instead of findAll.There are a few other related changes here, such as trying to ensure that
href-mut
will always generated a URL even if therouter
service returns acurrentRoute === null
, and a more sane way of checking whether a user needs redirecting from anspace.index
route (big thanks to @randallmorey for the transition vs currentURL work here)There's probably more work to come here in reducing the error and loading states in the application route to other individual components.