From 953eed70b220f9bcdcc3d5ea640b4a10a5f93426 Mon Sep 17 00:00:00 2001 From: Tuan Dang Date: Sun, 23 Jul 2023 13:24:12 +0700 Subject: [PATCH] Add back attribution source for non-SAML SSO case --- .../UserInfoSSOStep/UserInfoSSOStep.tsx | 46 ++++++++++++------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/frontend/src/views/Signup/components/UserInfoSSOStep/UserInfoSSOStep.tsx b/frontend/src/views/Signup/components/UserInfoSSOStep/UserInfoSSOStep.tsx index f93f5b15d..fed039467 100644 --- a/frontend/src/views/Signup/components/UserInfoSSOStep/UserInfoSSOStep.tsx +++ b/frontend/src/views/Signup/components/UserInfoSSOStep/UserInfoSSOStep.tsx @@ -69,13 +69,13 @@ export const UserInfoSSOStep = ({ const [nameError, setNameError] = useState(false); const [organizationName, setOrganizationName] = useState(""); const [organizationNameError, setOrganizationNameError] = useState(false); + const [attributionSource, setAttributionSource] = useState(""); const [errors, setErrors] = useState({}); const [isLoading, setIsLoading] = useState(false); const { t } = useTranslation(); useEffect(() => { - console.log("providerOrganizationName: ", providerOrganizationName); - if (providerOrganizationName) { + if (providerOrganizationName !== undefined) { setOrganizationName(providerOrganizationName); } }, []); @@ -171,7 +171,8 @@ export const UserInfoSSOStep = ({ providerAuthToken, salt: result.salt, verifier: result.verifier, - organizationName + organizationName, + attributionSource }); // unset signup JWT token and set JWT token @@ -209,7 +210,7 @@ export const UserInfoSSOStep = ({ setIsLoading(false); } }; - + return (

@@ -228,18 +229,31 @@ export const UserInfoSSOStep = ({ /> {nameError &&

Please, specify your name

}
-
-

Organization Name

- setOrganizationName(e.target.value)} - isRequired - className="h-12" - disabled - /> - {organizationNameError &&

Please, specify your organization name

} -
+ {providerOrganizationName === undefined && ( +
+

Organization Name

+ setOrganizationName(e.target.value)} + isRequired + className="h-12" + disabled + /> + {organizationNameError &&

Please, specify your organization name

} +
+ )} + {providerOrganizationName === undefined && ( +
+

Where did you hear about us? (optional)

+ setAttributionSource(e.target.value)} + value={attributionSource} + className="h-12" + /> +
+ )}