diff --git a/frontend/pages/admin/IntegrationsPage/IntegrationsPage.tsx b/frontend/pages/admin/IntegrationsPage/IntegrationsPage.tsx index 942ebb4996..0d9c3bdb9e 100644 --- a/frontend/pages/admin/IntegrationsPage/IntegrationsPage.tsx +++ b/frontend/pages/admin/IntegrationsPage/IntegrationsPage.tsx @@ -60,9 +60,17 @@ const IntegrationsPage = ({ return false; } + const diff = deepDifference(formUpdates, appConfig); + + // If there's no actual change, don't make the API call to update config. + // Still refetch in case settings were changed inside a card (like end-user auth). + if (Object.keys(diff).length === 0) { + refetchConfig(); + return true; + } + setIsUpdatingSettings(true); - const diff = deepDifference(formUpdates, appConfig); // send all formUpdates.agent_options because diff overrides all agent options diff.agent_options = formUpdates.agent_options; diff --git a/frontend/pages/admin/IntegrationsPage/cards/IdentityProviders/components/EndUserAuthSection/EndUserAuthSection.tsx b/frontend/pages/admin/IntegrationsPage/cards/IdentityProviders/components/EndUserAuthSection/EndUserAuthSection.tsx index 601b39e923..0f6c595ac1 100644 --- a/frontend/pages/admin/IntegrationsPage/cards/IdentityProviders/components/EndUserAuthSection/EndUserAuthSection.tsx +++ b/frontend/pages/admin/IntegrationsPage/cards/IdentityProviders/components/EndUserAuthSection/EndUserAuthSection.tsx @@ -32,6 +32,7 @@ export interface IEndUserAuthSectionProps { formData: IFormDataIdp; setFormData: React.Dispatch>; originalFormData: MutableRefObject; + onSubmit: () => void; } const EndUserAuthSection = ({ @@ -39,6 +40,9 @@ const EndUserAuthSection = ({ formData, setFormData, originalFormData, + // Notify parent component of changes, since we're calling our own API + // rather than using the common config update handler. + onSubmit: announceChanges, }: IEndUserAuthSectionProps) => { const { config, isPremiumTier } = useContext(AppContext); const gitOpsModeEnabled = config?.gitops.gitops_mode_enabled; @@ -98,6 +102,9 @@ const EndUserAuthSection = ({ renderFlash("success", "Successfully updated end user authentication!"); originalFormData.current = { ...formData }; setDirty(false); + // Notify parent component of changes, since we're calling our own API + // rather than using the common config update handler. + announceChanges(); } catch (err) { const ae = (typeof err === "object" ? err : {}) as AxiosResponse; if (ae.status === 422) { diff --git a/frontend/pages/admin/IntegrationsPage/cards/Sso/Sso.tsx b/frontend/pages/admin/IntegrationsPage/cards/Sso/Sso.tsx index 82a315d72b..02aa393ebe 100644 --- a/frontend/pages/admin/IntegrationsPage/cards/Sso/Sso.tsx +++ b/frontend/pages/admin/IntegrationsPage/cards/Sso/Sso.tsx @@ -334,12 +334,19 @@ const Sso = ({ ); }; + const onSubmitEndUserSso = async () => { + // Notify parent component that it needs to re-fetch app config. + // No formUpdates needed because changes are made inside the card. + await handleSubmit({}); + }; + const renderEndUserSsoTab = () => ( );