From ad2e8bdd6c850808da7607e1c6127909efc214a8 Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 16 Feb 2022 11:10:40 -0800 Subject: [PATCH 1/7] =?UTF-8?q?chore:=20=F0=9F=A4=96=20add=20preferred=20e?= =?UTF-8?q?ndpoitns?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/core/translations/resources/en-us.yaml | 2 + .../components/form/host-set/aws/index.hbs | 81 +++++++++++++++++++ .../components/form/host-set/azure/index.hbs | 81 +++++++++++++++++++ .../host-catalogs/host-catalog/host-sets.js | 25 ++++++ 4 files changed, 189 insertions(+) diff --git a/addons/core/translations/resources/en-us.yaml b/addons/core/translations/resources/en-us.yaml index 1341dcc76..6d55b8ae9 100644 --- a/addons/core/translations/resources/en-us.yaml +++ b/addons/core/translations/resources/en-us.yaml @@ -111,6 +111,8 @@ host-set: filter: label: Filter help: Create a filter to select resources using values such as tag name or tag value. Filter format is specific to each provider + preferred_endpoints: + label: Preferred Endpoints messages: welcome: title: Welcome to Host Sets diff --git a/ui/admin/app/components/form/host-set/aws/index.hbs b/ui/admin/app/components/form/host-set/aws/index.hbs index 3af6ce47f..4be390cbb 100644 --- a/ui/admin/app/components/form/host-set/aws/index.hbs +++ b/ui/admin/app/components/form/host-set/aws/index.hbs @@ -74,6 +74,87 @@ + + <:title>{{t 'resources.host-set.form.preferred_endpoints.label'}} + + <:body> + {{#if @model.errors.preferred_endpoints}} + + {{#each @model.errors.preferred_endpoints as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + {{t 'titles.value'}} + + + + + {{#each @model.preferred_endpoints as |endpoint i|}} + + + + + + + + + {{t 'actions.remove'}} + + + + {{/each}} + + + + + + + + {{t 'actions.add'}} + + + + + + + + <:title>{{t 'resources.host-set.form.filter.label'}} <:description>{{t 'resources.host-set.form.filter.help'}} diff --git a/ui/admin/app/components/form/host-set/azure/index.hbs b/ui/admin/app/components/form/host-set/azure/index.hbs index 686cb70d4..e7e437ce0 100644 --- a/ui/admin/app/components/form/host-set/azure/index.hbs +++ b/ui/admin/app/components/form/host-set/azure/index.hbs @@ -74,6 +74,87 @@ + + <:title>{{t 'resources.host-set.form.preferred_endpoints.label'}} + + <:body> + {{#if @model.errors.preferred_endpoints}} + + {{#each @model.errors.preferred_endpoints as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + {{t 'titles.value'}} + + + + + {{#each @model.preferred_endpoints as |endpoint i|}} + + + + + + + + + {{t 'actions.remove'}} + + + + {{/each}} + + + + + + + + {{t 'actions.add'}} + + + + + + + + Date: Wed, 16 Feb 2022 11:37:16 -0800 Subject: [PATCH 2/7] =?UTF-8?q?fix:=20=F0=9F=90=9B=20lint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/core/translations/resources/en-us.yaml | 1 + ui/admin/app/components/form/host-set/aws/index.hbs | 4 +++- ui/admin/app/components/form/host-set/azure/index.hbs | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/core/translations/resources/en-us.yaml b/addons/core/translations/resources/en-us.yaml index 6d55b8ae9..57de894d3 100644 --- a/addons/core/translations/resources/en-us.yaml +++ b/addons/core/translations/resources/en-us.yaml @@ -113,6 +113,7 @@ host-set: help: Create a filter to select resources using values such as tag name or tag value. Filter format is specific to each provider preferred_endpoints: label: Preferred Endpoints + help: Selects addresses of hosts, in cidr: or dns: format messages: welcome: title: Welcome to Host Sets diff --git a/ui/admin/app/components/form/host-set/aws/index.hbs b/ui/admin/app/components/form/host-set/aws/index.hbs index 4be390cbb..9f21b0097 100644 --- a/ui/admin/app/components/form/host-set/aws/index.hbs +++ b/ui/admin/app/components/form/host-set/aws/index.hbs @@ -76,7 +76,9 @@ <:title>{{t 'resources.host-set.form.preferred_endpoints.label'}} - + <:description>{{t + 'resources.host-set.form.preferred_endpoints.help' + }} <:body> {{#if @model.errors.preferred_endpoints}} diff --git a/ui/admin/app/components/form/host-set/azure/index.hbs b/ui/admin/app/components/form/host-set/azure/index.hbs index e7e437ce0..4cc9cfb4c 100644 --- a/ui/admin/app/components/form/host-set/azure/index.hbs +++ b/ui/admin/app/components/form/host-set/azure/index.hbs @@ -76,7 +76,9 @@ <:title>{{t 'resources.host-set.form.preferred_endpoints.label'}} - + <:description>{{t + 'resources.host-set.form.preferred_endpoints.help' + }} <:body> {{#if @model.errors.preferred_endpoints}} From e0b8f7d796e8f78dd897c718a8b49bdfe5582b6c Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 16 Feb 2022 11:38:16 -0800 Subject: [PATCH 3/7] remove unused --- .../host-catalogs/host-catalog/host-sets.js | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets.js b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets.js index c12deae0f..dc6fdccea 100644 --- a/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets.js +++ b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets.js @@ -91,29 +91,4 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsRoute extends Rou 'scopes.scope.host-catalogs.host-catalog.host-sets' ); } - - // /** - // * Adds a string item to array `property` on the passed `filter`. - - // * @param {hostSetModel} hostSet - // * @param {string} property - // * @param {string} value - // */ - // @action - // async addStringItem(hostSet, property, value) { - // const array = hostSet.get(property); - // array.addObject({ value }); - // } - // /** - // * Removes an item from array `property` at `index` on the - // * passed `hostSet`. - // * @param {hostSetModel} hostSet - // * @param {string} property - // * @param {number} index - // */ - // @action - // async removeItemByIndex(hostSet, property, index) { - // const array = hostSet.get(property); - // array.removeAt(index); - // } } From 595443bccf5369da816025bea071c40ba2e3dbc0 Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 16 Feb 2022 13:35:20 -0800 Subject: [PATCH 4/7] =?UTF-8?q?fix:=20=F0=9F=90=9B=20add=20placeholder=20t?= =?UTF-8?q?o=20input?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/rose/addon/components/rose/form/input/index.hbs | 2 ++ .../addon/components/rose/form/input/index.stories.mdx | 6 +++++- .../rose/addon/components/rose/form/input/input/index.hbs | 1 + addons/rose/addon/styles/rose/components/form/_input.scss | 4 ++++ ui/admin/app/components/form/host-set/aws/index.hbs | 7 ++++++- ui/admin/app/components/form/host-set/azure/index.hbs | 7 ++++++- 6 files changed, 24 insertions(+), 3 deletions(-) diff --git a/addons/rose/addon/components/rose/form/input/index.hbs b/addons/rose/addon/components/rose/form/input/index.hbs index 524523bbb..96bf0330d 100644 --- a/addons/rose/addon/components/rose/form/input/index.hbs +++ b/addons/rose/addon/components/rose/form/input/index.hbs @@ -15,6 +15,7 @@ type=@type disabled=@disabled error=@error + placeholder=@placeholder aria-describedby=(concat (if @helperText (concat 'helper-text-' this.id)) (if @error (concat ' errors-' this.id))) ) errors=(component 'rose/form/errors' @@ -48,6 +49,7 @@ @type={{@type}} @disabled={{@disabled}} @error={{@error}} + @placeholder={{@placeholder}} @aria-describedby="{{if @helperText (concat 'helper-text-' this.id)}} {{if @error (concat 'errors-' this.id)}}" /> {{yield (hash diff --git a/addons/rose/addon/components/rose/form/input/index.stories.mdx b/addons/rose/addon/components/rose/form/input/index.stories.mdx index 2eaeb2f99..e84eab87b 100644 --- a/addons/rose/addon/components/rose/form/input/index.stories.mdx +++ b/addons/rose/addon/components/rose/form/input/index.stories.mdx @@ -13,7 +13,7 @@ Renders a simple form input. ``` @@ -40,6 +41,7 @@ Or a fully contextual component without a wrapper, for maximum flexibility. @error={{false}} @disabled={{false}} readonly={{false}} + placeholder='la la la' > @@ -60,6 +62,7 @@ Or a fully contextual component without a wrapper, for maximum flexibility. @disabled={{disabled}} readonly={{read-only}} @icon={{icon}} + placeholder={{placeholder}} /> `, context: { @@ -75,6 +78,7 @@ Or a fully contextual component without a wrapper, for maximum flexibility. ), value: text('value', 'Value'), label: text('label', 'Label'), + placeholder: text('placeholder', 'this is a placeholder'), helperText: text('helperText', 'Helper text'), link: text('link', 'link goes here'), linkText: text('linkText', 'link text'), diff --git a/addons/rose/addon/components/rose/form/input/input/index.hbs b/addons/rose/addon/components/rose/form/input/input/index.hbs index 95e81a114..802feeea7 100644 --- a/addons/rose/addon/components/rose/form/input/input/index.hbs +++ b/addons/rose/addon/components/rose/form/input/input/index.hbs @@ -6,4 +6,5 @@ name={{@name}} @type={{@type}} @value={{@value}} + placeholder={{@placeholder}} aria-describedby={{@aria-describedby}} /> diff --git a/addons/rose/addon/styles/rose/components/form/_input.scss b/addons/rose/addon/styles/rose/components/form/_input.scss index 214f57734..889c933ef 100644 --- a/addons/rose/addon/styles/rose/components/form/_input.scss +++ b/addons/rose/addon/styles/rose/components/form/_input.scss @@ -30,6 +30,10 @@ border-radius: sizing.rems(xxxs); box-shadow: inset 0px 3px 1px rgba(var(--stark-components), var(--opacity-4)); + &::placeholder { + color: var(--ui-gray-subtler-1); + } + &.error { color: var(--failure); border-color: currentColor; diff --git a/ui/admin/app/components/form/host-set/aws/index.hbs b/ui/admin/app/components/form/host-set/aws/index.hbs index 9f21b0097..79782093e 100644 --- a/ui/admin/app/components/form/host-set/aws/index.hbs +++ b/ui/admin/app/components/form/host-set/aws/index.hbs @@ -103,6 +103,7 @@ @value={{endpoint.value}} @error={{@model.errors.preferred_endpoints}} @contextual={{true}} + @placeholder='cidr:2001:4860:4860::8888/32' as |field| > @@ -128,7 +129,11 @@ - + @@ -128,7 +129,11 @@ - + Date: Wed, 16 Feb 2022 13:36:49 -0800 Subject: [PATCH 5/7] Update index.stories.mdx --- addons/rose/addon/components/rose/form/input/index.stories.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/rose/addon/components/rose/form/input/index.stories.mdx b/addons/rose/addon/components/rose/form/input/index.stories.mdx index e84eab87b..486acaf47 100644 --- a/addons/rose/addon/components/rose/form/input/index.stories.mdx +++ b/addons/rose/addon/components/rose/form/input/index.stories.mdx @@ -41,7 +41,7 @@ Or a fully contextual component without a wrapper, for maximum flexibility. @error={{false}} @disabled={{false}} readonly={{false}} - placeholder='la la la' + placeholder='placeholder text' > From 1dcfc67e0a4cf04ee59387f506cef544489d3558 Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 16 Feb 2022 13:47:02 -0800 Subject: [PATCH 6/7] remove attr from input --- addons/rose/addon/components/rose/form/input/index.hbs | 2 -- .../rose/addon/components/rose/form/input/index.stories.mdx | 4 ---- addons/rose/addon/components/rose/form/input/input/index.hbs | 1 - ui/admin/app/components/form/host-set/aws/index.hbs | 4 ++-- ui/admin/app/components/form/host-set/azure/index.hbs | 4 ++-- 5 files changed, 4 insertions(+), 11 deletions(-) diff --git a/addons/rose/addon/components/rose/form/input/index.hbs b/addons/rose/addon/components/rose/form/input/index.hbs index 96bf0330d..524523bbb 100644 --- a/addons/rose/addon/components/rose/form/input/index.hbs +++ b/addons/rose/addon/components/rose/form/input/index.hbs @@ -15,7 +15,6 @@ type=@type disabled=@disabled error=@error - placeholder=@placeholder aria-describedby=(concat (if @helperText (concat 'helper-text-' this.id)) (if @error (concat ' errors-' this.id))) ) errors=(component 'rose/form/errors' @@ -49,7 +48,6 @@ @type={{@type}} @disabled={{@disabled}} @error={{@error}} - @placeholder={{@placeholder}} @aria-describedby="{{if @helperText (concat 'helper-text-' this.id)}} {{if @error (concat 'errors-' this.id)}}" /> {{yield (hash diff --git a/addons/rose/addon/components/rose/form/input/index.stories.mdx b/addons/rose/addon/components/rose/form/input/index.stories.mdx index e84eab87b..4dbe35b58 100644 --- a/addons/rose/addon/components/rose/form/input/index.stories.mdx +++ b/addons/rose/addon/components/rose/form/input/index.stories.mdx @@ -22,7 +22,6 @@ Renders a simple form input. @disabled={{false}} @icon='flight-icons/svg/search-16' readonly={{false}} - placeholder='this is a placeholder' /> ``` @@ -41,7 +40,6 @@ Or a fully contextual component without a wrapper, for maximum flexibility. @error={{false}} @disabled={{false}} readonly={{false}} - placeholder='la la la' > @@ -62,7 +60,6 @@ Or a fully contextual component without a wrapper, for maximum flexibility. @disabled={{disabled}} readonly={{read-only}} @icon={{icon}} - placeholder={{placeholder}} /> `, context: { @@ -78,7 +75,6 @@ Or a fully contextual component without a wrapper, for maximum flexibility. ), value: text('value', 'Value'), label: text('label', 'Label'), - placeholder: text('placeholder', 'this is a placeholder'), helperText: text('helperText', 'Helper text'), link: text('link', 'link goes here'), linkText: text('linkText', 'link text'), diff --git a/addons/rose/addon/components/rose/form/input/input/index.hbs b/addons/rose/addon/components/rose/form/input/input/index.hbs index 802feeea7..95e81a114 100644 --- a/addons/rose/addon/components/rose/form/input/input/index.hbs +++ b/addons/rose/addon/components/rose/form/input/input/index.hbs @@ -6,5 +6,4 @@ name={{@name}} @type={{@type}} @value={{@value}} - placeholder={{@placeholder}} aria-describedby={{@aria-describedby}} /> diff --git a/ui/admin/app/components/form/host-set/aws/index.hbs b/ui/admin/app/components/form/host-set/aws/index.hbs index 79782093e..3d7b974ab 100644 --- a/ui/admin/app/components/form/host-set/aws/index.hbs +++ b/ui/admin/app/components/form/host-set/aws/index.hbs @@ -103,7 +103,7 @@ @value={{endpoint.value}} @error={{@model.errors.preferred_endpoints}} @contextual={{true}} - @placeholder='cidr:2001:4860:4860::8888/32' + placeholder='cidr:2001:4860:4860::8888/32' as |field| > @@ -132,7 +132,7 @@ diff --git a/ui/admin/app/components/form/host-set/azure/index.hbs b/ui/admin/app/components/form/host-set/azure/index.hbs index b31f8e7df..866577b7d 100644 --- a/ui/admin/app/components/form/host-set/azure/index.hbs +++ b/ui/admin/app/components/form/host-set/azure/index.hbs @@ -103,7 +103,7 @@ @value={{endpoint.value}} @error={{@model.errors.preferred_endpoints}} @contextual={{true}} - @placeholder='cidr:2001:4860:4860::8888/32' + placeholder='cidr:2001:4860:4860::8888/32' as |field| > @@ -132,7 +132,7 @@ From 731ce408507ffef5e581453591acac55591145b4 Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 16 Feb 2022 13:53:58 -0800 Subject: [PATCH 7/7] undo change --- addons/rose/addon/components/rose/form/input/index.stories.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/rose/addon/components/rose/form/input/index.stories.mdx b/addons/rose/addon/components/rose/form/input/index.stories.mdx index 4dbe35b58..2eaeb2f99 100644 --- a/addons/rose/addon/components/rose/form/input/index.stories.mdx +++ b/addons/rose/addon/components/rose/form/input/index.stories.mdx @@ -13,7 +13,7 @@ Renders a simple form input.