Icu 6794 refactor attributes using the newer is nested attribute annotation (#1481)
This commit is contained in:
1 parent
ff6e2bb4cf
commit
ff7a1fedea
15 files changed
+325
-259
No files matched your search
@@ -59,16 +59,16 @@
|
||||
<form.input
|
||||
@name='issuer'
|
||||
@type='text'
|
||||
@value={{@model.attributes.issuer}}
|
||||
@value={{@model.issuer}}
|
||||
@label={{t 'form.issuer.label'}}
|
||||
@helperText={{t 'form.issuer.help'}}
|
||||
@error={{@model.errors.attributes_issuer}}
|
||||
@error={{@model.errors.issuer}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.attributes_issuer}}
|
||||
{{#if @model.errors.issuer}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.attributes_issuer as |error|}}
|
||||
{{#each @model.errors.issuer as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
@@ -78,26 +78,26 @@
|
||||
<form.checkbox
|
||||
@label={{t 'form.disable_discovered_config_validation.label'}}
|
||||
@helperText={{t 'form.disable_discovered_config_validation.help'}}
|
||||
@checked={{@model.attributes.disable_discovered_config_validation}}
|
||||
@checked={{@model.disable_discovered_config_validation}}
|
||||
@onChange={{fn
|
||||
(mut @model.attributes.disable_discovered_config_validation)
|
||||
(if @model.attributes.disable_discovered_config_validation false true)
|
||||
(mut @model.disable_discovered_config_validation)
|
||||
(if @model.disable_discovered_config_validation false true)
|
||||
}}
|
||||
/>
|
||||
|
||||
<form.input
|
||||
@name='client_id'
|
||||
@type='text'
|
||||
@value={{@model.attributes.client_id}}
|
||||
@value={{@model.client_id}}
|
||||
@label={{t 'form.client_id.label'}}
|
||||
@helperText={{t 'form.client_id.help'}}
|
||||
@error={{@model.errors.attributes_client_id}}
|
||||
@error={{@model.errors.client_id}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.attributes_client_id}}
|
||||
{{#if @model.errors.client_id}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.attributes_client_id as |error|}}
|
||||
{{#each @model.errors.client_id as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
@@ -107,16 +107,16 @@
|
||||
<form.input
|
||||
@name='client_secret'
|
||||
@type='password'
|
||||
@value={{@model.attributes.client_secret}}
|
||||
@value={{@model.client_secret}}
|
||||
@label={{t 'form.client_secret.label'}}
|
||||
@helperText={{t 'form.client_secret.help'}}
|
||||
@error={{@model.errors.attributes_client_secret}}
|
||||
@error={{@model.errors.client_secret}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.attributes_client_secret}}
|
||||
{{#if @model.errors.client_secret}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.attributes_client_secret as |error|}}
|
||||
{{#each @model.errors.client_secret as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
@@ -125,7 +125,7 @@
|
||||
|
||||
{{#unless @model.isNew}}
|
||||
<form.input
|
||||
@value={{@model.attributes.client_secret_hmac}}
|
||||
@value={{@model.client_secret_hmac}}
|
||||
@label={{t 'form.client_secret_hmac.label'}}
|
||||
readonly={{true}}
|
||||
@disabled={{true}}
|
||||
@@ -137,9 +137,9 @@
|
||||
<:title>{{t 'form.signing_algorithms.label'}}</:title>
|
||||
<:description>{{t 'form.signing_algorithms.help'}}</:description>
|
||||
<:body>
|
||||
{{#if @model.errors.attributes_signing_algorithms}}
|
||||
{{#if @model.errors.signing_algorithms}}
|
||||
<Rose::Form::Errors as |errors|>
|
||||
{{#each @model.errors.attributes_signing_algorithms as |error|}}
|
||||
{{#each @model.errors.signing_algorithms as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</Rose::Form::Errors>
|
||||
@@ -152,13 +152,13 @@
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
{{#each @model.attributes.signing_algorithms as |algorithm i|}}
|
||||
{{#each @model.signing_algorithms as |algorithm i|}}
|
||||
<body.row as |row|>
|
||||
<row.cell>
|
||||
|
||||
<Hds::Form::Select::Field
|
||||
@value={{algorithm.value}}
|
||||
@isInvalid={{@model.errors.attributes_signing_algorithms}}
|
||||
@isInvalid={{@model.errors.signing_algorithms}}
|
||||
disabled={{form.disabled}}
|
||||
{{on 'change' (set-from-event algorithm 'value')}}
|
||||
as |F|
|
||||
@@ -187,10 +187,7 @@
|
||||
false
|
||||
(if form.isEditable false true)
|
||||
}}
|
||||
{{on
|
||||
'click'
|
||||
(fn @removeItemByIndex 'attributes.signing_algorithms' i)
|
||||
}}
|
||||
{{on 'click' (fn @removeItemByIndex 'signing_algorithms' i)}}
|
||||
>
|
||||
{{t 'actions.remove'}}
|
||||
</Rose::Button>
|
||||
@@ -233,9 +230,7 @@
|
||||
{{on
|
||||
'click'
|
||||
(fn
|
||||
@addStringItem
|
||||
'attributes.signing_algorithms'
|
||||
this.newSigningAlgorithm
|
||||
@addStringItem 'signing_algorithms' this.newSigningAlgorithm
|
||||
)
|
||||
}}
|
||||
>
|
||||
@@ -253,9 +248,9 @@
|
||||
<:title>{{t 'form.allowed_audiences.label'}}</:title>
|
||||
<:description>{{t 'form.allowed_audiences.help'}}</:description>
|
||||
<:body>
|
||||
{{#if @model.errors.attributes_allowed_audiences}}
|
||||
{{#if @model.errors.allowed_audiences}}
|
||||
<Rose::Form::Errors as |errors|>
|
||||
{{#each @model.errors.attributes_allowed_audiences as |error|}}
|
||||
{{#each @model.errors.allowed_audiences as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</Rose::Form::Errors>
|
||||
@@ -268,13 +263,14 @@
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
{{#each @model.attributes.allowed_audiences as |audience i|}}
|
||||
{{#each @model.allowed_audiences as |audience i|}}
|
||||
<body.row as |row|>
|
||||
<row.cell>
|
||||
<form.input
|
||||
@type='text'
|
||||
@name='allowed_audiences'
|
||||
@value={{audience.value}}
|
||||
@error={{@model.errors.attributes_allowed_audiences}}
|
||||
@error={{@model.errors.allowed_audiences}}
|
||||
@contextual={{true}}
|
||||
as |field|
|
||||
>
|
||||
@@ -292,10 +288,7 @@
|
||||
false
|
||||
(if form.isEditable false true)
|
||||
}}
|
||||
{{on
|
||||
'click'
|
||||
(fn @removeItemByIndex 'attributes.allowed_audiences' i)
|
||||
}}
|
||||
{{on 'click' (fn @removeItemByIndex 'allowed_audiences' i)}}
|
||||
>
|
||||
{{t 'actions.remove'}}
|
||||
</Rose::Button>
|
||||
@@ -307,6 +300,7 @@
|
||||
<row.cell>
|
||||
<form.input
|
||||
@type='text'
|
||||
@name='allowed_audiences'
|
||||
@value={{this.newAllowedAudience}}
|
||||
@label={{t 'resources.auth-method.titles.new-allowed-audience'}}
|
||||
/>
|
||||
@@ -323,9 +317,7 @@
|
||||
{{on
|
||||
'click'
|
||||
(fn
|
||||
@addStringItem
|
||||
'attributes.allowed_audiences'
|
||||
this.newAllowedAudience
|
||||
@addStringItem 'allowed_audiences' this.newAllowedAudience
|
||||
)
|
||||
}}
|
||||
>
|
||||
@@ -343,9 +335,9 @@
|
||||
<:title>{{t 'form.claims_scopes.label'}}</:title>
|
||||
<:description>{{t 'form.claims_scopes.help'}}</:description>
|
||||
<:body>
|
||||
{{#if @model.errors.attributes_claims_scopes}}
|
||||
{{#if @model.errors.claims_scopes}}
|
||||
<Rose::Form::Errors as |errors|>
|
||||
{{#each @model.errors.attributes_claims_scopes as |error|}}
|
||||
{{#each @model.errors.claims_scopes as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</Rose::Form::Errors>
|
||||
@@ -358,13 +350,14 @@
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
{{#each @model.attributes.claims_scopes as |claimsScope i|}}
|
||||
{{#each @model.claims_scopes as |claimsScope i|}}
|
||||
<body.row as |row|>
|
||||
<row.cell>
|
||||
<form.input
|
||||
@type='text'
|
||||
@name='claims_scopes'
|
||||
@value={{claimsScope.value}}
|
||||
@error={{@model.errors.attributes_claims_scopes}}
|
||||
@error={{@model.errors.claims_scopes}}
|
||||
@contextual={{true}}
|
||||
as |field|
|
||||
>
|
||||
@@ -382,10 +375,7 @@
|
||||
false
|
||||
(if form.isEditable false true)
|
||||
}}
|
||||
{{on
|
||||
'click'
|
||||
(fn @removeItemByIndex 'attributes.claims_scopes' i)
|
||||
}}
|
||||
{{on 'click' (fn @removeItemByIndex 'claims_scopes' i)}}
|
||||
>
|
||||
{{t 'actions.remove'}}
|
||||
</Rose::Button>
|
||||
@@ -397,6 +387,7 @@
|
||||
<row.cell>
|
||||
<form.input
|
||||
@type='text'
|
||||
@name='claims_scopes'
|
||||
@value={{this.newClaimsScope}}
|
||||
@label={{t 'resources.auth-method.titles.new-claims-scope'}}
|
||||
/>
|
||||
@@ -412,11 +403,7 @@
|
||||
}}
|
||||
{{on
|
||||
'click'
|
||||
(fn
|
||||
@addStringItem
|
||||
'attributes.claims_scopes'
|
||||
this.newClaimsScope
|
||||
)
|
||||
(fn @addStringItem 'claims_scopes' this.newClaimsScope)
|
||||
}}
|
||||
>
|
||||
{{t 'actions.add'}}
|
||||
@@ -433,9 +420,9 @@
|
||||
<:title>{{t 'form.account_claim_maps.label'}}</:title>
|
||||
<:description>{{t 'form.account_claim_maps.help'}}</:description>
|
||||
<:body>
|
||||
{{#if @model.errors.attributes_account_claim_maps}}
|
||||
{{#if @model.errors.account_claim_maps}}
|
||||
<Rose::Form::Errors as |errors|>
|
||||
{{#each @model.errors.attributes_account_claim_maps as |error|}}
|
||||
{{#each @model.errors.account_claim_maps as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</Rose::Form::Errors>
|
||||
@@ -449,13 +436,14 @@
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
{{#each @model.attributes.account_claim_maps as |claimMap i|}}
|
||||
{{#each @model.account_claim_maps as |claimMap i|}}
|
||||
<body.row as |row|>
|
||||
<row.cell>
|
||||
<form.input
|
||||
@type='text'
|
||||
@name='from_claim'
|
||||
@value={{claimMap.from}}
|
||||
@error={{@model.errors.attributes_account_claim_maps}}
|
||||
@error={{@model.errors.account_claim_maps}}
|
||||
@contextual={{true}}
|
||||
as |field|
|
||||
>
|
||||
@@ -467,7 +455,7 @@
|
||||
|
||||
<Hds::Form::Select::Field
|
||||
@value={{claimMap.to}}
|
||||
@isInvalid={{@model.errors.attributes_account_claim_maps}}
|
||||
@isInvalid={{@model.errors.account_claim_maps}}
|
||||
disabled={{form.disabled}}
|
||||
{{on 'change' (set-from-event claimMap 'to')}}
|
||||
as |F|
|
||||
@@ -494,10 +482,7 @@
|
||||
false
|
||||
(if form.isEditable false true)
|
||||
}}
|
||||
{{on
|
||||
'click'
|
||||
(fn @removeItemByIndex 'attributes.account_claim_maps' i)
|
||||
}}
|
||||
{{on 'click' (fn @removeItemByIndex 'account_claim_maps' i)}}
|
||||
>
|
||||
{{t 'actions.remove'}}
|
||||
</Rose::Button>
|
||||
@@ -509,6 +494,7 @@
|
||||
<row.cell>
|
||||
<form.input
|
||||
@type='text'
|
||||
@name='from_claim'
|
||||
@value={{this.newFromClaim}}
|
||||
@label={{t 'resources.auth-method.titles.new-from-claim'}}
|
||||
/>
|
||||
@@ -563,9 +549,9 @@
|
||||
<:title>{{t 'form.idp_ca_certs.label'}}</:title>
|
||||
<:description>{{t 'form.idp_ca_certs.help'}}</:description>
|
||||
<:body>
|
||||
{{#if @model.errors.attributes_idp_ca_certs}}
|
||||
{{#if @model.errors.idp_ca_certs}}
|
||||
<Rose::Form::Errors as |errors|>
|
||||
{{#each @model.errors.attributes_idp_ca_certs as |error|}}
|
||||
{{#each @model.errors.idp_ca_certs as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</Rose::Form::Errors>
|
||||
@@ -578,12 +564,12 @@
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
{{#each @model.attributes.idp_ca_certs as |cert i|}}
|
||||
{{#each @model.idp_ca_certs as |cert i|}}
|
||||
<body.row as |row|>
|
||||
<row.cell>
|
||||
<form.textarea
|
||||
@value={{cert.value}}
|
||||
@error={{@model.errors.attributes_idp_ca_certs}}
|
||||
@error={{@model.errors.idp_ca_certs}}
|
||||
@contextual={{true}}
|
||||
as |field|
|
||||
>
|
||||
@@ -601,10 +587,7 @@
|
||||
false
|
||||
(if form.isEditable false true)
|
||||
}}
|
||||
{{on
|
||||
'click'
|
||||
(fn @removeItemByIndex 'attributes.idp_ca_certs' i)
|
||||
}}
|
||||
{{on 'click' (fn @removeItemByIndex 'idp_ca_certs' i)}}
|
||||
>
|
||||
{{t 'actions.remove'}}
|
||||
</Rose::Button>
|
||||
@@ -630,9 +613,7 @@
|
||||
}}
|
||||
{{on
|
||||
'click'
|
||||
(fn
|
||||
@addStringItem 'attributes.idp_ca_certs' this.newCertificate
|
||||
)
|
||||
(fn @addStringItem 'idp_ca_certs' this.newCertificate)
|
||||
}}
|
||||
>
|
||||
{{t 'actions.add'}}
|
||||
@@ -647,18 +628,18 @@
|
||||
<form.input
|
||||
@name='max_age'
|
||||
@type='number'
|
||||
@value={{@model.attributes.max_age}}
|
||||
@value={{@model.max_age}}
|
||||
@label={{t 'form.max_age.label'}}
|
||||
@helperText={{t 'form.max_age.help'}}
|
||||
@error={{@model.errors.attributes_max_age}}
|
||||
@error={{@model.errors.max_age}}
|
||||
readonly={{false}}
|
||||
step='1'
|
||||
min='0'
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.attributes_max_age}}
|
||||
{{#if @model.errors.max_age}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.attributes_max_age as |error|}}
|
||||
{{#each @model.errors.max_age as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
@@ -668,16 +649,16 @@
|
||||
<form.input
|
||||
@name='api_url_prefix'
|
||||
@type='test'
|
||||
@value={{@model.attributes.api_url_prefix}}
|
||||
@value={{@model.api_url_prefix}}
|
||||
@label={{t 'form.api_url_prefix.label'}}
|
||||
@helperText={{t 'form.api_url_prefix.help'}}
|
||||
@error={{@model.errors.attributes_api_url_prefix}}
|
||||
@error={{@model.errors.api_url_prefix}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.attributes_api_url_prefix}}
|
||||
{{#if @model.errors.api_url_prefix}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.attributes_api_url_prefix as |error|}}
|
||||
{{#each @model.errors.api_url_prefix as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
@@ -686,7 +667,7 @@
|
||||
|
||||
{{#unless @model.isNew}}
|
||||
<form.input
|
||||
@value={{@model.attributes.callback_url}}
|
||||
@value={{@model.callback_url}}
|
||||
@label={{t 'form.callback_url.label'}}
|
||||
@helperText={{t 'form.callback_url.help'}}
|
||||
readonly={{true}}
|
||||
|
||||
Reference in new issue
Block a user