* Replace Terms & Conditions with Sign Up Link on Sign In #4502 * terms replaced with signup link * begin fix (incomplete / do not merge) * Revert * Introduce welcome page * Update Twenty website --------- Co-authored-by: Mamatha Yarramaneni <mamathayarramaneni@Mamathas-Macbook.local> Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
This commit is contained in:
@ -22,7 +22,7 @@ jest.mock('react-router-dom', () => {
|
||||
const Wrapper = ({ children }: { children: React.ReactNode }) => (
|
||||
<RecoilRoot>
|
||||
<MemoryRouter
|
||||
initialEntries={['/sign-in', '/verify', '/opportunities']}
|
||||
initialEntries={['/welcome', '/verify', '/opportunities']}
|
||||
initialIndex={2}
|
||||
>
|
||||
{children}
|
||||
@ -44,7 +44,7 @@ describe('useApolloFactory', () => {
|
||||
expect(res).toHaveProperty('query');
|
||||
});
|
||||
|
||||
it('should navigate to /sign-in on unauthenticated error', async () => {
|
||||
it('should navigate to /welcome on unauthenticated error', async () => {
|
||||
const errors = [
|
||||
{
|
||||
extensions: {
|
||||
@ -90,7 +90,7 @@ describe('useApolloFactory', () => {
|
||||
expect((error as ApolloError).message).toBe('Error message not found.');
|
||||
|
||||
expect(mockNavigate).toHaveBeenCalled();
|
||||
expect(mockNavigate).toHaveBeenCalledWith('/sign-in');
|
||||
expect(mockNavigate).toHaveBeenCalledWith('/welcome');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@ -41,12 +41,11 @@ export const useApolloFactory = () => {
|
||||
setTokenPair(null);
|
||||
if (
|
||||
!isMatchingLocation(AppPath.Verify) &&
|
||||
!isMatchingLocation(AppPath.SignIn) &&
|
||||
!isMatchingLocation(AppPath.SignUp) &&
|
||||
!isMatchingLocation(AppPath.SignInUp) &&
|
||||
!isMatchingLocation(AppPath.Invite) &&
|
||||
!isMatchingLocation(AppPath.ResetPassword)
|
||||
) {
|
||||
navigate(AppPath.SignIn);
|
||||
navigate(AppPath.SignInUp);
|
||||
}
|
||||
},
|
||||
extraLinks: [],
|
||||
|
||||
@ -94,10 +94,17 @@ export const SignInUpForm = () => {
|
||||
return `Join ${workspace?.displayName ?? ''} team`;
|
||||
}
|
||||
|
||||
if (
|
||||
signInUpStep === SignInUpStep.Init ||
|
||||
signInUpStep === SignInUpStep.Email
|
||||
) {
|
||||
return 'Welcome to Twenty';
|
||||
}
|
||||
|
||||
return signInUpMode === SignInUpMode.SignIn
|
||||
? 'Sign in to Twenty'
|
||||
: 'Sign up to Twenty';
|
||||
}, [signInUpMode, workspace?.displayName, isInviteMode]);
|
||||
}, [signInUpMode, workspace?.displayName, isInviteMode, signInUpStep]);
|
||||
|
||||
const theme = useTheme();
|
||||
|
||||
@ -230,14 +237,14 @@ export const SignInUpForm = () => {
|
||||
/>
|
||||
</StyledForm>
|
||||
</StyledContentContainer>
|
||||
{signInUpStep === SignInUpStep.Password ? (
|
||||
{signInUpStep === SignInUpStep.Password && (
|
||||
<ActionLink onClick={handleResetPassword(form.getValues('email'))}>
|
||||
Forgot your password?
|
||||
</ActionLink>
|
||||
) : (
|
||||
)}
|
||||
{signInUpStep === SignInUpStep.Init && (
|
||||
<FooterNote>
|
||||
By using Twenty, you agree to the Terms of Service and Data Processing
|
||||
Agreement.
|
||||
By using Twenty, you agree to the Terms of Service and Privacy Policy.
|
||||
</FooterNote>
|
||||
)}
|
||||
</>
|
||||
|
||||
@ -39,7 +39,7 @@ export const useSignInUp = (form: UseFormReturn<Form>) => {
|
||||
);
|
||||
|
||||
const [signInUpMode, setSignInUpMode] = useState<SignInUpMode>(() => {
|
||||
return isMatchingLocation(AppPath.SignIn)
|
||||
return isMatchingLocation(AppPath.SignInUp)
|
||||
? SignInUpMode.SignIn
|
||||
: SignInUpMode.SignUp;
|
||||
});
|
||||
@ -53,7 +53,7 @@ export const useSignInUp = (form: UseFormReturn<Form>) => {
|
||||
const continueWithEmail = useCallback(() => {
|
||||
setSignInUpStep(SignInUpStep.Email);
|
||||
setSignInUpMode(
|
||||
isMatchingLocation(AppPath.SignIn)
|
||||
isMatchingLocation(AppPath.SignInUp)
|
||||
? SignInUpMode.SignIn
|
||||
: SignInUpMode.SignUp,
|
||||
);
|
||||
|
||||
@ -29,7 +29,7 @@ export const useSignInUpForm = () => {
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (isSignInPrefilled) {
|
||||
if (isSignInPrefilled === true) {
|
||||
form.setValue('email', 'tim@apple.dev');
|
||||
form.setValue('password', 'Applecar2025');
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ export const SettingsNavigationDrawerItems = () => {
|
||||
|
||||
const handleLogout = useCallback(() => {
|
||||
signOut();
|
||||
navigate(AppPath.SignIn);
|
||||
navigate(AppPath.SignInUp);
|
||||
}, [signOut, navigate]);
|
||||
|
||||
const isCalendarEnabled = useIsFeatureEnabled('IS_CALENDAR_ENABLED');
|
||||
|
||||
@ -22,7 +22,7 @@ export const DeleteAccount = () => {
|
||||
|
||||
const handleLogout = useCallback(() => {
|
||||
signOut();
|
||||
navigate(AppPath.SignIn);
|
||||
navigate(AppPath.SignInUp);
|
||||
}, [signOut, navigate]);
|
||||
|
||||
const deleteAccount = async () => {
|
||||
|
||||
@ -24,7 +24,7 @@ export const DeleteWorkspace = () => {
|
||||
|
||||
const handleLogout = useCallback(() => {
|
||||
signOut();
|
||||
navigate(AppPath.SignIn);
|
||||
navigate(AppPath.SignInUp);
|
||||
}, [signOut, navigate]);
|
||||
|
||||
const deleteWorkspace = async () => {
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
export enum AppPath {
|
||||
// Not logged-in
|
||||
Verify = '/verify',
|
||||
SignIn = '/sign-in',
|
||||
SignUp = '/sign-up',
|
||||
SignInUp = '/welcome',
|
||||
Invite = '/invite/:workspaceInviteHash',
|
||||
ResetPassword = '/reset-password/:passwordResetToken',
|
||||
|
||||
|
||||
Reference in New Issue
Block a user