From 44b5d7427a8a1285844c6276a4d1a3986bb9bf0b Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 8 Feb 2022 15:50:29 -0500 Subject: [PATCH 1/9] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20upgrade=20ember-?= =?UTF-8?q?radio-button=20to=20fix=20deprecations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/rose/package.json | 2 +- .../components/rose/form/radio/group-test.js | 5 ++- .../acceptance/auth-methods/oidc-test.js | 2 +- yarn.lock | 33 ++++--------------- 4 files changed, 13 insertions(+), 29 deletions(-) diff --git a/addons/rose/package.json b/addons/rose/package.json index 292c1f3ca..8cdb6d1b2 100644 --- a/addons/rose/package.json +++ b/addons/rose/package.json @@ -34,7 +34,7 @@ "ember-composable-helpers": "^4.5.0", "ember-focus-trap": "^0.7.0", "ember-named-blocks-polyfill": "^0.2.4", - "ember-radio-button": "^2.0.1", + "ember-radio-button": "github:yapplabs/ember-radio-button.git#b2ab65f", "ember-uuid": "^2.1.0", "emberx-select": "github:adopted-ember-addons/emberx-select#bc5f774" }, diff --git a/addons/rose/tests/integration/components/rose/form/radio/group-test.js b/addons/rose/tests/integration/components/rose/form/radio/group-test.js index 4354004e7..c1706fe5e 100644 --- a/addons/rose/tests/integration/components/rose/form/radio/group-test.js +++ b/addons/rose/tests/integration/components/rose/form/radio/group-test.js @@ -54,7 +54,10 @@ module('Integration | Component | rose/form/radio/group', function (hooks) { test('it reflects active radiofield value in @selectedValue and triggers a @changed function', async function (assert) { assert.expect(5); - this.changed = (value) => assert.ok(value); + this.changed = (value) => { + this.selectedValue = value; + assert.ok(value); + }; await render(hbs` Date: Tue, 8 Feb 2022 16:47:49 -0500 Subject: [PATCH 2/9] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20resolve=20legacy?= =?UTF-8?q?-attribute-arguments=20deprecations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/rose/nav/breadcrumbs/index.hbs | 2 +- .../addon/components/rose/nav/link/index.hbs | 9 ++++++++ .../rose/nav/link/index.stories.mdx | 23 +++++++++++++++++++ .../components/rose/nav/sidebar/index.hbs | 2 +- .../addon/components/rose/nav/tabs/index.hbs | 2 +- .../rose/components/nav/_breadcrumbs.scss | 2 +- addons/rose/app/components/rose/nav/link.js | 1 + .../components/rose/nav/breadcrumbs-test.js | 2 +- .../components/rose/nav/link-test.js | 18 +++++++++++++++ 9 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 addons/rose/addon/components/rose/nav/link/index.hbs create mode 100644 addons/rose/addon/components/rose/nav/link/index.stories.mdx create mode 100644 addons/rose/app/components/rose/nav/link.js create mode 100644 addons/rose/tests/integration/components/rose/nav/link-test.js diff --git a/addons/rose/addon/components/rose/nav/breadcrumbs/index.hbs b/addons/rose/addon/components/rose/nav/breadcrumbs/index.hbs index 287e2cba3..2e67e42df 100644 --- a/addons/rose/addon/components/rose/nav/breadcrumbs/index.hbs +++ b/addons/rose/addon/components/rose/nav/breadcrumbs/index.hbs @@ -1,5 +1,5 @@ diff --git a/addons/rose/addon/components/rose/nav/link/index.hbs b/addons/rose/addon/components/rose/nav/link/index.hbs new file mode 100644 index 000000000..37df6a85b --- /dev/null +++ b/addons/rose/addon/components/rose/nav/link/index.hbs @@ -0,0 +1,9 @@ +{{#if @model}} + + {{yield}} + +{{else}} + + {{yield}} + +{{/if}} diff --git a/addons/rose/addon/components/rose/nav/link/index.stories.mdx b/addons/rose/addon/components/rose/nav/link/index.stories.mdx new file mode 100644 index 000000000..381997582 --- /dev/null +++ b/addons/rose/addon/components/rose/nav/link/index.stories.mdx @@ -0,0 +1,23 @@ +import { Meta, Story, Preview } from '@storybook/addon-docs/blocks'; +import { hbs } from 'ember-cli-htmlbars'; +import { action } from '@storybook/addon-actions'; +import { text, boolean, select } from '@storybook/addon-knobs'; + + + +# Generic Navigation Link + +Proxies the built-in `LinkTo` component, applying a class `rose-nav-link`. + +```html +Text +``` + + + {{ + template: hbs` + Text + `, + context: {}, + }} + diff --git a/addons/rose/addon/components/rose/nav/sidebar/index.hbs b/addons/rose/addon/components/rose/nav/sidebar/index.hbs index 28250c8d6..8d5dd5f9b 100644 --- a/addons/rose/addon/components/rose/nav/sidebar/index.hbs +++ b/addons/rose/addon/components/rose/nav/sidebar/index.hbs @@ -12,7 +12,7 @@ {{/if}} {{yield (hash - link=(component "link-to" class="rose-nav-link") + link=(component "rose/nav/link") )}} diff --git a/addons/rose/addon/components/rose/nav/tabs/index.hbs b/addons/rose/addon/components/rose/nav/tabs/index.hbs index 18470f7d5..bef7428e2 100644 --- a/addons/rose/addon/components/rose/nav/tabs/index.hbs +++ b/addons/rose/addon/components/rose/nav/tabs/index.hbs @@ -3,7 +3,7 @@ class="rose-nav-tabs"> {{yield (hash - link=(component "link-to" class="rose-nav-link") + link=(component "rose/nav/link") )}} diff --git a/addons/rose/addon/styles/rose/components/nav/_breadcrumbs.scss b/addons/rose/addon/styles/rose/components/nav/_breadcrumbs.scss index e7ac5572e..f87fb9ae7 100644 --- a/addons/rose/addon/styles/rose/components/nav/_breadcrumbs.scss +++ b/addons/rose/addon/styles/rose/components/nav/_breadcrumbs.scss @@ -6,7 +6,7 @@ display: flex; flex-wrap: wrap; - .rose-nav-breadcrumbs-link { + .rose-nav-link { --color: var(--ui-gray); color: var(--color); text-decoration: none; diff --git a/addons/rose/app/components/rose/nav/link.js b/addons/rose/app/components/rose/nav/link.js new file mode 100644 index 000000000..b4f6d844f --- /dev/null +++ b/addons/rose/app/components/rose/nav/link.js @@ -0,0 +1 @@ +export { default } from 'rose/components/rose/nav/link'; diff --git a/addons/rose/tests/integration/components/rose/nav/breadcrumbs-test.js b/addons/rose/tests/integration/components/rose/nav/breadcrumbs-test.js index 1d8204eb4..bd935bae3 100644 --- a/addons/rose/tests/integration/components/rose/nav/breadcrumbs-test.js +++ b/addons/rose/tests/integration/components/rose/nav/breadcrumbs-test.js @@ -21,6 +21,6 @@ module('Integration | Component | rose/nav/breadcrumbs', function (hooks) { `); - assert.equal(findAll('.rose-nav-breadcrumbs-link').length, 2); + assert.equal(findAll('.rose-nav-link').length, 2); }); }); diff --git a/addons/rose/tests/integration/components/rose/nav/link-test.js b/addons/rose/tests/integration/components/rose/nav/link-test.js new file mode 100644 index 000000000..2887900bc --- /dev/null +++ b/addons/rose/tests/integration/components/rose/nav/link-test.js @@ -0,0 +1,18 @@ +import { module, test } from 'qunit'; +import { setupRenderingTest } from 'ember-qunit'; +import { render, find } from '@ember/test-helpers'; +import hbs from 'htmlbars-inline-precompile'; + +module('Integration | Component | rose/nav/link', function (hooks) { + setupRenderingTest(hooks); + + test('it renders', async function (assert) { + assert.expect(1); + await render(hbs` + + Item Name + + `); + assert.equal(find('.rose-nav-link').textContent.trim(), 'Item Name'); + }); +}); From 932e2e7b505fcd41d05adf820c067916203e9f9c Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 8 Feb 2022 16:56:21 -0500 Subject: [PATCH 3/9] docs: fix nav link titles --- addons/rose/addon/components/rose/nav/link/index.stories.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/rose/addon/components/rose/nav/link/index.stories.mdx b/addons/rose/addon/components/rose/nav/link/index.stories.mdx index 381997582..198f434f4 100644 --- a/addons/rose/addon/components/rose/nav/link/index.stories.mdx +++ b/addons/rose/addon/components/rose/nav/link/index.stories.mdx @@ -3,7 +3,7 @@ import { hbs } from 'ember-cli-htmlbars'; import { action } from '@storybook/addon-actions'; import { text, boolean, select } from '@storybook/addon-knobs'; - + # Generic Navigation Link @@ -14,7 +14,7 @@ Proxies the built-in `LinkTo` component, applying a class `rose-nav-link`. ``` - {{ + {{ template: hbs` Text `, From f0065ddc13f33d6e0e08bd665ce24d7018d687fb Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 9 Feb 2022 11:06:26 -0500 Subject: [PATCH 4/9] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20pull=20breadcrum?= =?UTF-8?q?bs=20fully=20local=20and=20remove=20dep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/app/components/bread-crumbs.js | 113 +++++++++++++++++++++++- ui/admin/package.json | 1 - yarn.lock | 7 -- 3 files changed, 111 insertions(+), 10 deletions(-) diff --git a/ui/admin/app/components/bread-crumbs.js b/ui/admin/app/components/bread-crumbs.js index 93f5a78a7..1f2ac7cea 100644 --- a/ui/admin/app/components/bread-crumbs.js +++ b/ui/admin/app/components/bread-crumbs.js @@ -1,9 +1,118 @@ -import BreadCrumbsComponent from 'ember-breadcrumbs/components/bread-crumbs'; +import Component from '@glimmer/component'; +import EmberObject, { computed, get } from '@ember/object'; import { inject as service } from '@ember/service'; +import { isBlank, isPresent } from '@ember/utils'; +import { A } from '@ember/array'; -export default class crumbs extends BreadCrumbsComponent { +// This component copies and modifies source from ember-breadcrumbs 0.2.3, +// updating it for Ember v4 compatibility. + +// The original copyright is below. + +/* +The MIT License (MIT) + +Copyright (c) 2014-2019 Chris Farber + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +export default class BreadcrumbsComponent extends Component { // =services @service session; @service scope; + @service router; + + // =properties + + /* eslint-disable-next-line ember/require-computed-property-dependencies */ + @computed('router.currentRouteName') + get routeInfos() { + /* eslint-disable-next-line ember/no-private-routing-service */ + return this.router._router._routerMicrolib.currentRouteInfos; + } + + /* + For the pathNames and controllers properties, we must be careful not to NOT + specify the properties of the route in our dependent keys. + + Observing the controller property of the route causes some serious problems: + https://github.com/chrisfarber/ember-breadcrumbs/issues/21 + */ + + @computed('routeInfos.[]') + get pathNames() { + return this.routeInfos.map(function (routeInfo) { + return routeInfo.name; + }); + } + + @computed('routeInfos.[]') + get controllers() { + return this.routeInfos.map(function (routeInfo) { + var route = routeInfo.route || routeInfo.handler; + return route.controller; + }); + } + + @computed( + 'controllers.@each.{breadCrumbs,breadCrumb,breadCrumbPath,breadCrumbModel}', + 'pathNames.[]' + ) + get breadCrumbs() { + var controllers = this.controllers; + var defaultPaths = this.pathNames; + var breadCrumbs = A([]); + + controllers.forEach(function (controller, index) { + var crumbs = controller.breadCrumbs || A([]); + var singleCrumb = controller.breadCrumb; + + if (!isBlank(singleCrumb)) { + crumbs.push({ + label: singleCrumb, + path: controller.breadCrumbPath, + model: controller.breadCrumbModel, + }); + } + + crumbs.forEach(function (crumb) { + breadCrumbs.addObject( + EmberObject.create({ + label: crumb.label, + path: crumb.path || defaultPaths[index], + model: crumb.model, + linkable: isPresent(crumb.linkable) + ? crumb.linkable + : crumb.path !== false, + isCurrent: false, + }) + ); + }); + }); + + var deepestCrumb = get(breadCrumbs, 'lastObject'); + if (deepestCrumb) { + deepestCrumb.isCurrent = true; + } + + return breadCrumbs; + } } diff --git a/ui/admin/package.json b/ui/admin/package.json index 6d2ac1828..cacece22b 100644 --- a/ui/admin/package.json +++ b/ui/admin/package.json @@ -49,7 +49,6 @@ "doctoc": "^2.0.1", "ember-a11y-testing": "^4.2.0", "ember-auto-import": "^1.12.0", - "ember-breadcrumbs": "^0.2.3", "ember-cli": "~4.1.0", "ember-cli-app-version": "^5.0.0", "ember-cli-babel": "^7.26.8", diff --git a/yarn.lock b/yarn.lock index 7008409e9..227b0b49f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10536,13 +10536,6 @@ ember-autofocus-modifier@^2.0.0: ember-cli-babel "^7.26.4" ember-modifier "^2.1.1" -ember-breadcrumbs@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/ember-breadcrumbs/-/ember-breadcrumbs-0.2.3.tgz#a95e02b73fdc2150f3d552e84a479d6dc96a8b31" - integrity sha512-QUiPXwAlTeiXykF5RnyilEgcj9NSFGciAawktImv6V6Lq9sNfmJHZAYZXAg8U/wA1tw7CG0fQl991K+jtuBTKQ== - dependencies: - ember-cli-babel "^7.10.0" - ember-browser-services@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ember-browser-services/-/ember-browser-services-2.0.0.tgz#37481eccd3828e80b0ef3b97edd8ab0325cb6dc5" From 4994b8256bc91ece8d8123b64bafcadb8781b29f Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 16 Feb 2022 15:05:35 -0500 Subject: [PATCH 5/9] =?UTF-8?q?chore:=20=F0=9F=A4=96=20add=20read-only=20h?= =?UTF-8?q?ost=20route=20for=20dynamic=20hosts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../host-sets/host-set/hosts/host.js | 3 + ui/admin/app/router.js | 4 +- .../host-sets/host-set/hosts/host.js | 3 + .../host-sets/host-set/hosts/host/index.js | 3 + .../host-sets/host-set/hosts/index.js | 3 + .../host-catalog/host-sets/host-set/hosts.hbs | 82 +---------------- .../host-sets/host-set/hosts/host.hbs | 3 + .../host-sets/host-set/hosts/host/index.hbs | 9 ++ .../host-sets/host-set/hosts/index.hbs | 91 +++++++++++++++++++ .../host-sets/host-set/hosts/host-test.js | 17 ++++ .../host-sets/host-set/hosts/host-test.js | 16 ++++ .../host-set/hosts/host/index-test.js | 16 ++++ .../host-sets/host-set/hosts/index-test.js | 16 ++++ 13 files changed, 184 insertions(+), 82 deletions(-) create mode 100644 ui/admin/app/controllers/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host.js create mode 100644 ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host.js create mode 100644 ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host/index.js create mode 100644 ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/index.js create mode 100644 ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host.hbs create mode 100644 ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host/index.hbs create mode 100644 ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/index.hbs create mode 100644 ui/admin/tests/unit/controllers/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host-test.js create mode 100644 ui/admin/tests/unit/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host-test.js create mode 100644 ui/admin/tests/unit/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host/index-test.js create mode 100644 ui/admin/tests/unit/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/index-test.js diff --git a/ui/admin/app/controllers/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host.js b/ui/admin/app/controllers/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host.js new file mode 100644 index 000000000..6ef77b91f --- /dev/null +++ b/ui/admin/app/controllers/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host.js @@ -0,0 +1,3 @@ +import Controller from '@ember/controller'; + +export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetHostsHostController extends Controller {} diff --git a/ui/admin/app/router.js b/ui/admin/app/router.js index ef557fbc8..75ce77c2c 100644 --- a/ui/admin/app/router.js +++ b/ui/admin/app/router.js @@ -91,7 +91,9 @@ Router.map(function () { this.route('host-sets', function () { this.route('new'); this.route('host-set', { path: ':host_set_id' }, function () { - this.route('hosts'); + this.route('hosts', function () { + this.route('host', { path: ':host_id' }, function () {}); + }); this.route('add-hosts'); this.route('create-and-add-host'); }); diff --git a/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host.js b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host.js new file mode 100644 index 000000000..3773e93c5 --- /dev/null +++ b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host.js @@ -0,0 +1,3 @@ +import Route from '@ember/routing/route'; + +export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetHostsHostRoute extends Route {} diff --git a/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host/index.js b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host/index.js new file mode 100644 index 000000000..873e01b71 --- /dev/null +++ b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host/index.js @@ -0,0 +1,3 @@ +import Route from '@ember/routing/route'; + +export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetHostsHostIndexRoute extends Route {} diff --git a/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/index.js b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/index.js new file mode 100644 index 000000000..30f72878b --- /dev/null +++ b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/index.js @@ -0,0 +1,3 @@ +import Route from '@ember/routing/route'; + +export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetHostsIndexRoute extends Route {} diff --git a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts.hbs b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts.hbs index 21d06fcb9..c78470ec0 100644 --- a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts.hbs +++ b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts.hbs @@ -1,83 +1,3 @@ {{page-title (t 'resources.host.title_plural')}} -{{#if @model.hosts}} - - - - - {{t 'form.name.label'}} - {{t 'form.type.label'}} - {{t 'form.id.label'}} - {{#if @model.isStatic}} - {{t 'titles.actions'}} - {{/if}} - - - - {{#each @model.hosts as |host|}} - - - - {{host.displayName}} - -

