richie-education 2.28.2-dev39 → 2.28.2-dev58
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/.eslintrc.json +11 -2
- package/i18n/locales/ar-SA.json +209 -125
- package/i18n/locales/es-ES.json +210 -126
- package/i18n/locales/fa-IR.json +209 -125
- package/i18n/locales/fr-CA.json +209 -125
- package/i18n/locales/fr-FR.json +209 -125
- package/i18n/locales/ko-KR.json +209 -125
- package/i18n/locales/pt-PT.json +212 -128
- package/i18n/locales/ru-RU.json +209 -125
- package/i18n/locales/vi-VN.json +209 -125
- package/js/api/joanie.ts +14 -17
- package/js/api/lms/dummy.ts +1 -12
- package/js/components/ContractFrame/AbstractContractFrame.spec.tsx +16 -9
- package/js/components/ContractFrame/AbstractContractFrame.tsx +32 -25
- package/js/components/ContractFrame/LearnerContractFrame.tsx +2 -2
- package/js/components/ContractFrame/_styles.scss +6 -14
- package/js/components/CreditCardSelector/index.spec.tsx +7 -7
- package/js/components/CreditCardSelector/index.tsx +2 -2
- package/js/components/DownloadContractButton/index.spec.tsx +1 -1
- package/js/components/OpenEdxFullNameForm/index.spec.tsx +229 -0
- package/js/components/OpenEdxFullNameForm/index.tsx +7 -7
- package/js/components/PaymentInterfaces/LyraPopIn.tsx +2 -2
- package/js/components/PaymentInterfaces/PayplugLightbox.tsx +1 -1
- package/js/components/PaymentInterfaces/__mocks__/index.tsx +1 -4
- package/js/components/PaymentInterfaces/types.ts +5 -2
- package/js/components/PurchaseButton/index.spec.tsx +69 -37
- package/js/components/SaleTunnel/AddressSelector/index.spec.tsx +2 -1
- package/js/components/SaleTunnel/CertificateSaleTunnel/index.tsx +2 -2
- package/js/components/SaleTunnel/CredentialSaleTunnel/index.tsx +6 -10
- package/js/components/SaleTunnel/GenericSaleTunnel.tsx +75 -41
- package/js/components/SaleTunnel/SaleTunnelInformation/index.tsx +0 -30
- package/js/components/SaleTunnel/SaleTunnelSavePaymentMethod/_styles.scss +12 -0
- package/js/components/SaleTunnel/SaleTunnelSavePaymentMethod/index.tsx +160 -0
- package/js/components/SaleTunnel/SaleTunnelSuccess/index.tsx +15 -29
- package/js/components/SaleTunnel/Sponsors/SaleTunnelSponsors.tsx +5 -0
- package/js/components/SaleTunnel/SubscriptionButton/_styles.scss +7 -0
- package/js/components/SaleTunnel/SubscriptionButton/index.tsx +202 -0
- package/js/components/SaleTunnel/_styles.scss +10 -1
- package/js/components/SaleTunnel/hooks/useTerms.tsx +0 -77
- package/js/components/SaleTunnel/index.credential.spec.tsx +12 -21
- package/js/components/SaleTunnel/index.full-process.spec.tsx +110 -48
- package/js/components/SaleTunnel/index.spec.tsx +330 -779
- package/js/components/SignContractButton/index.omniscientOrders.spec.tsx +16 -11
- package/js/components/SignContractButton/index.spec.tsx +16 -20
- package/js/components/SignContractButton/index.tsx +3 -1
- package/js/hooks/useCreditCards/index.spec.tsx +70 -6
- package/js/hooks/useCreditCards/index.ts +49 -11
- package/js/hooks/useOrders/index.spec.tsx +322 -0
- package/js/hooks/{useOrders.ts → useOrders/index.ts} +40 -14
- package/js/hooks/useProductOrder/index.spec.tsx +77 -60
- package/js/hooks/useProductOrder/index.tsx +2 -2
- package/js/hooks/useResources/useResourcesRoot.ts +1 -0
- package/js/pages/DashboardCreditCardsManagement/CreditCardBrandLogo.spec.tsx +1 -1
- package/js/pages/DashboardCreditCardsManagement/CreditCardBrandLogo.tsx +4 -2
- package/js/pages/TeacherDashboardContractsLayout/components/ContractActionsBar/index.spec.tsx +8 -5
- package/js/pages/TeacherDashboardContractsLayout/components/SignOrganizationContractButton/index.spec.tsx +8 -9
- package/js/pages/TeacherDashboardCourseLearnersLayout/components/CourseLearnerDataGrid/index.spec.tsx +1 -1
- package/js/pages/TeacherDashboardCourseLearnersLayout/components/CourseLearnerDataGrid/index.tsx +1 -6
- package/js/settings/settings.test.ts +11 -2
- 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 +49 -34
- package/js/utils/OrderHelper/index.ts +38 -42
- package/js/utils/search/getSuggestionsSection/index.spec.ts +3 -2
- package/js/utils/test/factories/joanie.ts +36 -51
- package/js/widgets/Dashboard/components/DashboardItem/CourseEnrolling/index.tsx +8 -18
- package/js/widgets/Dashboard/components/DashboardItem/Enrollment/ProductCertificateFooter/index.spec.tsx +26 -32
- package/js/widgets/Dashboard/components/DashboardItem/Enrollment/ProductCertificateFooter/index.tsx +11 -6
- package/js/widgets/Dashboard/components/DashboardItem/Order/DashboardItemOrder.spec.tsx +7 -6
- package/js/widgets/Dashboard/components/DashboardItem/Order/DashboardItemOrder.tsx +9 -10
- package/js/widgets/Dashboard/components/DashboardItem/Order/DashboardItemOrderContract.spec.tsx +3 -1
- package/js/widgets/Dashboard/components/DashboardItem/Order/DashboardItemOrderContract.useUnionResource.cache.spec.tsx +6 -7
- package/js/widgets/Dashboard/components/DashboardItem/Order/OrderPaymentDetailsModal/index.tsx +28 -8
- package/js/widgets/Dashboard/components/DashboardItem/Order/OrderPaymentRetryModal/index.tsx +4 -6
- package/js/widgets/Dashboard/components/DashboardItem/Order/OrderStateLearnerMessage/index.spec.tsx +18 -71
- package/js/widgets/Dashboard/components/DashboardItem/Order/OrderStateLearnerMessage/index.tsx +34 -35
- package/js/widgets/Dashboard/components/DashboardItem/Order/OrderStateMessage/index.tsx +27 -24
- package/js/widgets/Dashboard/components/DashboardItem/Order/OrderStateTeacherMessage/index.spec.tsx +18 -73
- package/js/widgets/Dashboard/components/DashboardItem/Order/OrderStateTeacherMessage/index.tsx +32 -16
- package/js/widgets/Dashboard/components/DashboardOrderLoader/index.tsx +3 -11
- package/js/widgets/Dashboard/components/Signature/SignatureDummy.tsx +25 -3
- package/js/widgets/SyllabusCourseRunsList/components/CourseProductItem/components/CourseProductCourseRuns/EnrollableCourseRunList.tsx +2 -6
- package/js/widgets/SyllabusCourseRunsList/components/CourseProductItem/components/CourseProductCourseRuns/index.spec.tsx +7 -14
- package/js/widgets/SyllabusCourseRunsList/components/CourseProductItem/components/CourseRunItem/index.spec.tsx +7 -5
- package/js/widgets/SyllabusCourseRunsList/components/CourseProductItem/components/CourseRunItem/index.tsx +5 -7
- package/js/widgets/SyllabusCourseRunsList/components/CourseProductItem/index.spec.tsx +242 -332
- package/js/widgets/SyllabusCourseRunsList/components/CourseProductItem/index.stories.tsx +12 -13
- package/js/widgets/SyllabusCourseRunsList/components/CourseProductItem/index.tsx +10 -21
- package/js/widgets/SyllabusCourseRunsList/components/CourseRunEnrollment/index.joanie.spec.tsx +2 -2
- package/package.json +27 -27
- package/scss/components/_index.scss +2 -1
- package/js/components/PaymentButton/_styles.scss +0 -27
- package/js/components/SaleTunnel/GenericPaymentButton/index.tsx +0 -333
- package/js/components/SaleTunnel/SaleTunnelNotValidated/index.tsx +0 -70
- package/js/widgets/SyllabusCourseRunsList/components/CourseProductItem/components/ProductSignatureHeader/index.tsx +0 -41
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
|
2
|
-
import { Button } from '@openfun/cunningham-react';
|
|
3
|
-
import { generatePath } from 'react-router-dom';
|
|
4
|
-
import WarningIcon from 'components/WarningIcon';
|
|
5
|
-
import { getDashboardBasename } from 'widgets/Dashboard/hooks/useDashboardRouter/getDashboardBasename';
|
|
6
|
-
import { useSaleTunnelContext } from 'components/SaleTunnel/GenericSaleTunnel';
|
|
7
|
-
import { LearnerDashboardPaths } from 'widgets/Dashboard/utils/learnerRoutesPaths';
|
|
8
|
-
import { ProductType } from 'types/Joanie';
|
|
9
|
-
|
|
10
|
-
const messages = defineMessages({
|
|
11
|
-
apology: {
|
|
12
|
-
defaultMessage: "Sorry, you'll have to wait a little longer!",
|
|
13
|
-
description: 'Text displayed to thank user for his order',
|
|
14
|
-
id: 'components.SaleTunnelSuccessNotValidated.apology',
|
|
15
|
-
},
|
|
16
|
-
title: {
|
|
17
|
-
defaultMessage: 'It takes too long to validate your order.',
|
|
18
|
-
description: 'Message to confirm that order has been created',
|
|
19
|
-
id: 'components.SaleTunnelSuccessNotValidated.title',
|
|
20
|
-
},
|
|
21
|
-
description: {
|
|
22
|
-
defaultMessage:
|
|
23
|
-
'Your payment has succeeded but your order validation is taking too long, you can close this dialog and come back later. You will receive your invoice by email in a few moments.',
|
|
24
|
-
description: "Text to remind that order's invoice will be send by email soon",
|
|
25
|
-
id: 'components.SaleTunnelSuccessNotValidated.description',
|
|
26
|
-
},
|
|
27
|
-
cta: {
|
|
28
|
-
defaultMessage: 'Close',
|
|
29
|
-
description: 'Label to the call to action to close sale tunnel',
|
|
30
|
-
id: 'components.SaleTunnelSuccessNotValidated.cta',
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
const SaleTunnelNotValidated = ({ closeModal }: { closeModal: () => void }) => {
|
|
35
|
-
const intl = useIntl();
|
|
36
|
-
const { order, product } = useSaleTunnelContext();
|
|
37
|
-
return (
|
|
38
|
-
<section className="sale-tunnel-end" data-testid="generic-sale-tunnel-not-validated-step">
|
|
39
|
-
<header className="sale-tunnel-end__header">
|
|
40
|
-
<WarningIcon />
|
|
41
|
-
<h3 className="sale-tunnel-end__title">
|
|
42
|
-
<FormattedMessage {...messages.apology} />
|
|
43
|
-
</h3>
|
|
44
|
-
</header>
|
|
45
|
-
<p className="sale-tunnel-end__content">
|
|
46
|
-
<FormattedMessage {...messages.title} />
|
|
47
|
-
<br />
|
|
48
|
-
<FormattedMessage {...messages.description} />
|
|
49
|
-
</p>
|
|
50
|
-
<footer className="sale-tunnel-end__footer">
|
|
51
|
-
{product.type === ProductType.CREDENTIAL ? (
|
|
52
|
-
<Button
|
|
53
|
-
href={
|
|
54
|
-
getDashboardBasename(intl.locale) +
|
|
55
|
-
generatePath(LearnerDashboardPaths.ORDER, { orderId: order!.id })
|
|
56
|
-
}
|
|
57
|
-
>
|
|
58
|
-
<FormattedMessage {...messages.cta} />
|
|
59
|
-
</Button>
|
|
60
|
-
) : (
|
|
61
|
-
<Button onClick={closeModal}>
|
|
62
|
-
<FormattedMessage {...messages.cta} />
|
|
63
|
-
</Button>
|
|
64
|
-
)}
|
|
65
|
-
</footer>
|
|
66
|
-
</section>
|
|
67
|
-
);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export default SaleTunnelNotValidated;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Button } from '@openfun/cunningham-react';
|
|
2
|
-
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
|
3
|
-
import { generatePath } from 'react-router-dom';
|
|
4
|
-
import Banner, { BannerType } from 'components/Banner';
|
|
5
|
-
import { getDashboardBasename } from 'widgets/Dashboard/hooks/useDashboardRouter/getDashboardBasename';
|
|
6
|
-
import { Order } from 'types/Joanie';
|
|
7
|
-
|
|
8
|
-
import { LearnerDashboardPaths } from 'widgets/Dashboard/utils/learnerRoutesPaths';
|
|
9
|
-
|
|
10
|
-
const messages = defineMessages({
|
|
11
|
-
signatureNeeded: {
|
|
12
|
-
defaultMessage: 'You need to sign your training contract before enrolling to course runs',
|
|
13
|
-
description: 'Banner displayed when the contract is not signed on the syllabus',
|
|
14
|
-
id: 'components.CourseProductItem.signatureNeeded',
|
|
15
|
-
},
|
|
16
|
-
contractSignActionLabel: {
|
|
17
|
-
id: 'components.CourseProductItem.contractSignActionLabel',
|
|
18
|
-
description: 'Label of "sign contract" action on the syllabus.',
|
|
19
|
-
defaultMessage: 'Sign your training contract',
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
export const ProductSignatureHeader = ({ order }: { order?: Order }) => {
|
|
24
|
-
const intl = useIntl();
|
|
25
|
-
return (
|
|
26
|
-
<>
|
|
27
|
-
<Banner message={intl.formatMessage(messages.signatureNeeded)} type={BannerType.ERROR} />
|
|
28
|
-
<Button
|
|
29
|
-
fullWidth={true}
|
|
30
|
-
className="mb-s"
|
|
31
|
-
size="small"
|
|
32
|
-
href={
|
|
33
|
-
getDashboardBasename(intl.locale) +
|
|
34
|
-
generatePath(LearnerDashboardPaths.ORDER, { orderId: order!.id })
|
|
35
|
-
}
|
|
36
|
-
>
|
|
37
|
-
<FormattedMessage {...messages.contractSignActionLabel} />
|
|
38
|
-
</Button>
|
|
39
|
-
</>
|
|
40
|
-
);
|
|
41
|
-
};
|