feat: 🎸 add account claim map support
This commit is contained in:
4 files changed
+55
-1
No files matched your search
@@ -6,5 +6,6 @@
|
||||
cancel=@cancel
|
||||
removeItemByIndex=@removeItemByIndex
|
||||
addStringItem=@addStringItem
|
||||
addAccountClaimMapItem=@addAccountClaimMapItem
|
||||
}}
|
||||
{{/if}}
|
||||
@@ -472,6 +472,45 @@
|
||||
</row.cell>
|
||||
</body.row>
|
||||
{{/each}}
|
||||
|
||||
<body.row as |row|>
|
||||
<row.cell>
|
||||
<form.input
|
||||
@type='text'
|
||||
@value={{this.newFromClaim}}
|
||||
@label={{t 'resources.auth-method.titles.new-from-claim'}}
|
||||
/>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<form.select
|
||||
@value={{this.newToClaim}}
|
||||
@label={{t 'resources.auth-method.titles.new-to-claim'}}
|
||||
@onChange={{fn (mut this.newToClaim)}}
|
||||
as |field|
|
||||
>
|
||||
<field.field as |select|>
|
||||
{{#each this.toClaims as |toClaim|}}
|
||||
<select.option
|
||||
@value={{toClaim}}
|
||||
>{{toClaim}}</select.option>
|
||||
{{/each}}
|
||||
</field.field>
|
||||
</form.select>
|
||||
</row.cell>
|
||||
<row.cell @shrink={{true}}>
|
||||
<Rose::Button
|
||||
@style='secondary'
|
||||
title={{t 'actions.add'}}
|
||||
@disabled={{if form.isEditable false true}}
|
||||
{{on
|
||||
'click'
|
||||
(fn @addAccountClaimMapItem this.newFromClaim this.newToClaim)
|
||||
}}
|
||||
>
|
||||
{{t 'actions.add'}}
|
||||
</Rose::Button>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
</table.body>
|
||||
</Rose::Table>
|
||||
</:body>
|
||||
|
||||
@@ -151,7 +151,7 @@ export default class ScopesScopeAuthMethodsRoute extends Route {
|
||||
|
||||
/**
|
||||
* Adds a string item to array `property` on the passed `authMethod`.
|
||||
* This is used to manage entries in fragment string array fields such
|
||||
* This is used to manage entries in fragment OIDC string array fields such
|
||||
* as `signing_algorithms`.
|
||||
* @param {AuthMethodModel} authMethod
|
||||
* @param {string} property
|
||||
@@ -162,4 +162,17 @@ export default class ScopesScopeAuthMethodsRoute extends Route {
|
||||
const array = authMethod.get(property);
|
||||
array.addObject({ value });
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an account claim map fragment to the passed OIDC `authMethod`.
|
||||
* @param {AuthMethodModel} authMethod
|
||||
* @param {string} property
|
||||
* @param {string} value
|
||||
*/
|
||||
@action
|
||||
async addAccountClaimMapItem(authMethod, from, to) {
|
||||
const array = authMethod.attributes.account_claim_maps;
|
||||
const value = { from, to };
|
||||
array.addObject(value);
|
||||
}
|
||||
}
|
||||
@@ -4,4 +4,5 @@
|
||||
@cancel={{route-action 'cancel' @model}}
|
||||
@removeItemByIndex={{route-action 'removeItemByIndex' @model}}
|
||||
@addStringItem={{route-action 'addStringItem' @model}}
|
||||
@addAccountClaimMapItem={{route-action 'addAccountClaimMapItem' @model}}
|
||||
/>
|
||||
Reference in new issue
Block a user