-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5027 from novuhq/nv-3193-questionnaire-in-the-sig…
…n-up-flow Questionnaire in the sign-up flow
- Loading branch information
Showing
17 changed files
with
560 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import * as capitalize from 'lodash.capitalize'; | ||
import { JobTitleEnum, jobTitleToLabelMapper } from '@novu/shared'; | ||
|
||
describe('User Sign-up and Login', function () { | ||
describe('Sign up', function () { | ||
|
@@ -14,10 +15,17 @@ describe('User Sign-up and Login', function () { | |
cy.getByTestId('email').type('[email protected]'); | ||
cy.getByTestId('password').type('usEr_password_123!'); | ||
cy.getByTestId('accept-cb').click({ force: true }); | ||
|
||
cy.getByTestId('submitButton').click(); | ||
|
||
cy.location('pathname').should('equal', '/auth/application'); | ||
cy.getByTestId('app-creation').type('Organization Name'); | ||
cy.getByTestId('questionnaire-job-title').click(); | ||
cy.get('.mantine-Select-item').contains(jobTitleToLabelMapper[JobTitleEnum.PRODUCT_MANAGER]).click(); | ||
cy.getByTestId('questionnaire-company-name').type('Company Name'); | ||
cy.getByTestId('check-box-container-multi_channel').trigger('mouseover').click(); | ||
|
||
cy.getByTestId('submit-btn').click(); | ||
|
||
cy.location('pathname').should('equal', '/get-started'); | ||
}); | ||
|
||
|
@@ -51,7 +59,7 @@ describe('User Sign-up and Login', function () { | |
cy.loginWithGitHub(); | ||
|
||
cy.location('pathname').should('equal', '/auth/application'); | ||
cy.getByTestId('app-creation').type('Organization Name'); | ||
cy.getByTestId('questionnaire-company-name').type('Organization Name'); | ||
cy.getByTestId('submit-btn').click(); | ||
|
||
cy.location('pathname').should('equal', '/quickstart'); | ||
|
@@ -82,7 +90,7 @@ describe('User Sign-up and Login', function () { | |
cy.getByTestId('submitButton').click(); | ||
|
||
cy.location('pathname').should('equal', '/auth/application'); | ||
cy.getByTestId('app-creation').type('Organization Name'); | ||
cy.getByTestId('questionnaire-company-name').type('Organization Name'); | ||
cy.getByTestId('submit-btn').click(); | ||
|
||
cy.location('pathname').should('equal', '/quickstart'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 7 additions & 4 deletions
11
...src/pages/auth/CreateOrganizationPage.tsx → .../web/src/pages/auth/QuestionnairePage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
117 changes: 0 additions & 117 deletions
117
apps/web/src/pages/auth/components/CreateOrganizationForm.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import { Divider } from '@mantine/core'; | ||
import styled from '@emotion/styled'; | ||
import { Button as MantineButton } from '@mantine/core'; | ||
|
||
import { colors, GitHub, Google, Text } from '@novu/design-system'; | ||
|
||
import { When } from '../../../components/utils/When'; | ||
import { IS_DOCKER_HOSTED } from '../../../config'; | ||
import { buildGithubLink, buildGoogleLink, buildVercelGithubLink } from './gitHubUtils'; | ||
import { useVercelParams } from '../../../hooks'; | ||
|
||
export function OAuth({ invitationToken }: { invitationToken?: string | undefined }) { | ||
const { isFromVercel, code, next, configurationId } = useVercelParams(); | ||
|
||
const githubLink = isFromVercel | ||
? buildVercelGithubLink({ code, next, configurationId }) | ||
: buildGithubLink({ invitationToken }); | ||
const googleLink = buildGoogleLink({ invitationToken }); | ||
|
||
return ( | ||
<When truthy={!IS_DOCKER_HOSTED}> | ||
<> | ||
<Container> | ||
<OAuthButton | ||
component="a" | ||
href={githubLink} | ||
my={30} | ||
variant="white" | ||
fullWidth | ||
radius="md" | ||
leftIcon={<GitHub />} | ||
sx={{ color: colors.B40, fontSize: '16px', fontWeight: 700, height: '50px', marginRight: 10 }} | ||
data-test-id="github-button" | ||
> | ||
Sign In with GitHub | ||
</OAuthButton> | ||
<OAuthButton | ||
component="a" | ||
href={googleLink} | ||
my={30} | ||
variant="white" | ||
fullWidth | ||
radius="md" | ||
leftIcon={<Google />} | ||
data-test-id="google-button" | ||
sx={{ color: colors.B40, fontSize: '16px', fontWeight: 700, height: '50px', marginLeft: 10 }} | ||
> | ||
Sign In with Google | ||
</OAuthButton> | ||
</Container> | ||
<Divider label={<Text color={colors.B40}>Or</Text>} color={colors.B30} labelPosition="center" my="md" /> | ||
</> | ||
</When> | ||
); | ||
} | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
justify-content: space-between; | ||
`; | ||
|
||
const OAuthButton = styled(MantineButton)<{ | ||
component: 'a'; | ||
my: number; | ||
href: string; | ||
variant: 'white'; | ||
fullWidth: boolean; | ||
radius: 'md'; | ||
leftIcon: any; | ||
sx: any; | ||
}>` | ||
:hover { | ||
color: ${colors.B40}; | ||
} | ||
`; |
Oops, something went wrong.