-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Experimentally hide the Name and Company Name fields on the signup page #15622
Experimentally hide the Name and Company Name fields on the signup page #15622
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments to simplify things. I haven't tested but I'm assuming that when submitting the form the name and companyName get set to an empty string when creating the user?
"authPage.signup.hideName": boolean; | ||
"authPage.signup.hideCompanyName": boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼 Easier to set up experiments if hide is set to true over show set to false
"authPage.signup.hideCompanyName" | ||
); | ||
|
||
const SignupPageValidationSchema = yup.object().shape({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var name should be camel case, not sure why it was pascal case in the first place.
const { hideField: hideName, fieldSchema: nameSchema } = useExperimentallyHiddenField("authPage.signup.hideName"); | ||
const { hideField: hideCompanyName, fieldSchema: companyNameSchema } = useExperimentallyHiddenField( | ||
"authPage.signup.hideCompanyName" | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be simpler to set the validation schema as a memo, for example:
const hideName = useExperiment("authPage.signup.hideName", false);
const validationSchema = useMemo(() => {
const shape = { /* the initial values */ };
if (!hideCompanyName) shape.name = yup.string();
return yup.object().(shape);
}, [hideCompanyName]);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion! I think this approach is a lot simpler
<NameField /> | ||
<CompanyNameField /> | ||
</RowFieldItem> | ||
{(!hideName || !hideCompanyName) && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another possible way to avoid checking for nots so often. Positive can be easier to read.
const showName = !useExperiement("authPage.signup.hideName", false);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it was starting to feel like too many nots, so what you suggested is probably a better approach
That is correct! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
I did not test this locally.
…ge (#15622) * Experimentally hide the Name and Company Name fields on the signup page * refactor validation schema
What
Resolves https://github.com/airbytehq/airbyte-cloud/issues/1430
How
This PR adds logic to hide the Full Name and Company Name fields on the signup page based on respective feature flags in LaunchDarkly.
When these fields are hidden, users will be created with empty strings set for both the name and company name columns on the user record. The backend handles this gracefully, and in the case of an empty company name it uses the email as the name of the workspace created for the new user.
Example screenshot of the signup page with both fields set to hidden in LaunchDarkly:
