From 7d426f0c7ec771f52c89f732718840e36d291ffd Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 26 May 2025 20:37:23 -0400 Subject: [PATCH] fix(UpdateOidcModal): do not update slug when changing name of existing provider --- src/components/Settings/EditOidcModal/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/Settings/EditOidcModal/index.tsx b/src/components/Settings/EditOidcModal/index.tsx index 346da6f8..427dddc7 100644 --- a/src/components/Settings/EditOidcModal/index.tsx +++ b/src/components/Settings/EditOidcModal/index.tsx @@ -58,15 +58,16 @@ interface EditOidcModalProps { onOk: () => void; } -function SlugField(props: FieldAttributes) { +function SlugField(props: FieldAttributes & { readOnly?: boolean }) { const { values: { name }, setFieldValue, } = useFormikContext>(); useEffect(() => { - setFieldValue(props.name, name?.toLowerCase().replace(/\s/g, '-')); - }, [props.name, name, setFieldValue]); + if (!props.readOnly) + setFieldValue(props.name, name?.toLowerCase().replace(/\s/g, '-')); + }, [props.name, props.readOnly, name, setFieldValue]); return ; }