richie-education 2.29.3-dev41 → 2.29.3-dev50

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.
@@ -13,7 +13,8 @@ export const getLocalizedErrorMessage = (
13
13
  return intl.formatMessage(errorMessages[ErrorKeys.MIXED_INVALID]);
14
14
  }
15
15
 
16
- return intl.formatMessage(errorMessages[error.key], error.values);
16
+ const message = intl.formatMessage(errorMessages[error.key], error.values);
17
+ return message as string | string[];
17
18
  };
18
19
 
19
20
  interface CunninghamErrorProp {
@@ -254,7 +254,12 @@ export const CourseRunFactory = factory((): CourseRun => {
254
254
  call_to_action: 'enroll now',
255
255
  text: CourseStateTextEnum.ENROLLMENT_OPENED,
256
256
  }).one(),
257
- languages: faker.helpers.multiple(faker.location.countryCode, { count: { min: 1, max: 5 } }),
257
+ languages: faker.helpers.multiple(() => faker.location.countryCode(), {
258
+ count: {
259
+ min: 1,
260
+ max: 5,
261
+ },
262
+ }),
258
263
  };
259
264
  });
260
265
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "richie-education",
3
- "version": "2.29.3-dev41",
3
+ "version": "2.29.3-dev50",
4
4
  "description": "A CMS to build learning portals for Open Education",
5
5
  "main": "sandbox/manage.py",
