From fc75b1df9e6d3685dd3b81fd1d6c9cd8a24b2957 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Thu, 20 Aug 2020 15:38:49 -0400 Subject: [PATCH] chore: Add host(s) breadcrumbs --- .../host-catalogs/host-catalog/hosts.js | 20 +++++++++++++++++++ .../host-catalogs/host-catalog/hosts/host.js | 15 ++++++++++++++ .../host-catalogs/host-catalog/hosts/new.js | 20 +++++++++++++++++++ .../host-catalog/host-sets/host-set.js | 2 +- .../host-catalogs/host-catalog/hosts/host.js | 2 +- .../host-catalogs/host-catalog/hosts-test.js | 12 +++++++++++ .../host-catalog/hosts/host-test.js | 12 +++++++++++ .../host-catalog/hosts/new-test.js | 12 +++++++++++ 8 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 ui/core/app/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts.js create mode 100644 ui/core/app/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/host.js create mode 100644 ui/core/app/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/new.js create mode 100644 ui/core/tests/unit/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts-test.js create mode 100644 ui/core/tests/unit/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/host-test.js create mode 100644 ui/core/tests/unit/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/new-test.js diff --git a/ui/core/app/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts.js b/ui/core/app/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts.js new file mode 100644 index 000000000..0ce0c8ba4 --- /dev/null +++ b/ui/core/app/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts.js @@ -0,0 +1,20 @@ +import Controller from '@ember/controller'; +import { inject as service } from '@ember/service'; + +export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostsController extends Controller { + + // =services + + @service intl; + + // =attributes + + /** + * Hosts breadcrumb + * @type {string} + */ + get breadCrumb() { + return this.intl.t('resources.hosts'); + } + +} diff --git a/ui/core/app/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/host.js b/ui/core/app/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/host.js new file mode 100644 index 000000000..7b1b2883b --- /dev/null +++ b/ui/core/app/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/host.js @@ -0,0 +1,15 @@ +import Controller from '@ember/controller'; + +export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostsHostController extends Controller { + + // =attributes + + /** + * Host breadcrumb + * @type {string} + */ + get breadCrumb() { + return this.model.displayName; + } + +} diff --git a/ui/core/app/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/new.js b/ui/core/app/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/new.js new file mode 100644 index 000000000..cc56bcf08 --- /dev/null +++ b/ui/core/app/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/new.js @@ -0,0 +1,20 @@ +import Controller from '@ember/controller'; +import { inject as service } from '@ember/service'; + +export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostsNewController extends Controller { + + // =services + + @service intl; + + // =attributes + + /** + * Translated new host breadcrumb + * @type {string} + */ + get breadCrumb() { + return this.intl.t('titles.new'); + } + +} 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 66c552c4d..6d2b4abd1 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 @@ -24,7 +24,7 @@ export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostSetsHo * @param {object} model */ renderTemplate(controller, model) { - this.render('scopes/scope/projects/project/host-catalogs/host-catalog/host-sets'); + super.renderTemplate(...arguments); this.render('scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/-header', { into: 'scopes/scope/projects/project/host-catalogs/host-catalog', diff --git a/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/host.js b/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/host.js index 671ca781b..907454d36 100644 --- a/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/host.js +++ b/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/host.js @@ -24,7 +24,7 @@ export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostsHostR * @param {object} model */ renderTemplate(controller, model) { - this.render('scopes/scope/projects/project/host-catalogs/host-catalog/hosts'); + super.renderTemplate(...arguments); this.render('scopes/scope/projects/project/host-catalogs/host-catalog/hosts/-header', { into: 'scopes/scope/projects/project/host-catalogs/host-catalog', diff --git a/ui/core/tests/unit/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts-test.js b/ui/core/tests/unit/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts-test.js new file mode 100644 index 000000000..0abab9e08 --- /dev/null +++ b/ui/core/tests/unit/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts-test.js @@ -0,0 +1,12 @@ +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; + +module('Unit | Controller | scopes/scope/projects/project/host-catalogs/host-catalog/hosts', function(hooks) { + setupTest(hooks); + + // Replace this with your real tests. + test('it exists', function(assert) { + let controller = this.owner.lookup('controller:scopes/scope/projects/project/host-catalogs/host-catalog/hosts'); + assert.ok(controller); + }); +}); diff --git a/ui/core/tests/unit/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/host-test.js b/ui/core/tests/unit/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/host-test.js new file mode 100644 index 000000000..caa2b88fd --- /dev/null +++ b/ui/core/tests/unit/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/host-test.js @@ -0,0 +1,12 @@ +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; + +module('Unit | Controller | scopes/scope/projects/project/host-catalogs/host-catalog/hosts/host', function(hooks) { + setupTest(hooks); + + // Replace this with your real tests. + test('it exists', function(assert) { + let controller = this.owner.lookup('controller:scopes/scope/projects/project/host-catalogs/host-catalog/hosts/host'); + assert.ok(controller); + }); +}); diff --git a/ui/core/tests/unit/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/new-test.js b/ui/core/tests/unit/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/new-test.js new file mode 100644 index 000000000..0fc59faf5 --- /dev/null +++ b/ui/core/tests/unit/controllers/scopes/scope/projects/project/host-catalogs/host-catalog/hosts/new-test.js @@ -0,0 +1,12 @@ +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; + +module('Unit | Controller | scopes/scope/projects/project/host-catalogs/host-catalog/hosts/new', function(hooks) { + setupTest(hooks); + + // Replace this with your real tests. + test('it exists', function(assert) { + let controller = this.owner.lookup('controller:scopes/scope/projects/project/host-catalogs/host-catalog/hosts/new'); + assert.ok(controller); + }); +});