From d28dc9708bf6ef050c816ed1e2e25435b50a9cff Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 6 Oct 2020 13:38:26 -0400 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20after=20navigating=20to?= =?UTF-8?q?=20a=20project,=20IAM=20should=20not=20appear?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/core/app/routes/scopes/scope.js | 16 +++++++++++ .../routes/scopes/scope/projects/project.js | 2 +- ui/core/app/templates/scopes/scope.hbs | 27 ------------------- .../app/templates/scopes/scope/-sidebar.hbs | 26 ++++++++++++++++++ .../project/{_sidebar.hbs => -sidebar.hbs} | 0 5 files changed, 43 insertions(+), 28 deletions(-) create mode 100644 ui/core/app/templates/scopes/scope/-sidebar.hbs rename ui/core/app/templates/scopes/scope/projects/project/{_sidebar.hbs => -sidebar.hbs} (100%) diff --git a/ui/core/app/routes/scopes/scope.js b/ui/core/app/routes/scopes/scope.js index ef8aa1273..58c145667 100644 --- a/ui/core/app/routes/scopes/scope.js +++ b/ui/core/app/routes/scopes/scope.js @@ -43,4 +43,20 @@ export default class ScopesScopeRoute extends Route { const scope = this.modelFor('scopes.scope'); this.controllerFor('application').set('scope', scope); } + + /** + * Renders the scope-specific sidebar template. + * @override + * @param {object} controller + * @param {object} model + */ + renderTemplate(controller, model) { + super.renderTemplate(...arguments); + + this.render('scopes/scope/-sidebar', { + into: 'scopes/scope', + outlet: 'sidebar', + model: model, + }); + } } diff --git a/ui/core/app/routes/scopes/scope/projects/project.js b/ui/core/app/routes/scopes/scope/projects/project.js index bf92852d2..0f3e7dbdb 100644 --- a/ui/core/app/routes/scopes/scope/projects/project.js +++ b/ui/core/app/routes/scopes/scope/projects/project.js @@ -22,7 +22,7 @@ export default class ScopesScopeProjectsProjectRoute extends Route { renderTemplate(controller, model) { super.renderTemplate(...arguments); - this.render('scopes/scope/projects/project/_sidebar', { + this.render('scopes/scope/projects/project/-sidebar', { into: 'scopes/scope', outlet: 'sidebar', model: model, diff --git a/ui/core/app/templates/scopes/scope.hbs b/ui/core/app/templates/scopes/scope.hbs index 718ce849e..2d7d21026 100644 --- a/ui/core/app/templates/scopes/scope.hbs +++ b/ui/core/app/templates/scopes/scope.hbs @@ -12,33 +12,6 @@ - - - - {{t "resources.user.title_plural"}} - - - - {{t "resources.group.title_plural"}} - - - - {{t "resources.role.title_plural"}} - - - - {{t "resources.auth-method.title_plural"}} - - - {{outlet "sidebar"}} diff --git a/ui/core/app/templates/scopes/scope/-sidebar.hbs b/ui/core/app/templates/scopes/scope/-sidebar.hbs new file mode 100644 index 000000000..27852d3ec --- /dev/null +++ b/ui/core/app/templates/scopes/scope/-sidebar.hbs @@ -0,0 +1,26 @@ + + + + {{t "resources.user.title_plural"}} + + + + {{t "resources.group.title_plural"}} + + + + {{t "resources.role.title_plural"}} + + + + {{t "resources.auth-method.title_plural"}} + + diff --git a/ui/core/app/templates/scopes/scope/projects/project/_sidebar.hbs b/ui/core/app/templates/scopes/scope/projects/project/-sidebar.hbs similarity index 100% rename from ui/core/app/templates/scopes/scope/projects/project/_sidebar.hbs rename to ui/core/app/templates/scopes/scope/projects/project/-sidebar.hbs