refactor: migrate to HDS select form fields (#1447)
* chore: 🤖 install HDS and associated assets * chore: 🤖 bump HDS version * refactor: 💡 optimize hds/icon addon content build * test: 💍 fix intermittent test failure * refactor: 💡 replace auth method selects with HDS select * refactor: 💡 update storybook and tests to reflect HDS selects * style: 💄 fix style linting issue * fix: 🐛 fix bad scss syntax * fix: 🐛 fix scss syntax again * refactor: 💡 remove references to rose/form/select * chore: 🤖 experimental HDS dark mode * refactor: 💡 add custom set helper to replace action helper * chore: 🤖 remove HDS dark mode, to be implemented in another pr * refactor: 💡 apply custom dark mode for HDS * chore: 🤖 add tier 2 color tweaks for better dark mode contrast * chore: 🤖 tweak HDS form borders in dark mode * docs: ✏️ add set function comment Co-authored-by: Dharini Jeeva <dharini@hashicorp.com>
This commit is contained in:
1 parent
87b1fb1c5c
commit
02b6afa5e7
18 files changed
+228
-481
No files matched your search
@@ -155,22 +155,27 @@
|
||||
{{#each @model.attributes.signing_algorithms as |algorithm i|}}
|
||||
<body.row as |row|>
|
||||
<row.cell>
|
||||
<form.select
|
||||
|
||||
<Hds::Form::Select::Field
|
||||
@value={{algorithm.value}}
|
||||
@error={{@model.errors.attributes_signing_algorithms}}
|
||||
@contextual={{true}}
|
||||
@onChange={{fn (mut algorithm.value)}}
|
||||
as |field|
|
||||
@isInvalid={{@model.errors.attributes_signing_algorithms}}
|
||||
disabled={{form.disabled}}
|
||||
{{on 'change' (set-from-event algorithm 'value')}}
|
||||
as |F|
|
||||
>
|
||||
<field.label>{{t 'form.algorithm.label'}}</field.label>
|
||||
<field.field as |select|>
|
||||
{{#each this.signingAlgorithms as |algorithm|}}
|
||||
<select.option
|
||||
@value={{algorithm}}
|
||||
>{{algorithm}}</select.option>
|
||||
<F.Label class='sr-only'>{{t
|
||||
'form.algorithm.label'
|
||||
}}</F.Label>
|
||||
<F.Options>
|
||||
{{#each this.signingAlgorithms as |algorithmOption|}}
|
||||
<option
|
||||
value={{algorithmOption}}
|
||||
selected={{eq algorithmOption algorithm.value}}
|
||||
>{{algorithmOption}}</option>
|
||||
{{/each}}
|
||||
</field.field>
|
||||
</form.select>
|
||||
</F.Options>
|
||||
</Hds::Form::Select::Field>
|
||||
|
||||
</row.cell>
|
||||
<row.cell @shrink={{true}}>
|
||||
<Rose::Button
|
||||
@@ -195,22 +200,26 @@
|
||||
|
||||
<body.row as |row|>
|
||||
<row.cell>
|
||||
<form.select
|
||||
|
||||
<Hds::Form::Select::Field
|
||||
@value={{this.newSigningAlgorithm}}
|
||||
@label={{t
|
||||
'resources.auth-method.titles.new-signing-algorithm'
|
||||
}}
|
||||
@onChange={{fn (mut this.newSigningAlgorithm)}}
|
||||
as |field|
|
||||
disabled={{form.disabled}}
|
||||
{{on 'change' (set-from-event this 'newSigningAlgorithm')}}
|
||||
as |F|
|
||||
>
|
||||
<field.field as |select|>
|
||||
{{#each this.signingAlgorithms as |algorithm|}}
|
||||
<select.option
|
||||
@value={{algorithm}}
|
||||
>{{algorithm}}</select.option>
|
||||
<F.Label class='sr-only'>{{t
|
||||
'resources.auth-method.titles.new-signing-algorithm'
|
||||
}}</F.Label>
|
||||
<F.Options>
|
||||
{{#each this.signingAlgorithms as |algorithmOption|}}
|
||||
<option
|
||||
value={{algorithmOption}}
|
||||
selected={{eq algorithmOption this.newSigningAlgorithm}}
|
||||
>{{algorithmOption}}</option>
|
||||
{{/each}}
|
||||
</field.field>
|
||||
</form.select>
|
||||
</F.Options>
|
||||
</Hds::Form::Select::Field>
|
||||
|
||||
</row.cell>
|
||||
<row.cell @shrink={{true}}>
|
||||
<Rose::Button
|
||||
@@ -455,22 +464,25 @@
|
||||
</form.input>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<form.select
|
||||
|
||||
<Hds::Form::Select::Field
|
||||
@value={{claimMap.to}}
|
||||
@error={{@model.errors.attributes_account_claim_maps}}
|
||||
@contextual={{true}}
|
||||
@onChange={{fn (mut claimMap.to)}}
|
||||
as |field|
|
||||
@isInvalid={{@model.errors.attributes_account_claim_maps}}
|
||||
disabled={{form.disabled}}
|
||||
{{on 'change' (set-from-event claimMap 'to')}}
|
||||
as |F|
|
||||
>
|
||||
<field.label>{{t 'form.to_claim.label'}}</field.label>
|
||||
<field.field as |select|>
|
||||
{{#each this.toClaims as |toClaim|}}
|
||||
<select.option
|
||||
@value={{toClaim}}
|
||||
>{{toClaim}}</select.option>
|
||||
<F.Label class='sr-only'>{{t 'form.to_claim.label'}}</F.Label>
|
||||
<F.Options>
|
||||
{{#each this.toClaims as |toClaimOption|}}
|
||||
<option
|
||||
value={{toClaimOption}}
|
||||
selected={{eq toClaimOption claimMap.to}}
|
||||
>{{toClaimOption}}</option>
|
||||
{{/each}}
|
||||
</field.field>
|
||||
</form.select>
|
||||
</F.Options>
|
||||
</Hds::Form::Select::Field>
|
||||
|
||||
</row.cell>
|
||||
<row.cell @shrink={{true}}>
|
||||
<Rose::Button
|
||||
@@ -502,20 +514,26 @@
|
||||
/>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<form.select
|
||||
|
||||
<Hds::Form::Select::Field
|
||||
@value={{this.newToClaim}}
|
||||
@label={{t 'resources.auth-method.titles.new-to-claim'}}
|
||||
@onChange={{fn (mut this.newToClaim)}}
|
||||
as |field|
|
||||
disabled={{form.disabled}}
|
||||
{{on 'change' (set-from-event this 'newToClaim')}}
|
||||
as |F|
|
||||
>
|
||||
<field.field as |select|>
|
||||
{{#each this.toClaims as |toClaim|}}
|
||||
<select.option
|
||||
@value={{toClaim}}
|
||||
>{{toClaim}}</select.option>
|
||||
<F.Label class='sr-only'>{{t
|
||||
'resources.auth-method.titles.new-to-claim'
|
||||
}}</F.Label>
|
||||
<F.Options>
|
||||
{{#each this.toClaims as |toClaimOption|}}
|
||||
<option
|
||||
value={{toClaimOption}}
|
||||
selected={{eq toClaimOption this.newToClaim}}
|
||||
>{{toClaimOption}}</option>
|
||||
{{/each}}
|
||||
</field.field>
|
||||
</form.select>
|
||||
</F.Options>
|
||||
</Hds::Form::Select::Field>
|
||||
|
||||
</row.cell>
|
||||
<row.cell @shrink={{true}}>
|
||||
<Rose::Button
|
||||
|
||||
Reference in new issue
Block a user