Skip to content

Commit f387806

Browse files
committed
fix(admin-ui): user and client page
1 parent fbbabd0 commit f387806

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

admin-ui/plugins/auth-server/components/Clients/ClientScriptPanel.js

+12-6
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,20 @@ function ClientScriptPanel({ client, scripts, formik, viewOnly }) {
3232
.filter((item) => item.scriptType == 'update_token')
3333
.filter((item) => item.enabled)
3434
.map((item) => ({ dn: item.dn, name: item.name }))
35+
function getMapping(exiting, fullArray) {
36+
if (!exiting) {
37+
exiting = []
38+
}
39+
return fullArray.filter((item) => exiting.includes(item.dn))
40+
}
3541

3642
return (
3743
<Container>
3844
<GluuTypeAheadForDn
3945
name="spontaneousScopeScriptDns"
4046
label="fields.spontaneous_scopes"
4147
formik={formik}
42-
value={client.spontaneousScopeScriptDns}
48+
value={getMapping(client?.spontaneousScopeScriptDns,spontaneousScripts)}
4349
options={spontaneousScripts}
4450
doc_category={DOC_CATEGORY}
4551
disabled={viewOnly}
@@ -48,7 +54,7 @@ function ClientScriptPanel({ client, scripts, formik, viewOnly }) {
4854
name="updateTokenScriptDns"
4955
label="fields.updateTokenScriptDns"
5056
formik={formik}
51-
value={client.updateTokenScriptDns}
57+
value={getMapping(client?.updateTokenScriptDns, updateTokenScriptDns)}
5258
options={updateTokenScriptDns}
5359
doc_category={DOC_CATEGORY}
5460
disabled={viewOnly}
@@ -57,7 +63,7 @@ function ClientScriptPanel({ client, scripts, formik, viewOnly }) {
5763
name="postAuthnScripts"
5864
label="fields.post_authn_scripts"
5965
formik={formik}
60-
value={client.postAuthnScripts}
66+
value={getMapping(client?.postAuthnScripts, postScripts)}
6167
options={postScripts}
6268
doc_category={DOC_CATEGORY}
6369
disabled={viewOnly}
@@ -66,7 +72,7 @@ function ClientScriptPanel({ client, scripts, formik, viewOnly }) {
6672
name="introspectionScripts"
6773
label="fields.introspection_scripts"
6874
formik={formik}
69-
value={client.introspectionScripts}
75+
value={getMapping(client?.introspectionScripts, instrospectionScripts)}
7076
options={instrospectionScripts}
7177
doc_category={DOC_CATEGORY}
7278
disabled={viewOnly}
@@ -75,7 +81,7 @@ function ClientScriptPanel({ client, scripts, formik, viewOnly }) {
7581
name="ropcScripts"
7682
label="fields.ropcScripts"
7783
formik={formik}
78-
value={client.ropcScripts}
84+
value={getMapping(client?.ropcScripts, ropcScripts)}
7985
options={ropcScripts}
8086
doc_category={DOC_CATEGORY}
8187
disabled={viewOnly}
@@ -84,7 +90,7 @@ function ClientScriptPanel({ client, scripts, formik, viewOnly }) {
8490
name="consentGatheringScripts"
8591
label="fields.consent_gathering_scripts"
8692
formik={formik}
87-
value={client.consentGatheringScripts}
93+
value={getMapping(client?.consentGatheringScripts, consentScripts)}
8894
options={consentScripts}
8995
doc_category={DOC_CATEGORY}
9096
disabled={viewOnly}

admin-ui/plugins/user-management/components/UserManagement/UserEditPage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function UserEditPage() {
127127
userDetails.customAttributes[i].values[0],
128128
).format('YYYY-MM-DD')
129129
} else {
130-
if (customAttribute[0].oxMultiValuedAttribute) {
130+
if (customAttribute[0]?.oxMultiValuedAttribute) {
131131
initialValues[userDetails.customAttributes[i].name] =
132132
userDetails.customAttributes[i].values
133133
} else {

0 commit comments

Comments
 (0)