From 32a2d90ceed103d77bcfd139552f14d4ce63d503 Mon Sep 17 00:00:00 2001 From: Darcy Ye Date: Fri, 16 Aug 2024 11:43:37 +0800 Subject: [PATCH] fix(console): fix enterprise SSO creation model button status --- .../pages/EnterpriseSso/SsoCreationModal/index.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/console/src/pages/EnterpriseSso/SsoCreationModal/index.tsx b/packages/console/src/pages/EnterpriseSso/SsoCreationModal/index.tsx index 723f24dc7..e712d10ea 100644 --- a/packages/console/src/pages/EnterpriseSso/SsoCreationModal/index.tsx +++ b/packages/console/src/pages/EnterpriseSso/SsoCreationModal/index.tsx @@ -131,13 +131,12 @@ function SsoCreationModal({ isOpen, onClose: rawOnClose }: Props) { }) ); - const isCreateButtonDisabled = useMemo(() => { - // The button is available only when: - // 1. `connectorName` field is not empty. - // 2. At least one connector is selected. - // 3. Error is resolved. Since `connectorName` is the only field of this form, it means `connectorName` field error is resolved. - return !(watch('connectorName') && isAnyConnectorSelected) || Boolean(errors.connectorName); - }, [errors.connectorName, isAnyConnectorSelected, watch]); + // The button is available only when: + // 1. `connectorName` field is not empty. + // 2. At least one connector is selected. + // 3. Error is resolved. Since `connectorName` is the only field of this form, it means `connectorName` field error is resolved. + const isCreateButtonDisabled = + !(watch('connectorName') && isAnyConnectorSelected) || Boolean(errors.connectorName); if (!isOpen) { return null; @@ -158,6 +157,7 @@ function SsoCreationModal({ isOpen, onClose: rawOnClose }: Props) { paywall={conditional( isDevFeaturesEnabled && planId === ReservedPlanId.Pro && ReservedPlanId.Pro )} + hasAddOnTag={isDevFeaturesEnabled} footer={ conditional( isDevFeaturesEnabled &&