6
6
  "scripts": {
@@ -41,73 +41,73 @@
41
41
  "@babel/core": "7.25.2",
42
42
  "@babel/plugin-syntax-dynamic-import": "7.8.3",
43
43
  "@babel/plugin-transform-modules-commonjs": "7.24.8",
44
- "@babel/preset-env": "7.25.3",
44
+ "@babel/preset-env": "7.25.4",
45
45
  "@babel/preset-react": "7.24.7",
46
46
  "@babel/preset-typescript": "7.24.7",
47
- "@faker-js/faker": "8.4.1",
47
+ "@faker-js/faker": "9.0.3",
48
48
  "@formatjs/cli": "6.2.12",
49
49
  "@formatjs/intl-relativetimeformat": "11.2.14",
50
50
  "@hookform/resolvers": "3.9.0",
51
51
  "@lyracom/embedded-form-glue": "1.4.2",
52
52
  "@openfun/cunningham-react": "2.9.4",
53
53
  "@openfun/cunningham-tokens": "2.1.1",
54
- "@sentry/browser": "8.26.0",
55
- "@sentry/types": "8.26.0",
56
- "@storybook/addon-actions": "8.2.9",
57
- "@storybook/addon-essentials": "8.2.9",
58
- "@storybook/addon-interactions": "8.2.9",
59
- "@storybook/addon-links": "8.2.9",
60
- "@storybook/react": "8.2.9",
61
- "@storybook/react-webpack5": "8.2.9",
62
- "@storybook/test": "8.2.9",
63
- "@tanstack/query-core": "5.51.24",
64
- "@tanstack/query-sync-storage-persister": "5.51.24",
65
- "@tanstack/react-query": "5.51.24",
66
- "@tanstack/react-query-devtools": "5.51.24",
67
- "@tanstack/react-query-persist-client": "5.51.24",
54
+ "@sentry/browser": "8.33.0",
55
+ "@sentry/types": "8.32.0",
56
+ "@storybook/addon-actions": "8.3.4",
57
+ "@storybook/addon-essentials": "8.3.4",
58
+ "@storybook/addon-interactions": "8.3.4",
59
+ "@storybook/addon-links": "8.3.4",
60
+ "@storybook/react": "8.3.4",
61
+ "@storybook/react-webpack5": "8.3.4",
62
+ "@storybook/test": "8.3.4",
63
+ "@tanstack/query-core": "5.56.2",
64
+ "@tanstack/query-sync-storage-persister": "5.56.2",
65
+ "@tanstack/react-query": "5.56.2",
66
+ "@tanstack/react-query-devtools": "5.56.2",
67
+ "@tanstack/react-query-persist-client": "5.56.2",
68
68
  "@testing-library/dom": "10.4.0",
69
- "@testing-library/jest-dom": "6.4.8",
70
- "@testing-library/react": "16.0.0",
69
+ "@testing-library/jest-dom": "6.5.0",
70
+ "@testing-library/react": "16.0.1",
71
71
  "@testing-library/user-event": "14.5.2",
72
72
  "@types/fetch-mock": "7.3.8",
73
73
  "@types/iframe-resizer": "3.5.13",
74
- "@types/jest": "29.5.12",
74
+ "@types/jest": "29.5.13",
75
75
  "@types/js-cookie": "3.0.6",
76
76
  "@types/lodash-es": "4.17.12",
77
77
  "@types/node-fetch": "2.6.11",
78
78
  "@types/query-string": "6.3.0",
79
- "@types/react": "18.3.3",
79
+ "@types/react": "18.3.10",
80
80
  "@types/react-autosuggest": "10.1.11",
81
81
  "@types/react-dom": "18.3.0",
82
82
  "@types/react-modal": "3.16.3",
83
83
  "@types/uuid": "10.0.0",
84
- "@typescript-eslint/eslint-plugin": "8.1.0",
85
- "@typescript-eslint/parser": "8.1.0",
84
+ "@typescript-eslint/eslint-plugin": "8.7.0",
85
+ "@typescript-eslint/parser": "8.7.0",
86
86
  "babel-jest": "29.7.0",
87
- "babel-loader": "9.1.3",
87
+ "babel-loader": "9.2.1",
88
88
  "babel-plugin-react-intl": "8.2.25",
89
89
  "bootstrap": ">=4.6.0 <5",
90
90
  "classnames": "2.5.1",
91
91
  "cljs-merge": "1.1.1",
92
- "core-js": "3.38.0",
92
+ "core-js": "3.38.1",
93
93
  "downshift": "9.0.8",
94
94
  "eslint": ">=8.57.0 <9",
95
95
  "eslint-config-airbnb": "19.0.4",
96
96
  "eslint-config-airbnb-typescript": "18.0.0",
97
97
  "eslint-config-prettier": "9.1.0",
98
- "eslint-import-resolver-webpack": "0.13.8",
99
- "eslint-plugin-compat": "6.0.0",
100
- "eslint-plugin-formatjs": "4.13.3",
101
- "eslint-plugin-import": "2.29.1",
102
- "eslint-plugin-jsx-a11y": "6.9.0",
98
+ "eslint-import-resolver-webpack": "0.13.9",
99
+ "eslint-plugin-compat": "6.0.1",
100
+ "eslint-plugin-formatjs": "5.0.0",
101
+ "eslint-plugin-import": "2.30.0",
102
+ "eslint-plugin-jsx-a11y": "6.10.0",
103
103
  "eslint-plugin-prettier": "5.2.1",
104
- "eslint-plugin-react": "7.35.0",
104
+ "eslint-plugin-react": "7.37.0",
105
105
  "eslint-plugin-react-hooks": "4.6.2",
106
- "eslint-plugin-storybook": "0.8.0",
106
+ "eslint-plugin-storybook": "0.9.0",
107
107
  "fetch-mock": "<10",
108
108
  "file-loader": "6.2.0",
109
109
  "glob": "11.0.0",
110
- "i18n-iso-countries": "7.11.3",
110
+ "i18n-iso-countries": "7.12.0",
111
111
  "iframe-resizer": "<5",
112
112
  "intl-pluralrules": "2.0.1",
113
113
  "jest": "29.7.0",
@@ -115,25 +115,25 @@
115
115
  "js-cookie": "3.0.5",
116
116
  "lodash-es": "4.17.21",
117
117
  "mdn-polyfills": "5.20.0",
118
- "msw": "2.3.5",
118
+ "msw": "2.4.9",
119
119
  "node-fetch": ">2.6.6 <3",
120
- "nodemon": "3.1.4",
120
+ "nodemon": "3.1.7",
121
121
  "prettier": "3.3.3",
122
122
  "query-string": "9.1.0",
123
123
  "react": "18.3.1",
124
124
  "react-autosuggest": "10.1.0",
125
125
  "react-dom": "18.3.1",
126
- "react-hook-form": "7.52.2",
127
- "react-intl": "6.6.8",
126
+ "react-hook-form": "7.53.0",
127
+ "react-intl": "6.7.0",
128
128
  "react-modal": "3.16.1",
129
- "react-router-dom": "6.26.1",
130
- "sass": "1.77.8",
129
+ "react-router-dom": "6.26.2",
130
+ "sass": "1.79.4",
131
131
  "source-map-loader": "5.0.0",
132
- "storybook": "8.2.9",
132
+ "storybook": "8.3.4",
133
133
  "tsconfig-paths-webpack-plugin": "4.1.0",
134
- "typescript": "5.5.4",
134
+ "typescript": "5.6.2",
135
135
  "uuid": "10.0.0",
136
- "webpack": "5.93.0",
136
+ "webpack": "5.95.0",
137
137
  "webpack-cli": "5.1.4",
138
138
  "whatwg-fetch": "3.6.20",
139
139
  "xhr-mock": "2.5.1",
@@ -142,7 +142,7 @@
142
142
  },
