🔥(frontend) remove use of phone number data for mailbox creation
Remove phone number field from mailbox creation form and requests to comply with GPDR as it is not an information we need to collect for creating a mailbox. Deletes translations about phone number field in mailbox creation form. Updates related e2e tests.
This commit is contained in:
committed by
Sebastien Nobour
parent
66300aca66
commit
d69861c148
@@ -13,7 +13,6 @@ export interface CreateMailboxParams {
|
||||
last_name: string;
|
||||
local_part: string;
|
||||
secondary_email: string;
|
||||
phone_number: string;
|
||||
mailDomainSlug: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ const createMailboxValidationSchema = z.object({
|
||||
last_name: z.string().min(1),
|
||||
local_part: z.string().min(1),
|
||||
secondary_email: z.string().min(1),
|
||||
phone_number: z.string().min(1),
|
||||
});
|
||||
|
||||
export const CreateMailboxForm = ({
|
||||
@@ -52,7 +51,6 @@ export const CreateMailboxForm = ({
|
||||
last_name: '',
|
||||
local_part: '',
|
||||
secondary_email: '',
|
||||
phone_number: '',
|
||||
},
|
||||
mode: 'onChange',
|
||||
reValidateMode: 'onChange',
|
||||
@@ -250,26 +248,6 @@ const Form = ({
|
||||
)}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
<Box $margin={{ horizontal: 'none' }}>
|
||||
<Controller
|
||||
control={methods.control}
|
||||
name="phone_number"
|
||||
render={({ fieldState }) => (
|
||||
<Input
|
||||
aria-invalid={!!fieldState.error}
|
||||
label={t('Phone number')}
|
||||
state={fieldState.error ? 'error' : 'default'}
|
||||
text={
|
||||
fieldState.error
|
||||
? t('Please enter your phone number')
|
||||
: undefined
|
||||
}
|
||||
{...methods.register('phone_number')}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
</form>
|
||||
);
|
||||
|
||||
@@ -97,11 +97,9 @@
|
||||
"Ouch !": "Ouch !",
|
||||
"Owner": "Propriétaire",
|
||||
"Personal data and cookies": "Données personnelles et cookies",
|
||||
"Phone number": "Numéro de téléphone",
|
||||
"Please enter the first part of the email address, without including \"@\" in it": "Veuillez entrer la première partie de l'adresse e-mail, sans y inclure \"@\"",
|
||||
"Please enter your first name": "Veuillez saisir votre prénom",
|
||||
"Please enter your last name": "Veuillez saisir votre nom",
|
||||
"Please enter your phone number": "Veuillez indiquer votre numéro de téléphone",
|
||||
"Please enter your secondary email address": "Veuillez saisir votre adresse e-mail secondaire",
|
||||
"Publication Director": "Directeur de la publication",
|
||||
"Publisher": "Éditeur",
|
||||
|
||||
@@ -144,8 +144,7 @@ test.describe('Mail domain create mailbox', () => {
|
||||
payload.first_name === 'John' &&
|
||||
payload.last_name === 'Doe' &&
|
||||
payload.local_part === 'john.doe' &&
|
||||
payload.secondary_email === 'john.doe@mail.com' &&
|
||||
payload.phone_number === '003371020304050';
|
||||
payload.secondary_email === 'john.doe@mail.com';
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -173,7 +172,6 @@ test.describe('Mail domain create mailbox', () => {
|
||||
await page.getByLabel('Main email address').fill('john.doe');
|
||||
await expect(page.locator('span').getByText('@domain.fr')).toBeVisible();
|
||||
await page.getByLabel('Secondary email address').fill('john.doe@mail.com');
|
||||
await page.getByLabel('Phone number').fill('003371020304050');
|
||||
|
||||
await page.getByRole('button', { name: 'Submit' }).click();
|
||||
|
||||
@@ -240,14 +238,13 @@ test.describe('Mail domain create mailbox', () => {
|
||||
};
|
||||
|
||||
let isCreateMailboxRequestSent = false;
|
||||
page.on('request', (request) => {
|
||||
if (
|
||||
request.url().includes('/mail-domains/domainfr/mailboxes/') &&
|
||||
request.method() === 'POST'
|
||||
) {
|
||||
isCreateMailboxRequestSent = true;
|
||||
}
|
||||
});
|
||||
page.on(
|
||||
'request',
|
||||
(request) =>
|
||||
(isCreateMailboxRequestSent =
|
||||
request.url().includes('/mail-domains/domainfr/mailboxes/') &&
|
||||
request.method() === 'POST'),
|
||||
);
|
||||
|
||||
await interceptApiCalls();
|
||||
|
||||
@@ -269,9 +266,6 @@ test.describe('Mail domain create mailbox', () => {
|
||||
await expect(
|
||||
page.getByText('Please enter your secondary email address'),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByText('Please enter your phone number'),
|
||||
).toBeVisible();
|
||||
|
||||
expect(isCreateMailboxRequestSent).toBeFalsy();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user