Merge pull request #432 from hashicorp/fix-scopes-nav

fix: 🐛 fixes issue where scope nav is empty after login
This commit is contained in:
Randall Morey authored and GitHub committed 2021-01-29 14:53:13 -05:00
commit 39932708b0
2 files changed
+17 -4

No files matched your search

+14 -3
View File
@@ -67,16 +67,27 @@ export default class ScopesScopeRoute extends Route {
this.scope.org = selectedOrg;
this.scope.project = selectedProject;
this.scopes = { orgs, projects, selectedOrg, selectedProject };
// Update the controller (if exists), since setupController is only
// called once the first time the route is activated. It is not called
// again on route refreshes.
if (this.controller) this.setControllerProperties(this.scopes);
}
/**
* Adds the scopes hash to the controller context (see `afterModel`).
* @param {Controller} controller
*/
setupController(controller) {
setupController(/* controller */) {
super.setupController(...arguments);
const scopes = this.scopes;
controller.setProperties({ scopes });
this.setControllerProperties(this.scopes);
}
/**
* Updates the controller's `scopes`.
* @param {array} scopes
*/
setControllerProperties(scopes) {
this.controller.setProperties({ scopes });
}
/**
@@ -77,7 +77,9 @@
<message.description>
{{t 'resources.auth-method.messages.welcome.description'}}
</message.description>
<message.link @route="scopes.scope.auth-methods.new">
<message.link
@route="scopes.scope.auth-methods.new"
@query={{hash type="password"}}>
<Rose::Icon @name="plus-circle-outline" />
{{t 'titles.new'}}
</message.link>