enable and delete working
This commit is contained in:
parent
35ca42f267
commit
ad7be3a62e
2 changed files with 64 additions and 8 deletions
|
@ -21,6 +21,63 @@ exports[`BreadCrumbs tests couple of crumbs 1`] = `
|
||||||
<li
|
<li
|
||||||
className="pf-c-breadcrumb__item"
|
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
|
<Link
|
||||||
to="/master/clients"
|
to="/master/clients"
|
||||||
>
|
>
|
||||||
|
@ -44,7 +101,7 @@ exports[`BreadCrumbs tests couple of crumbs 1`] = `
|
||||||
</BreadcrumbItem>
|
</BreadcrumbItem>
|
||||||
<BreadcrumbItem
|
<BreadcrumbItem
|
||||||
isActive={true}
|
isActive={true}
|
||||||
key=".$1"
|
key=".$2"
|
||||||
showDivider={true}
|
showDivider={true}
|
||||||
>
|
>
|
||||||
<li
|
<li
|
||||||
|
|
|
@ -54,12 +54,12 @@ const KerberosSettingsHeader = ({
|
||||||
{t("deleteProvider")}
|
{t("deleteProvider")}
|
||||||
</DropdownItem>,
|
</DropdownItem>,
|
||||||
]}
|
]}
|
||||||
isEnabled={value}
|
isEnabled={value === "true"}
|
||||||
onToggle={(value) => {
|
onToggle={(value) => {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
toggleDisableDialog();
|
toggleDisableDialog();
|
||||||
} else {
|
} else {
|
||||||
onChange(value);
|
onChange("" + value);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
@ -109,7 +109,6 @@ export const UserFederationKerberosSettings = () => {
|
||||||
addAlert(`${t("saveError")} '${error}'`, AlertVariant.danger);
|
addAlert(`${t("saveError")} '${error}'`, AlertVariant.danger);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// const form = useForm();
|
|
||||||
|
|
||||||
const [toggleDeleteDialog, DeleteConfirm] = useConfirmDialog({
|
const [toggleDeleteDialog, DeleteConfirm] = useConfirmDialog({
|
||||||
titleKey: "user-federation:userFedDeleteConfirmTitle",
|
titleKey: "user-federation:userFedDeleteConfirmTitle",
|
||||||
|
@ -118,7 +117,7 @@ export const UserFederationKerberosSettings = () => {
|
||||||
continueButtonVariant: ButtonVariant.danger,
|
continueButtonVariant: ButtonVariant.danger,
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
try {
|
try {
|
||||||
await adminClient.clients.del({ id });
|
await adminClient.components.del({ id });
|
||||||
addAlert(t("userFedDeletedSuccess"), AlertVariant.success);
|
addAlert(t("userFedDeletedSuccess"), AlertVariant.success);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
addAlert(`${t("userFedDeleteError")} ${error}`, AlertVariant.danger);
|
addAlert(`${t("userFedDeleteError")} ${error}`, AlertVariant.danger);
|
||||||
|
@ -130,13 +129,13 @@ export const UserFederationKerberosSettings = () => {
|
||||||
<>
|
<>
|
||||||
<DeleteConfirm />
|
<DeleteConfirm />
|
||||||
<Controller
|
<Controller
|
||||||
name="enabled"
|
name="config.enabled[0]"
|
||||||
|
defaultValue={["true"]}
|
||||||
control={form.control}
|
control={form.control}
|
||||||
defaultValue={true}
|
|
||||||
render={({ onChange, value }) => (
|
render={({ onChange, value }) => (
|
||||||
<KerberosSettingsHeader
|
<KerberosSettingsHeader
|
||||||
value={value}
|
value={value}
|
||||||
onChange={onChange}
|
onChange={(value) => onChange("" + value)}
|
||||||
toggleDeleteDialog={toggleDeleteDialog}
|
toggleDeleteDialog={toggleDeleteDialog}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
Loading…
Reference in a new issue