Files
threshold-ui/ui/admin/app/components/form/scope/index.hbs
T

62 lines
1.6 KiB
Handlebars
Raw Normal View History

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
}}
2020-06-24 17:10:54 -04:00
<Rose::Form
@onSubmit={{@submit}}
@cancel={{@cancel}}
@disabled={{@model.isSaving}}
@showEditToggle={{if @model.isNew false true}}
2020-06-24 17:10:54 -04:00
as |form|
>
<Hds::Form::TextInput::Field
@isOptional={{true}}
2020-06-24 17:10:54 -04:00
@value={{@model.name}}
@isInvalid={{@model.errors.name}}
@type='text'
name='name'
disabled={{form.disabled}}
{{on 'input' (set-from-event @model 'name')}}
as |F|
>
<F.Label>{{t 'form.name.label'}}</F.Label>
<F.HelperText>{{t 'form.name.help'}}</F.HelperText>
2020-06-24 17:10:54 -04:00
{{#if @model.errors.name}}
<F.Error as |E|>
2020-06-24 17:10:54 -04:00
{{#each @model.errors.name as |error|}}
<E.Message>{{error.message}}</E.Message>
2020-06-24 17:10:54 -04:00
{{/each}}
</F.Error>
2020-06-24 17:10:54 -04:00
{{/if}}
</Hds::Form::TextInput::Field>
2020-06-24 17:10:54 -04:00
<Hds::Form::Textarea::Field
@isOptional={{true}}
2020-06-24 17:10:54 -04:00
@value={{@model.description}}
@isInvalid={{@model.errors.description}}
name='description'
disabled={{form.disabled}}
as |F|
>
<F.Label>{{t 'form.description.label'}}</F.Label>
<F.HelperText>{{t 'form.description.help'}}</F.HelperText>
2020-06-24 17:10:54 -04:00
{{#if @model.errors.description}}
<F.Error as |E|>
2020-06-24 17:10:54 -04:00
{{#each @model.errors.description as |error|}}
<E.Message>{{error.message}}</E.Message>
2020-06-24 17:10:54 -04:00
{{/each}}
</F.Error>
2020-06-24 17:10:54 -04:00
{{/if}}
</Hds::Form::Textarea::Field>
2020-06-24 17:10:54 -04:00
2021-08-31 15:03:40 -04:00
{{#if (can 'save model' @model)}}
<form.actions
@enableEditText={{t 'actions.edit-form'}}
@submitText={{t 'actions.save'}}
@cancelText={{t 'actions.cancel'}}
/>
{{/if}}
2020-06-24 17:10:54 -04:00
2022-10-06 11:41:12 -04:00
</Rose::Form>