migrate ldap list wrapper fields (#3162)
This commit is contained in:
1 parent
71ec7b465a
commit
4e2b779d96
12 files changed
+163
-136
No files matched your search
@@ -150,9 +150,9 @@
|
||||
<Form::Field::KeyValue
|
||||
@name='signing_algorithms'
|
||||
@data={{@model.signing_algorithms}}
|
||||
@onAdd={{fn this.addRow 'signing_algorithms' this.createEmptyValue}}
|
||||
@onRemove={{fn this.removeRow 'signing_algorithms' this.createEmptyValue}}
|
||||
@onUpdate={{fn this.updateRow 'signing_algorithms'}}
|
||||
@onAdd={{fn @addRow 'signing_algorithms' (array 'value')}}
|
||||
@onRemove={{fn @removeRow 'signing_algorithms'}}
|
||||
@onUpdate={{fn @updateRow 'signing_algorithms'}}
|
||||
@legend={{t 'form.signing_algorithms.label'}}
|
||||
@helperText={{t 'form.signing_algorithms.help'}}
|
||||
@errors={{@model.errors.signing_algorithms}}
|
||||
@@ -162,7 +162,7 @@
|
||||
<:row as |R|>
|
||||
<R.Field as |F|>
|
||||
<F.Select
|
||||
data-test-value-input
|
||||
data-test-value-select
|
||||
{{on 'change' (fn R.updateRow 'value')}}
|
||||
>
|
||||
<option disabled hidden selected value=''>
|
||||
@@ -188,9 +188,9 @@
|
||||
<Form::Field::KeyValue
|
||||
@name='allowed_audiences'
|
||||
@data={{@model.allowed_audiences}}
|
||||
@onAdd={{fn this.addRow 'allowed_audiences' this.createEmptyValue}}
|
||||
@onRemove={{fn this.removeRow 'allowed_audiences' this.createEmptyValue}}
|
||||
@onUpdate={{fn this.updateRow 'allowed_audiences'}}
|
||||
@onAdd={{fn @addRow 'allowed_audiences' (array 'value')}}
|
||||
@onRemove={{fn @removeRow 'allowed_audiences'}}
|
||||
@onUpdate={{fn @updateRow 'allowed_audiences'}}
|
||||
@legend={{t 'form.allowed_audiences.label'}}
|
||||
@helperText={{t 'form.allowed_audiences.help'}}
|
||||
@errors={{@model.errors.allowed_audiences}}
|
||||
@@ -215,9 +215,9 @@
|
||||
<Form::Field::KeyValue
|
||||
@name='claims_scopes'
|
||||
@data={{@model.claims_scopes}}
|
||||
@onAdd={{fn this.addRow 'claims_scopes' this.createEmptyValue}}
|
||||
@onRemove={{fn this.removeRow 'claims_scopes' this.createEmptyValue}}
|
||||
@onUpdate={{fn this.updateRow 'claims_scopes'}}
|
||||
@onAdd={{fn @addRow 'claims_scopes' (array 'value')}}
|
||||
@onRemove={{fn @removeRow 'claims_scopes'}}
|
||||
@onUpdate={{fn @updateRow 'claims_scopes'}}
|
||||
@legend={{t 'form.claims_scopes.label'}}
|
||||
@helperText={{t 'form.claims_scopes.help'}}
|
||||
@errors={{@model.errors.claims_scopes}}
|
||||
@@ -242,13 +242,9 @@
|
||||
<Form::Field::KeyValue
|
||||
@name='account_claim_maps'
|
||||
@data={{@model.account_claim_maps}}
|
||||
@onAdd={{fn this.addRow 'account_claim_maps' this.createEmptyKeyValue}}
|
||||
@onRemove={{fn
|
||||
this.removeRow
|
||||
'account_claim_maps'
|
||||
this.createEmptyKeyValue
|
||||
}}
|
||||
@onUpdate={{fn this.updateRow 'account_claim_maps'}}
|
||||
@onAdd={{fn @addRow 'account_claim_maps' (array 'key' 'value')}}
|
||||
@onRemove={{fn @removeRow 'account_claim_maps'}}
|
||||
@onUpdate={{fn @updateRow 'account_claim_maps'}}
|
||||
@legend={{t 'form.account_claim_maps.label'}}
|
||||
@helperText={{t 'form.account_claim_maps.help'}}
|
||||
@errors={{@model.errors.account_claim_maps}}
|
||||
@@ -268,7 +264,7 @@
|
||||
<R.Field as |F|>
|
||||
<F.Label>{{t 'form.to_claim.label'}}</F.Label>
|
||||
<F.Select
|
||||
data-test-value-input
|
||||
data-test-value-select
|
||||
{{on 'change' (fn R.updateRow 'value')}}
|
||||
>
|
||||
<option disabled hidden selected value=''>
|
||||
@@ -292,9 +288,9 @@
|
||||
<Form::Field::KeyValue
|
||||
@name='idp_ca_certs'
|
||||
@data={{@model.idp_ca_certs}}
|
||||
@onAdd={{fn this.addRow 'idp_ca_certs' this.createEmptyValue}}
|
||||
@onRemove={{fn this.removeRow 'idp_ca_certs' this.createEmptyValue}}
|
||||
@onUpdate={{fn this.updateRow 'idp_ca_certs'}}
|
||||
@onAdd={{fn @addRow 'idp_ca_certs' (array 'value')}}
|
||||
@onRemove={{fn @removeRow 'idp_ca_certs'}}
|
||||
@onUpdate={{fn @updateRow 'idp_ca_certs'}}
|
||||
@legend={{t 'form.idp_ca_certs.label'}}
|
||||
@helperText={{t 'form.idp_ca_certs.help'}}
|
||||
@errors={{@model.errors.idp_ca_certs}}
|
||||
|
||||
@@ -9,11 +9,6 @@ import { action } from '@ember/object';
|
||||
import { tracked } from '@glimmer/tracking';
|
||||
|
||||
export default class FormAuthMethodOidcComponent extends Component {
|
||||
// For fields with just a value property
|
||||
createEmptyValue = () => ({ value: '' });
|
||||
|
||||
// For fields with key and value properties
|
||||
createEmptyKeyValue = () => ({ key: '', value: '' });
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
@@ -59,7 +54,6 @@ export default class FormAuthMethodOidcComponent extends Component {
|
||||
}
|
||||
|
||||
//actions
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
*/
|
||||
@@ -94,34 +88,4 @@ export default class FormAuthMethodOidcComponent extends Component {
|
||||
this.args.model.prompts = [...removeSelection];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a new empty row to account claim maps
|
||||
*/
|
||||
@action
|
||||
addRow(field, emptyRow) {
|
||||
this.args.model[field] = [...this.args.model[field], emptyRow()];
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a row from account claim maps
|
||||
*/
|
||||
@action
|
||||
removeRow(field, emptyRow, rowData) {
|
||||
let rows = this.args.model[field].filter((item) => item !== rowData);
|
||||
// Ensure at least one empty row exists for editing
|
||||
if (rows.length === 0) {
|
||||
rows = [emptyRow()];
|
||||
}
|
||||
this.args.model[field] = rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the account claim maps in the model
|
||||
*/
|
||||
@action
|
||||
updateRow(field, rowData, property, { target: { value } }) {
|
||||
rowData[property] = value;
|
||||
this.args.model[field] = [...this.args.model[field]];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user