From 921909aafd3df3b353572b2aa99becfa7ae68a5e Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Wed, 19 Aug 2020 15:49:51 -0400 Subject: [PATCH] chore: Add named outlets for host catalog template Host set updates host catalog template layout sections, thus named outlets need to be introduced to host catalog template. --- .../project/host-catalogs/host-catalog.js | 21 +++++++++++ .../host-catalog/host-sets/host-set.js | 24 +++++++++++++ .../project/host-catalogs/host-catalog.hbs | 15 ++++---- .../host-catalogs/host-catalog/-header.hbs | 1 + .../host-catalog/-navigation.hbs | 8 +++++ .../host-catalog/host-sets/-header.hbs | 1 + .../host-catalog/host-sets/-navigation.hbs | 5 +++ .../host-catalog/host-sets/host-set/index.hbs | 36 +++++++------------ .../components/form/host-set-test.js | 1 - 9 files changed, 79 insertions(+), 33 deletions(-) create mode 100644 ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/-header.hbs create mode 100644 ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/-navigation.hbs create mode 100644 ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/-header.hbs create mode 100644 ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/-navigation.hbs diff --git a/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog.js b/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog.js index d25608633..00d0b148d 100644 --- a/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog.js +++ b/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog.js @@ -17,4 +17,25 @@ export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogRoute exte }); } + /** + * Renders the host-catalog specific templates for header and navigation page sections. + * @override + * @param {object} controller + * @param {object} model + */ + renderTemplate(controller, model) { + this.render('scopes/scope/projects/project/host-catalogs/host-catalog'); + + this.render('scopes/scope/projects/project/host-catalogs/host-catalog/-header', { + into: 'scopes/scope/projects/project/host-catalogs/host-catalog', + outlet: 'header', + model: model + }); + + this.render('scopes/scope/projects/project/host-catalogs/host-catalog/-navigation', { + into: 'scopes/scope/projects/project/host-catalogs/host-catalog', + outlet: 'navigation', + model: model + }); + } } diff --git a/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/host-set.js b/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/host-set.js index 75f1f1fed..4025a17bd 100644 --- a/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/host-set.js +++ b/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/host-set.js @@ -16,4 +16,28 @@ export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostSetsHo adapterOptions: { scopeID, hostCatalogID } }); } + + /** + * Renders the host-set specific templates for header and navigation page sections. + * @override + * @param {object} controller + * @param {object} model + */ + renderTemplate(controller, model) { + this.render('scopes/scope/projects/project/host-catalogs/host-catalog/host-sets'); + + this.render('scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/-header', { + into: 'scopes/scope/projects/project/host-catalogs/host-catalog', + outlet: 'header', + model: model + }); + + this.render('scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/-navigation', { + into: 'scopes/scope/projects/project/host-catalogs/host-catalog', + outlet: 'navigation', + model: model + }); + + super.renderTemplate(...arguments); + } } diff --git a/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog.hbs b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog.hbs index 529b61a34..e9bdb8c81 100644 --- a/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog.hbs +++ b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog.hbs @@ -5,18 +5,15 @@ -

{{t "resources.host-catalog"}}

+ {{outlet "header"}}
+ + {{outlet "actions"}} + + - - - {{t 'titles.details'}} - - - {{t 'titles.host-sets'}} - - + {{outlet "navigation"}} diff --git a/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/-header.hbs b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/-header.hbs new file mode 100644 index 000000000..82af78ffe --- /dev/null +++ b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/-header.hbs @@ -0,0 +1 @@ +

{{t "resources.host-catalog"}}

diff --git a/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/-navigation.hbs b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/-navigation.hbs new file mode 100644 index 000000000..030326509 --- /dev/null +++ b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/-navigation.hbs @@ -0,0 +1,8 @@ + + + {{t 'titles.details'}} + + + {{t 'titles.host-sets'}} + + diff --git a/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/-header.hbs b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/-header.hbs new file mode 100644 index 000000000..ae86a8707 --- /dev/null +++ b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/-header.hbs @@ -0,0 +1 @@ +

{{t "resources.host-set"}}

\ No newline at end of file diff --git a/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/-navigation.hbs b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/-navigation.hbs new file mode 100644 index 000000000..62f603a0b --- /dev/null +++ b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/-navigation.hbs @@ -0,0 +1,5 @@ + + + {{t 'titles.details'}} + + \ No newline at end of file diff --git a/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/host-set/index.hbs b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/host-set/index.hbs index 64646aa20..4ea8678d7 100644 --- a/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/host-set/index.hbs +++ b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/host-set/index.hbs @@ -1,23 +1,13 @@ - - - -

{{t "resources.host-set"}}

-
- - - - - - {{t 'actions.delete'}} - - - -
+ + + + {{t 'actions.delete'}} + diff --git a/ui/core/tests/integration/components/form/host-set-test.js b/ui/core/tests/integration/components/form/host-set-test.js index 17fb6f818..9797376cc 100644 --- a/ui/core/tests/integration/components/form/host-set-test.js +++ b/ui/core/tests/integration/components/form/host-set-test.js @@ -20,5 +20,4 @@ module('Integration | Component | form/host-set', function(hooks) { assert.ok(find('form')); }); - }); });