Files
threshold-ui/ui/admin/app/components/form/policy/policy-selection/index.hbs
T
Dharini Jeeva 276713697a chore: 🤖 move overridable next to select (#2092)
* chore: 🤖 move overridable next to select

* fix: 🐛 lint
2024-01-12 17:20:30 -08:00

71 lines
2.2 KiB
Handlebars

<Hds::Form::Fieldset @isRequired={{true}} class='policy' as |F|>
<F.Legend>{{t (concat 'resources.policy.form.' @name '.label')}}</F.Legend>
<F.HelperText>
{{t (concat 'resources.policy.form.' @name '.help')}}
</F.HelperText>
<F.Control>
<Hds::Form::Select::Field
name={{@name}}
disabled={{or @disabled this.isDeleteDisable}}
aria-label={{t (concat 'resources.policy.form.' @name '.label')}}
@width='70%'
{{on 'change' this.handlePolicyTypeSelection}}
as |F|
>
<F.Options>
<option disabled hidden selected value=''>
{{t 'titles.choose-an-option'}}
</option>
{{#each-in @options as |key value|}}
<option value={{value}} selected={{eq key @selectedOption}}>
{{t
(concat 'resources.policy.form.' @name '_options.' key '.label')
}}
</option>
{{/each-in}}
</F.Options>
</Hds::Form::Select::Field>
{{#if @model.scope.isGlobal}}
<Hds::Form::Toggle::Field
checked={{this.isOverridable}}
disabled={{@disabled}}
name={{@customInputName}}
{{on 'change' this.handleOverridableToggle}}
as |F|
>
<F.Label>{{t 'resources.policy.form.overridable.label'}}</F.Label>
</Hds::Form::Toggle::Field>
{{/if}}
</F.Control>
</Hds::Form::Fieldset>
{{#if this.showCustomInput}}
<Hds::Form::Field class='policy-custom-input' @layout='vertical' as |F|>
<F.Label>{{t (concat 'resources.policy.titles.' @customInputName)}}
</F.Label>
<F.Control>
<Hds::SegmentedGroup as |S|>
<S.TextInput
@value={{@inputValue}}
disabled={{@disabled}}
aria-label={{t 'resources.policy.title'}}
{{on 'input' this.handleInputChange}}
name={{@customInputName}}
data-input-type={{@customInputName}}
/>
<S.Generic>
<Hds::Badge
class={{if @disabled 'disabled'}}
@text={{t 'resources.policy.titles.days'}}
@color='neutral'
@type='outlined'
/>
</S.Generic>
</Hds::SegmentedGroup>
</F.Control>
</Hds::Form::Field>
{{/if}}