enable and delete working

This commit is contained in:
mfrances 2021-01-25 11:46:07 -05:00
parent 35ca42f267
commit ad7be3a62e
2 changed files with 64 additions and 8 deletions

View file

@ -21,6 +21,63 @@ exports[`BreadCrumbs tests couple of crumbs 1`] = `
<li
className="pf-c-breadcrumb__item"
>
<Link
to="/master"
>
<LinkAnchor
href="/master"
navigate={[Function]}
>
<a
href="/master"
onClick={[Function]}
>
<span
key="/master"
>
Home
</span>
</a>
</LinkAnchor>
</Link>
</li>
</BreadcrumbItem>
<BreadcrumbItem
isActive={false}
key=".$1"
showDivider={true}
>
<li
className="pf-c-breadcrumb__item"
>
<span
className="pf-c-breadcrumb__item-divider"
>
<AngleRightIcon
color="currentColor"
noVerticalAlign={false}
size="sm"
>
<svg
aria-hidden={true}
aria-labelledby={null}
fill="currentColor"
height="1em"
role="img"
style={
Object {
"verticalAlign": "-0.125em",
}
}
viewBox="0 0 256 512"
width="1em"
>
<path
d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"
/>
</svg>
</AngleRightIcon>
</span>
<Link
to="/master/clients"
>
@ -44,7 +101,7 @@ exports[`BreadCrumbs tests couple of crumbs 1`] = `
</BreadcrumbItem>
<BreadcrumbItem
isActive={true}
key=".$1"
key=".$2"
showDivider={true}
>
<li

View file

@ -54,12 +54,12 @@ const KerberosSettingsHeader = ({
{t("deleteProvider")}
</DropdownItem>,
]}
isEnabled={value}
isEnabled={value === "true"}
onToggle={(value) => {
if (!value) {
toggleDisableDialog();
} else {
onChange(value);
onChange("" + value);
}
}}
/>
@ -109,7 +109,6 @@ export const UserFederationKerberosSettings = () => {
addAlert(`${t("saveError")} '${error}'`, AlertVariant.danger);
}
};
// const form = useForm();
const [toggleDeleteDialog, DeleteConfirm] = useConfirmDialog({
titleKey: "user-federation:userFedDeleteConfirmTitle",
@ -118,7 +117,7 @@ export const UserFederationKerberosSettings = () => {
continueButtonVariant: ButtonVariant.danger,
onConfirm: async () => {
try {
await adminClient.clients.del({ id });
await adminClient.components.del({ id });
addAlert(t("userFedDeletedSuccess"), AlertVariant.success);
} catch (error) {
addAlert(`${t("userFedDeleteError")} ${error}`, AlertVariant.danger);
@ -130,13 +129,13 @@ export const UserFederationKerberosSettings = () => {
<>
<DeleteConfirm />
<Controller
name="enabled"
name="config.enabled[0]"
defaultValue={["true"]}
control={form.control}
defaultValue={true}
render={({ onChange, value }) => (
<KerberosSettingsHeader
value={value}
onChange={onChange}
onChange={(value) => onChange("" + value)}
toggleDeleteDialog={toggleDeleteDialog}
/>
)}