Skip to content

Commit 59c47d9

Browse files
authored
Reactivated Enable / Disable LDAP functionality (#2714)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
1 parent cb38a54 commit 59c47d9

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

portal-ui/src/screens/Console/IDP/LDAP/IDPLDAPConfigurationDetails.tsx

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,9 @@ const IDPLDAPConfigurationDetails = () => {
186186
}
187187
};
188188

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) => {
195190
const payload = {
196191
key_values: [
197-
...input,
198192
{
199193
key: "enable",
200194
value: value ? "on" : "off",
@@ -214,7 +208,7 @@ const IDPLDAPConfigurationDetails = () => {
214208
.catch((err: ErrorResponseHandler) => {
215209
dispatch(setErrorSnackMessage(err));
216210
});
217-
};*/
211+
};
218212

219213
const renderFormField = (key: string, value: any) => {
220214
switch (value.type) {
@@ -281,7 +275,7 @@ const IDPLDAPConfigurationDetails = () => {
281275
{ label: "Configuration" },
282276
{
283277
label: "Entities",
284-
disabled: !hasConfiguration,
278+
disabled: !hasConfiguration || !isEnabled,
285279
},
286280
]}
287281
/>
@@ -300,13 +294,14 @@ const IDPLDAPConfigurationDetails = () => {
300294
label={"Edit Configuration"}
301295
disabled={loading}
302296
/>
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+
)}
310305
<Button
311306
id={"refresh-idp-config"}
312307
onClick={() => setLoading(true)}

0 commit comments

Comments
 (0)