@@ -186,15 +186,9 @@ const IDPLDAPConfigurationDetails = () => {
186
186
}
187
187
} ;
188
188
189
- /*
190
- TODO: Review enable / disable functionality for LDAP and enable this module
191
-
192
- const toggleConfiguration = (value: boolean) => {
193
- const input: any[] = [];
194
-
189
+ const toggleConfiguration = ( value : boolean ) => {
195
190
const payload = {
196
191
key_values : [
197
- ...input,
198
192
{
199
193
key : "enable" ,
200
194
value : value ? "on" : "off" ,
@@ -214,7 +208,7 @@ const IDPLDAPConfigurationDetails = () => {
214
208
. catch ( ( err : ErrorResponseHandler ) => {
215
209
dispatch ( setErrorSnackMessage ( err ) ) ;
216
210
} ) ;
217
- };*/
211
+ } ;
218
212
219
213
const renderFormField = ( key : string , value : any ) => {
220
214
switch ( value . type ) {
@@ -281,7 +275,7 @@ const IDPLDAPConfigurationDetails = () => {
281
275
{ label : "Configuration" } ,
282
276
{
283
277
label : "Entities" ,
284
- disabled : ! hasConfiguration ,
278
+ disabled : ! hasConfiguration || ! isEnabled ,
285
279
} ,
286
280
] }
287
281
/>
@@ -300,13 +294,14 @@ const IDPLDAPConfigurationDetails = () => {
300
294
label = { "Edit Configuration" }
301
295
disabled = { loading }
302
296
/>
303
- { /*<Button
304
- id={"is-configuration-enabled"}
305
- onClick={() => toggleConfiguration(!isEnabled)}
306
- label={isEnabled ? "Disable LDAP" : "Enable LDAP"}
307
- disabled={loadingEnabledSave}
308
- variant={isEnabled ? "secondary" : "regular"}
309
- />*/ }
297
+ { hasConfiguration && (
298
+ < Button
299
+ id = { "is-configuration-enabled" }
300
+ onClick = { ( ) => toggleConfiguration ( ! isEnabled ) }
301
+ label = { isEnabled ? "Disable LDAP" : "Enable LDAP" }
302
+ variant = { isEnabled ? "secondary" : "regular" }
303
+ />
304
+ ) }
310
305
< Button
311
306
id = { "refresh-idp-config" }
312
307
onClick = { ( ) => setLoading ( true ) }
0 commit comments