Skip to content
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

feat: New UI for SignUp / Login #16802

Merged
merged 43 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
9e970b1
update UI of signup, login pages
hbjORbj Sep 19, 2024
cade3ce
remove disabled state from google sign-in
hbjORbj Sep 19, 2024
c14d58f
Put isGoogleLoginEnabled to its place + fix displaySignupForm default…
hbjORbj Sep 19, 2024
6f90603
Rename Signup flow test -> Email Signup flow test
hbjORbj Sep 19, 2024
9f2df85
add data-testid to continue with email button
hbjORbj Sep 19, 2024
e678b33
completely decouble formMethods values from google sign in
hbjORbj Sep 19, 2024
7cbe9cb
fix
hbjORbj Sep 19, 2024
60a2a01
Merge origin/main
hbjORbj Sep 20, 2024
8cb1795
refactor
hbjORbj Sep 20, 2024
0fadb58
add signup page test
hbjORbj Sep 20, 2024
f7f0d1b
revert yarn.lock
hbjORbj Sep 20, 2024
d850f66
Merge branch 'main' into feature/new-signup-flow
hbjORbj Sep 20, 2024
7a60b18
fix e2e test
hbjORbj Sep 20, 2024
1174f86
add saml in signup
hbjORbj Sep 23, 2024
7197223
add saml in signin
hbjORbj Sep 23, 2024
2dd2ae4
revert
hbjORbj Sep 23, 2024
a3bfed8
remove space
hbjORbj Sep 23, 2024
56a5ee0
signup fixes
PeerRich Sep 24, 2024
c5ec4a5
fix login view
hbjORbj Sep 24, 2024
542ebd9
revert SAMLLogin
hbjORbj Sep 25, 2024
7965146
change login view
hbjORbj Sep 25, 2024
43357d8
do not invert google icon in login view
hbjORbj Sep 25, 2024
427ae90
Merge branch 'main' into feature/new-signup-flow
hbjORbj Sep 25, 2024
78d592c
disable SAML login button when login is submitting
hbjORbj Sep 25, 2024
14e1430
make the data-testid better for saml button
hbjORbj Sep 25, 2024
d3edcce
Merge remote-tracking branch 'origin/main' into feature/new-signup-flow
hbjORbj Sep 25, 2024
8d66e94
give submit button testid and test its presence
hbjORbj Sep 25, 2024
a164828
add missing line
hbjORbj Sep 25, 2024
6f123a0
Merge branch 'main' into feature/new-signup-flow
joeauyeung Sep 25, 2024
69c664c
address code nit
hbjORbj Sep 26, 2024
88922f7
Merge branch 'main' into feature/new-signup-flow
joeauyeung Sep 26, 2024
d3252b8
Merge branch 'main' into feature/new-signup-flow
joeauyeung Sep 26, 2024
6c6c9e4
signin_with_google -> continue_with_google
hbjORbj Sep 26, 2024
d1bafe8
saml button and email form should be together
hbjORbj Sep 26, 2024
7a10f83
improve text
hbjORbj Sep 26, 2024
b9dd309
change button copy
hbjORbj Sep 26, 2024
cf2eeaf
new design
hbjORbj Sep 26, 2024
71bf7e9
password is not required for saml
hbjORbj Sep 26, 2024
8528d05
fix
hbjORbj Sep 26, 2024
840c7a2
make saml button disabled if username is not there
hbjORbj Sep 26, 2024
5e7abbb
Merge branch 'main' into feature/new-signup-flow
joeauyeung Sep 26, 2024
79c9ecc
fix
hbjORbj Sep 26, 2024
7cf2012
Merge branch 'main' into feature/new-signup-flow
joeauyeung Sep 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 46 additions & 34 deletions apps/web/modules/auth/login-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ interface LoginValues {
}

const GoogleIcon = () => (
<img className="text-subtle mr-2 h-4 w-4 dark:invert" src="/google-icon.svg" alt="" />
<img className="text-subtle mr-2 h-4 w-4" src="/google-icon-colored.svg" alt="Continue with Google Icon" />
);
export type PageProps = inferSSRProps<typeof getServerSideProps>;
export default function Login({
Expand Down Expand Up @@ -195,6 +195,50 @@ PageProps & WithNonceProps<{}>) {
: null
}>
<FormProvider {...methods}>
{!twoFactorRequired && (
<>
<div className="space-y-3">
{isGoogleLoginEnabled && (
<Button
color="primary"
className="w-full justify-center"
disabled={formState.isSubmitting}
data-testid="google"
CustomStartIcon={<GoogleIcon />}
onClick={async (e) => {
e.preventDefault();
setLastUsed("google");
await signIn("google", {
callbackUrl,
});
}}>
<span>{t("signin_with_google")}</span>
{lastUsed === "google" && <LastUsed />}
</Button>
)}
{displaySSOLogin && (
<SAMLLogin
disabled={formState.isSubmitting}
samlTenantID={samlTenantID}
samlProductID={samlProductID}
setErrorMessage={setErrorMessage}
/>
)}
</div>
{(isGoogleLoginEnabled || displaySSOLogin) && (
<div className="my-8">
<div className="relative flex items-center">
<div className="border-subtle flex-grow border-t" />
<span className="text-subtle mx-2 flex-shrink text-sm font-normal leading-none">
{t("or").toLocaleLowerCase()}
</span>
<div className="border-subtle flex-grow border-t" />
</div>
</div>
)}
</>
)}

<form onSubmit={methods.handleSubmit(onSubmit)} noValidate data-testid="login-form">
<div>
<input defaultValue={csrfToken || undefined} type="hidden" hidden {...register("csrfToken")} />
Expand Down Expand Up @@ -233,7 +277,7 @@ PageProps & WithNonceProps<{}>) {
{errorMessage && <Alert severity="error" title={errorMessage} />}
<Button
type="submit"
color="primary"
color="secondary"
disabled={formState.isSubmitting}
className="w-full justify-center">
<span>{twoFactorRequired ? t("submit") : t("sign_in")}</span>
Expand All @@ -243,38 +287,6 @@ PageProps & WithNonceProps<{}>) {
</Button>
</div>
</form>
{!twoFactorRequired && (
<>
{(isGoogleLoginEnabled || displaySSOLogin) && <hr className="border-subtle my-8" />}
<div className="space-y-3">
{isGoogleLoginEnabled && (
<Button
color="secondary"
className="w-full justify-center"
disabled={formState.isSubmitting}
data-testid="google"
CustomStartIcon={<GoogleIcon />}
onClick={async (e) => {
e.preventDefault();
setLastUsed("google");
await signIn("google", {
callbackUrl,
});
}}>
<span>{t("signin_with_google")}</span>
{lastUsed === "google" && <LastUsed />}
</Button>
)}
{displaySSOLogin && (
<SAMLLogin
samlTenantID={samlTenantID}
samlProductID={samlProductID}
setErrorMessage={setErrorMessage}
/>
)}
</div>
</>
)}
</FormProvider>
</AuthContainer>
<AddToHomescreen />
Expand Down
Loading
Loading