From d108baccfc08ec9eb17ce224e6c3940fd23645e4 Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 8 Feb 2022 12:30:14 -0800 Subject: [PATCH 01/19] split host-set into static, aws and azure --- addons/core/translations/form/en-us.yaml | 6 +- .../components/form/host-set/aws/index.hbs | 109 +++++++++++++++++ .../components/form/host-set/azure/index.hbs | 110 ++++++++++++++++++ .../app/components/form/host-set/index.hbs | 67 +---------- .../components/form/host-set/static/index.hbs | 57 +++++++++ 5 files changed, 287 insertions(+), 62 deletions(-) create mode 100644 ui/admin/app/components/form/host-set/aws/index.hbs create mode 100644 ui/admin/app/components/form/host-set/azure/index.hbs create mode 100644 ui/admin/app/components/form/host-set/static/index.hbs diff --git a/addons/core/translations/form/en-us.yaml b/addons/core/translations/form/en-us.yaml index 227029c9b..489145681 100644 --- a/addons/core/translations/form/en-us.yaml +++ b/addons/core/translations/form/en-us.yaml @@ -139,4 +139,8 @@ region: provider_client_id: label: Client ID link-text : Learn more - help: The client ID for the client you want Boundary to use. \ No newline at end of file + help: The client ID for the client you want Boundary to use. +provider_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. + link-text: Learn more about using filters for Azure resources. \ No newline at end of file diff --git a/ui/admin/app/components/form/host-set/aws/index.hbs b/ui/admin/app/components/form/host-set/aws/index.hbs new file mode 100644 index 000000000..f4157e973 --- /dev/null +++ b/ui/admin/app/components/form/host-set/aws/index.hbs @@ -0,0 +1,109 @@ +{{@model.type}} {{@model.compositeType}} + + + + {{#if @model.errors.name}} + + {{#each @model.errors.name as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + {{#if @model.errors.description}} + + {{#each @model.errors.description as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + + + <:title>{{t 'resources.host-catalog.form.provider.label'}} + <:description>{{t + 'resources.host-catalog.form.provider.description' + }} + + <:body> + + + + + + + + {{#if @model.errors.filters}} + + {{#each @model.errors.filters as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + {{#if (can 'save model' @model)}} + + {{/if}} + \ No newline at end of file diff --git a/ui/admin/app/components/form/host-set/azure/index.hbs b/ui/admin/app/components/form/host-set/azure/index.hbs new file mode 100644 index 000000000..332c58f04 --- /dev/null +++ b/ui/admin/app/components/form/host-set/azure/index.hbs @@ -0,0 +1,110 @@ +{{@model.type}} {{@model.compositeType}} + + + + {{#if @model.errors.name}} + + {{#each @model.errors.name as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + {{#if @model.errors.description}} + + {{#each @model.errors.description as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + + + <:title>{{t 'resources.host-catalog.form.provider.label'}} + <:description>{{t + 'resources.host-catalog.form.provider.description' + }} + + <:body> + + + + + + + + {{#if @model.errors.filter}} + + {{#each @model.errors.filter as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + {{#if (can 'save model' @model)}} + + {{/if}} + diff --git a/ui/admin/app/components/form/host-set/index.hbs b/ui/admin/app/components/form/host-set/index.hbs index 01864acc5..da084d1fe 100644 --- a/ui/admin/app/components/form/host-set/index.hbs +++ b/ui/admin/app/components/form/host-set/index.hbs @@ -1,63 +1,8 @@ - - - - {{#if @model.errors.name}} - - {{#each @model.errors.name as |error|}} - {{error.message}} - {{/each}} - - {{/if}} - - - - {{#if @model.errors.description}} - - {{#each @model.errors.description as |error|}} - {{error.message}} - {{/each}} - - {{/if}} - - {{#if (can 'save model' @model)}} - - {{/if}} - \ No newline at end of file +{{component + (concat 'form/host-set/' @model.compositeType) + model=@model + submit=@submit + cancel=@cancel +}} \ No newline at end of file diff --git a/ui/admin/app/components/form/host-set/static/index.hbs b/ui/admin/app/components/form/host-set/static/index.hbs new file mode 100644 index 000000000..397b80a95 --- /dev/null +++ b/ui/admin/app/components/form/host-set/static/index.hbs @@ -0,0 +1,57 @@ + + + + {{#if @model.errors.name}} + + {{#each @model.errors.name as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + {{#if @model.errors.description}} + + {{#each @model.errors.description as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + {{#if (can 'save model' @model)}} + + {{/if}} + From dad3918d446fc5e31a5dd0dd8175073d772c6cae Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 8 Feb 2022 14:51:59 -0800 Subject: [PATCH 02/19] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20host-set:=20update?= =?UTF-8?q?s=20to=20fields?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/form/host-set/aws/index.hbs | 46 +++++++++--------- .../components/form/host-set/azure/index.hbs | 47 +++++++++---------- .../app/components/form/host-set/index.hbs | 2 - .../components/form/host-set/static/index.hbs | 2 +- 4 files changed, 47 insertions(+), 50 deletions(-) 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 f4157e973..155592a57 100644 --- a/ui/admin/app/components/form/host-set/aws/index.hbs +++ b/ui/admin/app/components/form/host-set/aws/index.hbs @@ -1,4 +1,3 @@ -{{@model.type}} {{@model.compositeType}} - - - <:title>{{t 'resources.host-catalog.form.provider.label'}} - <:description>{{t - 'resources.host-catalog.form.provider.description' - }} + + <:title>{{t 'resources.host-catalog.form.provider.label'}} + <:description>{{t + 'resources.host-catalog.form.provider.description' + }} - <:body> - - - - - + <:body> + + + + + - - - <:title>{{t 'resources.host-catalog.form.provider.label'}} - <:description>{{t - 'resources.host-catalog.form.provider.description' - }} + + <:title>{{t 'resources.host-catalog.form.provider.label'}} + <:description>{{t + 'resources.host-catalog.form.provider.description' + }} - <:body> - - - - - + <:body> + + + + + {{/if}} - + \ No newline at end of file diff --git a/ui/admin/app/components/form/host-set/index.hbs b/ui/admin/app/components/form/host-set/index.hbs index da084d1fe..5c3bd3f0c 100644 --- a/ui/admin/app/components/form/host-set/index.hbs +++ b/ui/admin/app/components/form/host-set/index.hbs @@ -1,5 +1,3 @@ - - {{component (concat 'form/host-set/' @model.compositeType) model=@model diff --git a/ui/admin/app/components/form/host-set/static/index.hbs b/ui/admin/app/components/form/host-set/static/index.hbs index 397b80a95..7ed797846 100644 --- a/ui/admin/app/components/form/host-set/static/index.hbs +++ b/ui/admin/app/components/form/host-set/static/index.hbs @@ -54,4 +54,4 @@ @cancelText={{t 'actions.cancel'}} /> {{/if}} - + \ No newline at end of file From 52d6d1c4bf4162d086214c8dcffd6c455a83c573 Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 8 Feb 2022 17:26:43 -0800 Subject: [PATCH 03/19] =?UTF-8?q?fix:=20=F0=9F=90=9B=20remove=20links=20fo?= =?UTF-8?q?r=20now?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/app/components/form/host-set/aws/index.hbs | 1 - ui/admin/app/components/form/host-set/azure/index.hbs | 1 - 2 files changed, 2 deletions(-) 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 155592a57..1fe12c0a2 100644 --- a/ui/admin/app/components/form/host-set/aws/index.hbs +++ b/ui/admin/app/components/form/host-set/aws/index.hbs @@ -83,7 +83,6 @@ @label={{t 'form.provider_filter.label'}} @helperText={{t 'form.provider_filter.help'}} @linkText={{t 'form.provider_filter.link-text'}} - @link='https://docs.aws.amazon.com/ARG/latest/APIReference/API_ListGroupResources.html' @error={{@model.errors.description}} disabled={{@model.isSaving}} readonly={{false}} 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 df2a3aa40..7d32a3b97 100644 --- a/ui/admin/app/components/form/host-set/azure/index.hbs +++ b/ui/admin/app/components/form/host-set/azure/index.hbs @@ -83,7 +83,6 @@ @label={{t 'form.provider_filter.label'}} @helperText={{t 'form.provider_filter.help'}} @linkText={{t 'form.provider_filter.link-text'}} - @link='https://docs.microsoft.com/en-us/rest/api/resources/Resources/List#uri-parameters' @error={{@model.errors.description}} disabled={{@model.isSaving}} readonly={{false}} From 1188c7567c784341ad0fa5bdca4f7ba146bd4a88 Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 9 Feb 2022 14:03:54 -0800 Subject: [PATCH 04/19] =?UTF-8?q?chore:=20=F0=9F=A4=96=20placeholder=20for?= =?UTF-8?q?=20filters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/form/host-set/aws/index.hbs | 25 ++++--------------- .../components/form/host-set/azure/index.hbs | 2 +- 2 files changed, 6 insertions(+), 21 deletions(-) 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 1fe12c0a2..0e65d1aed 100644 --- a/ui/admin/app/components/form/host-set/aws/index.hbs +++ b/ui/admin/app/components/form/host-set/aws/index.hbs @@ -76,26 +76,11 @@ - - {{#if @model.errors.filters}} - - {{#each @model.errors.filters as |error|}} - {{error.message}} - {{/each}} - - {{/if}} - + {{! placeholder for filter, update me when the model is ready }} + + <:title>{{t 'form.provider_filter.label'}} + <:description>{{t 'form.provider_filter.help'}} + {{#if (can 'save model' @model)}} + {{! placeholder for filter, update me when the model is ready }} Date: Wed, 9 Feb 2022 14:52:22 -0800 Subject: [PATCH 05/19] =?UTF-8?q?fix:=20=F0=9F=90=9B=20translations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/core/translations/resources/en-us.yaml | 13 +++++++++---- ui/admin/app/components/form/host-set/aws/index.hbs | 2 +- .../app/components/form/host-set/azure/index.hbs | 2 +- .../host-catalogs/host-catalog/host-sets/index.hbs | 12 ++++++++++-- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/addons/core/translations/resources/en-us.yaml b/addons/core/translations/resources/en-us.yaml index 27e3497c0..29bd6c7a3 100644 --- a/addons/core/translations/resources/en-us.yaml +++ b/addons/core/translations/resources/en-us.yaml @@ -129,10 +129,15 @@ host-set: title: No Hosts Available description: No hosts available for selection. types: - static: Static - unknown: Unknown - aws: AWS - azure: Azure + static: + label: Static + help: Provide a list of hosts and host sets with static addresses + unknown: + label: Unknown + aws: + label: AWS + azure: + label: Azure host: title: Host title_plural: Hosts 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 0e65d1aed..d5cb69c13 100644 --- a/ui/admin/app/components/form/host-set/aws/index.hbs +++ b/ui/admin/app/components/form/host-set/aws/index.hbs @@ -67,7 +67,7 @@ as |radioGroup| > {{#if hostSet.isStatic}} - {{t (concat 'resources.host-set.types.' hostSet.compositeType)}} + {{t + (concat + 'resources.host-set.types.' hostSet.compositeType '.label' + ) + }} {{else}} - {{t (concat 'resources.host-set.types.' hostSet.compositeType)}} + {{t + (concat + 'resources.host-set.types.' hostSet.compositeType '.label' + ) + }} {{/if}} From 42e754ab26e9beac0e20d73217820a1b3c66a0c3 Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 9 Feb 2022 18:44:43 -0800 Subject: [PATCH 06/19] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20allow=20host=20set?= =?UTF-8?q?=20typed=20creation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../host-catalog/host-sets/new.js | 22 ++++++++++++++++--- .../host-catalog/host-sets/new.hbs | 1 + 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/new.js b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/new.js index 3980cf51b..952e5d195 100644 --- a/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/new.js +++ b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/new.js @@ -1,18 +1,26 @@ import Route from '@ember/routing/route'; +import { action } from '@ember/object'; +import { inject as service } from '@ember/service'; export default class ScopesScopeHostCatalogsHostCatalogHostSetsNewRoute extends Route { - // =methods + // =services + @service router; + // =methods /** * Creates a new unsaved host set in current host catalog scope. * @return {HostSetModel} */ model() { - const { id: host_catalog_id } = this.modelFor( + const { id: host_catalog_id, compositeType } = this.modelFor( 'scopes.scope.host-catalogs.host-catalog' ); + if (this.currentModel?.isNew) { + this.currentModel.rollbackAttributes(); + } + console.log('typedwed', compositeType); return this.store.createRecord('host-set', { - type: 'static', + compositeType, host_catalog_id, }); } @@ -47,4 +55,12 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsNewRoute extends model: model, }); } + /** + * Update type of host set + * @param {string} type + */ + @action + async changeType(type) { + await this.router.replaceWith({ queryParams: { type } }); + } } diff --git a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/new.hbs b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/new.hbs index 9f68f1549..941f3e819 100644 --- a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/new.hbs +++ b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/new.hbs @@ -4,4 +4,5 @@ @model={{@model}} @submit={{route-action 'save' @model}} @cancel={{route-action 'cancel' @model}} + @changeType={{route-action 'changeType' @model.type}} /> \ No newline at end of file From 4c32cee46697ecf5feee70157c32d88ec4a9a9ef Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 8 Feb 2022 12:30:14 -0800 Subject: [PATCH 07/19] split host-set into static, aws and azure --- addons/core/translations/form/en-us.yaml | 6 +- .../components/form/host-set/aws/index.hbs | 109 +++++++++++++++++ .../components/form/host-set/azure/index.hbs | 110 ++++++++++++++++++ .../app/components/form/host-set/index.hbs | 67 +---------- .../components/form/host-set/static/index.hbs | 57 +++++++++ 5 files changed, 287 insertions(+), 62 deletions(-) create mode 100644 ui/admin/app/components/form/host-set/aws/index.hbs create mode 100644 ui/admin/app/components/form/host-set/azure/index.hbs create mode 100644 ui/admin/app/components/form/host-set/static/index.hbs diff --git a/addons/core/translations/form/en-us.yaml b/addons/core/translations/form/en-us.yaml index 227029c9b..489145681 100644 --- a/addons/core/translations/form/en-us.yaml +++ b/addons/core/translations/form/en-us.yaml @@ -139,4 +139,8 @@ region: provider_client_id: label: Client ID link-text : Learn more - help: The client ID for the client you want Boundary to use. \ No newline at end of file + help: The client ID for the client you want Boundary to use. +provider_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. + link-text: Learn more about using filters for Azure resources. \ No newline at end of file diff --git a/ui/admin/app/components/form/host-set/aws/index.hbs b/ui/admin/app/components/form/host-set/aws/index.hbs new file mode 100644 index 000000000..f4157e973 --- /dev/null +++ b/ui/admin/app/components/form/host-set/aws/index.hbs @@ -0,0 +1,109 @@ +{{@model.type}} {{@model.compositeType}} + + + + {{#if @model.errors.name}} + + {{#each @model.errors.name as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + {{#if @model.errors.description}} + + {{#each @model.errors.description as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + + + <:title>{{t 'resources.host-catalog.form.provider.label'}} + <:description>{{t + 'resources.host-catalog.form.provider.description' + }} + + <:body> + + + + + + + + {{#if @model.errors.filters}} + + {{#each @model.errors.filters as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + {{#if (can 'save model' @model)}} + + {{/if}} + \ No newline at end of file diff --git a/ui/admin/app/components/form/host-set/azure/index.hbs b/ui/admin/app/components/form/host-set/azure/index.hbs new file mode 100644 index 000000000..332c58f04 --- /dev/null +++ b/ui/admin/app/components/form/host-set/azure/index.hbs @@ -0,0 +1,110 @@ +{{@model.type}} {{@model.compositeType}} + + + + {{#if @model.errors.name}} + + {{#each @model.errors.name as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + {{#if @model.errors.description}} + + {{#each @model.errors.description as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + + + <:title>{{t 'resources.host-catalog.form.provider.label'}} + <:description>{{t + 'resources.host-catalog.form.provider.description' + }} + + <:body> + + + + + + + + {{#if @model.errors.filter}} + + {{#each @model.errors.filter as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + {{#if (can 'save model' @model)}} + + {{/if}} + diff --git a/ui/admin/app/components/form/host-set/index.hbs b/ui/admin/app/components/form/host-set/index.hbs index 01864acc5..da084d1fe 100644 --- a/ui/admin/app/components/form/host-set/index.hbs +++ b/ui/admin/app/components/form/host-set/index.hbs @@ -1,63 +1,8 @@ - - - - {{#if @model.errors.name}} - - {{#each @model.errors.name as |error|}} - {{error.message}} - {{/each}} - - {{/if}} - - - - {{#if @model.errors.description}} - - {{#each @model.errors.description as |error|}} - {{error.message}} - {{/each}} - - {{/if}} - - {{#if (can 'save model' @model)}} - - {{/if}} - \ No newline at end of file +{{component + (concat 'form/host-set/' @model.compositeType) + model=@model + submit=@submit + cancel=@cancel +}} \ No newline at end of file diff --git a/ui/admin/app/components/form/host-set/static/index.hbs b/ui/admin/app/components/form/host-set/static/index.hbs new file mode 100644 index 000000000..397b80a95 --- /dev/null +++ b/ui/admin/app/components/form/host-set/static/index.hbs @@ -0,0 +1,57 @@ + + + + {{#if @model.errors.name}} + + {{#each @model.errors.name as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + {{#if @model.errors.description}} + + {{#each @model.errors.description as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + {{#if (can 'save model' @model)}} + + {{/if}} + From 460c77994fa2efbc0efea6d67e4b0af3087a2587 Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 8 Feb 2022 14:51:59 -0800 Subject: [PATCH 08/19] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20host-set:=20update?= =?UTF-8?q?s=20to=20fields?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/form/host-set/aws/index.hbs | 46 +++++++++--------- .../components/form/host-set/azure/index.hbs | 47 +++++++++---------- .../app/components/form/host-set/index.hbs | 2 - .../components/form/host-set/static/index.hbs | 2 +- 4 files changed, 47 insertions(+), 50 deletions(-) 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 f4157e973..155592a57 100644 --- a/ui/admin/app/components/form/host-set/aws/index.hbs +++ b/ui/admin/app/components/form/host-set/aws/index.hbs @@ -1,4 +1,3 @@ -{{@model.type}} {{@model.compositeType}} - - - <:title>{{t 'resources.host-catalog.form.provider.label'}} - <:description>{{t - 'resources.host-catalog.form.provider.description' - }} + + <:title>{{t 'resources.host-catalog.form.provider.label'}} + <:description>{{t + 'resources.host-catalog.form.provider.description' + }} - <:body> - - - - - + <:body> + + + + + - - - <:title>{{t 'resources.host-catalog.form.provider.label'}} - <:description>{{t - 'resources.host-catalog.form.provider.description' - }} + + <:title>{{t 'resources.host-catalog.form.provider.label'}} + <:description>{{t + 'resources.host-catalog.form.provider.description' + }} - <:body> - - - - - + <:body> + + + + + {{/if}} - + \ No newline at end of file diff --git a/ui/admin/app/components/form/host-set/index.hbs b/ui/admin/app/components/form/host-set/index.hbs index da084d1fe..5c3bd3f0c 100644 --- a/ui/admin/app/components/form/host-set/index.hbs +++ b/ui/admin/app/components/form/host-set/index.hbs @@ -1,5 +1,3 @@ - - {{component (concat 'form/host-set/' @model.compositeType) model=@model diff --git a/ui/admin/app/components/form/host-set/static/index.hbs b/ui/admin/app/components/form/host-set/static/index.hbs index 397b80a95..7ed797846 100644 --- a/ui/admin/app/components/form/host-set/static/index.hbs +++ b/ui/admin/app/components/form/host-set/static/index.hbs @@ -54,4 +54,4 @@ @cancelText={{t 'actions.cancel'}} /> {{/if}} - + \ No newline at end of file From 791a6e9d55f6a28381f00a9d2eff6f462f694456 Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 8 Feb 2022 17:26:43 -0800 Subject: [PATCH 09/19] =?UTF-8?q?fix:=20=F0=9F=90=9B=20remove=20links=20fo?= =?UTF-8?q?r=20now?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/app/components/form/host-set/aws/index.hbs | 1 - ui/admin/app/components/form/host-set/azure/index.hbs | 1 - 2 files changed, 2 deletions(-) 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 155592a57..1fe12c0a2 100644 --- a/ui/admin/app/components/form/host-set/aws/index.hbs +++ b/ui/admin/app/components/form/host-set/aws/index.hbs @@ -83,7 +83,6 @@ @label={{t 'form.provider_filter.label'}} @helperText={{t 'form.provider_filter.help'}} @linkText={{t 'form.provider_filter.link-text'}} - @link='https://docs.aws.amazon.com/ARG/latest/APIReference/API_ListGroupResources.html' @error={{@model.errors.description}} disabled={{@model.isSaving}} readonly={{false}} 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 df2a3aa40..7d32a3b97 100644 --- a/ui/admin/app/components/form/host-set/azure/index.hbs +++ b/ui/admin/app/components/form/host-set/azure/index.hbs @@ -83,7 +83,6 @@ @label={{t 'form.provider_filter.label'}} @helperText={{t 'form.provider_filter.help'}} @linkText={{t 'form.provider_filter.link-text'}} - @link='https://docs.microsoft.com/en-us/rest/api/resources/Resources/List#uri-parameters' @error={{@model.errors.description}} disabled={{@model.isSaving}} readonly={{false}} From d205f0f3453a8ac026f5d88a33c0f6b48228679b Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 9 Feb 2022 14:03:54 -0800 Subject: [PATCH 10/19] =?UTF-8?q?chore:=20=F0=9F=A4=96=20placeholder=20for?= =?UTF-8?q?=20filters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/form/host-set/aws/index.hbs | 25 ++++--------------- .../components/form/host-set/azure/index.hbs | 2 +- 2 files changed, 6 insertions(+), 21 deletions(-) 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 1fe12c0a2..0e65d1aed 100644 --- a/ui/admin/app/components/form/host-set/aws/index.hbs +++ b/ui/admin/app/components/form/host-set/aws/index.hbs @@ -76,26 +76,11 @@ - - {{#if @model.errors.filters}} - - {{#each @model.errors.filters as |error|}} - {{error.message}} - {{/each}} - - {{/if}} - + {{! placeholder for filter, update me when the model is ready }} + + <:title>{{t 'form.provider_filter.label'}} + <:description>{{t 'form.provider_filter.help'}} + {{#if (can 'save model' @model)}} + {{! placeholder for filter, update me when the model is ready }} Date: Wed, 9 Feb 2022 14:52:22 -0800 Subject: [PATCH 11/19] =?UTF-8?q?fix:=20=F0=9F=90=9B=20translations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/core/translations/resources/en-us.yaml | 13 +++++++++---- ui/admin/app/components/form/host-set/aws/index.hbs | 2 +- .../app/components/form/host-set/azure/index.hbs | 2 +- .../host-catalogs/host-catalog/host-sets/index.hbs | 12 ++++++++++-- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/addons/core/translations/resources/en-us.yaml b/addons/core/translations/resources/en-us.yaml index 27e3497c0..29bd6c7a3 100644 --- a/addons/core/translations/resources/en-us.yaml +++ b/addons/core/translations/resources/en-us.yaml @@ -129,10 +129,15 @@ host-set: title: No Hosts Available description: No hosts available for selection. types: - static: Static - unknown: Unknown - aws: AWS - azure: Azure + static: + label: Static + help: Provide a list of hosts and host sets with static addresses + unknown: + label: Unknown + aws: + label: AWS + azure: + label: Azure host: title: Host title_plural: Hosts 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 0e65d1aed..d5cb69c13 100644 --- a/ui/admin/app/components/form/host-set/aws/index.hbs +++ b/ui/admin/app/components/form/host-set/aws/index.hbs @@ -67,7 +67,7 @@ as |radioGroup| > {{#if hostSet.isStatic}} - {{t (concat 'resources.host-set.types.' hostSet.compositeType)}} + {{t + (concat + 'resources.host-set.types.' hostSet.compositeType '.label' + ) + }} {{else}} - {{t (concat 'resources.host-set.types.' hostSet.compositeType)}} + {{t + (concat + 'resources.host-set.types.' hostSet.compositeType '.label' + ) + }} {{/if}} From 8ad078622fcea782370e8838a35c4b13f4a9abc2 Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 8 Feb 2022 12:30:14 -0800 Subject: [PATCH 12/19] split host-set into static, aws and azure --- addons/core/translations/form/en-us.yaml | 6 +- .../components/form/host-set/aws/index.hbs | 109 +++++++++++++++++ .../components/form/host-set/azure/index.hbs | 110 ++++++++++++++++++ .../app/components/form/host-set/index.hbs | 67 +---------- .../components/form/host-set/static/index.hbs | 57 +++++++++ 5 files changed, 287 insertions(+), 62 deletions(-) create mode 100644 ui/admin/app/components/form/host-set/aws/index.hbs create mode 100644 ui/admin/app/components/form/host-set/azure/index.hbs create mode 100644 ui/admin/app/components/form/host-set/static/index.hbs diff --git a/addons/core/translations/form/en-us.yaml b/addons/core/translations/form/en-us.yaml index 227029c9b..489145681 100644 --- a/addons/core/translations/form/en-us.yaml +++ b/addons/core/translations/form/en-us.yaml @@ -139,4 +139,8 @@ region: provider_client_id: label: Client ID link-text : Learn more - help: The client ID for the client you want Boundary to use. \ No newline at end of file + help: The client ID for the client you want Boundary to use. +provider_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. + link-text: Learn more about using filters for Azure resources. \ No newline at end of file diff --git a/ui/admin/app/components/form/host-set/aws/index.hbs b/ui/admin/app/components/form/host-set/aws/index.hbs new file mode 100644 index 000000000..f4157e973 --- /dev/null +++ b/ui/admin/app/components/form/host-set/aws/index.hbs @@ -0,0 +1,109 @@ +{{@model.type}} {{@model.compositeType}} + + + + {{#if @model.errors.name}} + + {{#each @model.errors.name as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + {{#if @model.errors.description}} + + {{#each @model.errors.description as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + + + <:title>{{t 'resources.host-catalog.form.provider.label'}} + <:description>{{t + 'resources.host-catalog.form.provider.description' + }} + + <:body> + + + + + + + + {{#if @model.errors.filters}} + + {{#each @model.errors.filters as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + {{#if (can 'save model' @model)}} + + {{/if}} + \ No newline at end of file diff --git a/ui/admin/app/components/form/host-set/azure/index.hbs b/ui/admin/app/components/form/host-set/azure/index.hbs new file mode 100644 index 000000000..332c58f04 --- /dev/null +++ b/ui/admin/app/components/form/host-set/azure/index.hbs @@ -0,0 +1,110 @@ +{{@model.type}} {{@model.compositeType}} + + + + {{#if @model.errors.name}} + + {{#each @model.errors.name as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + {{#if @model.errors.description}} + + {{#each @model.errors.description as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + + + <:title>{{t 'resources.host-catalog.form.provider.label'}} + <:description>{{t + 'resources.host-catalog.form.provider.description' + }} + + <:body> + + + + + + + + {{#if @model.errors.filter}} + + {{#each @model.errors.filter as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + {{#if (can 'save model' @model)}} + + {{/if}} + diff --git a/ui/admin/app/components/form/host-set/index.hbs b/ui/admin/app/components/form/host-set/index.hbs index 01864acc5..da084d1fe 100644 --- a/ui/admin/app/components/form/host-set/index.hbs +++ b/ui/admin/app/components/form/host-set/index.hbs @@ -1,63 +1,8 @@ - - - - {{#if @model.errors.name}} - - {{#each @model.errors.name as |error|}} - {{error.message}} - {{/each}} - - {{/if}} - - - - {{#if @model.errors.description}} - - {{#each @model.errors.description as |error|}} - {{error.message}} - {{/each}} - - {{/if}} - - {{#if (can 'save model' @model)}} - - {{/if}} - \ No newline at end of file +{{component + (concat 'form/host-set/' @model.compositeType) + model=@model + submit=@submit + cancel=@cancel +}} \ No newline at end of file diff --git a/ui/admin/app/components/form/host-set/static/index.hbs b/ui/admin/app/components/form/host-set/static/index.hbs new file mode 100644 index 000000000..397b80a95 --- /dev/null +++ b/ui/admin/app/components/form/host-set/static/index.hbs @@ -0,0 +1,57 @@ + + + + {{#if @model.errors.name}} + + {{#each @model.errors.name as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + {{#if @model.errors.description}} + + {{#each @model.errors.description as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + {{#if (can 'save model' @model)}} + + {{/if}} + From 98e9d8ef242d97aab47d0ff9c8fd0429480c2eef Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 8 Feb 2022 14:51:59 -0800 Subject: [PATCH 13/19] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20host-set:=20update?= =?UTF-8?q?s=20to=20fields?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/form/host-set/aws/index.hbs | 46 +++++++++--------- .../components/form/host-set/azure/index.hbs | 47 +++++++++---------- .../app/components/form/host-set/index.hbs | 2 - .../components/form/host-set/static/index.hbs | 2 +- 4 files changed, 47 insertions(+), 50 deletions(-) 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 f4157e973..155592a57 100644 --- a/ui/admin/app/components/form/host-set/aws/index.hbs +++ b/ui/admin/app/components/form/host-set/aws/index.hbs @@ -1,4 +1,3 @@ -{{@model.type}} {{@model.compositeType}} - - - <:title>{{t 'resources.host-catalog.form.provider.label'}} - <:description>{{t - 'resources.host-catalog.form.provider.description' - }} + + <:title>{{t 'resources.host-catalog.form.provider.label'}} + <:description>{{t + 'resources.host-catalog.form.provider.description' + }} - <:body> - - - - - + <:body> + + + + + - - - <:title>{{t 'resources.host-catalog.form.provider.label'}} - <:description>{{t - 'resources.host-catalog.form.provider.description' - }} + + <:title>{{t 'resources.host-catalog.form.provider.label'}} + <:description>{{t + 'resources.host-catalog.form.provider.description' + }} - <:body> - - - - - + <:body> + + + + + {{/if}} - + \ No newline at end of file diff --git a/ui/admin/app/components/form/host-set/index.hbs b/ui/admin/app/components/form/host-set/index.hbs index da084d1fe..5c3bd3f0c 100644 --- a/ui/admin/app/components/form/host-set/index.hbs +++ b/ui/admin/app/components/form/host-set/index.hbs @@ -1,5 +1,3 @@ - - {{component (concat 'form/host-set/' @model.compositeType) model=@model diff --git a/ui/admin/app/components/form/host-set/static/index.hbs b/ui/admin/app/components/form/host-set/static/index.hbs index 397b80a95..7ed797846 100644 --- a/ui/admin/app/components/form/host-set/static/index.hbs +++ b/ui/admin/app/components/form/host-set/static/index.hbs @@ -54,4 +54,4 @@ @cancelText={{t 'actions.cancel'}} /> {{/if}} - + \ No newline at end of file From 5e837fd2d5f3b07b937c93848aaa8050ad06dd11 Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 8 Feb 2022 17:26:43 -0800 Subject: [PATCH 14/19] =?UTF-8?q?fix:=20=F0=9F=90=9B=20remove=20links=20fo?= =?UTF-8?q?r=20now?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/app/components/form/host-set/aws/index.hbs | 1 - ui/admin/app/components/form/host-set/azure/index.hbs | 1 - 2 files changed, 2 deletions(-) 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 155592a57..1fe12c0a2 100644 --- a/ui/admin/app/components/form/host-set/aws/index.hbs +++ b/ui/admin/app/components/form/host-set/aws/index.hbs @@ -83,7 +83,6 @@ @label={{t 'form.provider_filter.label'}} @helperText={{t 'form.provider_filter.help'}} @linkText={{t 'form.provider_filter.link-text'}} - @link='https://docs.aws.amazon.com/ARG/latest/APIReference/API_ListGroupResources.html' @error={{@model.errors.description}} disabled={{@model.isSaving}} readonly={{false}} 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 df2a3aa40..7d32a3b97 100644 --- a/ui/admin/app/components/form/host-set/azure/index.hbs +++ b/ui/admin/app/components/form/host-set/azure/index.hbs @@ -83,7 +83,6 @@ @label={{t 'form.provider_filter.label'}} @helperText={{t 'form.provider_filter.help'}} @linkText={{t 'form.provider_filter.link-text'}} - @link='https://docs.microsoft.com/en-us/rest/api/resources/Resources/List#uri-parameters' @error={{@model.errors.description}} disabled={{@model.isSaving}} readonly={{false}} From cdf83c7de64da872c4dcb716e75b138334bd84ad Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 9 Feb 2022 14:03:54 -0800 Subject: [PATCH 15/19] =?UTF-8?q?chore:=20=F0=9F=A4=96=20placeholder=20for?= =?UTF-8?q?=20filters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/form/host-set/aws/index.hbs | 25 ++++--------------- .../components/form/host-set/azure/index.hbs | 2 +- 2 files changed, 6 insertions(+), 21 deletions(-) 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 1fe12c0a2..0e65d1aed 100644 --- a/ui/admin/app/components/form/host-set/aws/index.hbs +++ b/ui/admin/app/components/form/host-set/aws/index.hbs @@ -76,26 +76,11 @@ - - {{#if @model.errors.filters}} - - {{#each @model.errors.filters as |error|}} - {{error.message}} - {{/each}} - - {{/if}} - + {{! placeholder for filter, update me when the model is ready }} + + <:title>{{t 'form.provider_filter.label'}} + <:description>{{t 'form.provider_filter.help'}} + {{#if (can 'save model' @model)}} + {{! placeholder for filter, update me when the model is ready }} Date: Wed, 9 Feb 2022 14:52:22 -0800 Subject: [PATCH 16/19] =?UTF-8?q?fix:=20=F0=9F=90=9B=20translations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/core/translations/resources/en-us.yaml | 13 +++++++++---- ui/admin/app/components/form/host-set/aws/index.hbs | 2 +- .../app/components/form/host-set/azure/index.hbs | 2 +- .../host-catalogs/host-catalog/host-sets/index.hbs | 12 ++++++++++-- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/addons/core/translations/resources/en-us.yaml b/addons/core/translations/resources/en-us.yaml index 27e3497c0..29bd6c7a3 100644 --- a/addons/core/translations/resources/en-us.yaml +++ b/addons/core/translations/resources/en-us.yaml @@ -129,10 +129,15 @@ host-set: title: No Hosts Available description: No hosts available for selection. types: - static: Static - unknown: Unknown - aws: AWS - azure: Azure + static: + label: Static + help: Provide a list of hosts and host sets with static addresses + unknown: + label: Unknown + aws: + label: AWS + azure: + label: Azure host: title: Host title_plural: Hosts 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 0e65d1aed..d5cb69c13 100644 --- a/ui/admin/app/components/form/host-set/aws/index.hbs +++ b/ui/admin/app/components/form/host-set/aws/index.hbs @@ -67,7 +67,7 @@ as |radioGroup| > {{#if hostSet.isStatic}} - {{t (concat 'resources.host-set.types.' hostSet.compositeType)}} + {{t + (concat + 'resources.host-set.types.' hostSet.compositeType '.label' + ) + }} {{else}} - {{t (concat 'resources.host-set.types.' hostSet.compositeType)}} + {{t + (concat + 'resources.host-set.types.' hostSet.compositeType '.label' + ) + }} {{/if}} From a93bf5d4aa831299e50ffc5b52190b9d767cd83c Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 9 Feb 2022 18:44:43 -0800 Subject: [PATCH 17/19] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20allow=20host=20set?= =?UTF-8?q?=20typed=20creation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../host-catalog/host-sets/new.js | 22 ++++++++++++++++--- .../host-catalog/host-sets/new.hbs | 1 + 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/new.js b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/new.js index 3980cf51b..952e5d195 100644 --- a/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/new.js +++ b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/new.js @@ -1,18 +1,26 @@ import Route from '@ember/routing/route'; +import { action } from '@ember/object'; +import { inject as service } from '@ember/service'; export default class ScopesScopeHostCatalogsHostCatalogHostSetsNewRoute extends Route { - // =methods + // =services + @service router; + // =methods /** * Creates a new unsaved host set in current host catalog scope. * @return {HostSetModel} */ model() { - const { id: host_catalog_id } = this.modelFor( + const { id: host_catalog_id, compositeType } = this.modelFor( 'scopes.scope.host-catalogs.host-catalog' ); + if (this.currentModel?.isNew) { + this.currentModel.rollbackAttributes(); + } + console.log('typedwed', compositeType); return this.store.createRecord('host-set', { - type: 'static', + compositeType, host_catalog_id, }); } @@ -47,4 +55,12 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsNewRoute extends model: model, }); } + /** + * Update type of host set + * @param {string} type + */ + @action + async changeType(type) { + await this.router.replaceWith({ queryParams: { type } }); + } } diff --git a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/new.hbs b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/new.hbs index 9f68f1549..941f3e819 100644 --- a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/new.hbs +++ b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/host-sets/new.hbs @@ -4,4 +4,5 @@ @model={{@model}} @submit={{route-action 'save' @model}} @cancel={{route-action 'cancel' @model}} + @changeType={{route-action 'changeType' @model.type}} /> \ No newline at end of file From b00055a38f2923c8592d276cd7ba9f2dee109c23 Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 8 Feb 2022 12:30:14 -0800 Subject: [PATCH 18/19] split host-set into static, aws and azure --- ui/admin/app/components/form/host-set/azure/index.hbs | 2 +- ui/admin/app/components/form/host-set/static/index.hbs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 9679cc6c4..e4db78dc2 100644 --- a/ui/admin/app/components/form/host-set/azure/index.hbs +++ b/ui/admin/app/components/form/host-set/azure/index.hbs @@ -105,4 +105,4 @@ @cancelText={{t 'actions.cancel'}} /> {{/if}} - \ No newline at end of file + diff --git a/ui/admin/app/components/form/host-set/static/index.hbs b/ui/admin/app/components/form/host-set/static/index.hbs index 7ed797846..397b80a95 100644 --- a/ui/admin/app/components/form/host-set/static/index.hbs +++ b/ui/admin/app/components/form/host-set/static/index.hbs @@ -54,4 +54,4 @@ @cancelText={{t 'actions.cancel'}} /> {{/if}} - \ No newline at end of file + From b5ea82caaa4e440ad2b610cafc4a2fcbb0fca53b Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 8 Feb 2022 14:51:59 -0800 Subject: [PATCH 19/19] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20host-set:=20update?= =?UTF-8?q?s=20to=20fields?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/app/components/form/host-set/azure/index.hbs | 2 +- ui/admin/app/components/form/host-set/static/index.hbs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 e4db78dc2..9679cc6c4 100644 --- a/ui/admin/app/components/form/host-set/azure/index.hbs +++ b/ui/admin/app/components/form/host-set/azure/index.hbs @@ -105,4 +105,4 @@ @cancelText={{t 'actions.cancel'}} /> {{/if}} - + \ No newline at end of file diff --git a/ui/admin/app/components/form/host-set/static/index.hbs b/ui/admin/app/components/form/host-set/static/index.hbs index 397b80a95..7ed797846 100644 --- a/ui/admin/app/components/form/host-set/static/index.hbs +++ b/ui/admin/app/components/form/host-set/static/index.hbs @@ -54,4 +54,4 @@ @cancelText={{t 'actions.cancel'}} /> {{/if}} - + \ No newline at end of file