143
143
  "resolutions": {
144
144
  "@testing-library/dom": "10.4.0",
145
- "@types/react": "18.3.3",
145
+ "@types/react": "18.3.10",
146
146
  "@types/react-dom": "18.3.0"
147
147
  },
148
148
  "msw": {
@@ -152,7 +152,7 @@
152
152
  "node": "20.11.0"
153
153
  },
154
154
  "devDependencies": {
155
- "@storybook/addon-mdx-gfm": "8.2.9",
155
+ "@storybook/addon-mdx-gfm": "8.3.4",
156
156
  "@storybook/addon-webpack5-compiler-babel": "3.0.3"
157
157
  }
158
158
  }
@@ -128,6 +128,18 @@ $r-theme: (
128
128
  cta-color: r-color('firebrick6'),
129
129
  cta-border: r-color('white'),
130
130
  ),
131
+ compacted-banner: (
132
+ title-color: r-color('charcoal'),
133
+ title-alt-color: r-color('firebrick6'),
134
+ content-color: r-color('black'),
135
+ search-input-background: rgba(r-color('white'), 0.7),
136
+ search-btn-background: r-color('firebrick6'),
137
+ search-icon-fill: r-color('white'),
138
+ cta-variant-from: rgba(r-color('white'), 0.8),
139
+ cta-variant-to: rgba(r-color('white'), 0.8),
140
+ cta-color: r-color('firebrick6'),
141
+ cta-border: r-color('white'),
142
+ ),
131
143
  section-plugin: (
132
144
  title-emphased-color: r-color('firebrick6'),
133
145
  ),
@@ -28,6 +28,20 @@ body {
28
28
  background-size: 100% 100%;
29
29
  }
30
30
  }
31
+
32
+ // Apply the top padding behavior with topbar over mode only on the first child which
33
+ // is the only variant that can be exposed to issue with topbar over
34
+ .compacted-banner:first-child {
35
+ .compacted-banner__inner {
36
+ @include media-breakpoint-up(lg) {
37
+ @if $r-topbar-height {
38
+ padding: $r-topbar-height 0 1rem;
39
+ } @else {
40
+ padding: 1rem 0 1rem;
41
+ }
42
+ }
43
+ }
44
+ }
31
45
  }
32
46
 
33
47
  // Container relative to some modal components
@@ -61,6 +61,7 @@
61
61
  @import './templates/courses/plugins/licence_plugin';
62
62
  @import './templates/richie/section/section';
63
63
  @import './templates/richie/large_banner/large_banner';
64
+ @import './templates/richie/large_banner/compacted_banner';
64
65
  @import './templates/richie/nesteditem/nesteditem';
65
66
  @import './templates/richie/glimpse/glimpse';
66
67
 
