Skip to content

Commit

Permalink
fix: edit fields issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mjatin-dev committed Mar 18, 2022
1 parent 59fcf22 commit 80708e6
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 37 deletions.
21 changes: 11 additions & 10 deletions admin-ui/plugins/auth-server/components/Clients/ClientBasicPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const ClientBasicPanel = ({ client, scopes, formik }) => {
id="clientSecret"
name="clientSecret"
type={showClientSecret ? 'text' : 'password'}
defaultValue={client.clientSecret}
value={client.clientSecret}
onChange={formik.handleChange}
/>
<IconButton
Expand All @@ -137,15 +137,16 @@ const ClientBasicPanel = ({ client, scopes, formik }) => {
value={!client.disabled}
doc_category={DOC_CATEGORY}
/>
<GluuToogleRow
name="expirable"
formik={formik}
label="fields.is_expirable_client"
value={client.expirable && client.expirable.length ? true : false}
handler={handleExpirable}
doc_category={DOC_CATEGORY}
/>

{client.expirable && (
<GluuToogleRow
name="expirable"
formik={formik}
label="fields.is_expirable_client"
value={client.expirable && client.expirable.length ? true : false}
handler={handleExpirable}
doc_category={DOC_CATEGORY}
/>
)}
{client.expirable && client.expirable.length && (
<FormGroup row>
<GluuLabel label="client_expiration_date" size={5} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function ClientScriptPanel({ client, scopes, scripts, formik }) {
doc_category={DOC_CATEGORY}
></GluuTypeAheadForDn>
<GluuTypeAheadForDn
name="rptScripts"
name="rptClaimsScripts"
label="fields.rpt_scripts"
formik={formik}
value={client.rptClaimsScripts}
Expand Down
61 changes: 35 additions & 26 deletions admin-ui/plugins/auth-server/components/Clients/ClientWizardForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,23 +116,23 @@ function ClientWizardForm({
return total.filter((item) => partial.includes(item.dn)) || []
}
// client.description = extractDescription(client.customAttributes || [])
client.spontaneousScopes =
getMapping(client.attributes.spontaneousScopes, scopes) || []
client.introspectionScripts =
getMapping(client.attributes.introspectionScripts, instrospectionScripts) ||
[]
client.spontaneousScopeScriptDns =
getMapping(
client.attributes.spontaneousScopeScriptDns,
spontaneousScripts,
) || []
client.consentGatheringScripts =
getMapping(client.attributes.consentGatheringScripts, consentScripts) || []
// client.spontaneousScopes =
// getMapping(client.attributes.spontaneousScopes, scopes) || []
// client.introspectionScripts =
// getMapping(client.attributes.introspectionScripts, instrospectionScripts) ||
// []
// client.spontaneousScopeScriptDns =
// getMapping(
// client.attributes.spontaneousScopeScriptDns,
// spontaneousScripts,
// ) || []
// client.consentGatheringScripts =
// getMapping(client.attributes.consentGatheringScripts, consentScripts) || []

client.postAuthnScripts =
getMapping(client.attributes.postAuthnScripts, postScripts) || []
client.rptClaimsScripts =
getMapping(client.attributes.rptClaimsScripts, rptScripts) || []
// client.postAuthnScripts =
// getMapping(client.attributes.postAuthnScripts, postScripts) || []
// client.rptClaimsScripts =
// getMapping(client.attributes.rptClaimsScripts, rptScripts) || []
// client.tlsClientAuthSubjectDn = client.attributes.tlsClientAuthSubjectDn
// client.runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims =
// client.attributes
Expand All @@ -150,7 +150,7 @@ function ClientWizardForm({
const initialValues = {
inum: client.inum,
dn: client.dn,
clientSecret: client.secret,
clientSecret: client.clientSecret,
displayName: client.displayName,
clientName: client.clientName,
description: client.description,
Expand All @@ -164,13 +164,21 @@ function ClientWizardForm({
tosUri: client.tosUri,
jwksUri: client.jwksUri,
jwks: client.jwks,
expirable: [],
expirable: client.expirationDate ? ['on'] : [],
expirationDate: client.expirationDate,
softwareStatement: client.softwareStatement,
softwareVersion: client.softwareVersion,
softwareId: client.softwareId,
softwareSection: client.softwareSection ? client.softwareSection : false,
cibaSection: client.cibaSection ? client.cibaSection : false,
softwareSection:
client.softwareId || client.softwareVersion || client.softwareStatement
? true
: false,
cibaSection:
client.backchannelTokenDeliveryMode ||
client.backchannelClientNotificationEndpoint ||
client.backchannelUserCodeParameter
? true
: false,
idTokenSignedResponseAlg: client.idTokenSignedResponseAlg,
idTokenEncryptedResponseAlg: client.idTokenEncryptedResponseAlg,
tokenEndpointAuthMethod: client.tokenEndpointAuthMethod,
Expand Down Expand Up @@ -220,12 +228,13 @@ function ClientWizardForm({
keepClientAuthorizationAfterExpiration:
client.attributes.keepClientAuthorizationAfterExpiration,
allowSpontaneousScopes: client.attributes.allowSpontaneousScopes,
spontaneousScopes: client.spontaneousScopes,
introspectionScripts: client.introspectionScripts,
spontaneousScopeScriptDns: client.spontaneousScopeScriptDns,
consentGatheringScripts: client.consentGatheringScripts,
postAuthnScripts: client.postAuthnScripts,
rptClaimsScripts: client.rptClaimsScripts,
spontaneousScopes: client.attributes.spontaneousScopes || [],
introspectionScripts: client.attributes.introspectionScripts || [],
spontaneousScopeScriptDns:
client.attributes.spontaneousScopeScriptDns || [],
consentGatheringScripts: client.attributes.consentGatheringScripts || [],
postAuthnScripts: client.attributes.postAuthnScripts || [],
rptClaimsScripts: client.attributes.rptClaimsScripts || [],
additionalAudience: client.attributes.additionalAudience,
backchannelLogoutUri: client.attributes.backchannelLogoutUri,
customObjectClasses: client.customObjectClasses,
Expand Down

0 comments on commit 80708e6

Please sign in to comment.