Merge pull request #414 from mfrances17/issue-374
Prevent LDAP and Kerberos settings saves unless dirty
This commit is contained in:
commit
b7b33429dc
2 changed files with 14 additions and 2 deletions
|
@ -103,6 +103,7 @@ export const UserFederationKerberosSettings = () => {
|
|||
}, []);
|
||||
|
||||
const setupForm = (component: ComponentRepresentation) => {
|
||||
form.reset();
|
||||
Object.entries(component).map((entry) => {
|
||||
form.setValue(
|
||||
"config.allowPasswordAuthentication",
|
||||
|
@ -177,7 +178,12 @@ export const UserFederationKerberosSettings = () => {
|
|||
<SettingsCache form={form} showSectionHeading />
|
||||
<Form onSubmit={form.handleSubmit(save)}>
|
||||
<ActionGroup>
|
||||
<Button variant="primary" type="submit" data-testid="kerberos-save">
|
||||
<Button
|
||||
isDisabled={!form.formState.isDirty}
|
||||
variant="primary"
|
||||
type="submit"
|
||||
data-testid="kerberos-save"
|
||||
>
|
||||
{t("common:save")}
|
||||
</Button>
|
||||
<Button
|
||||
|
|
|
@ -137,6 +137,7 @@ export const UserFederationLdapSettings = () => {
|
|||
}, []);
|
||||
|
||||
const setupForm = (component: ComponentRepresentation) => {
|
||||
form.reset();
|
||||
Object.entries(component).map((entry) => {
|
||||
if (entry[0] === "config") {
|
||||
convertToFormValues(entry[1], "config", form.setValue);
|
||||
|
@ -240,7 +241,12 @@ export const UserFederationLdapSettings = () => {
|
|||
</ScrollForm>
|
||||
<Form onSubmit={form.handleSubmit(save)}>
|
||||
<ActionGroup>
|
||||
<Button variant="primary" type="submit" data-testid="ldap-save">
|
||||
<Button
|
||||
isDisabled={!form.formState.isDirty}
|
||||
variant="primary"
|
||||
type="submit"
|
||||
data-testid="ldap-save"
|
||||
>
|
||||
{t("common:save")}
|
||||
</Button>
|
||||
<Button
|
||||
|
|
Loading…
Reference in a new issue