@@ -0,0 +1,149 @@
1
+ // A compact banner without image contents
2
+ // Opposed to 'hero-intro' this variant delegates the top padding for topbar in 'over'
3
+ // mode in content component
4
+ //
5
+ .compacted-banner {
6
+ position: relative;
7
+ padding: 0;
8
+
9
+ &__inner {
10
+ padding: 1rem 0;
11
+
12
+ @include media-breakpoint-up(lg) {
13
+ display: flex;
14
+ }
15
+ }
16
+
17
+ &__body {
18
+ @include make-container();
19
+ @include make-container-max-widths();
20
+ padding: 1rem;
21
+ text-align: center;
22
+
23
+ @include media-breakpoint-up(lg) {
24
+ display: flex;
25
+ padding: 2rem;
26
+ flex-direction: column;
27
+ justify-content: space-between;
28
+ }
29
+ }
30
+
31
+ // NOTE: Force disabling of hardcoded hero title class from some already save
32
+ // contents. Sadly we can not disable the huge font size
33
+ .hero-intro__title {
34
+ margin-bottom: 1rem !important;
35
+ width: auto;
36
+ color: inherit;
37
+
38
+ strong {
39
+ color: inherit;
40
+ font-weight: inherit;
41
+ }
42
+ }
43
+
44
+ // NOTE: Apply the color+weight behavior with 'strong' element alike in
45
+ // 'hero-intro__title' but naturally on title elements without any class
46
+ h1,
47
+ h2,
48
+ h3,
49
+ h4,
50
+ h5,
51
+ h6 {
52
+ color: r-theme-val(compacted-banner, title-color);
53
+ margin-bottom: 0.5em;
54
+
55
+ strong {
56
+ color: r-theme-val(compacted-banner, title-alt-color);
57
+ font-weight: inherit;
58
+ }
59
+ }
60
+
61
+ // NOTE: Implement again the 'hero-intro__title' equivalent behavior
62
+ &__title {
63
+ @include responsive-spacer('margin-bottom', 1);
64
+ @include font-size($extra-font-size);
65
+ color: r-theme-val(compacted-banner, title-color);
66
+
67
+ strong {
68
+ color: r-theme-val(compacted-banner, title-alt-color);
69
+ font-weight: inherit;
70
+ }
71
+ }
72
+
73
+ &__content {
74
+ @include font-size($h5-font-size);
75
+ color: r-theme-val(compacted-banner, content-color);
76
+ }
77
+
78
+ &__search {
79
+ display: flex;
80
+ flex-wrap: wrap;
81
+ align-items: center;
82
+ justify-content: center;
83
+
84
+ .richie-react--root-search-suggest-field {
85
+ @include sv-flex(1, 0, 100%);
86
+ position: relative;
87
+
88
+ @include media-breakpoint-up(lg) {
89
+ @include sv-flex(1, 0, 320px);
90
+ }
91
+
92
+ .react-autosuggest__container {
93
+ margin-bottom: 0;
94
+ }
95
+
96
+ input {
97
+ background: r-theme-val(compacted-banner, search-input-background);
98
+ }
99
+
100
+ .search-input {
101
+ &__btn {
102
+ background: r-theme-val(compacted-banner, search-btn-background);
103
+ border-top-right-radius: 3rem;
104
+ border-bottom-right-radius: 3rem;
105
+
106
+ &__icon {
107
+ fill: r-theme-val(compacted-banner, search-icon-fill);
108
+ }
109
+ }
110
+ }
111
+ }
112
+ }
113
+
114
+ &__cta {
115
+ @include sv-flex(0, 0, auto);
116
+ @include button-size(
117
+ $btn-padding-y,
118
+ $btn-padding-x,
119
+ $btn-font-size,
120
+ $btn-line-height,
121
+ $btn-border-radius
122
+ );
123
+ @include button-variant(
124
+ r-theme-val(compacted-banner, cta-variant-from),
125
+ r-theme-val(compacted-banner, cta-variant-to)
126
+ );
127
+ margin: 1.2rem 0 0;
128
+ font-size: $font-size-base;
129
+ color: r-theme-val(compacted-banner, cta-color);
130
+ border-radius: 2rem;
131
+ @if r-theme-val(compacted-banner, cta-border) {
132
+ border: 1px solid r-theme-val(compacted-banner, cta-border);
133
+ }
134
+
135
+ @include media-breakpoint-up(lg) {
136
+ margin-top: 0;
137
+ @include responsive-spacer('margin-left', 0, $breakpoints: ('lg': 3));
138
+ }
139
+
140
+ &:after {
141
+ content: '→';
142
+ margin-left: 1rem;
143
+ }
144
+
145
+ &:hover {
146
+ text-decoration: none;
147
+ }
148
+ }
149
+ }