mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-18 07:56:56 +00:00
feat: change copy /signup route (#8783)
* feat: change copy /signup route * feat: remove firstName from payload
This commit is contained in:
parent
9d04b397ac
commit
5a7ad670d8
@ -59,7 +59,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.signup-page-content {
|
.signup-page-content {
|
||||||
width: 720px;
|
width: 540px;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@ -102,7 +102,7 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
.ant-input {
|
.ant-input {
|
||||||
width: 60%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import afterLogin from 'AppRoutes/utils';
|
|||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
import { useNotifications } from 'hooks/useNotifications';
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import { ArrowRight } from 'lucide-react';
|
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { useQuery } from 'react-query';
|
import { useQuery } from 'react-query';
|
||||||
import { useLocation } from 'react-router-dom';
|
import { useLocation } from 'react-router-dom';
|
||||||
@ -23,7 +22,6 @@ import { FormContainer, Label } from './styles';
|
|||||||
import { isPasswordNotValidMessage, isPasswordValid } from './utils';
|
import { isPasswordNotValidMessage, isPasswordValid } from './utils';
|
||||||
|
|
||||||
type FormValues = {
|
type FormValues = {
|
||||||
firstName: string;
|
|
||||||
email: string;
|
email: string;
|
||||||
organizationName: string;
|
organizationName: string;
|
||||||
password: string;
|
password: string;
|
||||||
@ -114,10 +112,9 @@ function SignUp(): JSX.Element {
|
|||||||
|
|
||||||
const signUp = async (values: FormValues): Promise<void> => {
|
const signUp = async (values: FormValues): Promise<void> => {
|
||||||
try {
|
try {
|
||||||
const { organizationName, password, firstName, email } = values;
|
const { organizationName, password, email } = values;
|
||||||
const response = await signUpApi({
|
const response = await signUpApi({
|
||||||
email,
|
email,
|
||||||
name: firstName,
|
|
||||||
orgDisplayName: organizationName,
|
orgDisplayName: organizationName,
|
||||||
password,
|
password,
|
||||||
token: params.get('token') || undefined,
|
token: params.get('token') || undefined,
|
||||||
@ -142,11 +139,10 @@ function SignUp(): JSX.Element {
|
|||||||
|
|
||||||
const acceptInvite = async (values: FormValues): Promise<void> => {
|
const acceptInvite = async (values: FormValues): Promise<void> => {
|
||||||
try {
|
try {
|
||||||
const { password, email, firstName } = values;
|
const { password, email } = values;
|
||||||
await accept({
|
await accept({
|
||||||
password,
|
password,
|
||||||
token: params.get('token') || '',
|
token: params.get('token') || '',
|
||||||
displayName: firstName,
|
|
||||||
});
|
});
|
||||||
const loginResponse = await loginApi({
|
const loginResponse = await loginApi({
|
||||||
email,
|
email,
|
||||||
@ -208,7 +204,6 @@ function SignUp(): JSX.Element {
|
|||||||
if (!isPasswordValid(values.password)) {
|
if (!isPasswordValid(values.password)) {
|
||||||
logEvent('Account Creation Page - Invalid Password', {
|
logEvent('Account Creation Page - Invalid Password', {
|
||||||
email: values.email,
|
email: values.email,
|
||||||
name: values.firstName,
|
|
||||||
});
|
});
|
||||||
setIsPasswordPolicyError(true);
|
setIsPasswordPolicyError(true);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
@ -219,7 +214,6 @@ function SignUp(): JSX.Element {
|
|||||||
await signUp(values);
|
await signUp(values);
|
||||||
logEvent('Account Created Successfully', {
|
logEvent('Account Created Successfully', {
|
||||||
email: values.email,
|
email: values.email,
|
||||||
name: values.firstName,
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
await acceptInvite(values);
|
await acceptInvite(values);
|
||||||
@ -235,11 +229,6 @@ function SignUp(): JSX.Element {
|
|||||||
})();
|
})();
|
||||||
};
|
};
|
||||||
|
|
||||||
const getIsNameVisible = (): boolean =>
|
|
||||||
!(form.getFieldValue('firstName') === 0 && !isSignUp);
|
|
||||||
|
|
||||||
const isNameVisible = getIsNameVisible();
|
|
||||||
|
|
||||||
const handleValuesChange: (changedValues: Partial<FormValues>) => void = (
|
const handleValuesChange: (changedValues: Partial<FormValues>) => void = (
|
||||||
changedValues,
|
changedValues,
|
||||||
) => {
|
) => {
|
||||||
@ -260,7 +249,6 @@ function SignUp(): JSX.Element {
|
|||||||
loading ||
|
loading ||
|
||||||
!values.email ||
|
!values.email ||
|
||||||
(!precheck.sso && (!values.password || !values.confirmPassword)) ||
|
(!precheck.sso && (!values.password || !values.confirmPassword)) ||
|
||||||
(!isDetailsDisable && !values.firstName) ||
|
|
||||||
confirmPasswordError ||
|
confirmPasswordError ||
|
||||||
isPasswordPolicyError
|
isPasswordPolicyError
|
||||||
);
|
);
|
||||||
@ -288,8 +276,8 @@ function SignUp(): JSX.Element {
|
|||||||
>
|
>
|
||||||
<div className="signup-form-header">
|
<div className="signup-form-header">
|
||||||
<Typography.Paragraph className="signup-form-header-text">
|
<Typography.Paragraph className="signup-form-header-text">
|
||||||
Create your account to monitor, trace, and troubleshoot your applications
|
You're almost in. Create a password to start monitoring your
|
||||||
effortlessly.
|
applications with SigNoz.
|
||||||
</Typography.Paragraph>
|
</Typography.Paragraph>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -307,47 +295,22 @@ function SignUp(): JSX.Element {
|
|||||||
</FormContainer.Item>
|
</FormContainer.Item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{isNameVisible && (
|
|
||||||
<div className="first-name-container">
|
|
||||||
<Label htmlFor="signupFirstName">Name</Label>{' '}
|
|
||||||
<FormContainer.Item noStyle name="firstName">
|
|
||||||
<Input
|
|
||||||
placeholder="Your Name"
|
|
||||||
required
|
|
||||||
id="signupFirstName"
|
|
||||||
disabled={isDetailsDisable && form.getFieldValue('firstName')}
|
|
||||||
/>
|
|
||||||
</FormContainer.Item>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<div className="org-name-container">
|
|
||||||
<Label htmlFor="organizationName">Organization Name</Label>{' '}
|
|
||||||
<FormContainer.Item noStyle name="organizationName">
|
|
||||||
<Input
|
|
||||||
placeholder="Your Company"
|
|
||||||
id="organizationName"
|
|
||||||
disabled={isDetailsDisable}
|
|
||||||
/>
|
|
||||||
</FormContainer.Item>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{!precheck.sso && (
|
{!precheck.sso && (
|
||||||
<div className="password-section">
|
<>
|
||||||
<div className="password-container">
|
<div className="password-container">
|
||||||
<label htmlFor="Password">Password</label>{' '}
|
<Label htmlFor="currentPassword">Password</Label>
|
||||||
<FormContainer.Item noStyle name="password">
|
<FormContainer.Item noStyle name="password">
|
||||||
<Input.Password required id="currentPassword" />
|
<Input.Password required id="currentPassword" />
|
||||||
</FormContainer.Item>
|
</FormContainer.Item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="password-container">
|
<div className="password-container">
|
||||||
<label htmlFor="ConfirmPassword">Confirm Password</label>{' '}
|
<Label htmlFor="confirmPassword">Confirm Password</Label>
|
||||||
<FormContainer.Item noStyle name="confirmPassword">
|
<FormContainer.Item noStyle name="confirmPassword">
|
||||||
<Input.Password required id="confirmPassword" />
|
<Input.Password required id="confirmPassword" />
|
||||||
</FormContainer.Item>
|
</FormContainer.Item>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="password-error-container">
|
<div className="password-error-container">
|
||||||
@ -382,9 +345,9 @@ function SignUp(): JSX.Element {
|
|||||||
loading={loading}
|
loading={loading}
|
||||||
disabled={isValidForm()}
|
disabled={isValidForm()}
|
||||||
className="periscope-btn primary next-btn"
|
className="periscope-btn primary next-btn"
|
||||||
icon={<ArrowRight size={12} />}
|
block
|
||||||
>
|
>
|
||||||
Sign Up
|
Access My Workspace
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</FormContainer>
|
</FormContainer>
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
export interface Props {
|
export interface Props {
|
||||||
name: string;
|
|
||||||
orgDisplayName: string;
|
orgDisplayName: string;
|
||||||
email: string;
|
email: string;
|
||||||
password: string;
|
password: string;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user