Skip to content

Commit

Permalink
UI: Fix missing nav links on namespace login (hashicorp#12478)
Browse files Browse the repository at this point in the history
* Override loading behavior which breaks query params passed to API calls

* Only show loading state if transition is not queryparams only

* Add changelog

* Skip loader if testing
  • Loading branch information
hashishaw authored and jartek committed Sep 11, 2021
1 parent fffa523 commit d3b4824
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 12 deletions.
3 changes: 3 additions & 0 deletions changelog/12478.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:fix
ui: fix missing navbar items on login to namespace
```
12 changes: 12 additions & 0 deletions ui/app/routes/vault/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,17 @@ export default Route.extend(ModelBoundaryRoute, ClusterRoute, {
}
return true;
},
loading(transition) {
if (transition.queryParamsOnly || Ember.testing) {
return;
}
// eslint-disable-next-line ember/no-controller-access-in-routes
let controller = this.controllerFor('vault.cluster');
controller.set('currentlyLoading', true);

transition.finally(function() {
controller.set('currentlyLoading', false);
});
},
},
});
28 changes: 16 additions & 12 deletions ui/app/templates/vault/cluster.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,20 @@
{{/flash-message}}
{{/each}}
</div>
{{#if showNav}}
<UiWizard>
<section class="section">
<div class="container is-widescreen">
<TokenExpireWarning @expirationDate={{auth.tokenExpirationDate}}>
{{outlet}}
</TokenExpireWarning>
</div>
</section>
</UiWizard>
{{#if currentlyLoading}}
<LogoSplash />
{{else}}
{{outlet}}
{{/if}}
{{#if showNav}}
<UiWizard>
<section class="section">
<div class="container is-widescreen">
<TokenExpireWarning @expirationDate={{auth.tokenExpirationDate}}>
{{outlet}}
</TokenExpireWarning>
</div>
</section>
</UiWizard>
{{else}}
{{outlet}}
{{/if}}
{{/if}}

0 comments on commit d3b4824

Please sign in to comment.