2023-03-01 09:39:41 -06:00
|
|
|
{{!
|
|
|
|
|
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}}
|
2020-09-25 19:07:56 -04:00
|
|
|
@showEditToggle={{if @model.isNew false true}}
|
2020-06-24 17:10:54 -04:00
|
|
|
as |form|
|
|
|
|
|
>
|
|
|
|
|
|
2022-11-15 08:53:10 -08:00
|
|
|
<Hds::Form::TextInput::Field
|
2022-11-15 09:34:25 -08:00
|
|
|
@isOptional={{true}}
|
2020-06-24 17:10:54 -04:00
|
|
|
@value={{@model.name}}
|
2022-11-15 08:53:10 -08:00
|
|
|
@isInvalid={{@model.errors.name}}
|
|
|
|
|
@type='text'
|
|
|
|
|
name='name'
|
|
|
|
|
disabled={{form.disabled}}
|
|
|
|
|
{{on 'input' (set-from-event @model 'name')}}
|
|
|
|
|
as |F|
|
2021-05-11 14:13:24 -04:00
|
|
|
>
|
2022-11-15 08:53:10 -08:00
|
|
|
<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}}
|
2022-11-15 08:53:10 -08:00
|
|
|
<F.Error as |E|>
|
2020-06-24 17:10:54 -04:00
|
|
|
{{#each @model.errors.name as |error|}}
|
2022-11-15 08:53:10 -08:00
|
|
|
<E.Message>{{error.message}}</E.Message>
|
2020-06-24 17:10:54 -04:00
|
|
|
{{/each}}
|
2022-11-15 08:53:10 -08:00
|
|
|
</F.Error>
|
2020-06-24 17:10:54 -04:00
|
|
|
{{/if}}
|
2022-11-15 08:53:10 -08:00
|
|
|
</Hds::Form::TextInput::Field>
|
2020-06-24 17:10:54 -04:00
|
|
|
|
2022-11-15 08:53:10 -08:00
|
|
|
<Hds::Form::Textarea::Field
|
2022-11-15 09:34:25 -08:00
|
|
|
@isOptional={{true}}
|
2020-06-24 17:10:54 -04:00
|
|
|
@value={{@model.description}}
|
2022-11-15 08:53:10 -08:00
|
|
|
@isInvalid={{@model.errors.description}}
|
|
|
|
|
name='description'
|
|
|
|
|
disabled={{form.disabled}}
|
|
|
|
|
as |F|
|
2021-05-11 14:13:24 -04:00
|
|
|
>
|
2022-11-15 08:53:10 -08:00
|
|
|
<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}}
|
2022-11-15 08:53:10 -08:00
|
|
|
<F.Error as |E|>
|
2020-06-24 17:10:54 -04:00
|
|
|
{{#each @model.errors.description as |error|}}
|
2022-11-15 08:53:10 -08:00
|
|
|
<E.Message>{{error.message}}</E.Message>
|
2020-06-24 17:10:54 -04:00
|
|
|
{{/each}}
|
2022-11-15 08:53:10 -08:00
|
|
|
</F.Error>
|
2020-06-24 17:10:54 -04:00
|
|
|
{{/if}}
|
2022-11-15 08:53:10 -08:00
|
|
|
</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>
|