Icu 12567 add new field credential mapping overrides (#2156)
* chore: 🤖 add credential type select list
This commit is contained in:
1 parent
956f6fd04d
commit
93c8d481fd
14 files changed
+517
-36
No files matched your search
@@ -113,7 +113,7 @@
|
||||
@width='100%'
|
||||
name='credential_type'
|
||||
disabled={{or form.disabled (not @model.isNew)}}
|
||||
{{on 'input' (set-from-event @model 'credential_type')}}
|
||||
{{on 'input' this.selectCredentialType}}
|
||||
as |F|
|
||||
>
|
||||
<F.Label>
|
||||
@@ -140,6 +140,46 @@
|
||||
{{/if}}
|
||||
</Hds::Form::Select::Field>
|
||||
|
||||
{{#if @model.credential_type}}
|
||||
<Form::Field::ListWrapper
|
||||
@layout='horizontal'
|
||||
@isOptional={{true}}
|
||||
@disabled={{form.disabled}}
|
||||
>
|
||||
<:fieldset as |F|>
|
||||
<F.Legend>
|
||||
{{t
|
||||
'resources.credential-library.form.credential_mapping_overrides.label'
|
||||
}}
|
||||
</F.Legend>
|
||||
<F.HelperText>
|
||||
{{t
|
||||
'resources.credential-library.form.credential_mapping_overrides.help'
|
||||
}}
|
||||
</F.HelperText>
|
||||
|
||||
{{#if @model.errors.credential_mapping_overrides}}
|
||||
<F.Error as |E|>
|
||||
{{#each @model.errors.credential_mapping_overrides as |error|}}
|
||||
<E.Message>{{error.message}}</E.Message>
|
||||
{{/each}}
|
||||
</F.Error>
|
||||
{{/if}}
|
||||
</:fieldset>
|
||||
|
||||
<:field as |F|>
|
||||
<F.SelectText
|
||||
@name='credential_mapping_overrides'
|
||||
@selectOptions={{this.mappingOverrides}}
|
||||
@model={{@model}}
|
||||
@disabled={{form.disabled}}
|
||||
@removeDuplicates={{true}}
|
||||
@width='400px'
|
||||
/>
|
||||
</:field>
|
||||
</Form::Field::ListWrapper>
|
||||
{{/if}}
|
||||
|
||||
<Hds::Form::Radio::Group
|
||||
disabled={{form.disabled}}
|
||||
{{on 'input' (set-from-event @model 'http_method')}}
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
options,
|
||||
TYPES_CREDENTIAL_LIBRARY,
|
||||
} from 'api/models/credential-library';
|
||||
|
||||
import { action } from '@ember/object';
|
||||
export default class FormCredentialLibraryVaultGenericComponent extends Component {
|
||||
// =properties
|
||||
/**
|
||||
@@ -30,4 +30,17 @@ export default class FormCredentialLibraryVaultGenericComponent extends Componen
|
||||
get isHttpRequestBodyAllowed() {
|
||||
return this.args.model.http_method?.match(/post/i);
|
||||
}
|
||||
|
||||
get mappingOverrides() {
|
||||
return options.mapping_overrides[this.args.model.credential_type];
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the previously selected key value pair when toggling between credential types on a new form
|
||||
*/
|
||||
@action
|
||||
selectCredentialType({ target: { value } }) {
|
||||
this.args.model.credential_mapping_overrides = {};
|
||||
this.args.model.credential_type = value;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user