richie-education 3.3.2-dev6 → 3.4.1-dev13
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 +0 -3
- package/.storybook/main.js +11 -12
- package/.storybook/preview.tsx +49 -24
- package/cunningham.cjs +31 -0
- package/i18n/compile-translations.js +12 -10
- package/i18n/locales/ar-SA.json +20 -0
- package/i18n/locales/es-ES.json +20 -0
- package/i18n/locales/fa-IR.json +20 -0
- package/i18n/locales/fr-CA.json +20 -0
- package/i18n/locales/fr-FR.json +21 -1
- package/i18n/locales/ko-KR.json +20 -0
- package/i18n/locales/pt-PT.json +42 -22
- package/i18n/locales/ru-RU.json +20 -0
- package/i18n/locales/vi-VN.json +20 -0
- package/jest.config.js +5 -0
- package/js/api/joanie.ts +20 -0
- package/js/api/utils.ts +4 -3
- package/js/components/AddressesManagement/AddressForm/index.stories.tsx +1 -1
- package/js/components/AddressesManagement/AddressForm/index.tsx +4 -3
- package/js/components/AddressesManagement/index.stories.tsx +1 -1
- package/js/components/AddressesManagement/index.tsx +5 -3
- package/js/components/Badge/index.stories.tsx +1 -1
- package/js/components/Badge/index.tsx +1 -1
- package/js/components/Banner/index.stories.tsx +1 -1
- package/js/components/CourseGlimpse/index.stories.tsx +1 -1
- package/js/components/CourseGlimpseList/index.stories.tsx +1 -1
- package/js/components/CreditCardSelector/_styles.scss +2 -2
- package/js/components/CreditCardSelector/index.tsx +11 -3
- package/js/components/DownloadAgreementButton/index.tsx +51 -0
- package/js/components/DownloadBatchOrderSeatsButton/index.spec.tsx +46 -0
- package/js/components/DownloadBatchOrderSeatsButton/index.tsx +80 -0
- package/js/components/DownloadCertificateButton/index.tsx +2 -1
- package/js/components/DownloadContractButton/index.tsx +7 -1
- package/js/components/Form/Form/index.tsx +4 -2
- package/js/components/Icon/index.stories.tsx +2 -1
- package/js/components/Modal/index.stories.tsx +1 -1
- package/js/components/Modal/index.tsx +2 -1
- package/js/components/OpenEdxFullNameForm/index.stories.tsx +1 -1
- package/js/components/OpenEdxFullNameForm/index.tsx +2 -2
- package/js/components/PaymentScheduleGrid/_styles.scss +2 -2
- package/js/components/PurchaseButton/index.stories.tsx +1 -1
- package/js/components/RegisteredAddress/index.stories.tsx +1 -1
- package/js/components/RegisteredAddress/index.tsx +4 -2
- package/js/components/SaleTunnel/AddressSelector/CreateAddressFormModal.tsx +1 -1
- package/js/components/SaleTunnel/AddressSelector/EditAddressFormModal.tsx +1 -1
- package/js/components/SaleTunnel/AddressSelector/index.tsx +4 -2
- package/js/components/SaleTunnel/SaleTunnelInformation/SaleTunnelInformationGroup.tsx +5 -4
- package/js/components/SaleTunnel/SaleTunnelInformation/SaleTunnelInformationSingular.tsx +27 -5
- package/js/components/SaleTunnel/SaleTunnelSuccess/index.tsx +1 -1
- package/js/components/SaleTunnel/SubscriptionButton/index.tsx +9 -6
- package/js/components/SaleTunnel/_styles.scss +9 -8
- package/js/components/SaleTunnel/index.credential.spec.tsx +50 -1
- package/js/components/SaleTunnel/index.full-process-b2b.spec.tsx +5 -5
- package/js/components/SaleTunnel/index.full-process-b2c.spec.tsx +1 -1
- package/js/components/SaleTunnel/index.stories.tsx +1 -1
- package/js/components/Spinner/index.stories.tsx +1 -1
- package/js/components/Tabs/index.stories.tsx +1 -1
- package/js/components/Tabs/index.tsx +2 -1
- package/js/components/TeacherDashboardCourseList/index.tsx +2 -1
- package/js/hooks/useAddressesManagement.tsx +4 -2
- package/js/hooks/useBatchOrder/index.tsx +21 -1
- package/js/hooks/useCreditCards/index.ts +6 -4
- package/js/hooks/useDashboardAddressForm.tsx +3 -3
- package/js/hooks/useDownloadAgreement/index.spec.tsx +136 -0
- package/js/hooks/useDownloadAgreement/index.tsx +25 -0
- package/js/hooks/useDownloadBatchOrderSeats/index.spec.tsx +132 -0
- package/js/hooks/useDownloadBatchOrderSeats/index.tsx +24 -0
- package/js/hooks/useMatchMedia.ts +1 -1
- package/js/hooks/useResources/useResourcesRoot.ts +1 -1
- package/js/hooks/useUnionResource/index.ts +6 -2
- package/js/hooks/useUnionResource/utils/fetchEntity.ts +1 -0
- package/js/pages/DashboardAddressesManagement/DashboardAddressBox.tsx +3 -3
- package/js/pages/DashboardAddressesManagement/DashboardCreateAddress.stories.tsx +1 -1
- package/js/pages/DashboardAddressesManagement/DashboardCreateAddress.tsx +1 -1
- package/js/pages/DashboardAddressesManagement/DashboardEditAddress.stories.tsx +1 -1
- package/js/pages/DashboardAddressesManagement/DashboardEditAddress.tsx +3 -2
- package/js/pages/DashboardAddressesManagement/index.stories.tsx +1 -1
- package/js/pages/DashboardAddressesManagement/index.tsx +1 -1
- package/js/pages/DashboardBatchOrderLayout/index.spec.tsx +19 -2
- package/js/pages/DashboardCourses/index.tsx +2 -1
- package/js/pages/DashboardCreditCardsManagement/CreditCardBrandLogo.stories.tsx +1 -1
- package/js/pages/DashboardCreditCardsManagement/DashboardCreditCardBox.tsx +3 -3
- package/js/pages/DashboardCreditCardsManagement/DashboardEditCreditCard.stories.tsx +1 -1
- package/js/pages/DashboardCreditCardsManagement/DashboardEditCreditCard.tsx +3 -2
- package/js/pages/DashboardCreditCardsManagement/index.stories.tsx +1 -1
- package/js/pages/DashboardOpenEdxProfile/index.stories.tsx +1 -1
- package/js/pages/TeacherDashboardContractsLayout/components/BulkDownloadContractButton/index.tsx +4 -2
- package/js/pages/TeacherDashboardContractsLayout/components/SignOrganizationContractButton/index.tsx +2 -1
- package/js/pages/TeacherDashboardContractsLayout/hooks/useCheckContractArchiveExists/index.spec.tsx +4 -4
- package/js/pages/TeacherDashboardContractsLayout/hooks/useDownloadContractArchive/index.spec.tsx +8 -9
- package/js/pages/TeacherDashboardContractsLayout/hooks/useDownloadContractArchive/index.tsx +14 -3
- package/js/pages/TeacherDashboardCourseLearnersLayout/components/CourseLearnerDataGrid/index.tsx +6 -1
- package/js/pages/TeacherDashboardCourseLoader/CourseRunList/utils.tsx +2 -1
- package/js/pages/TeacherDashboardOrganizationAgreements/BulkAgreementContractButton.tsx +4 -2
- package/js/pages/TeacherDashboardOrganizationAgreements/SignOrganizationAgreementButton.tsx +2 -1
- package/js/pages/TeacherDashboardOrganizationQuotes/BatchOrderSeatInfoQuote.tsx +112 -0
- package/js/pages/TeacherDashboardOrganizationQuotes/_styles.scss +17 -0
- package/js/pages/TeacherDashboardOrganizationQuotes/index.full-process.spec.tsx +7 -4
- package/js/pages/TeacherDashboardOrganizationQuotes/index.spec.tsx +8 -4
- package/js/pages/TeacherDashboardOrganizationQuotes/index.tsx +39 -26
- 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 +22 -2
- package/js/utils/ProductHelper/index.spec.ts +1 -1
- package/js/utils/StorybookHelper/index.tsx +3 -6
- package/js/utils/cunningham-tokens.ts +1111 -142
- package/js/utils/download.ts +3 -1
- package/js/utils/errors/handle.spec.ts +3 -3
- package/js/utils/react-query/useSessionMutation/index.ts +8 -3
- package/js/utils/test/factories/joanie.ts +16 -2
- package/js/widgets/Dashboard/components/DashboardAvatar/index.stories.tsx +1 -1
- package/js/widgets/Dashboard/components/DashboardBox/index.stories.tsx +13 -5
- package/js/widgets/Dashboard/components/DashboardBreadcrumbs/index.stories.tsx +1 -1
- package/js/widgets/Dashboard/components/DashboardBreadcrumbs/index.tsx +3 -2
- package/js/widgets/Dashboard/components/DashboardCard/index.spec.tsx +13 -2
- package/js/widgets/Dashboard/components/DashboardCard/index.stories.tsx +12 -4
- package/js/widgets/Dashboard/components/DashboardCard/index.tsx +1 -1
- package/js/widgets/Dashboard/components/DashboardItem/BatchOrder/BatchOrderAgreementInfo.tsx +72 -0
- package/js/widgets/Dashboard/components/DashboardItem/BatchOrder/BatchOrderPaymentModal/BatchOrderPaymentManager.tsx +1 -1
- package/js/widgets/Dashboard/components/DashboardItem/BatchOrder/BatchOrderPaymentModal/index.tsx +2 -1
- package/js/widgets/Dashboard/components/DashboardItem/BatchOrder/BatchOrderSeatInfo.spec.tsx +114 -0
- package/js/widgets/Dashboard/components/DashboardItem/BatchOrder/BatchOrderSeatInfo.tsx +133 -0
- package/js/widgets/Dashboard/components/DashboardItem/BatchOrder/DashboardBatchOrderSubItems.tsx +17 -1
- package/js/widgets/Dashboard/components/DashboardItem/BatchOrder/batchOrderSeatInfoMessages.ts +24 -0
- package/js/widgets/Dashboard/components/DashboardItem/BatchOrder/index.tsx +16 -3
- package/js/widgets/Dashboard/components/DashboardItem/Certificate/index.stories.tsx +1 -1
- package/js/widgets/Dashboard/components/DashboardItem/Contract/index.stories.tsx +1 -1
- package/js/widgets/Dashboard/components/DashboardItem/CourseEnrolling/index.stories.tsx +1 -1
- package/js/widgets/Dashboard/components/DashboardItem/CourseEnrolling/index.tsx +8 -4
- package/js/widgets/Dashboard/components/DashboardItem/Enrollment/DashboardItemEnrollment.stories.tsx +1 -1
- package/js/widgets/Dashboard/components/DashboardItem/Enrollment/ProductCertificateFooter/index.tsx +1 -1
- package/js/widgets/Dashboard/components/DashboardItem/Order/DashboardItemOrderReadonly.stories.tsx +1 -1
- package/js/widgets/Dashboard/components/DashboardItem/Order/DashboardItemOrderWritable.stories.tsx +1 -1
- package/js/widgets/Dashboard/components/DashboardItem/Order/Installment/index.tsx +1 -1
- package/js/widgets/Dashboard/components/DashboardItem/Order/OrderPaymentDetailsModal/_styles.scss +2 -2
- package/js/widgets/Dashboard/components/DashboardItem/Order/OrderPaymentRetryModal/index.tsx +2 -1
- package/js/widgets/Dashboard/components/DashboardItem/Order/OrganizationBlock/index.tsx +6 -3
- package/js/widgets/Dashboard/components/DashboardItem/_styles.scss +6 -2
- package/js/widgets/Dashboard/components/DashboardItem/index.stories.tsx +1 -1
- package/js/widgets/Dashboard/components/DashboardItem/index.tsx +2 -1
- package/js/widgets/Dashboard/components/DashboardListAvatar/index.stories.tsx +1 -1
- package/js/widgets/Dashboard/components/DashboardSidebar/index.stories.tsx +1 -1
- package/js/widgets/Dashboard/components/LearnerDashboardSidebar/index.stories.tsx +1 -1
- package/js/widgets/Dashboard/components/ProtectedOutlet/AuthenticatedOutlet.spec.tsx +1 -1
- package/js/widgets/Dashboard/components/ProtectedOutlet/ProtectedOutlet.spec.tsx +1 -1
- package/js/widgets/Dashboard/components/SearchBar/index.tsx +2 -1
- package/js/widgets/Dashboard/components/TeacherDashboardOrganizationSidebar/index.stories.tsx +1 -1
- package/js/widgets/Dashboard/components/TeacherDashboardProfileSidebar/index.stories.tsx +1 -1
- package/js/widgets/Dashboard/hooks/useRouteInfo/index.spec.tsx +2 -2
- package/js/widgets/Dashboard/index.spec.tsx +1 -1
- package/js/widgets/Dashboard/utils/teacherDashboardPaths.tsx +2 -2
- package/js/widgets/Search/components/SearchFilterValueParent/index.stories.tsx +1 -1
- package/js/widgets/Search/components/SearchFiltersPane/index.tsx +2 -1
- package/js/widgets/Slider/index.stories.tsx +1 -1
- package/js/widgets/Slider/index.tsx +7 -6
- package/js/widgets/SyllabusCourseRunsList/components/CourseProductItem/components/CourseProductCertificateItem/index.stories.tsx +1 -1
- package/js/widgets/SyllabusCourseRunsList/components/CourseProductItem/components/CourseRunItem/index.stories.tsx +1 -1
- package/js/widgets/SyllabusCourseRunsList/components/CourseProductItem/index.stories.tsx +1 -1
- package/js/widgets/SyllabusCourseRunsList/components/CourseWishButton/index.tsx +4 -2
- package/js/widgets/SyllabusCourseRunsList/components/SyllabusCourseRun/index.stories.tsx +1 -1
- package/js/widgets/SyllabusCourseRunsList/components/SyllabusCourseRunCompacted/index.stories.tsx +41 -0
- package/js/widgets/UserLogin/index.stories.tsx +1 -1
- package/package.json +76 -81
- package/scss/components/_subheader.scss +1 -1
- package/scss/components/templates/richie/slider/_slider.scss +1 -1
- package/scss/objects/_course_glimpses.scss +1 -0
- package/scss/objects/_dashboard.scss +77 -0
- package/scss/trumps/_bootstrap.scss +1 -0
- package/scss/vendors/css/cunningham-tokens.css +1259 -154
- package/scss/vendors/cunningham-tokens.scss +1479 -150
- package/tsconfig.json +1 -1
- package/webpack.config.js +8 -0
|
@@ -14,7 +14,12 @@ const messages = defineMessages({
|
|
|
14
14
|
seats: {
|
|
15
15
|
id: 'batchOrder.seats',
|
|
16
16
|
description: 'Text displayed for seats value in batch order',
|
|
17
|
-
defaultMessage: '
|
|
17
|
+
defaultMessage: '{nb_seats} seats',
|
|
18
|
+
},
|
|
19
|
+
seatsCount: {
|
|
20
|
+
id: 'batchOrder.seatsCount',
|
|
21
|
+
description: 'Text displayed for seats count in batch order (owned / total)',
|
|
22
|
+
defaultMessage: '{seats_owned}/{nb_seats} seats',
|
|
18
23
|
},
|
|
19
24
|
[BatchOrderState.DRAFT]: {
|
|
20
25
|
id: 'batchOrder.status.draft',
|
|
@@ -136,8 +141,16 @@ export const DashboardItemBatchOrder = ({
|
|
|
136
141
|
{batchOrder.nb_seats && (
|
|
137
142
|
<div className="dashboard-item__block__information">
|
|
138
143
|
<Icon name={IconTypeEnum.GROUPS} size="small" />
|
|
139
|
-
<span>
|
|
140
|
-
|
|
144
|
+
<span>
|
|
145
|
+
{batchOrder.seats_owned
|
|
146
|
+
? intl.formatMessage(messages.seatsCount, {
|
|
147
|
+
seats_owned: batchOrder.seats_owned,
|
|
148
|
+
nb_seats: batchOrder.nb_seats,
|
|
149
|
+
})
|
|
150
|
+
: intl.formatMessage(messages.seats, {
|
|
151
|
+
nb_seats: batchOrder.nb_seats,
|
|
152
|
+
})}
|
|
153
|
+
</span>
|
|
141
154
|
</div>
|
|
142
155
|
)}
|
|
143
156
|
{batchOrder.payment_method && (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
import { DashboardItemCertificate } from 'widgets/Dashboard/components/DashboardItem/Certificate/index';
|
|
3
3
|
import { StorybookHelper } from 'utils/StorybookHelper';
|
|
4
4
|
import { Certificate } from 'types/Joanie';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
import { DashboardItemContract } from 'widgets/Dashboard/components/DashboardItem/Contract/index';
|
|
3
3
|
import { StorybookHelper } from 'utils/StorybookHelper';
|
|
4
4
|
import { Contract, NestedCredentialOrder } from 'types/Joanie';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
import { createMemoryRouter, RouterProvider } from 'react-router';
|
|
3
3
|
import { faker } from '@faker-js/faker';
|
|
4
4
|
import { TargetCourseFactory } from 'utils/test/factories/joanie';
|
|
@@ -243,7 +243,8 @@ export const DashboardItemCourseEnrollingRun = ({
|
|
|
243
243
|
SHOW_ACCESS_COURSE_PRIORITIES.includes(courseRun.state.priority) && (
|
|
244
244
|
<div>
|
|
245
245
|
<Button
|
|
246
|
-
color="
|
|
246
|
+
color="brand"
|
|
247
|
+
variant="secondary"
|
|
247
248
|
size="small"
|
|
248
249
|
href={courseRun.resource_link}
|
|
249
250
|
data-testid="dashboard-item-enrollment__button"
|
|
@@ -257,7 +258,8 @@ export const DashboardItemCourseEnrollingRun = ({
|
|
|
257
258
|
<div>
|
|
258
259
|
<Button
|
|
259
260
|
disabled={!isOpenedForEnrollment || !canEnroll}
|
|
260
|
-
color="
|
|
261
|
+
color="brand"
|
|
262
|
+
variant="tertiary"
|
|
261
263
|
size="small"
|
|
262
264
|
onClick={enroll}
|
|
263
265
|
title={!canEnroll ? intl.formatMessage(messages.cannotEnroll) : ''}
|
|
@@ -287,7 +289,8 @@ const NotEnrolled = ({
|
|
|
287
289
|
</div>
|
|
288
290
|
{!hideEnrollButtons && (
|
|
289
291
|
<RouterButton
|
|
290
|
-
color="
|
|
292
|
+
color="brand"
|
|
293
|
+
variant="secondary"
|
|
291
294
|
size="small"
|
|
292
295
|
href={notEnrolledUrl}
|
|
293
296
|
data-testid="dashboard-item-enrollment__button"
|
|
@@ -327,7 +330,8 @@ export const Enrolled = ({
|
|
|
327
330
|
</div>
|
|
328
331
|
{SHOW_ACCESS_COURSE_PRIORITIES.includes(enrollment.course_run.state.priority) && (
|
|
329
332
|
<Button
|
|
330
|
-
color="
|
|
333
|
+
color="brand"
|
|
334
|
+
variant="secondary"
|
|
331
335
|
size="small"
|
|
332
336
|
href={enrollment.course_run.resource_link}
|
|
333
337
|
data-testid="dashboard-item-enrollment__button"
|
package/js/widgets/Dashboard/components/DashboardItem/Enrollment/ProductCertificateFooter/index.tsx
CHANGED
|
@@ -210,7 +210,7 @@ const FailedInstallmentManager = ({ order, updateOrder }: FailedInstallmentManag
|
|
|
210
210
|
return (
|
|
211
211
|
<>
|
|
212
212
|
<div className="dashboard-splitted-card__item__actions">
|
|
213
|
-
<Button size="small" color="primary" onClick={installmentRetryModal.open}>
|
|
213
|
+
<Button size="small" color="brand" variant="primary" onClick={installmentRetryModal.open}>
|
|
214
214
|
<FormattedMessage
|
|
215
215
|
{...messages.paymentNeededButton}
|
|
216
216
|
values={{
|
package/js/widgets/Dashboard/components/DashboardItem/Order/DashboardItemOrderReadonly.stories.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
import { createMemoryRouter, RouterProvider } from 'react-router';
|
|
3
3
|
import { CredentialOrder, OrderState, Product, TargetCourse } from 'types/Joanie';
|
|
4
4
|
import {
|
package/js/widgets/Dashboard/components/DashboardItem/Order/DashboardItemOrderWritable.stories.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
import { CredentialOrder, OrderState, Product, TargetCourse } from 'types/Joanie';
|
|
3
3
|
import { QueryStateFactory } from 'utils/test/factories/reactQuery';
|
|
4
4
|
import {
|
|
@@ -162,7 +162,7 @@ const InstallmentManager = ({ order }: Props) => {
|
|
|
162
162
|
<FormattedMessage {...messages.paymentLabel} />
|
|
163
163
|
</div>
|
|
164
164
|
<div className="dashboard-splitted-card__item__actions">
|
|
165
|
-
<Button size="small" color="secondary" onClick={modal.open}>
|
|
165
|
+
<Button size="small" color="brand" variant="secondary" onClick={modal.open}>
|
|
166
166
|
<FormattedMessage {...messages.paymentButton} />
|
|
167
167
|
</Button>
|
|
168
168
|
</div>
|
package/js/widgets/Dashboard/components/DashboardItem/Order/OrderPaymentDetailsModal/_styles.scss
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.order-payment-details {
|
|
2
2
|
&__title {
|
|
3
|
-
font-weight: var(--c--
|
|
4
|
-
font-size: var(--c--
|
|
3
|
+
font-weight: var(--c--globals--font--weights--bold);
|
|
4
|
+
font-size: var(--c--globals--font--sizes--md);
|
|
5
5
|
text-align: left;
|
|
6
6
|
}
|
|
7
7
|
}
|
package/js/widgets/Dashboard/components/DashboardItem/Order/OrderPaymentRetryModal/index.tsx
CHANGED
|
@@ -166,7 +166,8 @@ export const OrderPaymentRetryModal = ({ installment, order, ...props }: Props)
|
|
|
166
166
|
hideCloseButton={state === ComponentStates.LOADING}
|
|
167
167
|
actions={
|
|
168
168
|
<Button
|
|
169
|
-
color="
|
|
169
|
+
color="brand"
|
|
170
|
+
variant="primary"
|
|
170
171
|
size="small"
|
|
171
172
|
fullWidth={true}
|
|
172
173
|
onClick={pay}
|
|
@@ -100,7 +100,8 @@ const OrganizationBlock = ({ order, product }: Props) => {
|
|
|
100
100
|
<FormattedMessage {...messages.organizationMailContactLabel} />
|
|
101
101
|
<Button
|
|
102
102
|
size="small"
|
|
103
|
-
color="
|
|
103
|
+
color="brand"
|
|
104
|
+
variant="tertiary"
|
|
104
105
|
href={'mailto:' + (organization.contact_email ?? '')}
|
|
105
106
|
>
|
|
106
107
|
{organization.contact_email}
|
|
@@ -112,7 +113,8 @@ const OrganizationBlock = ({ order, product }: Props) => {
|
|
|
112
113
|
<FormattedMessage {...messages.organizationPhoneContactLabel} />
|
|
113
114
|
<Button
|
|
114
115
|
size="small"
|
|
115
|
-
color="
|
|
116
|
+
color="brand"
|
|
117
|
+
variant="tertiary"
|
|
116
118
|
href={'tel:' + (organization.contact_phone ?? '')}
|
|
117
119
|
>
|
|
118
120
|
{organization.contact_phone}
|
|
@@ -124,7 +126,8 @@ const OrganizationBlock = ({ order, product }: Props) => {
|
|
|
124
126
|
<FormattedMessage {...messages.organizationDpoContactLabel} />
|
|
125
127
|
<Button
|
|
126
128
|
size="small"
|
|
127
|
-
color="
|
|
129
|
+
color="brand"
|
|
130
|
+
variant="tertiary"
|
|
128
131
|
href={'mailto:' + (organization.dpo_email ?? '')}
|
|
129
132
|
>
|
|
130
133
|
{organization.dpo_email}
|
|
@@ -162,12 +162,16 @@
|
|
|
162
162
|
padding: 0.5rem 1rem;
|
|
163
163
|
font-size: 0.8rem;
|
|
164
164
|
display: flex;
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
flex-direction: column;
|
|
166
|
+
gap: 0.5rem;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
+
.dashboard-item__action-button {
|
|
172
|
+
align-self: flex-end;
|
|
173
|
+
}
|
|
174
|
+
|
|
171
175
|
.dashboard-item__course-enrolling {
|
|
172
176
|
&__infos {
|
|
173
177
|
align-items: center;
|
|
@@ -92,7 +92,8 @@ const DashboardItemMore = ({ more }: { more: ReactNode }) => {
|
|
|
92
92
|
<div className="selector dashboard-item__block__head__more">
|
|
93
93
|
<Button
|
|
94
94
|
icon={<Icon name={IconTypeEnum.MORE} />}
|
|
95
|
-
color="
|
|
95
|
+
color="brand"
|
|
96
|
+
variant="tertiary"
|
|
96
97
|
size="small"
|
|
97
98
|
aria-label={intl.formatMessage(messages.moreLabel)}
|
|
98
99
|
{...getToggleButtonProps()}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
import { createMemoryRouter, RouterProvider } from 'react-router';
|
|
3
3
|
import { UserFactory } from 'utils/test/factories/richie';
|
|
4
4
|
import { StorybookHelper } from 'utils/StorybookHelper';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
import { createMemoryRouter, RouterProvider } from 'react-router';
|
|
3
3
|
import { UserFactory } from 'utils/test/factories/richie';
|
|
4
4
|
import { LearnerDashboardSidebar } from 'widgets/Dashboard/components/LearnerDashboardSidebar';
|
|
@@ -47,7 +47,7 @@ describe('<AuthenticatedOutlet />', () => {
|
|
|
47
47
|
await screen.findByTestId('route-restricted');
|
|
48
48
|
|
|
49
49
|
// location.replace should not have been called
|
|
50
|
-
expect(location.replace).not.
|
|
50
|
+
expect(location.replace).not.toHaveBeenCalled();
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
it('should redirect to provided path if user is anonymous', () => {
|
|
@@ -39,7 +39,7 @@ describe('<ProtectedOutlet />', () => {
|
|
|
39
39
|
screen.getByTestId('route-restricted');
|
|
40
40
|
|
|
41
41
|
// location.replace should not have been called
|
|
42
|
-
expect(location.replace).not.
|
|
42
|
+
expect(location.replace).not.toHaveBeenCalled();
|
|
43
43
|
});
|
|
44
44
|
|
|
45
45
|
it('should redirect to provided path if isAllowed is false', () => {
|
|
@@ -59,7 +59,8 @@ const SearchBar = ({ onSubmit }: SearchBarProps) => {
|
|
|
59
59
|
className="dashboard-search-bar__input"
|
|
60
60
|
type="button"
|
|
61
61
|
size="small"
|
|
62
|
-
color="
|
|
62
|
+
color="brand"
|
|
63
|
+
variant="tertiary"
|
|
63
64
|
icon={<span className="material-icons">close</span>}
|
|
64
65
|
onClick={clear}
|
|
65
66
|
aria-label={intl.formatMessage(messages.clearSearchButtonLabel)}
|
package/js/widgets/Dashboard/components/TeacherDashboardOrganizationSidebar/index.stories.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
import { createMemoryRouter, RouterProvider } from 'react-router';
|
|
3
3
|
import fetchMock from 'fetch-mock';
|
|
4
4
|
import { UserFactory } from 'utils/test/factories/richie';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
import { createMemoryRouter, RouterProvider } from 'react-router';
|
|
3
3
|
import { UserFactory } from 'utils/test/factories/richie';
|
|
4
4
|
import { TeacherDashboardProfileSidebar } from 'widgets/Dashboard/components/TeacherDashboardProfileSidebar';
|
|
@@ -33,7 +33,7 @@ describe('useRouteInfo', () => {
|
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
await waitFor(() =>
|
|
36
|
-
expect(result!.current).
|
|
36
|
+
expect(result!.current).toMatchObject({
|
|
37
37
|
id: '0',
|
|
38
38
|
pathname: '/posts',
|
|
39
39
|
params: {},
|
|
@@ -46,7 +46,7 @@ describe('useRouteInfo', () => {
|
|
|
46
46
|
rerender();
|
|
47
47
|
|
|
48
48
|
await waitFor(() =>
|
|
49
|
-
expect(result.current).
|
|
49
|
+
expect(result.current).toMatchObject({
|
|
50
50
|
id: '0-0',
|
|
51
51
|
pathname: '/posts/a-first-post',
|
|
52
52
|
params: { postId: 'a-first-post' },
|
|
@@ -82,7 +82,7 @@ describe('<Dashboard />', () => {
|
|
|
82
82
|
|
|
83
83
|
await expectNoSpinner('Loading orders and enrollments...');
|
|
84
84
|
|
|
85
|
-
expect(location.replace).not.
|
|
85
|
+
expect(location.replace).not.toHaveBeenCalled();
|
|
86
86
|
expectUrlMatchLocationDisplayed(LearnerDashboardPaths.COURSES);
|
|
87
87
|
});
|
|
88
88
|
|
|
@@ -82,7 +82,7 @@ export const TEACHER_DASHBOARD_ROUTE_LABELS = defineMessages<TeacherDashboardPat
|
|
|
82
82
|
[TeacherDashboardPaths.ORGANIZATION_COURSE_PRODUCT_LEARNER_LIST]: {
|
|
83
83
|
id: 'components.TeacherDashboard.TeacherDashboardRoutes.organization.course.product.learnerList.label',
|
|
84
84
|
description: "Label to display the organization product's learner list view.",
|
|
85
|
-
defaultMessage: '
|
|
85
|
+
defaultMessage: 'Buyers',
|
|
86
86
|
},
|
|
87
87
|
[TeacherDashboardPaths.COURSE]: {
|
|
88
88
|
id: 'components.TeacherDashboard.TeacherDashboardRoutes.course.label',
|
|
@@ -102,7 +102,7 @@ export const TEACHER_DASHBOARD_ROUTE_LABELS = defineMessages<TeacherDashboardPat
|
|
|
102
102
|
[TeacherDashboardPaths.COURSE_PRODUCT_LEARNER_LIST]: {
|
|
103
103
|
id: 'components.TeacherDashboard.TeacherDashboardRoutes.course.product.learnerList.label',
|
|
104
104
|
description: "Label to display the product's learner list view.",
|
|
105
|
-
defaultMessage: '
|
|
105
|
+
defaultMessage: 'Buyers',
|
|
106
106
|
},
|
|
107
107
|
[TeacherDashboardPaths.COURSE_PRODUCT_CONTRACTS]: {
|
|
108
108
|
id: 'components.TeacherDashboard.TeacherDashboardRoutes.course.product.contracts.label',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
import { StorybookHelper } from 'utils/StorybookHelper';
|
|
3
3
|
import { HistoryProvider } from 'hooks/useHistory';
|
|
4
4
|
import { SearchFilterValueParent } from '.';
|
|
@@ -101,18 +101,19 @@ const Slider = ({ slides, title }: SliderProps) => {
|
|
|
101
101
|
return (
|
|
102
102
|
<div
|
|
103
103
|
className="slider"
|
|
104
|
-
ref={emblaRef}
|
|
105
104
|
aria-roledescription="carousel"
|
|
106
105
|
aria-label={title}
|
|
107
106
|
role="button"
|
|
108
107
|
tabIndex={0}
|
|
109
108
|
onKeyDown={handleKeyDown}
|
|
110
109
|
>
|
|
111
|
-
<
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
110
|
+
<div ref={emblaRef}>
|
|
111
|
+
<Slideshow
|
|
112
|
+
slides={slides}
|
|
113
|
+
onNextSlide={() => emblaApi?.scrollNext()}
|
|
114
|
+
onPreviousSlide={() => emblaApi?.scrollPrev()}
|
|
115
|
+
/>
|
|
116
|
+
</div>
|
|
116
117
|
<SlidePanel
|
|
117
118
|
slides={slides}
|
|
118
119
|
activeSlideIndex={activeSlideIndex}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
import { CertificationDefinitionFactory, OrderLiteFactory } from 'utils/test/factories/joanie';
|
|
3
3
|
import JoanieApiProvider from 'contexts/JoanieApiContext';
|
|
4
4
|
import { StorybookHelper } from 'utils/StorybookHelper';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
import { QueryClientProvider } from '@tanstack/react-query';
|
|
3
3
|
import { CredentialOrderFactory, TargetCourseFactory } from 'utils/test/factories/joanie';
|
|
4
4
|
import { StorybookHelper } from 'utils/StorybookHelper';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
import { QueryClientProvider } from '@tanstack/react-query';
|
|
3
3
|
import fetchMock from 'fetch-mock';
|
|
4
4
|
import { StorybookHelper } from 'utils/StorybookHelper';
|
|
@@ -69,7 +69,8 @@ const CourseWishButton = ({ course }: Props) => {
|
|
|
69
69
|
return user ? (
|
|
70
70
|
<>
|
|
71
71
|
<Button
|
|
72
|
-
color="
|
|
72
|
+
color="brand"
|
|
73
|
+
variant="primary"
|
|
73
74
|
onClick={isWished ? removeFromWishlist : addToWishlist}
|
|
74
75
|
fullWidth
|
|
75
76
|
disabled={componentState === ComponentStates.LOADING}
|
|
@@ -87,7 +88,8 @@ const CourseWishButton = ({ course }: Props) => {
|
|
|
87
88
|
</>
|
|
88
89
|
) : (
|
|
89
90
|
<Button
|
|
90
|
-
color="
|
|
91
|
+
color="brand"
|
|
92
|
+
variant="primary"
|
|
91
93
|
onClick={login}
|
|
92
94
|
fullWidth
|
|
93
95
|
disabled={componentState === ComponentStates.LOADING}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
import { CourseRunFactory, PacedCourseFactory } from 'utils/test/factories/richie';
|
|
3
3
|
import { StorybookHelper } from 'utils/StorybookHelper';
|
|
4
4
|
import { CourseCertificateOffer, CourseOffer } from '../../../../types/Course';
|
package/js/widgets/SyllabusCourseRunsList/components/SyllabusCourseRunCompacted/index.stories.tsx
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { CourseRunFactory } from 'utils/test/factories/richie';
|
|
3
|
+
import { StorybookHelper } from 'utils/StorybookHelper';
|
|
4
|
+
import { CourseCertificateOffer, CourseOffer } from 'types/Course';
|
|
5
|
+
import { SyllabusCourseRunCompacted } from '.';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
component: SyllabusCourseRunCompacted,
|
|
9
|
+
render: (args) => StorybookHelper.wrapInApp(<SyllabusCourseRunCompacted {...args} />),
|
|
10
|
+
} as Meta<typeof SyllabusCourseRunCompacted>;
|
|
11
|
+
|
|
12
|
+
type Story = StoryObj<typeof SyllabusCourseRunCompacted>;
|
|
13
|
+
|
|
14
|
+
const courseRun = CourseRunFactory().one();
|
|
15
|
+
|
|
16
|
+
const singleDateCourseRun = {
|
|
17
|
+
...courseRun,
|
|
18
|
+
start: null,
|
|
19
|
+
enrollment_start: null,
|
|
20
|
+
title: 'Certificate Product',
|
|
21
|
+
price_currency: 'EUR',
|
|
22
|
+
offer: CourseOffer.FREE,
|
|
23
|
+
certificate_offer: CourseCertificateOffer.PAID,
|
|
24
|
+
certificate_price: 100,
|
|
25
|
+
discounted_price: null,
|
|
26
|
+
discount: null,
|
|
27
|
+
} as any;
|
|
28
|
+
|
|
29
|
+
const course = {
|
|
30
|
+
id: '038c4f92-542a-4652-8537-322a75297b75',
|
|
31
|
+
code: 'IYfwh',
|
|
32
|
+
is_self_paced: true,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const CertificateSyllabusSingleDate: Story = {
|
|
36
|
+
args: {
|
|
37
|
+
courseRun: singleDateCourseRun,
|
|
38
|
+
course,
|
|
39
|
+
showLanguages: true,
|
|
40
|
+
},
|
|
41
|
+
};
|