@@ -32,14 +32,20 @@ function ClientScriptPanel({ client, scripts, formik, viewOnly }) {
32
32
. filter ( ( item ) => item . scriptType == 'update_token' )
33
33
. filter ( ( item ) => item . enabled )
34
34
. 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
+ }
35
41
36
42
return (
37
43
< Container >
38
44
< GluuTypeAheadForDn
39
45
name = "spontaneousScopeScriptDns"
40
46
label = "fields.spontaneous_scopes"
41
47
formik = { formik }
42
- value = { client . spontaneousScopeScriptDns }
48
+ value = { getMapping ( client ? .spontaneousScopeScriptDns , spontaneousScripts ) }
43
49
options = { spontaneousScripts }
44
50
doc_category = { DOC_CATEGORY }
45
51
disabled = { viewOnly }
@@ -48,7 +54,7 @@ function ClientScriptPanel({ client, scripts, formik, viewOnly }) {
48
54
name = "updateTokenScriptDns"
49
55
label = "fields.updateTokenScriptDns"
50
56
formik = { formik }
51
- value = { client . updateTokenScriptDns }
57
+ value = { getMapping ( client ? .updateTokenScriptDns , updateTokenScriptDns ) }
52
58
options = { updateTokenScriptDns }
53
59
doc_category = { DOC_CATEGORY }
54
60
disabled = { viewOnly }
@@ -57,7 +63,7 @@ function ClientScriptPanel({ client, scripts, formik, viewOnly }) {
57
63
name = "postAuthnScripts"
58
64
label = "fields.post_authn_scripts"
59
65
formik = { formik }
60
- value = { client . postAuthnScripts }
66
+ value = { getMapping ( client ? .postAuthnScripts , postScripts ) }
61
67
options = { postScripts }
62
68
doc_category = { DOC_CATEGORY }
63
69
disabled = { viewOnly }
@@ -66,7 +72,7 @@ function ClientScriptPanel({ client, scripts, formik, viewOnly }) {
66
72
name = "introspectionScripts"
67
73
label = "fields.introspection_scripts"
68
74
formik = { formik }
69
- value = { client . introspectionScripts }
75
+ value = { getMapping ( client ? .introspectionScripts , instrospectionScripts ) }
70
76
options = { instrospectionScripts }
71
77
doc_category = { DOC_CATEGORY }
72
78
disabled = { viewOnly }
@@ -75,7 +81,7 @@ function ClientScriptPanel({ client, scripts, formik, viewOnly }) {
75
81
name = "ropcScripts"
76
82
label = "fields.ropcScripts"
77
83
formik = { formik }
78
- value = { client . ropcScripts }
84
+ value = { getMapping ( client ? .ropcScripts , ropcScripts ) }
79
85
options = { ropcScripts }
80
86
doc_category = { DOC_CATEGORY }
81
87
disabled = { viewOnly }
@@ -84,7 +90,7 @@ function ClientScriptPanel({ client, scripts, formik, viewOnly }) {
84
90
name = "consentGatheringScripts"
85
91
label = "fields.consent_gathering_scripts"
86
92
formik = { formik }
87
- value = { client . consentGatheringScripts }
93
+ value = { getMapping ( client ? .consentGatheringScripts , consentScripts ) }
88
94
options = { consentScripts }
89
95
doc_category = { DOC_CATEGORY }
90
96
disabled = { viewOnly }
0 commit comments