fix: 🐛 update @name attribute for RadioCard Groups (#2617)
✅ Closes: https://hashicorp.atlassian.net/browse/ICU-15676
This commit is contained in:
1 parent
8874d0be86
commit
078e36f9b8
19 files changed
+64
-32
No files matched your search
@@ -18,6 +18,8 @@ description:
|
||||
type:
|
||||
label: Type
|
||||
help: The type of the resource, to help differentiate schemas
|
||||
plugin_type:
|
||||
label: plugin_type
|
||||
login_name:
|
||||
label: Login Name
|
||||
help: The account login name
|
||||
|
||||
@@ -56,7 +56,11 @@
|
||||
{{t 'resources.alias.description'}}
|
||||
</F.HelperText>
|
||||
<F.Control>
|
||||
<Hds::Form::RadioCard::Group @name='type' @alignment='center' as |G|>
|
||||
<Hds::Form::RadioCard::Group
|
||||
@name={{t 'form.type.label'}}
|
||||
@alignment='center'
|
||||
as |G|
|
||||
>
|
||||
<G.Legend>{{t 'resources.target.form.type.label'}}</G.Legend>
|
||||
<G.RadioCard @maxWidth='15rem' @checked='true' @disabled='true' as |R|>
|
||||
<R.Label>{{t 'resources.alias.form.type.label'}}</R.Label>
|
||||
|
||||
@@ -52,7 +52,11 @@
|
||||
</Hds::Form::Textarea::Field>
|
||||
|
||||
{{#if (and @model.isNew (feature-flag 'ssh-target'))}}
|
||||
<Hds::Form::RadioCard::Group @name='type' @alignment='center' as |G|>
|
||||
<Hds::Form::RadioCard::Group
|
||||
@name={{t 'form.type.label'}}
|
||||
@alignment='center'
|
||||
as |G|
|
||||
>
|
||||
<G.Legend>{{t 'form.type.label'}}</G.Legend>
|
||||
{{#each this.types as |type|}}
|
||||
<G.RadioCard
|
||||
|
||||
@@ -54,7 +54,11 @@
|
||||
</Hds::Form::Textarea::Field>
|
||||
|
||||
{{#if @model.isNew}}
|
||||
<Hds::Form::RadioCard::Group @name='type' @alignment='center' as |G|>
|
||||
<Hds::Form::RadioCard::Group
|
||||
@name={{t 'form.type.label'}}
|
||||
@alignment='center'
|
||||
as |G|
|
||||
>
|
||||
<G.Legend>{{t 'form.type.label'}}</G.Legend>
|
||||
{{#each this.types as |type|}}
|
||||
<G.RadioCard
|
||||
|
||||
@@ -54,11 +54,14 @@
|
||||
{{#if (feature-flag 'static-credentials')}}
|
||||
{{#if @model.isNew}}
|
||||
|
||||
<Hds::Form::RadioCard::Group @alignment='center' as |G|>
|
||||
<Hds::Form::RadioCard::Group
|
||||
@name={{t 'form.type.label'}}
|
||||
@alignment='center'
|
||||
as |G|
|
||||
>
|
||||
<G.Legend>{{t 'form.type.label'}}</G.Legend>
|
||||
{{#each-in this.mapResourceTypeWithIcon as |credentialStoreType icon|}}
|
||||
<G.RadioCard
|
||||
@name={{credentialStoreType}}
|
||||
@value={{credentialStoreType}}
|
||||
@checked={{eq credentialStoreType @model.type}}
|
||||
@maxWidth='20rem'
|
||||
|
||||
@@ -54,11 +54,14 @@
|
||||
|
||||
{{#if (feature-flag 'static-credentials')}}
|
||||
{{#if @model.isNew}}
|
||||
<Hds::Form::RadioCard::Group @alignment='center' as |G|>
|
||||
<Hds::Form::RadioCard::Group
|
||||
@name={{t 'form.type.label'}}
|
||||
@alignment='center'
|
||||
as |G|
|
||||
>
|
||||
<G.Legend>{{t 'form.type.label'}}</G.Legend>
|
||||
{{#each-in this.mapResourceTypeWithIcon as |credentialStoreType icon|}}
|
||||
<G.RadioCard
|
||||
@name={{credentialStoreType}}
|
||||
@value={{credentialStoreType}}
|
||||
@checked={{eq credentialStoreType @model.type}}
|
||||
@maxWidth='20rem'
|
||||
|
||||
@@ -53,11 +53,10 @@
|
||||
</Hds::Form::Textarea::Field>
|
||||
|
||||
{{#if @model.isNew}}
|
||||
<Hds::Form::RadioCard::Group as |G|>
|
||||
<Hds::Form::RadioCard::Group @name={{t 'form.type.label'}} as |G|>
|
||||
<G.Legend>{{t 'form.type.label'}}</G.Legend>
|
||||
{{#each @types as |credentialType|}}
|
||||
<G.RadioCard
|
||||
@name={{credentialType}}
|
||||
@value={{credentialType}}
|
||||
@checked={{eq credentialType @model.type}}
|
||||
@maxWidth='20rem'
|
||||
|
||||
@@ -52,11 +52,10 @@
|
||||
{{/if}}
|
||||
</Hds::Form::Textarea::Field>
|
||||
{{#if @model.isNew}}
|
||||
<Hds::Form::RadioCard::Group @name='type' as |G|>
|
||||
<Hds::Form::RadioCard::Group @name={{t 'form.type.label'}} as |G|>
|
||||
<G.Legend>{{t 'form.type.label'}}</G.Legend>
|
||||
{{#each @types as |credentialType|}}
|
||||
<G.RadioCard
|
||||
@name={{credentialType}}
|
||||
@value={{credentialType}}
|
||||
@maxWidth='20rem'
|
||||
@checked={{eq credentialType @model.type}}
|
||||
|
||||
@@ -53,11 +53,10 @@
|
||||
</Hds::Form::Textarea::Field>
|
||||
|
||||
{{#if @model.isNew}}
|
||||
<Hds::Form::RadioCard::Group @name='type' as |G|>
|
||||
<Hds::Form::RadioCard::Group @name={{t 'form.type.label'}} as |G|>
|
||||
<G.Legend>{{t 'form.type.label'}}</G.Legend>
|
||||
{{#each @types as |credentialType|}}
|
||||
<G.RadioCard
|
||||
@name={{credentialType}}
|
||||
@value={{credentialType}}
|
||||
@maxWidth='20rem'
|
||||
@checked={{eq credentialType @model.type}}
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</Hds::Form::Textarea::Field>
|
||||
|
||||
{{#if @model.isNew}}
|
||||
<Hds::Form::RadioCard::Group @name='type' as |G|>
|
||||
<Hds::Form::RadioCard::Group @name={{t 'form.type.label'}} as |G|>
|
||||
<G.Legend>
|
||||
{{t 'form.type.label'}}
|
||||
</G.Legend>
|
||||
@@ -83,7 +83,11 @@
|
||||
</G.RadioCard>
|
||||
{{/each}}
|
||||
</Hds::Form::RadioCard::Group>
|
||||
<Hds::Form::RadioCard::Group @name='plugin_type' @alignment='center' as |G|>
|
||||
<Hds::Form::RadioCard::Group
|
||||
@name={{t 'form.plugin_type.label'}}
|
||||
@alignment='center'
|
||||
as |G|
|
||||
>
|
||||
<G.Legend>
|
||||
{{t 'titles.provider'}}
|
||||
</G.Legend>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
</Hds::Form::Textarea::Field>
|
||||
|
||||
{{#if @model.isNew}}
|
||||
<Hds::Form::RadioCard::Group @name='type' as |G|>
|
||||
<Hds::Form::RadioCard::Group @name={{t 'form.type.label'}} as |G|>
|
||||
<G.Legend>{{t 'form.type.label'}}</G.Legend>
|
||||
{{#each this.hostCatalogTypes as |hostCatalogType|}}
|
||||
<G.RadioCard
|
||||
@@ -69,7 +69,11 @@
|
||||
</G.RadioCard>
|
||||
{{/each}}
|
||||
</Hds::Form::RadioCard::Group>
|
||||
<Hds::Form::RadioCard::Group @name='plugin_type' @alignment='center' as |G|>
|
||||
<Hds::Form::RadioCard::Group
|
||||
@name={{t 'form.plugin_type.label'}}
|
||||
@alignment='center'
|
||||
as |G|
|
||||
>
|
||||
<G.Legend>{{t 'titles.provider'}}</G.Legend>
|
||||
<G.Legend>{{t 'titles.choose-a-provider'}}</G.Legend>
|
||||
<G.HelperText>{{concat
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
{{#if @model.isNew}}
|
||||
|
||||
<Hds::Form::RadioCard::Group @name='type' as |G|>
|
||||
<Hds::Form::RadioCard::Group @name={{t 'form.type.label'}} as |G|>
|
||||
<G.Legend>{{t 'form.type.label'}}</G.Legend>
|
||||
{{#each this.hostCatalogTypes as |hostCatalogType|}}
|
||||
<G.RadioCard
|
||||
|
||||
@@ -115,7 +115,11 @@
|
||||
{{/if}}
|
||||
|
||||
{{! Provider / plugin.name }}
|
||||
<Hds::Form::RadioCard::Group @name='plugin_type' @alignment='center' as |G|>
|
||||
<Hds::Form::RadioCard::Group
|
||||
@name={{t 'form.plugin_type.label'}}
|
||||
@alignment='center'
|
||||
as |G|
|
||||
>
|
||||
<G.Legend>{{t 'titles.provider'}}</G.Legend>
|
||||
<G.HelperText>{{t 'descriptions.choose-a-provider'}}</G.HelperText>
|
||||
|
||||
@@ -212,11 +216,10 @@
|
||||
</Hds::Form::TextInput::Field>
|
||||
|
||||
{{! credential_type }}
|
||||
<Hds::Form::RadioCard::Group name='credential_type' as |G|>
|
||||
<Hds::Form::RadioCard::Group @name={{t 'form.type.label'}} as |G|>
|
||||
<G.Legend>{{t 'resources.storage-bucket.types.credential'}}</G.Legend>
|
||||
{{#each this.credentials as |credentialType|}}
|
||||
<G.RadioCard
|
||||
@name={{credentialType}}
|
||||
@value={{credentialType}}
|
||||
@checked={{eq credentialType this.selectedCredentialType}}
|
||||
@disabled={{form.disabled}}
|
||||
|
||||
@@ -115,7 +115,11 @@
|
||||
{{/if}}
|
||||
|
||||
{{! Provider / plugin.name }}
|
||||
<Hds::Form::RadioCard::Group @name='plugin_type' @alignment='center' as |G|>
|
||||
<Hds::Form::RadioCard::Group
|
||||
@name={{t 'form.plugin_type.label'}}
|
||||
@alignment='center'
|
||||
as |G|
|
||||
>
|
||||
<G.Legend>{{t 'titles.provider'}}</G.Legend>
|
||||
<G.HelperText>{{t 'descriptions.choose-a-provider'}}</G.HelperText>
|
||||
|
||||
|
||||
@@ -53,7 +53,11 @@
|
||||
</Hds::Form::Textarea::Field>
|
||||
|
||||
{{#if (and @model.isNew (feature-flag 'ssh-target'))}}
|
||||
<Hds::Form::RadioCard::Group @name='type' @alignment='center' as |G|>
|
||||
<Hds::Form::RadioCard::Group
|
||||
@name={{t 'form.type.label'}}
|
||||
@alignment='center'
|
||||
as |G|
|
||||
>
|
||||
<G.Legend>{{t 'resources.target.form.type.label'}}</G.Legend>
|
||||
<G.HelperText>{{t 'resources.target.form.type.help'}}</G.HelperText>
|
||||
{{#each this.typeMetas as |type|}}
|
||||
|
||||
@@ -21,7 +21,7 @@ module('Acceptance | host-catalogs | create', function (hooks) {
|
||||
|
||||
const NAME_INPUT_SELECTOR = '[name="name"]';
|
||||
const DESCRIPTION_INPUT_SELECTOR = '[name="description"]';
|
||||
const TYPE_INPUT_SELECTOR = '[name="type"]';
|
||||
const TYPE_INPUT_SELECTOR = '[name="Type"]';
|
||||
const SAVE_BUTTON_SELECTOR = '[type="submit"]';
|
||||
const CANCEL_BUTTON_SELECTOR = '.rose-form-actions [type="button"]';
|
||||
const ALERT_TEXT_SELECTOR =
|
||||
|
||||
@@ -148,9 +148,7 @@ module('Acceptance | storage-buckets | create', function (hooks) {
|
||||
await fillIn(commonSelectors.FIELD_NAME, commonSelectors.FIELD_NAME_VALUE);
|
||||
|
||||
// There are 2 credential types
|
||||
assert
|
||||
.dom(`${selectors.GROUP_CREDENTIAL_TYPE} .hds-form-radio-card`)
|
||||
.exists({ count: 2 });
|
||||
assert.dom(selectors.GROUP_CREDENTIAL_TYPE).exists({ count: 2 });
|
||||
|
||||
await click(selectors.FIELD_DYNAMIC_CREDENTIAL);
|
||||
await fillIn(selectors.FIELD_ROLE_ARN, selectors.FIELD_ROLE_ARN_VALUE);
|
||||
@@ -172,9 +170,7 @@ module('Acceptance | storage-buckets | create', function (hooks) {
|
||||
|
||||
await click(`[href="${urls.newStorageBucket}"]`);
|
||||
await fillIn(commonSelectors.FIELD_NAME, commonSelectors.FIELD_NAME_VALUE);
|
||||
assert
|
||||
.dom(`${selectors.GROUP_CREDENTIAL_TYPE} .hds-form-radio-card`)
|
||||
.exists({ count: 2 });
|
||||
assert.dom(selectors.GROUP_CREDENTIAL_TYPE).exists({ count: 2 });
|
||||
|
||||
await click(selectors.FIELD_STATIC_CREDENTIAL);
|
||||
await fillIn(selectors.FIELD_ACCESS_KEY, selectors.FIELD_ACCESS_KEY_VALUE);
|
||||
|
||||
@@ -14,7 +14,7 @@ export const FIELD_BUCKET_NAME_VALUE = 'Test Bucket name';
|
||||
export const FIELD_BUCKET_NAME_ERROR = '[data-test-bucket-name-error]';
|
||||
export const FIELD_BUCKET_PREFIX = '[name=bucket_prefix]';
|
||||
export const FIELD_REGION = '[name=region]';
|
||||
export const GROUP_CREDENTIAL_TYPE = '[name=credential_type]';
|
||||
export const GROUP_CREDENTIAL_TYPE = '[name=Type]';
|
||||
export const FIELD_STATIC_CREDENTIAL = '[value=static]';
|
||||
export const FIELD_DYNAMIC_CREDENTIAL = '[value=dynamic]';
|
||||
export const FIELD_ROLE_ARN = '[name=role_arn]';
|
||||
|
||||
@@ -85,7 +85,7 @@ module('Acceptance | targets | create', function (hooks) {
|
||||
test('defaults to type `ssh` when no query param provided', async function (assert) {
|
||||
featuresService.enable('ssh-target');
|
||||
await visit(urls.newTarget);
|
||||
assert.strictEqual(find('[name="type"]:checked').value, TYPE_TARGET_SSH);
|
||||
assert.strictEqual(find('[name="Type"]:checked').value, TYPE_TARGET_SSH);
|
||||
});
|
||||
|
||||
test('can create a type `ssh` target', async function (assert) {
|
||||
|
||||
Reference in new issue
Block a user