richie-education 3.2.1-dev9 → 3.2.2-dev26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/i18n/locales/ar-SA.json +29 -1
- package/i18n/locales/es-ES.json +29 -1
- package/i18n/locales/fa-IR.json +29 -1
- package/i18n/locales/fr-CA.json +29 -1
- package/i18n/locales/fr-FR.json +29 -1
- package/i18n/locales/ko-KR.json +29 -1
- package/i18n/locales/pt-PT.json +29 -1
- package/i18n/locales/ru-RU.json +29 -1
- package/i18n/locales/vi-VN.json +29 -1
- package/js/api/joanie.ts +144 -0
- package/js/components/PaymentInterfaces/types.ts +7 -0
- package/js/components/PaymentScheduleGrid/index.tsx +4 -2
- package/js/components/SaleTunnel/AddressSelector/index.spec.tsx +9 -2
- package/js/components/SaleTunnel/GenericSaleTunnel.tsx +33 -0
- package/js/components/SaleTunnel/SaleTunnelInformation/SaleTunnelInformationGroup.tsx +253 -0
- package/js/components/SaleTunnel/SaleTunnelInformation/SaleTunnelInformationSingular.tsx +314 -0
- package/js/components/SaleTunnel/SaleTunnelInformation/StepContent.tsx +528 -0
- package/js/components/SaleTunnel/SaleTunnelInformation/index.tsx +47 -261
- package/js/components/SaleTunnel/SaleTunnelSuccess/index.tsx +25 -11
- package/js/components/SaleTunnel/SubscriptionButton/index.tsx +54 -6
- package/js/components/SaleTunnel/_styles.scss +55 -0
- package/js/components/SaleTunnel/index.full-process-b2b.spec.tsx +356 -0
- package/js/components/SaleTunnel/{index.full-process.spec.tsx → index.full-process-b2c.spec.tsx} +4 -1
- package/js/components/SaleTunnel/index.spec.tsx +130 -1
- package/js/hooks/useBatchOrder/index.tsx +36 -0
- package/js/hooks/useContractArchive/index.ts +2 -0
- package/js/hooks/useOfferingOrganizations/index.tsx +38 -0
- package/js/hooks/useOrganizationAgreements.tsx/index.tsx +66 -0
- package/js/hooks/useOrganizationQuotes/index.tsx +56 -0
- package/js/hooks/usePaymentPlan.tsx +2 -1
- package/js/hooks/useTeacherPendingAgreementsCount/index.ts +34 -0
- package/js/pages/DashboardBatchOrderLayout/_styles.scss +5 -0
- package/js/pages/DashboardBatchOrderLayout/index.spec.tsx +78 -0
- package/js/pages/DashboardBatchOrderLayout/index.tsx +45 -0
- package/js/pages/DashboardBatchOrders/index.spec.tsx +237 -0
- package/js/pages/DashboardBatchOrders/index.tsx +84 -0
- package/js/pages/TeacherDashboardContractsLayout/TeacherDashboardCourseContractsLayout/index.tsx +0 -1
- package/js/pages/TeacherDashboardContractsLayout/hooks/useDownloadContractArchive/index.tsx +3 -1
- package/js/pages/TeacherDashboardOrganizationAgreements/AgreementActionsBar.tsx +49 -0
- package/js/pages/TeacherDashboardOrganizationAgreements/BulkAgreementContractButton.tsx +79 -0
- package/js/pages/TeacherDashboardOrganizationAgreements/OrganizationAgreementFrame.tsx +71 -0
- package/js/pages/TeacherDashboardOrganizationAgreements/SignOrganizationAgreementButton.tsx +60 -0
- package/js/pages/TeacherDashboardOrganizationAgreements/hooks/useAgreementsAbilities.tsx +8 -0
- package/js/pages/TeacherDashboardOrganizationAgreements/hooks/useHasAgreementToDownload.tsx +27 -0
- package/js/pages/TeacherDashboardOrganizationAgreements/hooks/useTeacherAgreementsToSign.tsx +32 -0
- package/js/pages/TeacherDashboardOrganizationAgreements/index.spec.tsx +433 -0
- package/js/pages/TeacherDashboardOrganizationAgreements/index.tsx +130 -0
- package/js/pages/TeacherDashboardOrganizationAgreementsLayout/index.tsx +25 -0
- package/js/pages/TeacherDashboardOrganizationCourseLoader/index.spec.tsx +9 -0
- package/js/pages/TeacherDashboardOrganizationQuotes/_styles.scss +40 -0
- package/js/pages/TeacherDashboardOrganizationQuotes/index.full-process.spec.tsx +194 -0
- package/js/pages/TeacherDashboardOrganizationQuotes/index.spec.tsx +144 -0
- package/js/pages/TeacherDashboardOrganizationQuotes/index.tsx +521 -0
- package/js/pages/TeacherDashboardOrganizationQuotesLayout/index.tsx +26 -0
- package/js/translations/ar-SA.json +1 -1
- package/js/translations/es-ES.json +1 -1
- package/js/translations/fa-IR.json +1 -1
- package/js/translations/fr-CA.json +1 -1
- package/js/translations/fr-FR.json +1 -1
- package/js/translations/ko-KR.json +1 -1
- package/js/translations/pt-PT.json +1 -1
- package/js/translations/ru-RU.json +1 -1
- package/js/translations/vi-VN.json +1 -1
- package/js/types/Joanie.ts +216 -1
- package/js/utils/AbilitiesHelper/agreementAbilities.ts +14 -0
- package/js/utils/AbilitiesHelper/index.ts +7 -0
- package/js/utils/AbilitiesHelper/types.ts +12 -3
- package/js/utils/ObjectHelper/index.ts +20 -0
- package/js/utils/OrderHelper/index.ts +10 -0
- package/js/utils/errors/HttpError.ts +1 -0
- package/js/utils/test/factories/joanie.ts +156 -1
- package/js/widgets/Dashboard/components/DashboardBatchOrderLoader/_styles.scss +14 -0
- package/js/widgets/Dashboard/components/DashboardBatchOrderLoader/index.tsx +32 -0
- package/js/widgets/Dashboard/components/DashboardCard/index.spec.tsx +18 -0
- package/js/widgets/Dashboard/components/DashboardCard/index.stories.tsx +25 -2
- package/js/widgets/Dashboard/components/DashboardCard/index.tsx +4 -2
- package/js/widgets/Dashboard/components/DashboardItem/BatchOrder/BatchOrderPaymentModal/BatchOrderPaymentManager.tsx +88 -0
- package/js/widgets/Dashboard/components/DashboardItem/BatchOrder/BatchOrderPaymentModal/index.tsx +216 -0
- package/js/widgets/Dashboard/components/DashboardItem/BatchOrder/DashboardBatchOrderSubItems.tsx +316 -0
- package/js/widgets/Dashboard/components/DashboardItem/BatchOrder/index.spec.tsx +27 -0
- package/js/widgets/Dashboard/components/DashboardItem/BatchOrder/index.tsx +175 -0
- package/js/widgets/Dashboard/components/DashboardItem/Order/DashboardItemOrder.tsx +5 -2
- package/js/widgets/Dashboard/components/DashboardItem/Order/OrganizationBlock/index.tsx +4 -1
- package/js/widgets/Dashboard/components/DashboardItem/Order/_styles.scss +5 -0
- package/js/widgets/Dashboard/components/DashboardItem/_styles.scss +43 -0
- package/js/widgets/Dashboard/components/DashboardSidebar/components/AgreementNavLink/index.spec.tsx +214 -0
- package/js/widgets/Dashboard/components/DashboardSidebar/components/AgreementNavLink/index.tsx +47 -0
- package/js/widgets/Dashboard/components/LearnerDashboardSidebar/index.tsx +1 -0
- package/js/widgets/Dashboard/components/TeacherDashboardOrganizationSidebar/index.spec.tsx +21 -3
- package/js/widgets/Dashboard/components/TeacherDashboardOrganizationSidebar/index.tsx +9 -0
- package/js/widgets/Dashboard/utils/learnerRoutes.tsx +30 -0
- package/js/widgets/Dashboard/utils/learnerRoutesPaths.tsx +12 -0
- package/js/widgets/Dashboard/utils/teacherDashboardPaths.tsx +12 -0
- package/js/widgets/Dashboard/utils/teacherRoutes.tsx +17 -0
- package/js/widgets/SyllabusCourseRunsList/components/CourseProductItem/index.spec.tsx +8 -2
- package/package.json +4 -1
- package/scss/colors/_theme.scss +1 -1
- package/scss/components/_index.scss +1 -0
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
|
3
|
+
import { UseFormReturn } from 'react-hook-form';
|
|
4
|
+
import { Checkbox, Input, Radio, RadioGroup, Select } from '@openfun/cunningham-react';
|
|
5
|
+
import { useOfferingOrganizations } from 'hooks/useOfferingOrganizations';
|
|
6
|
+
import { BatchOrder } from 'types/Joanie';
|
|
7
|
+
import { CountrySelectField, getLocalizedCunninghamErrorProp } from 'components/Form';
|
|
8
|
+
import { useSaleTunnelContext } from 'components/SaleTunnel/GenericSaleTunnel';
|
|
9
|
+
import { PaymentMethod } from 'components/PaymentInterfaces/types';
|
|
10
|
+
|
|
11
|
+
const messages = defineMessages({
|
|
12
|
+
stepCompany: {
|
|
13
|
+
id: 'components.SaleTunnel.BatchOrderForm.stepCompany',
|
|
14
|
+
description: 'Step label for company information in the batch order form',
|
|
15
|
+
defaultMessage: 'Organization',
|
|
16
|
+
},
|
|
17
|
+
stepAdmin: {
|
|
18
|
+
id: 'components.SaleTunnel.BatchOrderForm.stepAdmin',
|
|
19
|
+
description: 'Step label for administrative follow-up in the batch order form',
|
|
20
|
+
defaultMessage: 'Follow-up',
|
|
21
|
+
},
|
|
22
|
+
stepParticipants: {
|
|
23
|
+
id: 'components.SaleTunnel.BatchOrderForm.stepParticipants',
|
|
24
|
+
description: 'Step label for participants information in the batch order form',
|
|
25
|
+
defaultMessage: 'Participants',
|
|
26
|
+
},
|
|
27
|
+
stepFinancing: {
|
|
28
|
+
id: 'components.SaleTunnel.BatchOrderForm.stepFinancing',
|
|
29
|
+
description: 'Step label for financing/payment in the batch order form',
|
|
30
|
+
defaultMessage: 'Financing',
|
|
31
|
+
},
|
|
32
|
+
stepCompanyTitle: {
|
|
33
|
+
id: 'components.SaleTunnel.BatchOrderForm.stepCompanyTitle',
|
|
34
|
+
description: 'Title of the section with company/organization details',
|
|
35
|
+
defaultMessage: 'Information about your company / organisation',
|
|
36
|
+
},
|
|
37
|
+
stepAdminTitle: {
|
|
38
|
+
id: 'components.SaleTunnel.BatchOrderForm.stepAdminTitle',
|
|
39
|
+
description:
|
|
40
|
+
'Title of the section with details about the person responsible for admin follow-up',
|
|
41
|
+
defaultMessage: 'Responsible for the administrative follow-up',
|
|
42
|
+
},
|
|
43
|
+
stepSignatoryTitle: {
|
|
44
|
+
id: 'components.SaleTunnel.BatchOrderForm.stepSignatoryTitle',
|
|
45
|
+
description:
|
|
46
|
+
'Title of the section with details about the person responsible for signing the quote',
|
|
47
|
+
defaultMessage: 'Authorized signatory',
|
|
48
|
+
},
|
|
49
|
+
stepBillingTitle: {
|
|
50
|
+
id: 'components.SaleTunnel.BatchOrderForm.stepBillingTitle',
|
|
51
|
+
description: 'Title of the section with billing details',
|
|
52
|
+
defaultMessage: 'Billing informations',
|
|
53
|
+
},
|
|
54
|
+
stepParticipantsTitle: {
|
|
55
|
+
id: 'components.SaleTunnel.BatchOrderForm.stepParticipantsTitle',
|
|
56
|
+
description: 'Title of the section to enter the number of registrations/participants',
|
|
57
|
+
defaultMessage: 'How many registrations ?',
|
|
58
|
+
},
|
|
59
|
+
stepFinancingTitle: {
|
|
60
|
+
id: 'components.SaleTunnel.BatchOrderForm.stepFinancingTitle',
|
|
61
|
+
description: 'Title of the section to select the payment plan of the course',
|
|
62
|
+
defaultMessage: 'Payment plan of the course',
|
|
63
|
+
},
|
|
64
|
+
companyName: {
|
|
65
|
+
id: 'batchOrder.companyName',
|
|
66
|
+
description: 'Label for the field asking the name of the company',
|
|
67
|
+
defaultMessage: 'Company name',
|
|
68
|
+
},
|
|
69
|
+
identificationNumber: {
|
|
70
|
+
id: 'batchOrder.identificationNumber',
|
|
71
|
+
description:
|
|
72
|
+
'Label for the field asking the company identification number (eg. SIRET in France)',
|
|
73
|
+
defaultMessage: 'Identification number (SIRET for french company)',
|
|
74
|
+
},
|
|
75
|
+
vatNumber: {
|
|
76
|
+
id: 'batchOrder.vatNumber',
|
|
77
|
+
description: 'Label for the field asking the company VAT number',
|
|
78
|
+
defaultMessage: 'VAT number',
|
|
79
|
+
},
|
|
80
|
+
address: {
|
|
81
|
+
id: 'batchOrder.address',
|
|
82
|
+
description: 'Label for the field asking the company address',
|
|
83
|
+
defaultMessage: 'Address',
|
|
84
|
+
},
|
|
85
|
+
postCode: {
|
|
86
|
+
id: 'batchOrder.postCode',
|
|
87
|
+
description: 'Label for the field asking the postal code',
|
|
88
|
+
defaultMessage: 'Post code',
|
|
89
|
+
},
|
|
90
|
+
city: {
|
|
91
|
+
id: 'batchOrder.city',
|
|
92
|
+
description: 'Label for the field asking the city',
|
|
93
|
+
defaultMessage: 'City',
|
|
94
|
+
},
|
|
95
|
+
country: {
|
|
96
|
+
id: 'batchOrder.country',
|
|
97
|
+
description: 'Label for the field asking the country',
|
|
98
|
+
defaultMessage: 'Country',
|
|
99
|
+
},
|
|
100
|
+
firstName: {
|
|
101
|
+
id: 'batchOrder.firstName',
|
|
102
|
+
description: 'Label for the field asking the first name of the contact person',
|
|
103
|
+
defaultMessage: 'First name',
|
|
104
|
+
},
|
|
105
|
+
lastName: {
|
|
106
|
+
id: 'batchOrder.lastName',
|
|
107
|
+
description: 'Label for the field asking the last name of the contact person',
|
|
108
|
+
defaultMessage: 'Last name',
|
|
109
|
+
},
|
|
110
|
+
role: {
|
|
111
|
+
id: 'batchOrder.role',
|
|
112
|
+
description: 'Label for the field asking the role/position of the contact person',
|
|
113
|
+
defaultMessage: 'Role',
|
|
114
|
+
},
|
|
115
|
+
email: {
|
|
116
|
+
id: 'batchOrder.email',
|
|
117
|
+
description: 'Label for the field asking the email address of the contact person',
|
|
118
|
+
defaultMessage: 'Email',
|
|
119
|
+
},
|
|
120
|
+
phone: {
|
|
121
|
+
id: 'batchOrder.phone',
|
|
122
|
+
description: 'Label for the field asking the phone number of the contact person',
|
|
123
|
+
defaultMessage: 'Phone',
|
|
124
|
+
},
|
|
125
|
+
checkBilling: {
|
|
126
|
+
id: 'components.SaleTunnel.BatchOrderForm.checkBilling',
|
|
127
|
+
description: 'Checkbox label to indicate using alternative billing information',
|
|
128
|
+
defaultMessage: 'Use other informations for billing',
|
|
129
|
+
},
|
|
130
|
+
contactName: {
|
|
131
|
+
id: 'batchOrder.contactName',
|
|
132
|
+
description: 'Label for the field asking the billing contact name',
|
|
133
|
+
defaultMessage: 'Name of the contact',
|
|
134
|
+
},
|
|
135
|
+
contactEmail: {
|
|
136
|
+
id: 'batchOrder.contactEmail',
|
|
137
|
+
description: 'Label for the field asking the billing contact email',
|
|
138
|
+
defaultMessage: 'Email of the contact',
|
|
139
|
+
},
|
|
140
|
+
nbSeats: {
|
|
141
|
+
id: 'batchOrder.nbSeats',
|
|
142
|
+
description: 'Label for the field asking the number of participants/seats',
|
|
143
|
+
defaultMessage: 'How many participants ?',
|
|
144
|
+
},
|
|
145
|
+
cardPayment: {
|
|
146
|
+
id: 'batchOrder.cardPayment',
|
|
147
|
+
description: 'Option label for selecting credit card payment',
|
|
148
|
+
defaultMessage: 'Payment by credit card',
|
|
149
|
+
},
|
|
150
|
+
bankTransfer: {
|
|
151
|
+
id: 'batchOrder.bankTransfer',
|
|
152
|
+
description: 'Option label for selecting bank transfer payment',
|
|
153
|
+
defaultMessage: 'Payment by bank transfer',
|
|
154
|
+
},
|
|
155
|
+
purchaseOrder: {
|
|
156
|
+
id: 'batchOrder.purchaseOrder',
|
|
157
|
+
description: 'Option label for selecting payment via purchase order',
|
|
158
|
+
defaultMessage: 'Payment with purchase order',
|
|
159
|
+
},
|
|
160
|
+
withoutOrderForm: {
|
|
161
|
+
id: 'batchOrder.withoutOrderForm',
|
|
162
|
+
description: 'Option label for selecting payment without order form',
|
|
163
|
+
defaultMessage: 'Without order form',
|
|
164
|
+
},
|
|
165
|
+
opco: {
|
|
166
|
+
id: 'batchOrder.opc',
|
|
167
|
+
description: 'Label for the field asking the OPCO (French training funding organisation)',
|
|
168
|
+
defaultMessage: 'OPCO',
|
|
169
|
+
},
|
|
170
|
+
fundingEntity: {
|
|
171
|
+
id: 'batchOrder.fundingEntity',
|
|
172
|
+
description: 'Label for the field asking the type of funding entity',
|
|
173
|
+
defaultMessage: 'Funding entity',
|
|
174
|
+
},
|
|
175
|
+
fundingEntityName: {
|
|
176
|
+
id: 'batchOrder.fundingEntityName',
|
|
177
|
+
description: 'Label for the field asking the name of the funding entity',
|
|
178
|
+
defaultMessage: 'Entity name',
|
|
179
|
+
},
|
|
180
|
+
fundingEntityAmount: {
|
|
181
|
+
id: 'batchOrder.fundingEntityAmount',
|
|
182
|
+
description: 'Label for the field asking the amount covered by the funding entity',
|
|
183
|
+
defaultMessage: 'Amount covered',
|
|
184
|
+
},
|
|
185
|
+
recommandation: {
|
|
186
|
+
id: 'batchOrder.recommandation',
|
|
187
|
+
description:
|
|
188
|
+
'Label for the field asking how the user heard about or was recommended the course',
|
|
189
|
+
defaultMessage: 'This course was recommended to me by',
|
|
190
|
+
},
|
|
191
|
+
participatingOrganisations: {
|
|
192
|
+
id: 'batchOrder.participatingOrganisations',
|
|
193
|
+
description: 'Label for the field listing other participating organisations',
|
|
194
|
+
defaultMessage: 'Participating organisations',
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
export const StepContent = ({
|
|
199
|
+
activeStep,
|
|
200
|
+
form,
|
|
201
|
+
}: {
|
|
202
|
+
activeStep: number;
|
|
203
|
+
form: UseFormReturn<BatchOrder>;
|
|
204
|
+
}) => {
|
|
205
|
+
const intl = useIntl();
|
|
206
|
+
const { register, formState } = form;
|
|
207
|
+
const { offering } = useSaleTunnelContext();
|
|
208
|
+
const { items: organizations } = useOfferingOrganizations({ id: offering?.id });
|
|
209
|
+
const orgOptions = organizations.map((organization) => ({
|
|
210
|
+
label: organization.title,
|
|
211
|
+
value: organization.code,
|
|
212
|
+
}));
|
|
213
|
+
const [otherBillingAddress, setOtherBillingAddress] = useState(false);
|
|
214
|
+
|
|
215
|
+
return (
|
|
216
|
+
<div className="step-content">
|
|
217
|
+
<div className="step organization" hidden={activeStep !== 0}>
|
|
218
|
+
<FormattedMessage {...messages.stepCompanyTitle} />
|
|
219
|
+
<Input
|
|
220
|
+
className="field"
|
|
221
|
+
label={intl.formatMessage(messages.companyName)}
|
|
222
|
+
{...register('company_name')}
|
|
223
|
+
required
|
|
224
|
+
state={formState.errors.company_name?.message ? 'error' : 'default'}
|
|
225
|
+
text={getLocalizedCunninghamErrorProp(intl, formState.errors.company_name?.message).text}
|
|
226
|
+
/>
|
|
227
|
+
<Input
|
|
228
|
+
className="field"
|
|
229
|
+
{...register('identification_number')}
|
|
230
|
+
required
|
|
231
|
+
state={formState.errors.identification_number?.message ? 'error' : 'default'}
|
|
232
|
+
text={
|
|
233
|
+
getLocalizedCunninghamErrorProp(intl, formState.errors.identification_number?.message)
|
|
234
|
+
.text
|
|
235
|
+
}
|
|
236
|
+
label={intl.formatMessage(messages.identificationNumber)}
|
|
237
|
+
/>
|
|
238
|
+
<Input
|
|
239
|
+
className="field"
|
|
240
|
+
{...register('vat_registration')}
|
|
241
|
+
label={intl.formatMessage(messages.vatNumber)}
|
|
242
|
+
/>
|
|
243
|
+
<Input
|
|
244
|
+
className="field"
|
|
245
|
+
{...register('address')}
|
|
246
|
+
label={intl.formatMessage(messages.address)}
|
|
247
|
+
required
|
|
248
|
+
state={formState.errors.address?.message ? 'error' : 'default'}
|
|
249
|
+
text={getLocalizedCunninghamErrorProp(intl, formState.errors.address?.message).text}
|
|
250
|
+
/>
|
|
251
|
+
<div className="city-fields">
|
|
252
|
+
<Input
|
|
253
|
+
className="field"
|
|
254
|
+
{...register('postcode')}
|
|
255
|
+
label={intl.formatMessage(messages.postCode)}
|
|
256
|
+
required
|
|
257
|
+
state={formState.errors.postcode?.message ? 'error' : 'default'}
|
|
258
|
+
text={getLocalizedCunninghamErrorProp(intl, formState.errors.postcode?.message).text}
|
|
259
|
+
/>
|
|
260
|
+
<Input
|
|
261
|
+
className="field"
|
|
262
|
+
{...register('city')}
|
|
263
|
+
label={intl.formatMessage(messages.city)}
|
|
264
|
+
required
|
|
265
|
+
state={formState.errors.city?.message ? 'error' : 'default'}
|
|
266
|
+
text={getLocalizedCunninghamErrorProp(intl, formState.errors.city?.message).text}
|
|
267
|
+
/>
|
|
268
|
+
</div>
|
|
269
|
+
<CountrySelectField
|
|
270
|
+
className="field"
|
|
271
|
+
{...register('country')}
|
|
272
|
+
label={intl.formatMessage(messages.country)}
|
|
273
|
+
state={formState.errors.country?.message ? 'error' : 'default'}
|
|
274
|
+
text={getLocalizedCunninghamErrorProp(intl, formState.errors.country?.message).text}
|
|
275
|
+
/>
|
|
276
|
+
<Checkbox
|
|
277
|
+
label={intl.formatMessage(messages.checkBilling)}
|
|
278
|
+
onChange={() => setOtherBillingAddress(!otherBillingAddress)}
|
|
279
|
+
checked={otherBillingAddress}
|
|
280
|
+
/>
|
|
281
|
+
</div>
|
|
282
|
+
{otherBillingAddress && (
|
|
283
|
+
<div className="step billing" hidden={activeStep !== 0}>
|
|
284
|
+
<FormattedMessage {...messages.stepBillingTitle} />
|
|
285
|
+
<Input
|
|
286
|
+
className="field"
|
|
287
|
+
{...register('billing_address.contact_name')}
|
|
288
|
+
label={intl.formatMessage(messages.contactName)}
|
|
289
|
+
/>
|
|
290
|
+
<Input
|
|
291
|
+
className="field"
|
|
292
|
+
{...register('billing_address.contact_email')}
|
|
293
|
+
label={intl.formatMessage(messages.contactEmail)}
|
|
294
|
+
/>
|
|
295
|
+
<Input
|
|
296
|
+
className="field"
|
|
297
|
+
{...register('billing_address.company_name')}
|
|
298
|
+
label={intl.formatMessage(messages.companyName)}
|
|
299
|
+
/>
|
|
300
|
+
<Input
|
|
301
|
+
className="field"
|
|
302
|
+
{...register('billing_address.identification_number')}
|
|
303
|
+
label={intl.formatMessage(messages.identificationNumber)}
|
|
304
|
+
/>
|
|
305
|
+
<Input
|
|
306
|
+
className="field"
|
|
307
|
+
{...register('billing_address.address')}
|
|
308
|
+
label={intl.formatMessage(messages.address)}
|
|
309
|
+
/>
|
|
310
|
+
<div className="city-fields">
|
|
311
|
+
<Input
|
|
312
|
+
className="field"
|
|
313
|
+
{...register('billing_address.postcode')}
|
|
314
|
+
label={intl.formatMessage(messages.postCode)}
|
|
315
|
+
/>
|
|
316
|
+
<Input
|
|
317
|
+
className="field"
|
|
318
|
+
{...register('billing_address.city')}
|
|
319
|
+
label={intl.formatMessage(messages.city)}
|
|
320
|
+
/>
|
|
321
|
+
</div>
|
|
322
|
+
<CountrySelectField
|
|
323
|
+
className="field"
|
|
324
|
+
{...register('billing_address.country')}
|
|
325
|
+
label={intl.formatMessage(messages.country)}
|
|
326
|
+
/>
|
|
327
|
+
</div>
|
|
328
|
+
)}
|
|
329
|
+
<div className="step admin" hidden={activeStep !== 1}>
|
|
330
|
+
<FormattedMessage {...messages.stepAdminTitle} />
|
|
331
|
+
<Input
|
|
332
|
+
className="field"
|
|
333
|
+
{...register('administrative_lastname')}
|
|
334
|
+
label={intl.formatMessage(messages.lastName)}
|
|
335
|
+
required
|
|
336
|
+
state={formState.errors.administrative_lastname?.message ? 'error' : 'default'}
|
|
337
|
+
text={
|
|
338
|
+
getLocalizedCunninghamErrorProp(intl, formState.errors.administrative_lastname?.message)
|
|
339
|
+
.text
|
|
340
|
+
}
|
|
341
|
+
/>
|
|
342
|
+
<Input
|
|
343
|
+
className="field"
|
|
344
|
+
{...register('administrative_firstname')}
|
|
345
|
+
label={intl.formatMessage(messages.firstName)}
|
|
346
|
+
required
|
|
347
|
+
state={formState.errors.administrative_firstname?.message ? 'error' : 'default'}
|
|
348
|
+
text={
|
|
349
|
+
getLocalizedCunninghamErrorProp(
|
|
350
|
+
intl,
|
|
351
|
+
formState.errors.administrative_firstname?.message,
|
|
352
|
+
).text
|
|
353
|
+
}
|
|
354
|
+
/>
|
|
355
|
+
<Input
|
|
356
|
+
className="field"
|
|
357
|
+
{...register('administrative_profession')}
|
|
358
|
+
label={intl.formatMessage(messages.role)}
|
|
359
|
+
required
|
|
360
|
+
state={formState.errors.administrative_profession?.message ? 'error' : 'default'}
|
|
361
|
+
text={
|
|
362
|
+
getLocalizedCunninghamErrorProp(
|
|
363
|
+
intl,
|
|
364
|
+
formState.errors.administrative_profession?.message,
|
|
365
|
+
).text
|
|
366
|
+
}
|
|
367
|
+
/>
|
|
368
|
+
<Input
|
|
369
|
+
className="field"
|
|
370
|
+
{...register('administrative_email')}
|
|
371
|
+
label={intl.formatMessage(messages.email)}
|
|
372
|
+
required
|
|
373
|
+
state={formState.errors.administrative_email?.message ? 'error' : 'default'}
|
|
374
|
+
text={
|
|
375
|
+
getLocalizedCunninghamErrorProp(intl, formState.errors.administrative_email?.message)
|
|
376
|
+
.text
|
|
377
|
+
}
|
|
378
|
+
/>
|
|
379
|
+
<Input
|
|
380
|
+
className="field"
|
|
381
|
+
{...register('administrative_telephone')}
|
|
382
|
+
label={intl.formatMessage(messages.phone)}
|
|
383
|
+
required
|
|
384
|
+
state={formState.errors.administrative_telephone?.message ? 'error' : 'default'}
|
|
385
|
+
text={
|
|
386
|
+
getLocalizedCunninghamErrorProp(
|
|
387
|
+
intl,
|
|
388
|
+
formState.errors.administrative_telephone?.message,
|
|
389
|
+
).text
|
|
390
|
+
}
|
|
391
|
+
/>
|
|
392
|
+
</div>
|
|
393
|
+
<div className="step signatory" hidden={activeStep !== 2}>
|
|
394
|
+
<FormattedMessage {...messages.stepSignatoryTitle} />
|
|
395
|
+
<Input
|
|
396
|
+
className="field"
|
|
397
|
+
{...register('signatory_lastname')}
|
|
398
|
+
label={intl.formatMessage(messages.lastName)}
|
|
399
|
+
required
|
|
400
|
+
state={formState.errors.signatory_lastname?.message ? 'error' : 'default'}
|
|
401
|
+
text={
|
|
402
|
+
getLocalizedCunninghamErrorProp(intl, formState.errors.signatory_lastname?.message).text
|
|
403
|
+
}
|
|
404
|
+
/>
|
|
405
|
+
<Input
|
|
406
|
+
className="field"
|
|
407
|
+
{...register('signatory_firstname')}
|
|
408
|
+
label={intl.formatMessage(messages.firstName)}
|
|
409
|
+
required
|
|
410
|
+
state={formState.errors.signatory_firstname?.message ? 'error' : 'default'}
|
|
411
|
+
text={
|
|
412
|
+
getLocalizedCunninghamErrorProp(intl, formState.errors.signatory_firstname?.message)
|
|
413
|
+
.text
|
|
414
|
+
}
|
|
415
|
+
/>
|
|
416
|
+
<Input
|
|
417
|
+
className="field"
|
|
418
|
+
{...register('signatory_profession')}
|
|
419
|
+
label={intl.formatMessage(messages.role)}
|
|
420
|
+
required
|
|
421
|
+
state={formState.errors.signatory_profession?.message ? 'error' : 'default'}
|
|
422
|
+
text={
|
|
423
|
+
getLocalizedCunninghamErrorProp(intl, formState.errors.signatory_profession?.message)
|
|
424
|
+
.text
|
|
425
|
+
}
|
|
426
|
+
/>
|
|
427
|
+
<Input
|
|
428
|
+
className="field"
|
|
429
|
+
{...register('signatory_email')}
|
|
430
|
+
label={intl.formatMessage(messages.email)}
|
|
431
|
+
required
|
|
432
|
+
state={formState.errors.signatory_email?.message ? 'error' : 'default'}
|
|
433
|
+
text={
|
|
434
|
+
getLocalizedCunninghamErrorProp(intl, formState.errors.signatory_email?.message).text
|
|
435
|
+
}
|
|
436
|
+
/>
|
|
437
|
+
<Input
|
|
438
|
+
className="field"
|
|
439
|
+
{...register('signatory_telephone')}
|
|
440
|
+
label={intl.formatMessage(messages.phone)}
|
|
441
|
+
required
|
|
442
|
+
state={formState.errors.signatory_telephone?.message ? 'error' : 'default'}
|
|
443
|
+
text={
|
|
444
|
+
getLocalizedCunninghamErrorProp(intl, formState.errors.signatory_telephone?.message)
|
|
445
|
+
.text
|
|
446
|
+
}
|
|
447
|
+
/>
|
|
448
|
+
</div>
|
|
449
|
+
<div className="step seats" hidden={activeStep !== 3}>
|
|
450
|
+
<FormattedMessage {...messages.stepParticipantsTitle} />
|
|
451
|
+
<Input
|
|
452
|
+
className="field"
|
|
453
|
+
type="number"
|
|
454
|
+
{...register('nb_seats')}
|
|
455
|
+
label={intl.formatMessage(messages.nbSeats)}
|
|
456
|
+
required
|
|
457
|
+
state={formState.errors.nb_seats?.message ? 'error' : 'default'}
|
|
458
|
+
text={getLocalizedCunninghamErrorProp(intl, formState.errors.nb_seats?.message).text}
|
|
459
|
+
/>
|
|
460
|
+
</div>
|
|
461
|
+
<div className="step financing" hidden={activeStep !== 4}>
|
|
462
|
+
<FormattedMessage {...messages.stepFinancingTitle} />
|
|
463
|
+
<RadioGroup fullWidth={true} className="payment-block">
|
|
464
|
+
<Radio
|
|
465
|
+
{...register('payment_method')}
|
|
466
|
+
value={PaymentMethod.CARD_PAYMENT}
|
|
467
|
+
label={intl.formatMessage(messages.cardPayment)}
|
|
468
|
+
required
|
|
469
|
+
state={formState.errors.payment_method?.message ? 'error' : 'default'}
|
|
470
|
+
text={
|
|
471
|
+
getLocalizedCunninghamErrorProp(intl, formState.errors.payment_method?.message).text
|
|
472
|
+
}
|
|
473
|
+
/>
|
|
474
|
+
<Radio
|
|
475
|
+
{...register('payment_method')}
|
|
476
|
+
value={PaymentMethod.BANK_TRANSFER}
|
|
477
|
+
label={intl.formatMessage(messages.bankTransfer)}
|
|
478
|
+
required
|
|
479
|
+
state={formState.errors.payment_method?.message ? 'error' : 'default'}
|
|
480
|
+
text={
|
|
481
|
+
getLocalizedCunninghamErrorProp(intl, formState.errors.payment_method?.message).text
|
|
482
|
+
}
|
|
483
|
+
/>
|
|
484
|
+
<Radio
|
|
485
|
+
{...register('payment_method')}
|
|
486
|
+
value={PaymentMethod.PURCHASE_ORDER}
|
|
487
|
+
label={intl.formatMessage(messages.purchaseOrder)}
|
|
488
|
+
required
|
|
489
|
+
state={formState.errors.payment_method?.message ? 'error' : 'default'}
|
|
490
|
+
text={
|
|
491
|
+
getLocalizedCunninghamErrorProp(intl, formState.errors.payment_method?.message).text
|
|
492
|
+
}
|
|
493
|
+
/>
|
|
494
|
+
</RadioGroup>
|
|
495
|
+
<FormattedMessage {...messages.fundingEntity} />
|
|
496
|
+
<div className="organism-block">
|
|
497
|
+
<Input
|
|
498
|
+
{...register('funding_entity')}
|
|
499
|
+
label={intl.formatMessage(messages.fundingEntityName)}
|
|
500
|
+
required
|
|
501
|
+
state={formState.errors.funding_entity?.message ? 'error' : 'default'}
|
|
502
|
+
text={
|
|
503
|
+
getLocalizedCunninghamErrorProp(intl, formState.errors.funding_entity?.message).text
|
|
504
|
+
}
|
|
505
|
+
/>
|
|
506
|
+
<Input
|
|
507
|
+
{...register('funding_amount')}
|
|
508
|
+
type="number"
|
|
509
|
+
label={intl.formatMessage(messages.fundingEntityAmount)}
|
|
510
|
+
required
|
|
511
|
+
state={formState.errors.funding_amount?.message ? 'error' : 'default'}
|
|
512
|
+
text={
|
|
513
|
+
getLocalizedCunninghamErrorProp(intl, formState.errors.funding_amount?.message).text
|
|
514
|
+
}
|
|
515
|
+
/>
|
|
516
|
+
</div>
|
|
517
|
+
<FormattedMessage {...messages.recommandation} />
|
|
518
|
+
<Select
|
|
519
|
+
{...register('organization_id')}
|
|
520
|
+
label={intl.formatMessage(messages.participatingOrganisations)}
|
|
521
|
+
clearable
|
|
522
|
+
options={orgOptions}
|
|
523
|
+
className="recommandation"
|
|
524
|
+
/>
|
|
525
|
+
</div>
|
|
526
|
+
</div>
|
|
527
|
+
);
|
|
528
|
+
};
|