richie-education 3.1.3-dev3 → 3.1.3-dev30
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/.storybook/__mocks__/utils/context.ts +4 -0
- package/js/api/joanie.ts +8 -8
- package/js/components/ContractFrame/OrganizationContractFrame.spec.tsx +11 -19
- package/js/components/ContractFrame/OrganizationContractFrame.tsx +4 -4
- package/js/components/CourseGlimpse/CourseGlimpseFooter.tsx +30 -5
- package/js/components/CourseGlimpse/index.spec.tsx +18 -0
- package/js/components/CourseGlimpse/index.stories.tsx +75 -4
- package/js/components/CourseGlimpse/index.tsx +4 -0
- package/js/components/CourseGlimpse/utils.ts +35 -30
- package/js/components/CourseGlimpseList/utils.ts +2 -2
- package/js/components/PurchaseButton/index.tsx +3 -3
- package/js/components/SaleTunnel/CredentialSaleTunnel/index.tsx +1 -3
- package/js/components/SaleTunnel/GenericSaleTunnel.tsx +13 -1
- package/js/components/SaleTunnel/SaleTunnelInformation/index.tsx +9 -7
- package/js/components/SaleTunnel/SubscriptionButton/index.tsx +1 -2
- package/js/components/SaleTunnel/index.credential.spec.tsx +5 -19
- package/js/components/SaleTunnel/index.full-process.spec.tsx +3 -3
- package/js/components/SaleTunnel/index.spec.tsx +171 -29
- package/js/components/SaleTunnel/index.stories.tsx +17 -3
- package/js/components/SaleTunnel/index.tsx +2 -2
- package/js/components/TeacherDashboardCourseList/index.spec.tsx +3 -3
- package/js/components/TeacherDashboardCourseList/index.tsx +2 -2
- package/js/hooks/useContractArchive/index.ts +3 -3
- package/js/hooks/useCourseProductUnion/index.spec.tsx +16 -18
- package/js/hooks/useCourseProductUnion/index.ts +7 -7
- package/js/hooks/useCourseProducts.ts +4 -8
- package/js/hooks/useDefaultOrganizationId/index.tsx +4 -7
- package/js/hooks/useOffering/index.ts +32 -0
- package/js/hooks/useTeacherCoursesSearch/index.tsx +2 -2
- package/js/hooks/useTeacherPendingContractsCount/index.ts +4 -4
- package/js/pages/DashboardCourses/index.spec.tsx +14 -14
- package/js/pages/TeacherDashboardContractsLayout/TeacherDashboardContracts/index.spec.tsx +11 -14
- package/js/pages/TeacherDashboardContractsLayout/TeacherDashboardContracts/index.tsx +4 -9
- package/js/pages/TeacherDashboardContractsLayout/components/BulkDownloadContractButton/index.spec.tsx +11 -11
- package/js/pages/TeacherDashboardContractsLayout/components/BulkDownloadContractButton/index.timer.spec.tsx +10 -13
- package/js/pages/TeacherDashboardContractsLayout/components/BulkDownloadContractButton/index.tsx +4 -4
- package/js/pages/TeacherDashboardContractsLayout/components/ContractActionsBar/index.spec.tsx +20 -28
- package/js/pages/TeacherDashboardContractsLayout/components/ContractActionsBar/index.tsx +8 -11
- package/js/pages/TeacherDashboardContractsLayout/components/SignOrganizationContractButton/index.spec.tsx +6 -6
- package/js/pages/TeacherDashboardContractsLayout/components/SignOrganizationContractButton/index.tsx +4 -4
- package/js/pages/TeacherDashboardContractsLayout/hooks/useCheckContractArchiveExists/index.spec.tsx +7 -7
- package/js/pages/TeacherDashboardContractsLayout/hooks/useCheckContractArchiveExists/index.tsx +5 -5
- package/js/pages/TeacherDashboardContractsLayout/hooks/useDownloadContractArchive/contractArchiveLocalStorage.spec.ts +21 -28
- package/js/pages/TeacherDashboardContractsLayout/hooks/useDownloadContractArchive/contractArchiveLocalStorage.ts +13 -17
- package/js/pages/TeacherDashboardContractsLayout/hooks/useDownloadContractArchive/index.spec.tsx +11 -13
- package/js/pages/TeacherDashboardContractsLayout/hooks/useDownloadContractArchive/index.tsx +6 -6
- package/js/pages/TeacherDashboardContractsLayout/hooks/useHasContractToDownload/index.tsx +3 -3
- package/js/pages/TeacherDashboardContractsLayout/hooks/useTeacherContractFilters/index.spec.tsx +16 -16
- package/js/pages/TeacherDashboardContractsLayout/hooks/useTeacherContractFilters/index.tsx +4 -4
- package/js/pages/TeacherDashboardContractsLayout/hooks/useTeacherContractsToSign.tsx +4 -4
- package/js/pages/TeacherDashboardCourseLearnersLayout/hooks/useCourseLearnersFilters/index.spec.tsx +21 -21
- package/js/pages/TeacherDashboardCourseLearnersLayout/hooks/useCourseLearnersFilters/index.ts +5 -10
- package/js/pages/TeacherDashboardCourseLearnersLayout/index.spec.tsx +61 -79
- package/js/pages/TeacherDashboardCourseLearnersLayout/index.tsx +1 -1
- package/js/pages/TeacherDashboardCoursesLoader/index.spec.tsx +11 -11
- package/js/pages/TeacherDashboardOrganizationCourseLoader/index.spec.tsx +11 -11
- package/js/pages/TeacherDashboardTraining/TeacherDashboardTrainingLoader.tsx +7 -7
- package/js/pages/TeacherDashboardTraining/index.spec.tsx +21 -29
- package/js/pages/TeacherDashboardTraining/index.tsx +12 -16
- package/js/types/Course.ts +4 -0
- package/js/types/Joanie.ts +36 -29
- package/js/types/index.ts +6 -2
- package/js/utils/ProductHelper/index.ts +1 -5
- package/js/utils/test/factories/joanie.ts +19 -25
- package/js/utils/test/factories/richie.ts +10 -2
- package/js/utils/test/mockCourseProductWithOrder.ts +4 -4
- package/js/widgets/Dashboard/components/DashboardItem/Enrollment/DashboardItemEnrollment.tsx +1 -1
- package/js/widgets/Dashboard/components/DashboardItem/Enrollment/ProductCertificateFooter/index.spec.tsx +1 -1
- package/js/widgets/Dashboard/components/DashboardItem/Order/DashboardItemOrder.tsx +3 -3
- package/js/widgets/Dashboard/components/DashboardItem/Order/DashboardItemOrderContract.useUnionResource.cache.spec.tsx +1 -1
- package/js/widgets/Dashboard/components/DashboardItem/Order/Installment/index.tsx +4 -4
- package/js/widgets/Dashboard/components/DashboardItem/stories.mock.ts +1 -1
- package/js/widgets/Dashboard/components/DashboardSidebar/components/ContractNavLink/index.spec.tsx +23 -28
- package/js/widgets/Dashboard/components/DashboardSidebar/components/ContractNavLink/index.tsx +4 -8
- package/js/widgets/Dashboard/components/TeacherDashboardCourseSidebar/index.spec.tsx +17 -24
- package/js/widgets/Dashboard/components/TeacherDashboardCourseSidebar/index.tsx +18 -21
- package/js/widgets/Dashboard/components/TeacherDashboardCourseSidebar/utils.ts +4 -4
- package/js/widgets/Dashboard/components/TeacherDashboardOrganizationSidebar/index.tsx +3 -7
- package/js/widgets/Dashboard/utils/teacherDashboardPaths.tsx +4 -4
- package/js/widgets/SyllabusCourseRunsList/components/CourseProductItem/CourseProductItemFooter/index.tsx +19 -34
- package/js/widgets/SyllabusCourseRunsList/components/CourseProductItem/_styles.scss +35 -8
- package/js/widgets/SyllabusCourseRunsList/components/CourseProductItem/components/CourseProductCourseRuns/CourseRunList.tsx +3 -3
- package/js/widgets/SyllabusCourseRunsList/components/CourseProductItem/components/CourseProductCourseRuns/_styles.scss +9 -0
- package/js/widgets/SyllabusCourseRunsList/components/CourseProductItem/index.spec.tsx +186 -140
- package/js/widgets/SyllabusCourseRunsList/components/CourseProductItem/index.stories.tsx +11 -2
- package/js/widgets/SyllabusCourseRunsList/components/CourseProductItem/index.tsx +111 -24
- package/js/widgets/SyllabusCourseRunsList/components/SyllabusCourseRun/index.stories.tsx +81 -0
- package/js/widgets/SyllabusCourseRunsList/components/SyllabusCourseRun/index.tsx +14 -0
- package/js/widgets/SyllabusCourseRunsList/components/SyllabusCourseRunCompacted/index.tsx +14 -0
- package/js/widgets/SyllabusCourseRunsList/index.spec.tsx +54 -8
- package/package.json +1 -1
- package/scss/objects/_course_glimpses.scss +16 -0
- package/js/hooks/useCourseProductRelation/index.ts +0 -44
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FormattedMessage, defineMessages } from 'react-intl';
|
|
2
2
|
import PurchaseButton from 'components/PurchaseButton';
|
|
3
|
-
import {
|
|
3
|
+
import { Offering, CredentialProduct } from 'types/Joanie';
|
|
4
4
|
import { PacedCourse } from 'types';
|
|
5
5
|
|
|
6
6
|
const messages = defineMessages({
|
|
@@ -24,56 +24,41 @@ other {# remaining seats}
|
|
|
24
24
|
|
|
25
25
|
interface CourseProductItemFooterProps {
|
|
26
26
|
course: PacedCourse;
|
|
27
|
-
|
|
27
|
+
offering: Offering;
|
|
28
28
|
canPurchase: boolean;
|
|
29
|
-
orderGroups: OrderGroup[];
|
|
30
|
-
orderGroupsAvailable: OrderGroup[];
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
const CourseProductItemFooter = ({
|
|
34
32
|
course,
|
|
35
|
-
|
|
36
|
-
orderGroups,
|
|
37
|
-
orderGroupsAvailable,
|
|
33
|
+
offering,
|
|
38
34
|
canPurchase,
|
|
39
35
|
}: CourseProductItemFooterProps) => {
|
|
40
|
-
if (
|
|
41
|
-
return (
|
|
42
|
-
<PurchaseButton
|
|
43
|
-
course={course}
|
|
44
|
-
product={courseProductRelation.product as CredentialProduct}
|
|
45
|
-
organizations={courseProductRelation.organizations}
|
|
46
|
-
isWithdrawable={courseProductRelation.is_withdrawable}
|
|
47
|
-
disabled={!canPurchase}
|
|
48
|
-
buttonProps={{ fullWidth: true }}
|
|
49
|
-
/>
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
if (orderGroupsAvailable.length === 0) {
|
|
36
|
+
if (!offering.rules.has_seats_left)
|
|
53
37
|
return (
|
|
54
38
|
<p className="product-widget__footer__message">
|
|
55
39
|
<FormattedMessage {...messages.noSeatsAvailable} />
|
|
56
40
|
</p>
|
|
57
41
|
);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<div className="product-widget__footer__order-group" key={orderGroup.id}>
|
|
42
|
+
return (
|
|
43
|
+
<div className="product-widget__footer__order-group">
|
|
61
44
|
<PurchaseButton
|
|
62
45
|
course={course}
|
|
63
|
-
product={
|
|
64
|
-
|
|
65
|
-
|
|
46
|
+
product={offering.product as CredentialProduct}
|
|
47
|
+
offering={offering}
|
|
48
|
+
organizations={offering.organizations}
|
|
49
|
+
isWithdrawable={offering.is_withdrawable}
|
|
66
50
|
disabled={!canPurchase}
|
|
67
|
-
orderGroup={orderGroup}
|
|
68
51
|
buttonProps={{ fullWidth: true }}
|
|
69
52
|
/>
|
|
70
|
-
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
53
|
+
{offering.rules.has_seat_limit && (
|
|
54
|
+
<p className="product-widget__footer__message">
|
|
55
|
+
<FormattedMessage
|
|
56
|
+
{...messages.nbSeatsAvailable}
|
|
57
|
+
values={{ nb: offering.rules.nb_available_seats }}
|
|
58
|
+
/>
|
|
59
|
+
</p>
|
|
60
|
+
)}
|
|
76
61
|
</div>
|
|
77
|
-
)
|
|
62
|
+
);
|
|
78
63
|
};
|
|
79
64
|
export default CourseProductItemFooter;
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
background-color: r-theme-val(product-item, base-border);
|
|
44
44
|
color: r-theme-val(product-item, light-color);
|
|
45
45
|
justify-content: space-between;
|
|
46
|
+
text-align: center;
|
|
46
47
|
padding: 1rem 0.5rem;
|
|
47
48
|
|
|
48
49
|
&-main {
|
|
@@ -51,6 +52,8 @@
|
|
|
51
52
|
font-family: $r-font-family-montserrat;
|
|
52
53
|
font-weight: bold;
|
|
53
54
|
justify-content: space-between;
|
|
55
|
+
text-align: initial;
|
|
56
|
+
margin-bottom: rem-calc(8px);
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
&-metadata {
|
|
@@ -64,6 +67,12 @@
|
|
|
64
67
|
}
|
|
65
68
|
}
|
|
66
69
|
|
|
70
|
+
& .product-widget__header-main {
|
|
71
|
+
display: flex;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
text-align: center;
|
|
74
|
+
}
|
|
75
|
+
|
|
67
76
|
& .product-widget__title {
|
|
68
77
|
color: r-theme-val(product-item, light-color);
|
|
69
78
|
font-size: 1.5rem;
|
|
@@ -73,11 +82,32 @@
|
|
|
73
82
|
background-color: r-theme-val(product-item, light-color);
|
|
74
83
|
border-radius: 100vw;
|
|
75
84
|
color: r-theme-val(product-item, base-border);
|
|
76
|
-
font-size:
|
|
77
|
-
margin-bottom: 0;
|
|
78
|
-
margin-left: rem-calc(8px);
|
|
85
|
+
font-size: 1rem;
|
|
86
|
+
margin-bottom: 0.3rem;
|
|
79
87
|
padding: 0.375rem 0.81rem;
|
|
80
88
|
white-space: nowrap;
|
|
89
|
+
display: inline-block;
|
|
90
|
+
|
|
91
|
+
&-discounted {
|
|
92
|
+
text-decoration: line-through;
|
|
93
|
+
margin-right: rem-calc(6px);
|
|
94
|
+
font-size: 0.73rem;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&-discount {
|
|
98
|
+
color: r-theme-val(product-item, feedback-color);
|
|
99
|
+
text-decoration: none;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&-description,
|
|
104
|
+
&-discount {
|
|
105
|
+
font-size: 1.1rem;
|
|
106
|
+
margin: 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&-discount {
|
|
110
|
+
font-weight: bold;
|
|
81
111
|
}
|
|
82
112
|
}
|
|
83
113
|
|
|
@@ -149,13 +179,10 @@
|
|
|
149
179
|
|
|
150
180
|
&__order-group {
|
|
151
181
|
text-align: center;
|
|
182
|
+
margin-bottom: 0.5rem;
|
|
152
183
|
|
|
153
184
|
.product-widget__footer__message {
|
|
154
|
-
margin: 0.5rem 0;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
&:last-child {
|
|
158
|
-
margin-bottom: -1rem;
|
|
185
|
+
margin: 0.5rem 0 0;
|
|
159
186
|
}
|
|
160
187
|
}
|
|
161
188
|
}
|
|
@@ -38,7 +38,7 @@ const CourseRunList = ({ courseRuns }: Props) => {
|
|
|
38
38
|
<ol className="course-runs-list">
|
|
39
39
|
{Children.toArray(
|
|
40
40
|
courseRuns.map((courseRun) => (
|
|
41
|
-
<li className="course-runs-item course-runs-item--inactive">
|
|
41
|
+
<li key={courseRun.id} className="course-runs-item course-runs-item--inactive">
|
|
42
42
|
<strong className="course-runs-item__course-dates">
|
|
43
43
|
<span
|
|
44
44
|
className="offscreen"
|
|
@@ -68,7 +68,7 @@ const CourseRunList = ({ courseRuns }: Props) => {
|
|
|
68
68
|
</strong>
|
|
69
69
|
<span
|
|
70
70
|
data-testid={`course-run-${courseRun.id}-enrollment-dates`}
|
|
71
|
-
className="course-runs-item__metadata"
|
|
71
|
+
className="course-runs-item__metadata course-runs-item__enrollment-date"
|
|
72
72
|
>
|
|
73
73
|
<EnrollmentDate
|
|
74
74
|
enrollment_start={courseRun.enrollment_start}
|
|
@@ -77,7 +77,7 @@ const CourseRunList = ({ courseRuns }: Props) => {
|
|
|
77
77
|
</span>
|
|
78
78
|
<span
|
|
79
79
|
data-testid={`course-run-${courseRun.id}-languages`}
|
|
80
|
-
className="course-runs-item__metadata"
|
|
80
|
+
className="course-runs-item__metadata course-runs-item__languages"
|
|
81
81
|
>
|
|
82
82
|
<FormattedMessage
|
|
83
83
|
{...sharedMessages.language}
|
|
@@ -113,6 +113,15 @@
|
|
|
113
113
|
line-height: 1.4em;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
&__enrollment-date {
|
|
117
|
+
font-weight: bold;
|
|
118
|
+
color: #03317f;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&__languages {
|
|
122
|
+
font-weight: bold;
|
|
123
|
+
}
|
|
124
|
+
|
|
116
125
|
&__feedback {
|
|
117
126
|
color: r-theme-val(product-item, feedback-color);
|
|
118
127
|
}
|