Files
threshold-ui/ui/admin/app/components/form/account/ldap/index.hbs
T
hashicc 72fa6d86c4 Update copyright headers (#3161)
* chore: 🤖 remove hashi copyright .github headers and update config

* chore: 🤖 remove remaining hashicorp copyright headers

* Add missing copyright headers
2026-02-03 12:08:35 -05:00

140 lines
4.2 KiB
Handlebars

{{!
Copyright IBM Corp. 2021, 2026
SPDX-License-Identifier: BUSL-1.1
}}
<Rose::Form
@onSubmit={{@submit}}
@cancel={{@cancel}}
@disabled={{@model.isSaving}}
@showEditToggle={{if @model.isNew false true}}
as |form|
>
<InfoField @value={{@model.type}} disabled={{form.disabled}} as |F|>
<F.Label>{{t 'form.type.label'}}</F.Label>
</InfoField>
<Hds::Form::TextInput::Field
@isOptional={{true}}
name='name'
@value={{@model.name}}
@isInvalid={{@model.errors.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>
{{#if @model.errors.name}}
<F.Error as |E|>
{{#each @model.errors.name as |error|}}
<E.Message>{{error.message}}</E.Message>
{{/each}}
</F.Error>
{{/if}}
</Hds::Form::TextInput::Field>
<Hds::Form::Textarea::Field
@isOptional={{true}}
@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>
{{#if @model.errors.description}}
<F.Error as |E|>
{{#each @model.errors.description as |error|}}
<E.Message>{{error.message}}</E.Message>
{{/each}}
</F.Error>
{{/if}}
</Hds::Form::Textarea::Field>
{{#if @model.isNew}}
<Hds::Form::TextInput::Field
@isRequired={{true}}
name='login_name'
@value={{@model.login_name}}
@isInvalid={{@model.errors.login_name}}
disabled={{form.disabled}}
{{on 'input' (set-from-event @model 'login_name')}}
as |F|
>
<F.Label>{{t 'form.login_name.label'}}</F.Label>
<F.HelperText>{{t 'form.login_name.help'}}</F.HelperText>
{{#if @model.errors.login_name}}
<F.Error as |E|>
{{#each @model.errors.login_name as |error|}}
<E.Message>{{error.message}}</E.Message>
{{/each}}
</F.Error>
{{/if}}
</Hds::Form::TextInput::Field>
{{/if}}
{{#unless @model.isNew}}
<Hds::Form::Fieldset class='ldap-read-only-fields' as |F|>
<F.Control>
<div class='ldap-section'>
<Hds::Text::Display
@tag='h2'
@size='400'
@weight='bold'
class='remove-margin'
>
{{t 'resources.account.title'}}
{{t 'form.other_fields.label'}}
</Hds::Text::Display>
<Hds::Form::HelperText @controlId='helper-text-for-section'>{{t
'form.other_fields.help'
}}</Hds::Form::HelperText>
</div>
{{#if @model.login_name}}
<InfoField @value={{@model.login_name}} as |F|>
<F.Label>{{t 'form.login_name.label'}}</F.Label>
</InfoField>
{{/if}}
{{#if @model.email}}
<InfoField @value={{@model.email}} as |F|>
<F.Label>{{t 'resources.account.form.email.label'}}</F.Label>
</InfoField>
{{/if}}
{{#if @model.full_name}}
<InfoField @value={{@model.full_name}} as |F|>
<F.Label>{{t 'resources.account.form.full_name.label'}}</F.Label>
</InfoField>
{{/if}}
{{#if @model.dn}}
<InfoField @value={{@model.dn}} as |F|>
<F.Label>{{t 'resources.account.form.dn.label'}}</F.Label>
</InfoField>
{{/if}}
{{#if @model.member_of_groups}}
<Hds::Text::Body @tag='p' @size='300' @weight='semibold' class='p'>{{t
'resources.account.form.member_of_groups.label'
}}</Hds::Text::Body>
{{#each @model.member_of_groups as |group|}}
<Hds::Form::TextInput::Field
@value={{group.value}}
disabled={{true}}
/>
{{/each}}
{{/if}}
</F.Control>
</Hds::Form::Fieldset>
{{/unless}}
{{#if (can 'save model' @model)}}
<form.actions
@enableEditText={{t 'actions.edit-form'}}
@submitText={{t 'actions.save'}}
@cancelText={{t 'actions.cancel'}}
/>
{{/if}}
</Rose::Form>