{{host.description}}

-
- - - - - - {{host.id}} - - - - {{#if (can 'removeHosts hostSet' @model.hostSet)}} - - - {{t 'actions.remove'}} - - - {{/if}} - -
- {{/each}} -
-
- -{{/if}} - -{{#unless @model.hosts}} - - - - {{t 'resources.host-set.host.messages.none.description'}} - - {{!-- - - - {{t "resources.host-set.actions.create-and-add-host"}} - - --}} - - -{{/unless}} \ No newline at end of file +{{outlet}} \ No newline at end of file diff --git a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host.hbs b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host.hbs new file mode 100644 index 000000000..7d32ecb0d --- /dev/null +++ b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host.hbs @@ -0,0 +1,3 @@ +{{page-title @model.displayName}} + +{{outlet}} \ No newline at end of file diff --git a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host/index.hbs b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host/index.hbs new file mode 100644 index 000000000..2a0249dfa --- /dev/null +++ b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host/index.hbs @@ -0,0 +1,9 @@ + + +{{!-- + +--}} \ No newline at end of file diff --git a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/index.hbs b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/index.hbs new file mode 100644 index 000000000..3d1189b2e --- /dev/null +++ b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/index.hbs @@ -0,0 +1,91 @@ +{{#if @model.hosts}} + + + + + {{t 'form.name.label'}} + {{t 'form.type.label'}} + {{t 'form.id.label'}} + {{#if @model.isStatic}} + {{t 'titles.actions'}} + {{/if}} + + + + {{#each @model.hosts as |host|}} + + + {{#if host.isStatic}} + + {{host.displayName}} + + {{else}} + {{! Link to a different subroute for dynamic/plugin hosts }} + + {{host.displayName}} + + {{/if}} +

{{host.description}}

+
+ + + + + + {{host.id}} + + + + {{#if (can 'removeHosts hostSet' @model.hostSet)}} + + + {{t 'actions.remove'}} + + + {{/if}} + +
+ {{/each}} +
+
+ +{{/if}} + +{{#unless @model.hosts}} + + + + {{t 'resources.host-set.host.messages.none.description'}} + + {{!-- + + + {{t "resources.host-set.actions.create-and-add-host"}} + + --}} + + +{{/unless}} \ No newline at end of file diff --git a/ui/admin/tests/unit/controllers/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host-test.js b/ui/admin/tests/unit/controllers/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host-test.js new file mode 100644 index 000000000..7779bde77 --- /dev/null +++ b/ui/admin/tests/unit/controllers/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host-test.js @@ -0,0 +1,17 @@ +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; + +module( + 'Unit | Controller | scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host', + function (hooks) { + setupTest(hooks); + + // TODO: Replace this with your real tests. + test('it exists', function (assert) { + let controller = this.owner.lookup( + 'controller:scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host' + ); + assert.ok(controller); + }); + } +); diff --git a/ui/admin/tests/unit/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host-test.js b/ui/admin/tests/unit/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host-test.js new file mode 100644 index 000000000..6fc01e757 --- /dev/null +++ b/ui/admin/tests/unit/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host-test.js @@ -0,0 +1,16 @@ +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; + +module( + 'Unit | Route | scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host', + function (hooks) { + setupTest(hooks); + + test('it exists', function (assert) { + let route = this.owner.lookup( + 'route:scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host' + ); + assert.ok(route); + }); + } +); diff --git a/ui/admin/tests/unit/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host/index-test.js b/ui/admin/tests/unit/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host/index-test.js new file mode 100644 index 000000000..94e8acb8f --- /dev/null +++ b/ui/admin/tests/unit/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host/index-test.js @@ -0,0 +1,16 @@ +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; + +module( + 'Unit | Route | scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host/index', + function (hooks) { + setupTest(hooks); + + test('it exists', function (assert) { + let route = this.owner.lookup( + 'route:scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host/index' + ); + assert.ok(route); + }); + } +); diff --git a/ui/admin/tests/unit/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/index-test.js b/ui/admin/tests/unit/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/index-test.js new file mode 100644 index 000000000..53eabbeab --- /dev/null +++ b/ui/admin/tests/unit/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/index-test.js @@ -0,0 +1,16 @@ +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; + +module( + 'Unit | Route | scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/index', + function (hooks) { + setupTest(hooks); + + test('it exists', function (assert) { + let route = this.owner.lookup( + 'route:scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/index' + ); + assert.ok(route); + }); + } +); From e15198d944f5a7c313b1e79926394c3c81184c99 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 16 Feb 2022 15:20:27 -0500 Subject: [PATCH 6/9] chore: add missing breadcrumb --- .../host-catalog/host-sets/host-set/hosts/host.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ui/admin/app/controllers/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host.js b/ui/admin/app/controllers/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host.js index 6ef77b91f..97ce819cc 100644 --- a/ui/admin/app/controllers/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host.js +++ b/ui/admin/app/controllers/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host.js @@ -1,3 +1,13 @@ import Controller from '@ember/controller'; -export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetHostsHostController extends Controller {} +export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetHostsHostController extends Controller { + // =attributes + + /** + * A role breadcrumb + * @type {string} + */ + get breadCrumb() { + return this.model.displayName; + } +} From 85744200f7dfb85a708df1e9712b85568e283948 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Corvo Date: Wed, 23 Feb 2022 08:03:32 -0800 Subject: [PATCH 7/9] =?UTF-8?q?chore:=20=F0=9F=A4=96=20Add=20resolutions?= =?UTF-8?q?=20engine.io?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 ++- yarn.lock | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 7b6148ae1..304855ddd 100755 --- a/package.json +++ b/package.json @@ -87,7 +87,8 @@ "json-schema": "^0.4.0", "follow-redirects": "^1.14.7", "node-fetch": "^2.6.7", - "shelljs": "^0.8.5" + "shelljs": "^0.8.5", + "engine.io": "^5.2.1" }, "config": { "commitizen": { diff --git a/yarn.lock b/yarn.lock index 80a9f952f..3e4932745 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11749,10 +11749,10 @@ engine.io-parser@~4.0.0: dependencies: base64-arraybuffer "0.1.4" -engine.io@~5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-5.1.1.tgz#a1f97e51ddf10cbd4db8b5ff4b165aad3760cdd3" - integrity sha512-aMWot7H5aC8L4/T8qMYbLdvKlZOdJTH54FxfdFunTGvhMx1BHkJOntWArsVfgAZVwAO9LC2sryPWRcEeUzCe5w== +engine.io@^5.2.1, engine.io@~5.1.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-5.2.1.tgz#3f84baf13471d35a6f3284a4effcd04c2f73c8a1" + integrity sha512-hyNxjVgWp619QMfqi/+/6/LQF+ueOIWeVOza3TeyvxUGjeT9U/xPkkHW/NJNuhbStrxMujEoMadoc2EY7DDEnw== dependencies: accepts "~1.3.4" base64id "2.0.0" From 34c1adeba24b6c3c0611a8f655023552a7a1ce15 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Corvo Date: Wed, 23 Feb 2022 08:17:12 -0800 Subject: [PATCH 8/9] =?UTF-8?q?chore:=20=F0=9F=A4=96=20Add=20resolutions?= =?UTF-8?q?=20markdown=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 ++- yarn.lock | 52 ++++++++-------------------------------------------- 2 files changed, 10 insertions(+), 45 deletions(-) diff --git a/package.json b/package.json index 7b6148ae1..6b7ac60e2 100755 --- a/package.json +++ b/package.json @@ -87,7 +87,8 @@ "json-schema": "^0.4.0", "follow-redirects": "^1.14.7", "node-fetch": "^2.6.7", - "shelljs": "^0.8.5" + "shelljs": "^0.8.5", + "markdown-it": "^12.3.2" }, "config": { "commitizen": { diff --git a/yarn.lock b/yarn.lock index 80a9f952f..15bcad3be 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6467,7 +6467,7 @@ are-we-there-yet@~1.1.2: delegates "^1.0.0" readable-stream "^2.0.6" -argparse@^1.0.7, argparse@~1.0.2: +argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== @@ -11791,7 +11791,7 @@ ensure-posix-path@^1.0.0, ensure-posix-path@^1.0.1, ensure-posix-path@^1.0.2, en resolved "https://registry.yarnpkg.com/ensure-posix-path/-/ensure-posix-path-1.1.1.tgz#3c62bdb19fa4681544289edb2b382adc029179ce" integrity sha512-VWU0/zXzVbeJNXvME/5EmLuEj2TauvoaTz6aFYK1Z92JCBlDlZ3Gu0tuGR42kpW1754ywTs+QB0g5TP0oj9Zaw== -entities@^1.1.1, entities@~1.1.1: +entities@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== @@ -16813,13 +16813,6 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= -linkify-it@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-2.2.0.tgz#e3b54697e78bf915c70a38acd78fd09e0058b1cf" - integrity sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw== - dependencies: - uc.micro "^1.0.1" - linkify-it@^3.0.1: version "3.0.2" resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-3.0.2.tgz#f55eeb8bc1d3ae754049e124ab3bb56d97797fb8" @@ -16827,13 +16820,6 @@ linkify-it@^3.0.1: dependencies: uc.micro "^1.0.1" -linkify-it@~1.2.0: - version "1.2.4" - resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-1.2.4.tgz#0773526c317c8fd13bd534ee1d180ff88abf881a" - integrity sha1-B3NSbDF8j9E71TTuHRgP+Iq/iBo= - dependencies: - uc.micro "^1.0.1" - livereload-js@^3.3.1: version "3.3.2" resolved "https://registry.yarnpkg.com/livereload-js/-/livereload-js-3.3.2.tgz#c88b009c6e466b15b91faa26fd7c99d620e12651" @@ -17530,10 +17516,10 @@ markdown-it-terminal@0.2.1: lodash.merge "^4.6.2" markdown-it "^8.3.1" -markdown-it@^12.0.4: - version "12.2.0" - resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.2.0.tgz#091f720fd5db206f80de7a8d1f1a7035fd0d38db" - integrity sha512-Wjws+uCrVQRqOoJvze4HCqkKl1AsSh95iFAeQDwnyfxM09divCBSXlDR1uTvyUP3Grzpn4Ru8GeCxYPM8vkCQg== +markdown-it@^12.0.4, markdown-it@^12.3.2, markdown-it@^4.3.0, markdown-it@^8.3.1: + version "12.3.2" + resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.3.2.tgz#bf92ac92283fe983fe4de8ff8abfb5ad72cd0c90" + integrity sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg== dependencies: argparse "^2.0.1" entities "~2.1.0" @@ -17541,28 +17527,6 @@ markdown-it@^12.0.4: mdurl "^1.0.1" uc.micro "^1.0.5" -markdown-it@^4.3.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-4.4.0.tgz#3df373dbea587a9a7fef3e56311b68908f75c414" - integrity sha1-PfNz2+pYepp/7z5WMRtokI91xBQ= - dependencies: - argparse "~1.0.2" - entities "~1.1.1" - linkify-it "~1.2.0" - mdurl "~1.0.0" - uc.micro "^1.0.0" - -markdown-it@^8.3.1: - version "8.4.2" - resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-8.4.2.tgz#386f98998dc15a37722aa7722084f4020bdd9b54" - integrity sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ== - dependencies: - argparse "^1.0.7" - entities "~1.1.1" - linkify-it "^2.0.0" - mdurl "^1.0.1" - uc.micro "^1.0.5" - markdown-to-jsx@^6.11.4: version "6.11.4" resolved "https://registry.yarnpkg.com/markdown-to-jsx/-/markdown-to-jsx-6.11.4.tgz#b4528b1ab668aef7fe61c1535c27e837819392c5" @@ -17695,7 +17659,7 @@ mdn-links@^0.1.0: resolved "https://registry.yarnpkg.com/mdn-links/-/mdn-links-0.1.0.tgz#e24c83b97cb4c5886cc39f2f780705fbfe273aa5" integrity sha1-4kyDuXy0xYhsw58veAcF+/4nOqU= -mdurl@^1.0.0, mdurl@^1.0.1, mdurl@~1.0.0: +mdurl@^1.0.0, mdurl@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= @@ -23665,7 +23629,7 @@ typescript@~4.2.4: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.4.tgz#8610b59747de028fda898a8aef0e103f156d0961" integrity sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg== -uc.micro@^1.0.0, uc.micro@^1.0.1, uc.micro@^1.0.5: +uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== From 3d782582e58dd77e758c0249dc99a872e4695d5f Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Corvo Date: Wed, 23 Feb 2022 10:35:03 -0800 Subject: [PATCH 9/9] =?UTF-8?q?chore:=20=F0=9F=A4=96=20Update=20flight=20i?= =?UTF-8?q?cons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/rose/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/rose/package.json b/addons/rose/package.json index 3254f48b0..8cbfaf017 100644 --- a/addons/rose/package.json +++ b/addons/rose/package.json @@ -44,7 +44,7 @@ "@ember/test-helpers": "^2.6.0", "@glimmer/component": "^1.0.4", "@glimmer/tracking": "^1.0.4", - "@hashicorp/flight-icons": "^2.0.1", + "@hashicorp/flight-icons": "^2.1.0", "@storybook/addon-a11y": "^6.3.12", "@storybook/addon-actions": "^6.3.10", "@storybook/addon-docs": "^6.3.8", diff --git a/yarn.lock b/yarn.lock index 1edc8a96b..d44bf4caf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3513,10 +3513,10 @@ resolved "https://registry.yarnpkg.com/@handlebars/parser/-/parser-2.0.0.tgz#5e8b7298f31ff8f7b260e6b7363c7e9ceed7d9c5" integrity sha512-EP9uEDZv/L5Qh9IWuMUGJRfwhXJ4h1dqKTT4/3+tY0eu7sPis7xh23j61SYUnNF4vqCQvvUXpDo9Bh/+q1zASA== -"@hashicorp/flight-icons@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@hashicorp/flight-icons/-/flight-icons-2.0.1.tgz#7e7370f1d45207409dd20ebdce7285370e7d9532" - integrity sha512-445WEmL0ysOeVQDe2khCqGbmNm+/Rv5B35Q8FXvc+RuE+r9mNWL0ufe2cVa8Sqqt/VRg0lyTEhArNX9gYCX1Yg== +"@hashicorp/flight-icons@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@hashicorp/flight-icons/-/flight-icons-2.1.0.tgz#bda6c6942af0432d3342b1b1a2ff7f8da4c10f8a" + integrity sha512-4HWwty+LNhMD7O30sBinn7OQo2KTSUEk1qm65hqFitfp2m8sEl8F+7gY4NcTJV9Y1eEe3C7bED5OOnsPVc60ww== "@humanwhocodes/config-array@^0.5.0": version "0.5.0"