From 58731f14481e3b914ad21218b4e054d5d5c0f251 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 15 Feb 2022 14:36:54 -0500 Subject: [PATCH 1/3] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20simplify=20new?= =?UTF-8?q?=20host=20catalog=20creation=20steps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../host-catalogs/host-catalog/host-sets/new.js | 15 ++------------- .../app/routes/scopes/scope/host-catalogs/new.js | 16 +++++----------- .../host-catalogs/host-catalog/host-sets/new.hbs | 1 - 3 files changed, 7 insertions(+), 25 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 38b1c86c6..3c728dd1a 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 @@ -15,10 +15,6 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsNewRoute extends 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', { compositeType, host_catalog_id, @@ -55,17 +51,10 @@ 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 } }); - } + /** * Adds a string item to array `property` on the passed `filter`. - + * @param {hostSetModel} hostSet * @param {string} property * @param {string} value diff --git a/ui/admin/app/routes/scopes/scope/host-catalogs/new.js b/ui/admin/app/routes/scopes/scope/host-catalogs/new.js index 1e4932280..c712630aa 100644 --- a/ui/admin/app/routes/scopes/scope/host-catalogs/new.js +++ b/ui/admin/app/routes/scopes/scope/host-catalogs/new.js @@ -23,7 +23,7 @@ export default class ScopesScopeHostCatalogsNewRoute extends Route { * creating another, but reuse name/description if available. * @return {HostCatalogModel} */ - model() { + model({ type: compositeType = 'static' }) { const scopeModel = this.modelFor('scopes.scope'); let name, description; if (this.currentModel?.isNew) { @@ -32,25 +32,19 @@ export default class ScopesScopeHostCatalogsNewRoute extends Route { } return this.store.createRecord('host-catalog', { scopeModel, + compositeType, name, description, }); } - afterModel(model, transition) { - this.changeType(transition.to.queryParams?.type); - } - /** * Update type of host catalog * @param {string} type */ @action - async changeType(type) { - const model = this.modelFor('scopes.scope.host-catalogs.new'); - if (!type) type = 'static'; // Unknown host catalog type defaults to 'static' - if (model.isUnknown) type = 'aws'; //Is this the default case for plugin type? - model.compositeType = type; - await this.router.replaceWith({ queryParams: { type } }); + changeType(type) { + if (type === 'plugin') type = 'aws'; + 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 4047f364c..2aec7f029 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,7 +4,6 @@ @model={{@model}} @submit={{route-action 'save' @model}} @cancel={{route-action 'cancel' @model}} - @changeType={{route-action 'changeType' @model.type}} @removeItemByIndex={{route-action 'removeItemByIndex' @model}} @addStringItem={{route-action 'addStringItem' @model}} /> \ No newline at end of file From e5e231f93a259d10e86da4d604da4e1b2354e058 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 15 Feb 2022 15:08:59 -0500 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20add=20disable=5Fcred?= =?UTF-8?q?ential=5Frotation=20field=20to=20forms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/core/translations/form/en-us.yaml | 18 ++++++++++-------- .../components/form/host-catalog/aws/index.hbs | 12 ++++++++++-- .../components/form/host-catalog/aws/index.js | 11 +++++++++++ .../form/host-catalog/azure/index.hbs | 11 +++++++++-- .../routes/scopes/scope/host-catalogs/new.js | 6 +++++- 5 files changed, 45 insertions(+), 13 deletions(-) create mode 100644 ui/admin/app/components/form/host-catalog/aws/index.js diff --git a/addons/core/translations/form/en-us.yaml b/addons/core/translations/form/en-us.yaml index a13b995f2..8204dce5d 100644 --- a/addons/core/translations/form/en-us.yaml +++ b/addons/core/translations/form/en-us.yaml @@ -118,7 +118,7 @@ callback_url: filter: label: Filter help: A boolean expression defining a filter run against the provided information. -tenant_id: +tenant_id: label: Tenant ID help: The tenant (directory) ID for your Azure Active Directory application. link-text: Learn more @@ -134,20 +134,22 @@ secret_access_key: label: Secret Access Key help: The subscription ID for the subscription with read access. link-text: Learn more -region: +region: label: Region provider: label: Provider Details description: This is the provider for this host catalog. The format of the host set filters are specific to each provider. - help: - client: + help: + client: label: Client ID help: The client ID for the client you want Boundary to use. link-text : Learn more - choose_a_provider: - label: Choose a provider + choose_a_provider: + label: Choose a provider description: There are several built-in plugins for the most common providers. You can choose from on of the included plugins or use a custom plugin. - filter: + 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 + link-text: Learn more about using filters for Azure resources. +disable_credential_rotation: + label: Disable credential rotation diff --git a/ui/admin/app/components/form/host-catalog/aws/index.hbs b/ui/admin/app/components/form/host-catalog/aws/index.hbs index 36ebed43a..8422c5ddc 100644 --- a/ui/admin/app/components/form/host-catalog/aws/index.hbs +++ b/ui/admin/app/components/form/host-catalog/aws/index.hbs @@ -13,7 +13,6 @@ @label={{t 'form.name.label'}} @helperText={{t 'form.name.help'}} @error={{@model.errors.name}} - disabled={{@model.isSaving}} readonly={{false}} as |field| > @@ -33,7 +32,6 @@ @label={{t 'form.description.label'}} @helperText={{t 'form.description.help'}} @error={{@model.errors.description}} - disabled={{@model.isSaving}} readonly={{false}} as |field| > @@ -156,6 +154,16 @@ @link='https://learn.hashicorp.com/tutorials/boundary/cloud-host-catalogs#set-up-cloud-hosts' readonly={{false}} /> + + + +   + {{#if (can 'save model' @model)}} @@ -33,7 +32,6 @@ @label={{t 'form.description.label'}} @helperText={{t 'form.description.help'}} @error={{@model.errors.description}} - disabled={{@model.isSaving}} readonly={{false}} as |field| > @@ -161,6 +159,15 @@ readonly={{false}} /> + + +   + {{#if (can 'save model' @model)}} Date: Tue, 15 Feb 2022 15:58:31 -0500 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=F0=9F=90=9B=20use=20@checked?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/app/components/form/host-catalog/aws/index.hbs | 2 +- .../app/components/form/host-catalog/azure/index.hbs | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/ui/admin/app/components/form/host-catalog/aws/index.hbs b/ui/admin/app/components/form/host-catalog/aws/index.hbs index 8422c5ddc..238ab99cd 100644 --- a/ui/admin/app/components/form/host-catalog/aws/index.hbs +++ b/ui/admin/app/components/form/host-catalog/aws/index.hbs @@ -157,7 +157,7 @@ diff --git a/ui/admin/app/components/form/host-catalog/azure/index.hbs b/ui/admin/app/components/form/host-catalog/azure/index.hbs index ae2c0e033..4152090d8 100644 --- a/ui/admin/app/components/form/host-catalog/azure/index.hbs +++ b/ui/admin/app/components/form/host-catalog/azure/index.hbs @@ -159,15 +159,6 @@ readonly={{false}} /> - - -   - {{#if (can 'save model' @model)}}