From fbdcfa7a7b1c78930c8ce423be609c9a36ec1bd3 Mon Sep 17 00:00:00 2001 From: MathildeDuboille Date: Wed, 10 Nov 2021 11:20:39 +0100 Subject: [PATCH] (PC-11490) create constants for fields label --- .../FormContact/FormContact.tsx | 5 +-- .../FormNotifications/FormNotifications.tsx | 5 +-- .../FormOfferVenue/FormOfferVenue.tsx | 11 ++++-- .../FormType/FormType.tsx | 14 +++++--- .../FormVenue/FormVenue.tsx | 5 +-- .../OfferEducationalDefaultValues.spec.tsx | 35 +++++++++++++------ .../__tests-utils__/eacOfferCreationUtils.ts | 6 ++-- .../OfferEducational/constants/labels.ts | 13 +++++++ 8 files changed, 68 insertions(+), 26 deletions(-) create mode 100644 src/screens/OfferEducational/constants/labels.ts diff --git a/src/screens/OfferEducational/OfferEducationalForm/FormContact/FormContact.tsx b/src/screens/OfferEducational/OfferEducationalForm/FormContact/FormContact.tsx index d40fd9bdb..e95423a72 100644 --- a/src/screens/OfferEducational/OfferEducationalForm/FormContact/FormContact.tsx +++ b/src/screens/OfferEducational/OfferEducationalForm/FormContact/FormContact.tsx @@ -2,6 +2,7 @@ import React from 'react' import { TextInput } from 'ui-kit' +import { EMAIL_LABEL, PHONE_LABEL } from '../../constants/labels' import FormSection from '../FormSection' import styles from './FormContact.module.scss' @@ -14,13 +15,13 @@ const FormContact = (): JSX.Element => { >
diff --git a/src/screens/OfferEducational/OfferEducationalForm/FormNotifications/FormNotifications.tsx b/src/screens/OfferEducational/OfferEducationalForm/FormNotifications/FormNotifications.tsx index a88fa769c..4b20b8cbb 100644 --- a/src/screens/OfferEducational/OfferEducationalForm/FormNotifications/FormNotifications.tsx +++ b/src/screens/OfferEducational/OfferEducationalForm/FormNotifications/FormNotifications.tsx @@ -2,6 +2,7 @@ import React from 'react' import { Checkbox, TextInput } from 'ui-kit' +import { NOTIFICATIONS_EMAIL_LABEL, NOTIFICATIONS_LABEL } from '../../constants/labels' import FormSection from '../FormSection' import styles from './FormNotifications.module.scss' @@ -12,13 +13,13 @@ const FormNotifications = (): JSX.Element => { title="Notifications" >
diff --git a/src/screens/OfferEducational/OfferEducationalForm/FormOfferVenue/FormOfferVenue.tsx b/src/screens/OfferEducational/OfferEducationalForm/FormOfferVenue/FormOfferVenue.tsx index f227fb450..3ced60a20 100644 --- a/src/screens/OfferEducational/OfferEducationalForm/FormOfferVenue/FormOfferVenue.tsx +++ b/src/screens/OfferEducational/OfferEducationalForm/FormOfferVenue/FormOfferVenue.tsx @@ -2,6 +2,11 @@ import React from 'react' import { RadioButton } from 'ui-kit' +import { + OFFER_VENUE_OFFERER_LABEL, + OFFER_VENUE_OTHER_LABEL, + OFFER_VENUE_SCHOOL_LABEL, +} from '../../constants/labels' import FormSection from '../FormSection' import styles from './FormOfferVenue.module.scss' @@ -18,17 +23,17 @@ const FormOfferVenue = (): JSX.Element => {
diff --git a/src/screens/OfferEducational/OfferEducationalForm/FormType/FormType.tsx b/src/screens/OfferEducational/OfferEducationalForm/FormType/FormType.tsx index 6f55906c3..9b9df924e 100644 --- a/src/screens/OfferEducational/OfferEducationalForm/FormType/FormType.tsx +++ b/src/screens/OfferEducational/OfferEducationalForm/FormType/FormType.tsx @@ -3,6 +3,12 @@ import React from 'react' import { Category, SubCategory } from 'custom_types/categories' import { Select, TextArea, TextInput } from 'ui-kit' +import { + CATEGORY_LABEL, + DESCRIPTION_LABEL, + SUBCATEGORY_LABEL, + TITLE_LABEL, +} from '../../constants/labels' import FormSection from '../FormSection' import styles from './FormType.module.scss' @@ -29,27 +35,27 @@ const EACOfferCreationType = ({ >