@coorpacademy/components 10.5.3 → 10.5.7-alpha.3
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/es/molecule/course-section/index.js +5 -3
- package/es/molecule/course-section/index.js.map +1 -1
- package/es/molecule/course-section/style.css +2 -1
- package/es/molecule/course-section/test/fixtures/chapter.js +2 -1
- package/es/molecule/course-section/test/fixtures/chapter.js.map +1 -1
- package/es/molecule/course-section/test/fixtures/course.js +2 -1
- package/es/molecule/course-section/test/fixtures/course.js.map +1 -1
- package/es/molecule/course-section/test/fixtures.js +15 -0
- package/es/molecule/course-section/test/fixtures.js.map +1 -0
- package/es/molecule/course-sections/index.js +40 -0
- package/es/molecule/course-sections/index.js.map +1 -0
- package/es/molecule/course-sections/style.css +3 -0
- package/es/molecule/course-sections/test/fixtures/default.js +149 -0
- package/es/molecule/course-sections/test/fixtures/default.js.map +1 -0
- package/es/molecule/course-sections/test/fixtures/loading.js +9 -0
- package/es/molecule/course-sections/test/fixtures/loading.js.map +1 -0
- package/es/molecule/draggable/index.js +1 -1
- package/es/molecule/draggable/index.js.map +1 -1
- package/es/molecule/draggable/style.css +2 -16
- package/es/molecule/draggable-list/index.js +56 -0
- package/es/molecule/draggable-list/index.js.map +1 -0
- package/es/molecule/draggable-list/test/fixtures/course-sections.js +20 -0
- package/es/molecule/draggable-list/test/fixtures/course-sections.js.map +1 -0
- package/es/molecule/draggable-list/test/fixtures/dashboard-sections.js +26 -0
- package/es/molecule/draggable-list/test/fixtures/dashboard-sections.js.map +1 -0
- package/es/molecule/draggable-list/test/fixtures.js +13 -0
- package/es/molecule/draggable-list/test/fixtures.js.map +1 -0
- package/es/molecule/{setup-sections → draggable-list}/test/on-drop.js +17 -17
- package/es/molecule/draggable-list/test/on-drop.js.map +1 -0
- package/es/molecule/questions/qcm/index.js +40 -25
- package/es/molecule/questions/qcm/index.js.map +1 -1
- package/es/molecule/questions/qcm/style.css +39 -15
- package/es/molecule/questions/qcm/test/fixtures/default.js +8 -0
- package/es/molecule/questions/qcm/test/fixtures/default.js.map +1 -1
- package/es/molecule/questions/qcm/test/qcm.js +105 -0
- package/es/molecule/questions/qcm/test/qcm.js.map +1 -0
- package/es/molecule/questions/qcm-graphic/index.js +38 -17
- package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/es/molecule/questions/qcm-graphic/style.css +60 -15
- package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js +65 -0
- package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -0
- package/es/molecule/select-multiple/style.css +8 -5
- package/es/molecule/setup-section/style.css +1 -0
- package/es/molecule/setup-sections/index.js +7 -33
- package/es/molecule/setup-sections/index.js.map +1 -1
- package/es/molecule/wizard-summary/test/fixtures/organize-courses.js +106 -0
- package/es/molecule/wizard-summary/test/fixtures/organize-courses.js.map +1 -0
- package/es/organism/brand-form/test/fixtures/wizard-playlists.js +1 -1
- package/es/organism/brand-form/test/fixtures/wizard-playlists.js.map +1 -1
- package/es/organism/wizard-contents/index.js +6 -0
- package/es/organism/wizard-contents/index.js.map +1 -1
- package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +45 -0
- package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -0
- package/es/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js +22 -0
- package/es/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js.map +1 -0
- package/es/util/get-shadow-box-color-from-primary.js +4 -0
- package/es/util/get-shadow-box-color-from-primary.js.map +1 -0
- package/es/util/test/get-shadow-box-color-from-primary.js +33 -0
- package/es/util/test/get-shadow-box-color-from-primary.js.map +1 -0
- package/es/variables/colors.css +3 -0
- package/lib/molecule/course-section/index.js +5 -3
- package/lib/molecule/course-section/index.js.map +1 -1
- package/lib/molecule/course-section/style.css +2 -1
- package/lib/molecule/course-section/test/fixtures/chapter.js +2 -1
- package/lib/molecule/course-section/test/fixtures/chapter.js.map +1 -1
- package/lib/molecule/course-section/test/fixtures/course.js +2 -1
- package/lib/molecule/course-section/test/fixtures/course.js.map +1 -1
- package/lib/molecule/course-section/test/fixtures.js +25 -0
- package/lib/molecule/course-section/test/fixtures.js.map +1 -0
- package/lib/molecule/course-sections/index.js +54 -0
- package/lib/molecule/course-sections/index.js.map +1 -0
- package/lib/molecule/course-sections/style.css +3 -0
- package/lib/molecule/course-sections/test/fixtures/default.js +154 -0
- package/lib/molecule/course-sections/test/fixtures/default.js.map +1 -0
- package/lib/molecule/course-sections/test/fixtures/loading.js +14 -0
- package/lib/molecule/course-sections/test/fixtures/loading.js.map +1 -0
- package/lib/molecule/draggable/index.js +1 -1
- package/lib/molecule/draggable/index.js.map +1 -1
- package/lib/molecule/draggable/style.css +2 -16
- package/lib/molecule/draggable-list/index.js +73 -0
- package/lib/molecule/draggable-list/index.js.map +1 -0
- package/lib/molecule/draggable-list/test/fixtures/course-sections.js +29 -0
- package/lib/molecule/draggable-list/test/fixtures/course-sections.js.map +1 -0
- package/lib/molecule/draggable-list/test/fixtures/dashboard-sections.js +37 -0
- package/lib/molecule/draggable-list/test/fixtures/dashboard-sections.js.map +1 -0
- package/lib/molecule/draggable-list/test/fixtures.js +22 -0
- package/lib/molecule/draggable-list/test/fixtures.js.map +1 -0
- package/lib/molecule/{setup-sections → draggable-list}/test/on-drop.js +19 -19
- package/lib/molecule/draggable-list/test/on-drop.js.map +1 -0
- package/lib/molecule/questions/qcm/index.js +47 -23
- package/lib/molecule/questions/qcm/index.js.map +1 -1
- package/lib/molecule/questions/qcm/style.css +39 -15
- package/lib/molecule/questions/qcm/test/fixtures/default.js +8 -0
- package/lib/molecule/questions/qcm/test/fixtures/default.js.map +1 -1
- package/lib/molecule/questions/qcm/test/qcm.js +117 -0
- package/lib/molecule/questions/qcm/test/qcm.js.map +1 -0
- package/lib/molecule/questions/qcm-graphic/index.js +36 -15
- package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/lib/molecule/questions/qcm-graphic/style.css +60 -15
- package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js +76 -0
- package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -0
- package/lib/molecule/select-multiple/style.css +8 -5
- package/lib/molecule/setup-section/style.css +1 -0
- package/lib/molecule/setup-sections/index.js +7 -37
- package/lib/molecule/setup-sections/index.js.map +1 -1
- package/lib/molecule/wizard-summary/test/fixtures/organize-courses.js +111 -0
- package/lib/molecule/wizard-summary/test/fixtures/organize-courses.js.map +1 -0
- package/lib/organism/brand-form/test/fixtures/wizard-playlists.js +1 -1
- package/lib/organism/brand-form/test/fixtures/wizard-playlists.js.map +1 -1
- package/lib/organism/wizard-contents/index.js +7 -0
- package/lib/organism/wizard-contents/index.js.map +1 -1
- package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +54 -0
- package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -0
- package/lib/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js +32 -0
- package/lib/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js.map +1 -0
- package/lib/util/get-shadow-box-color-from-primary.js +12 -0
- package/lib/util/get-shadow-box-color-from-primary.js.map +1 -0
- package/lib/util/test/get-shadow-box-color-from-primary.js +40 -0
- package/lib/util/test/get-shadow-box-color-from-primary.js.map +1 -0
- package/lib/variables/colors.css +3 -0
- package/package.json +2 -2
- package/es/molecule/search/test/fixtures.js +0 -15
- package/es/molecule/search/test/fixtures.js.map +0 -1
- package/es/molecule/setup-sections/test/on-drop.js.map +0 -1
- package/lib/molecule/search/test/fixtures.js +0 -25
- package/lib/molecule/search/test/fixtures.js.map +0 -1
- package/lib/molecule/setup-sections/test/on-drop.js.map +0 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
@value mobile from breakpoints;
|
|
3
3
|
@value colors: "../../../variables/colors.css";
|
|
4
4
|
@value white from colors;
|
|
5
|
-
@value
|
|
6
|
-
@value
|
|
7
|
-
@value
|
|
5
|
+
@value cm_grey_75 from colors;
|
|
6
|
+
@value cm_primary_blue from colors;
|
|
7
|
+
@value cm_blue_900 from colors;
|
|
8
8
|
|
|
9
9
|
.wrapper {
|
|
10
10
|
display: flex;
|
|
@@ -15,16 +15,33 @@
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.answer {
|
|
18
|
-
|
|
18
|
+
position: relative;
|
|
19
|
+
color: cm_blue_900;
|
|
19
20
|
background-color: white;
|
|
20
|
-
border: 1px solid color(black lightness(85%));
|
|
21
|
-
border-radius: 3px;
|
|
22
21
|
box-sizing: border-box;
|
|
23
22
|
cursor: pointer;
|
|
24
23
|
padding: 8px;
|
|
25
24
|
width: 200px;
|
|
26
25
|
min-height: 245px;
|
|
27
26
|
margin: 0 4px 8px;
|
|
27
|
+
box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.12);
|
|
28
|
+
border-radius: 16px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.background {
|
|
32
|
+
top: 0;
|
|
33
|
+
left: 0;
|
|
34
|
+
position: absolute;
|
|
35
|
+
border-radius: 16px;
|
|
36
|
+
height: 100%;
|
|
37
|
+
width: 100%;
|
|
38
|
+
transition: opacity 0.25s linear, background-color 0.25s linear;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.content {
|
|
42
|
+
height: 100%;
|
|
43
|
+
width: 100%;
|
|
44
|
+
position: relative;
|
|
28
45
|
}
|
|
29
46
|
|
|
30
47
|
.imageWrapper {
|
|
@@ -33,12 +50,21 @@
|
|
|
33
50
|
align-items: center;
|
|
34
51
|
height: 110px;
|
|
35
52
|
margin-bottom: 16px;
|
|
36
|
-
background-size:
|
|
53
|
+
background-size: cover;
|
|
37
54
|
background-repeat: no-repeat;
|
|
38
55
|
background-position: center center;
|
|
56
|
+
border-radius: 12px;
|
|
39
57
|
}
|
|
40
58
|
|
|
41
59
|
.titleWrapper {
|
|
60
|
+
display: flex;
|
|
61
|
+
height: calc(100% - 126px);
|
|
62
|
+
width: 100%;
|
|
63
|
+
align-items: center;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.title {
|
|
42
68
|
font-family: 'Gilroy';
|
|
43
69
|
font-size: 17px;
|
|
44
70
|
line-height: 20px;
|
|
@@ -49,18 +75,36 @@
|
|
|
49
75
|
}
|
|
50
76
|
|
|
51
77
|
.answer:hover {
|
|
52
|
-
background
|
|
78
|
+
background: cm_grey_75;
|
|
79
|
+
box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.12);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.answer .background{
|
|
83
|
+
opacity: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.answer:hover .background{
|
|
87
|
+
opacity: 1;
|
|
53
88
|
}
|
|
54
89
|
|
|
55
90
|
.selected {
|
|
56
91
|
composes: answer;
|
|
57
|
-
color:
|
|
92
|
+
color: cm_primary_blue;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.selected .background{
|
|
96
|
+
opacity: 0.05;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.selected:hover .background{
|
|
100
|
+
opacity: 0.1;
|
|
58
101
|
}
|
|
59
102
|
|
|
60
103
|
@media mobile {
|
|
61
104
|
.wrapper {
|
|
62
105
|
flex-direction: column;
|
|
63
|
-
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center;
|
|
64
108
|
width: 100%;
|
|
65
109
|
padding-bottom: 0;
|
|
66
110
|
}
|
|
@@ -69,17 +113,18 @@
|
|
|
69
113
|
display: flex;
|
|
70
114
|
align-items: center;
|
|
71
115
|
flex-flow: row nowrap;
|
|
72
|
-
width: 100
|
|
116
|
+
width: calc(100% - 45px);
|
|
73
117
|
min-height: 82px;
|
|
74
118
|
height: inherit;
|
|
75
119
|
margin: 0 0 8px;
|
|
76
120
|
overflow: hidden;
|
|
77
121
|
}
|
|
78
122
|
|
|
79
|
-
.
|
|
80
|
-
|
|
123
|
+
.content {
|
|
124
|
+
display: flex;
|
|
125
|
+
align-items: center;
|
|
81
126
|
}
|
|
82
|
-
|
|
127
|
+
|
|
83
128
|
.answer:last-child {
|
|
84
129
|
margin-bottom: 0;
|
|
85
130
|
}
|
|
@@ -96,7 +141,7 @@
|
|
|
96
141
|
white-space: wrap;
|
|
97
142
|
overflow: hidden;
|
|
98
143
|
padding: 0;
|
|
99
|
-
|
|
144
|
+
justify-content: left;
|
|
100
145
|
font-size: 15px;
|
|
101
146
|
}
|
|
102
147
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import _identity from "lodash/fp/identity";
|
|
2
|
+
|
|
3
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
|
|
5
|
+
import browserEnv from 'browser-env';
|
|
6
|
+
import test from 'ava';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { shallow, configure } from 'enzyme';
|
|
9
|
+
import Adapter from 'enzyme-adapter-react-16';
|
|
10
|
+
import QCMImage from '..';
|
|
11
|
+
import defaultFixture from './fixtures/default';
|
|
12
|
+
browserEnv();
|
|
13
|
+
configure({
|
|
14
|
+
adapter: new Adapter()
|
|
15
|
+
});
|
|
16
|
+
const translate = _identity;
|
|
17
|
+
test('onClick should be reachable, should match given aria-label', t => {
|
|
18
|
+
let answerWasClicked = false;
|
|
19
|
+
defaultFixture.props.answers[1] = _extends(_extends({}, defaultFixture.props.answers[1]), {}, {
|
|
20
|
+
onClick: () => {
|
|
21
|
+
answerWasClicked = true;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const wrapper = shallow( /*#__PURE__*/React.createElement(QCMImage, defaultFixture.props), {
|
|
25
|
+
context: {
|
|
26
|
+
translate
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
const answersImages = wrapper.find('[data-name="answerImage"]');
|
|
30
|
+
t.true(answersImages.at(1).exists());
|
|
31
|
+
t.is(answersImages.at(1).props()['aria-label'], 'Lorem ipsum');
|
|
32
|
+
const answers = wrapper.find('[data-name="answerGraphic"]');
|
|
33
|
+
answers.at(1).simulate('click');
|
|
34
|
+
t.true(answerWasClicked);
|
|
35
|
+
t.pass();
|
|
36
|
+
});
|
|
37
|
+
test("should set: selected's background to Primary w/ alpha 5% && color to primary, unselected's no background && color to a nuance of primary", t => {
|
|
38
|
+
const wrapper = shallow( /*#__PURE__*/React.createElement(QCMImage, defaultFixture.props), {
|
|
39
|
+
context: {
|
|
40
|
+
translate
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const answers = wrapper.find('[data-name="answerGraphic"]');
|
|
44
|
+
const firstAnswer = answers.at(0);
|
|
45
|
+
t.true(firstAnswer.exists());
|
|
46
|
+
t.deepEqual(firstAnswer.props().style, {});
|
|
47
|
+
const unselectedBackgroundAnswer = firstAnswer.children().at(0);
|
|
48
|
+
t.true(unselectedBackgroundAnswer.exists());
|
|
49
|
+
t.deepEqual(unselectedBackgroundAnswer.props().style, {
|
|
50
|
+
backgroundColor: '#F4F4F5'
|
|
51
|
+
});
|
|
52
|
+
const firstAnswerText = firstAnswer.children().at(1).children().at(1).children().at(0);
|
|
53
|
+
t.true(firstAnswerText.exists());
|
|
54
|
+
const thirdAnswer = answers.at(2);
|
|
55
|
+
t.true(thirdAnswer.exists());
|
|
56
|
+
t.deepEqual(thirdAnswer.props().style, {
|
|
57
|
+
boxShadow: '0 4px 16px rgba(0, 122, 179, 0.25)'
|
|
58
|
+
});
|
|
59
|
+
const selectedBackgroundAnswer = thirdAnswer.children().at(0);
|
|
60
|
+
t.true(selectedBackgroundAnswer.exists());
|
|
61
|
+
t.deepEqual(selectedBackgroundAnswer.props().style, {
|
|
62
|
+
backgroundColor: '#00B0FF'
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=qcm-graphic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/questions/qcm-graphic/test/qcm-graphic.js"],"names":["browserEnv","test","React","shallow","configure","Adapter","QCMImage","defaultFixture","adapter","translate","t","answerWasClicked","props","answers","onClick","wrapper","context","answersImages","find","true","at","exists","is","simulate","pass","firstAnswer","deepEqual","style","unselectedBackgroundAnswer","children","backgroundColor","firstAnswerText","thirdAnswer","boxShadow","selectedBackgroundAnswer"],"mappings":";;;;AAAA,OAAOA,UAAP,MAAuB,aAAvB;AACA,OAAOC,IAAP,MAAiB,KAAjB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAAQC,OAAR,EAAiBC,SAAjB,QAAiC,QAAjC;AAEA,OAAOC,OAAP,MAAoB,yBAApB;AACA,OAAOC,QAAP,MAAqB,IAArB;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AAEAP,UAAU;AACVI,SAAS,CAAC;AAACI,EAAAA,OAAO,EAAE,IAAIH,OAAJ;AAAV,CAAD,CAAT;AACA,MAAMI,SAAS,YAAf;AAEAR,IAAI,CAAC,4DAAD,EAA+DS,CAAC,IAAI;AACtE,MAAIC,gBAAgB,GAAG,KAAvB;AACAJ,EAAAA,cAAc,CAACK,KAAf,CAAqBC,OAArB,CAA6B,CAA7B,0BACKN,cAAc,CAACK,KAAf,CAAqBC,OAArB,CAA6B,CAA7B,CADL;AAEEC,IAAAA,OAAO,EAAE,MAAM;AACbH,MAAAA,gBAAgB,GAAG,IAAnB;AACD;AAJH;AAOA,QAAMI,OAAO,GAAGZ,OAAO,eAAC,oBAAC,QAAD,EAAcI,cAAc,CAACK,KAA7B,CAAD,EAAyC;AAC9DI,IAAAA,OAAO,EAAE;AAACP,MAAAA;AAAD;AADqD,GAAzC,CAAvB;AAIA,QAAMQ,aAAa,GAAGF,OAAO,CAACG,IAAR,CAAa,2BAAb,CAAtB;AACAR,EAAAA,CAAC,CAACS,IAAF,CAAOF,aAAa,CAACG,EAAd,CAAiB,CAAj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,GAAwCT,EAAxC,CAA2C,CAA3C,EAA8CS,QAA9C,GAAyDT,EAAzD,CAA4D,CAA5D,CAAxB;AACAV,EAAAA,CAAC,CAACS,IAAF,CAAOY,eAAe,CAACV,MAAhB,EAAP;AAEA,QAAMW,WAAW,GAAGnB,OAAO,CAACO,EAAR,CAAW,CAAX,CAApB;AACAV,EAAAA,CAAC,CAACS,IAAF,CAAOa,WAAW,CAACX,MAAZ,EAAP;AACAX,EAAAA,CAAC,CAACgB,SAAF,CAAYM,WAAW,CAACpB,KAAZ,GAAoBe,KAAhC,EAAuC;AAACM,IAAAA,SAAS,EAAE;AAAZ,GAAvC;AACA,QAAMC,wBAAwB,GAAGF,WAAW,CAACH,QAAZ,GAAuBT,EAAvB,CAA0B,CAA1B,CAAjC;AACAV,EAAAA,CAAC,CAACS,IAAF,CAAOe,wBAAwB,CAACb,MAAzB,EAAP;AACAX,EAAAA,CAAC,CAACgB,SAAF,CAAYQ,wBAAwB,CAACtB,KAAzB,GAAiCe,KAA7C,EAAoD;AAACG,IAAAA,eAAe,EAAE;AAAlB,GAApD;AACD,CArBG,CAAJ","sourcesContent":["import browserEnv from 'browser-env';\nimport test from 'ava';\nimport React from 'react';\nimport {shallow, configure} from 'enzyme';\nimport {identity} from 'lodash/fp';\nimport Adapter from 'enzyme-adapter-react-16';\nimport QCMImage from '..';\nimport defaultFixture from './fixtures/default';\n\nbrowserEnv();\nconfigure({adapter: new Adapter()});\nconst translate = identity;\n\ntest('onClick should be reachable, should match given aria-label', t => {\n let answerWasClicked = false;\n defaultFixture.props.answers[1] = {\n ...defaultFixture.props.answers[1],\n onClick: () => {\n answerWasClicked = true;\n }\n };\n\n const wrapper = shallow(<QCMImage {...defaultFixture.props} />, {\n context: {translate}\n });\n\n const answersImages = wrapper.find('[data-name=\"answerImage\"]');\n t.true(answersImages.at(1).exists());\n t.is(answersImages.at(1).props()['aria-label'], 'Lorem ipsum');\n\n const answers = wrapper.find('[data-name=\"answerGraphic\"]');\n answers.at(1).simulate('click');\n t.true(answerWasClicked);\n t.pass();\n});\n\ntest(\"should set: selected's background to Primary w/ alpha 5% && color to primary, unselected's no background && color to a nuance of primary\", t => {\n const wrapper = shallow(<QCMImage {...defaultFixture.props} />, {\n context: {translate}\n });\n const answers = wrapper.find('[data-name=\"answerGraphic\"]');\n\n const firstAnswer = answers.at(0);\n t.true(firstAnswer.exists());\n t.deepEqual(firstAnswer.props().style, {});\n const unselectedBackgroundAnswer = firstAnswer.children().at(0);\n t.true(unselectedBackgroundAnswer.exists());\n t.deepEqual(unselectedBackgroundAnswer.props().style, {backgroundColor: '#F4F4F5'});\n const firstAnswerText = firstAnswer.children().at(1).children().at(1).children().at(0);\n t.true(firstAnswerText.exists());\n\n const thirdAnswer = answers.at(2);\n t.true(thirdAnswer.exists());\n t.deepEqual(thirdAnswer.props().style, {boxShadow: '0 4px 16px rgba(0, 122, 179, 0.25)'});\n const selectedBackgroundAnswer = thirdAnswer.children().at(0);\n t.true(selectedBackgroundAnswer.exists());\n t.deepEqual(selectedBackgroundAnswer.props().style, {backgroundColor: '#00B0FF'});\n});\n"],"file":"qcm-graphic.js"}
|
|
@@ -352,6 +352,7 @@
|
|
|
352
352
|
|
|
353
353
|
.coorpmanager .descriptionLabel {
|
|
354
354
|
margin: 0 1px 18px 0;
|
|
355
|
+
padding: 8px 16px;
|
|
355
356
|
border-radius: 7px;
|
|
356
357
|
background-color: cm_grey_700;
|
|
357
358
|
flex-grow: 0;
|
|
@@ -365,14 +366,16 @@
|
|
|
365
366
|
text-align: center;
|
|
366
367
|
color: white;
|
|
367
368
|
padding: 8px 16px;
|
|
368
|
-
max-width:
|
|
369
|
-
position: absolute;
|
|
370
|
-
left: -20px;
|
|
371
|
-
z-index: 999;
|
|
372
|
-
bottom: 18px;
|
|
369
|
+
max-width: 348px;
|
|
373
370
|
width: max-content;
|
|
371
|
+
position: absolute;
|
|
372
|
+
left: -24px;
|
|
373
|
+
z-index: 3;
|
|
374
|
+
bottom: 5px;
|
|
374
375
|
visibility: hidden;
|
|
375
376
|
opacity: 0;
|
|
377
|
+
overflow-wrap: break-word;
|
|
378
|
+
white-space: break-spaces;
|
|
376
379
|
}
|
|
377
380
|
|
|
378
381
|
.coorpmanager .title.titleWithSelection .descriptionLabel,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import React, { useState, useCallback } from 'react';
|
|
1
|
+
import React from 'react';
|
|
4
2
|
import PropTypes from 'prop-types';
|
|
5
|
-
import
|
|
3
|
+
import DraggableList from '../draggable-list';
|
|
6
4
|
import SetupSection from '../setup-section';
|
|
7
5
|
import Loader from '../../atom/loader';
|
|
8
6
|
import style from './style.css';
|
|
@@ -16,36 +14,12 @@ const SetupSections = ({
|
|
|
16
14
|
loading,
|
|
17
15
|
onDrop
|
|
18
16
|
}) => {
|
|
19
|
-
const [dragTo, setDragTo] = useState(null);
|
|
20
|
-
const [dragFrom, setDragFrom] = useState(null);
|
|
21
|
-
const dragStartHandler = useCallback(id => {
|
|
22
|
-
setDragFrom(id);
|
|
23
|
-
}, [setDragFrom]);
|
|
24
|
-
const dragOverHandler = useCallback(id => {
|
|
25
|
-
if (dragTo === id) return;
|
|
26
|
-
setDragTo(id);
|
|
27
|
-
}, [dragTo, setDragTo]);
|
|
28
|
-
const dragLeaveHandler = useCallback(id => {
|
|
29
|
-
setDragTo(null);
|
|
30
|
-
}, [setDragTo]);
|
|
31
|
-
const dropHandler = useCallback(id => {
|
|
32
|
-
if (onDrop && dragFrom) onDrop(dragFrom, id);
|
|
33
|
-
setDragTo(null);
|
|
34
|
-
setDragFrom(null);
|
|
35
|
-
}, [onDrop, setDragTo, setDragFrom, dragFrom]);
|
|
36
17
|
if (loading) return /*#__PURE__*/React.createElement(Loading, null);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
onDragOver: dragOverHandler,
|
|
43
|
-
onDragLeave: dragLeaveHandler,
|
|
44
|
-
onDrop: dropHandler
|
|
45
|
-
}, /*#__PURE__*/React.createElement(SetupSection, _extends({}, section, {
|
|
46
|
-
key: section.id
|
|
47
|
-
}))));
|
|
48
|
-
return /*#__PURE__*/React.createElement("div", null, sectionsView);
|
|
18
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(DraggableList, {
|
|
19
|
+
itemType: "setup-section",
|
|
20
|
+
items: sections,
|
|
21
|
+
onDrop: onDrop
|
|
22
|
+
}));
|
|
49
23
|
};
|
|
50
24
|
|
|
51
25
|
SetupSections.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/setup-sections/index.js"],"names":["React","
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/setup-sections/index.js"],"names":["React","PropTypes","DraggableList","SetupSection","Loader","style","Loading","loading","SetupSections","sections","onDrop","propTypes","arrayOf","shape","bool","func"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,OAAO,GAAG,mBACd;AAAK,EAAA,SAAS,EAAED,KAAK,CAACE;AAAtB,gBACE,oBAAC,MAAD,OADF,CADF;;AAMA,MAAMC,aAAa,GAAG,CAAC;AAACC,EAAAA,QAAD;AAAWF,EAAAA,OAAX;AAAoBG,EAAAA;AAApB,CAAD,KAAiC;AACrD,MAAIH,OAAJ,EAAa,oBAAO,oBAAC,OAAD,OAAP;AAEb,sBACE,8CACE,oBAAC,aAAD;AAAe,IAAA,QAAQ,EAAC,eAAxB;AAAwC,IAAA,KAAK,EAAEE,QAA/C;AAAyD,IAAA,MAAM,EAAEC;AAAjE,IADF,CADF;AAKD,CARD;;AAUAF,aAAa,CAACG,SAAd,2CAA0B;AACxBF,EAAAA,QAAQ,EAAER,SAAS,CAACW,OAAV,CAAkBX,SAAS,CAACY,KAAV,CAAgBV,YAAY,CAACQ,SAA7B,CAAlB,CADc;AAExBJ,EAAAA,OAAO,EAAEN,SAAS,CAACa,IAFK;AAGxBJ,EAAAA,MAAM,EAAET,SAAS,CAACc;AAHM,CAA1B;AAMA,eAAeP,aAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport DraggableList from '../draggable-list';\nimport SetupSection from '../setup-section';\nimport Loader from '../../atom/loader';\nimport style from './style.css';\n\nconst Loading = () => (\n <div className={style.loading}>\n <Loader />\n </div>\n);\n\nconst SetupSections = ({sections, loading, onDrop}) => {\n if (loading) return <Loading />;\n\n return (\n <div>\n <DraggableList itemType=\"setup-section\" items={sections} onDrop={onDrop} />\n </div>\n );\n};\n\nSetupSections.propTypes = {\n sections: PropTypes.arrayOf(PropTypes.shape(SetupSection.propTypes)),\n loading: PropTypes.bool,\n onDrop: PropTypes.func\n};\n\nexport default SetupSections;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
props: {
|
|
3
|
+
title: 'Certification summary',
|
|
4
|
+
sections: [{
|
|
5
|
+
items: [{
|
|
6
|
+
type: 'mainElement',
|
|
7
|
+
title: 'Language',
|
|
8
|
+
value: '🇬🇧 English'
|
|
9
|
+
}, {
|
|
10
|
+
type: 'mainElement',
|
|
11
|
+
title: 'Name',
|
|
12
|
+
value: 'Marketing expert'
|
|
13
|
+
}]
|
|
14
|
+
}, {
|
|
15
|
+
title: 'Translation',
|
|
16
|
+
items: [{
|
|
17
|
+
type: 'text',
|
|
18
|
+
text: '🇫🇷 French'
|
|
19
|
+
}, {
|
|
20
|
+
type: 'text',
|
|
21
|
+
text: '🇪🇸 Spanish'
|
|
22
|
+
}, {
|
|
23
|
+
type: 'text',
|
|
24
|
+
text: '🇮🇹 Italian'
|
|
25
|
+
}]
|
|
26
|
+
}, {
|
|
27
|
+
title: 'Populations',
|
|
28
|
+
items: [{
|
|
29
|
+
type: 'text',
|
|
30
|
+
text: 'Population 2'
|
|
31
|
+
}],
|
|
32
|
+
counterText: '1 population'
|
|
33
|
+
}, {
|
|
34
|
+
title: 'Courses',
|
|
35
|
+
items: [{
|
|
36
|
+
type: 'content',
|
|
37
|
+
title: 'Marketing and online advertising Marketing and online advertising Marketing and online advertising Marketing and online advertising',
|
|
38
|
+
author: 'Author',
|
|
39
|
+
category: 'course',
|
|
40
|
+
label: 'Course'
|
|
41
|
+
}, {
|
|
42
|
+
type: 'content',
|
|
43
|
+
title: 'Social networks',
|
|
44
|
+
author: 'Author',
|
|
45
|
+
category: 'chapter',
|
|
46
|
+
label: "5' learning"
|
|
47
|
+
}, {
|
|
48
|
+
type: 'content',
|
|
49
|
+
title: 'Other title',
|
|
50
|
+
author: 'Author 2',
|
|
51
|
+
category: 'course',
|
|
52
|
+
label: 'Course'
|
|
53
|
+
}, {
|
|
54
|
+
type: 'content',
|
|
55
|
+
title: 'Social others',
|
|
56
|
+
author: 'Author XXX',
|
|
57
|
+
category: 'chapter',
|
|
58
|
+
label: "5' learning"
|
|
59
|
+
}, {
|
|
60
|
+
type: 'content',
|
|
61
|
+
title: 'Social others others',
|
|
62
|
+
author: 'Author XXX',
|
|
63
|
+
label: "5' learning",
|
|
64
|
+
category: 'chapter'
|
|
65
|
+
}, {
|
|
66
|
+
type: 'content',
|
|
67
|
+
title: 'Something about empowerment',
|
|
68
|
+
author: 'Author XXX',
|
|
69
|
+
label: 'course',
|
|
70
|
+
category: 'course'
|
|
71
|
+
}, {
|
|
72
|
+
type: 'content',
|
|
73
|
+
title: 'Be a better human being',
|
|
74
|
+
author: 'Author XXX',
|
|
75
|
+
label: "5' learning",
|
|
76
|
+
category: 'chapter'
|
|
77
|
+
}, {
|
|
78
|
+
type: 'content',
|
|
79
|
+
title: 'Stronger faster better',
|
|
80
|
+
author: 'Author XXX',
|
|
81
|
+
label: 'course',
|
|
82
|
+
category: 'course'
|
|
83
|
+
}, {
|
|
84
|
+
type: 'content',
|
|
85
|
+
title: 'Relativity beyond time',
|
|
86
|
+
author: 'Author XXX',
|
|
87
|
+
label: 'course',
|
|
88
|
+
category: 'course'
|
|
89
|
+
}, {
|
|
90
|
+
type: 'content',
|
|
91
|
+
title: 'Are you awake?',
|
|
92
|
+
author: 'Author XXX',
|
|
93
|
+
label: "5' learning",
|
|
94
|
+
category: 'chapter'
|
|
95
|
+
}],
|
|
96
|
+
counterText: '12 courses'
|
|
97
|
+
}],
|
|
98
|
+
action: {
|
|
99
|
+
icon: 'save',
|
|
100
|
+
text: 'Save in drafts',
|
|
101
|
+
'aria-label': 'Save in drafts',
|
|
102
|
+
onClick: () => console.log('save')
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=organize-courses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/wizard-summary/test/fixtures/organize-courses.js"],"names":["props","title","sections","items","type","value","text","counterText","author","category","label","action","icon","onClick","console","log"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,uBADF;AAELC,IAAAA,QAAQ,EAAE,CACR;AACEC,MAAAA,KAAK,EAAE,CACL;AACEC,QAAAA,IAAI,EAAE,aADR;AAEEH,QAAAA,KAAK,EAAE,UAFT;AAGEI,QAAAA,KAAK,EAAE;AAHT,OADK,EAML;AACED,QAAAA,IAAI,EAAE,aADR;AAEEH,QAAAA,KAAK,EAAE,MAFT;AAGEI,QAAAA,KAAK,EAAE;AAHT,OANK;AADT,KADQ,EAeR;AACEJ,MAAAA,KAAK,EAAE,aADT;AAEEE,MAAAA,KAAK,EAAE,CACL;AACEC,QAAAA,IAAI,EAAE,MADR;AAEEE,QAAAA,IAAI,EAAE;AAFR,OADK,EAKL;AACEF,QAAAA,IAAI,EAAE,MADR;AAEEE,QAAAA,IAAI,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AAAA,IAAI,EAAE,SADR;AAEEH,QAAAA,KAAK,EAAE,6BAFT;AAGEO,QAAAA,MAAM,EAAE,YAHV;AAIEE,QAAAA,KAAK,EAAE,QAJT;AAKED,QAAAA,QAAQ,EAAE;AALZ,OArCK,EA4CL;AACEL,QAAAA,IAAI,EAAE,SADR;AAEEH,QAAAA,KAAK,EAAE,yBAFT;AAGEO,QAAAA,MAAM,EAAE,YAHV;AAIEE,QAAAA,KAAK,EAAE,aAJT;AAKED,QAAAA,QAAQ,EAAE;AALZ,OA5CK,EAmDL;AACEL,QAAAA,IAAI,EAAE,SADR;AAEEH,QAAAA,KAAK,EAAE,wBAFT;AAGEO,QAAAA,MAAM,EAAE,YAHV;AAIEE,QAAAA,KAAK,EAAE,QAJT;AAKED,QAAAA,QAAQ,EAAE;AALZ,OAnDK,EA0DL;AACEL,QAAAA,IAAI,EAAE,SADR;AAEEH,QAAAA,KAAK,EAAE,wBAFT;AAGEO,QAAAA,MAAM,EAAE,YAHV;AAIEE,QAAAA,KAAK,EAAE,QAJT;AAKED,QAAAA,QAAQ,EAAE;AALZ,OA1DK,EAiEL;AACEL,QAAAA,IAAI,EAAE,SADR;AAEEH,QAAAA,KAAK,EAAE,gBAFT;AAGEO,QAAAA,MAAM,EAAE,YAHV;AAIEE,QAAAA,KAAK,EAAE,aAJT;AAKED,QAAAA,QAAQ,EAAE;AALZ,OAjEK,CAFT;AA2EEF,MAAAA,WAAW,EAAE;AA3Ef,KA1CQ,CAFL;AA0HLI,IAAAA,MAAM,EAAE;AACNC,MAAAA,IAAI,EAAE,MADA;AAENN,MAAAA,IAAI,EAAE,gBAFA;AAGN,oBAAc,gBAHR;AAINO,MAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,MAAZ;AAJT;AA1HH;AADM,CAAf","sourcesContent":["export default {\n props: {\n title: 'Certification summary',\n sections: [\n {\n items: [\n {\n type: 'mainElement',\n title: 'Language',\n value: '🇬🇧 English'\n },\n {\n type: 'mainElement',\n title: 'Name',\n value: 'Marketing expert'\n }\n ]\n },\n {\n title: 'Translation',\n items: [\n {\n type: 'text',\n text: '🇫🇷 French'\n },\n {\n type: 'text',\n text: '🇪🇸 Spanish'\n },\n {\n type: 'text',\n text: '🇮🇹 Italian'\n }\n ]\n },\n {\n title: 'Populations',\n items: [\n {\n type: 'text',\n text: 'Population 2'\n }\n ],\n counterText: '1 population'\n },\n {\n title: 'Courses',\n items: [\n {\n type: 'content',\n title:\n 'Marketing and online advertising Marketing and online advertising Marketing and online advertising Marketing and online advertising',\n author: 'Author',\n category: 'course',\n label: 'Course'\n },\n {\n type: 'content',\n title: 'Social networks',\n author: 'Author',\n category: 'chapter',\n label: \"5' learning\"\n },\n {\n type: 'content',\n title: 'Other title',\n author: 'Author 2',\n category: 'course',\n label: 'Course'\n },\n {\n type: 'content',\n title: 'Social others',\n author: 'Author XXX',\n category: 'chapter',\n label: \"5' learning\"\n },\n {\n type: 'content',\n title: 'Social others others',\n author: 'Author XXX',\n label: \"5' learning\",\n category: 'chapter'\n },\n {\n type: 'content',\n title: 'Something about empowerment',\n author: 'Author XXX',\n label: 'course',\n category: 'course'\n },\n {\n type: 'content',\n title: 'Be a better human being',\n author: 'Author XXX',\n label: \"5' learning\",\n category: 'chapter'\n },\n {\n type: 'content',\n title: 'Stronger faster better',\n author: 'Author XXX',\n label: 'course',\n category: 'course'\n },\n {\n type: 'content',\n title: 'Relativity beyond time',\n author: 'Author XXX',\n label: 'course',\n category: 'course'\n },\n {\n type: 'content',\n title: 'Are you awake?',\n author: 'Author XXX',\n label: \"5' learning\",\n category: 'chapter'\n }\n ],\n counterText: '12 courses'\n }\n ],\n action: {\n icon: 'save',\n text: 'Save in drafts',\n 'aria-label': 'Save in drafts',\n onClick: () => console.log('save')\n }\n }\n};\n"],"file":"organize-courses.js"}
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
type: 'selectMultiple',
|
|
6
6
|
title: 'Languages',
|
|
7
7
|
placeholder: 'Language selection',
|
|
8
|
-
description: '
|
|
8
|
+
description: 'The name and description of your custom playlist will be displayed in the selected language. Only the selected language will be saved. You can translate during step 2 "Translations".',
|
|
9
9
|
theme: 'coorpmanager',
|
|
10
10
|
hint: '15 / 30 characters',
|
|
11
11
|
size: 'default',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/organism/brand-form/test/fixtures/wizard-playlists.js"],"names":["props","groups","fields","type","title","placeholder","description","theme","hint","size","options","name","value","selected","multiple"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,EAAE,CACN;AACEC,MAAAA,MAAM,EAAE,CACN;AACEC,QAAAA,IAAI,EAAE,gBADR;AAEEC,QAAAA,KAAK,EAAE,WAFT;AAGEC,QAAAA,WAAW,EAAE,oBAHf;AAIEC,QAAAA,WAAW,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/organism/brand-form/test/fixtures/wizard-playlists.js"],"names":["props","groups","fields","type","title","placeholder","description","theme","hint","size","options","name","value","selected","multiple"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,EAAE,CACN;AACEC,MAAAA,MAAM,EAAE,CACN;AACEC,QAAAA,IAAI,EAAE,gBADR;AAEEC,QAAAA,KAAK,EAAE,WAFT;AAGEC,QAAAA,WAAW,EAAE,oBAHf;AAIEC,QAAAA,WAAW,EACT,wLALJ;AAMEC,QAAAA,KAAK,EAAE,cANT;AAOEC,QAAAA,IAAI,EAAE,oBAPR;AAQEC,QAAAA,IAAI,EAAE,SARR;AASEC,QAAAA,OAAO,EAAE,CACP;AACEC,UAAAA,IAAI,EAAE,cADR;AAEEC,UAAAA,KAAK,EAAE,IAFT;AAGEC,UAAAA,QAAQ,EAAE;AAHZ,SADO,EAMP;AACEF,UAAAA,IAAI,EAAE,aADR;AAEEC,UAAAA,KAAK,EAAE,IAFT;AAGEC,UAAAA,QAAQ,EAAE;AAHZ,SANO,EAWP;AACEF,UAAAA,IAAI,EAAE,WADR;AAEEC,UAAAA,KAAK,EAAE,IAFT;AAGEC,UAAAA,QAAQ,EAAE;AAHZ,SAXO,EAgBP;AACEF,UAAAA,IAAI,EAAE,cADR;AAEEC,UAAAA,KAAK,EAAE,IAFT;AAGEC,UAAAA,QAAQ,EAAE;AAHZ,SAhBO,CATX;AA+BEC,QAAAA,QAAQ,EAAE;AA/BZ,OADM,EAkCN;AACEX,QAAAA,IAAI,EAAE,MADR;AAEEC,QAAAA,KAAK,EAAE,eAFT;AAGEC,QAAAA,WAAW,EAAE,eAHf;AAIEC,QAAAA,WAAW,EAAE,0BAJf;AAKEC,QAAAA,KAAK,EAAE,cALT;AAMEC,QAAAA,IAAI,EAAE,oBANR;AAOEI,QAAAA,KAAK,EAAE,kBAPT;AAQEH,QAAAA,IAAI,EAAE;AARR,OAlCM,EA4CN;AACEN,QAAAA,IAAI,EAAE,UADR;AAEEC,QAAAA,KAAK,EAAE,aAFT;AAGEC,QAAAA,WAAW,EAAE,aAHf;AAIEC,QAAAA,WAAW,EAAE,0BAJf;AAKEC,QAAAA,KAAK,EAAE,cALT;AAMEC,QAAAA,IAAI,EAAE,qBANR;AAOEC,QAAAA,IAAI,EAAE,QAPR;AAQEG,QAAAA,KAAK,EACH;AATJ,OA5CM;AADV,KADM;AADH;AADM,CAAf","sourcesContent":["export default {\n props: {\n groups: [\n {\n fields: [\n {\n type: 'selectMultiple',\n title: 'Languages',\n placeholder: 'Language selection',\n description:\n 'The name and description of your custom playlist will be displayed in the selected language. Only the selected language will be saved. You can translate during step 2 \"Translations\".',\n theme: 'coorpmanager',\n hint: '15 / 30 characters',\n size: 'default',\n options: [\n {\n name: '🇬🇧 English',\n value: 'en',\n selected: true\n },\n {\n name: '🇩🇪 German',\n value: 'de',\n selected: false\n },\n {\n name: '🇹🇭 Thai',\n value: 'th',\n selected: false\n },\n {\n name: '🇪🇸 Spanish',\n value: 'es',\n selected: false\n }\n ],\n multiple: false\n },\n {\n type: 'text',\n title: 'Playlist name',\n placeholder: 'Playlist name',\n description: 'This is the tooltip text',\n theme: 'coorpmanager',\n hint: '15 / 30 characters',\n value: 'Marketing expert',\n size: 'default'\n },\n {\n type: 'textarea',\n title: 'Description',\n placeholder: 'Description',\n description: 'This is the tooltip text',\n theme: 'coorpmanager',\n hint: '80 / 200 characters',\n size: 'medium',\n value:\n 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis fermentum sem ac fermentum luctus. Integer eu dui magna. Donec ut tristique dui. Vestibulum non accumsan tellus. Donec luctus erat vitae aliquet viverra. Mauris malesuada tortor quis viverra vestibulum. Nullam laoreet porta massa vitae porta.'\n }\n ]\n }\n ]\n }\n};\n"],"file":"wizard-playlists.js"}
|
|
@@ -11,6 +11,7 @@ import BrandForm from '../brand-form';
|
|
|
11
11
|
import ContentTranslate from '../content-translation';
|
|
12
12
|
import OrganismSearchAndChipsResults from '../search-and-chips-results';
|
|
13
13
|
import CourseSelection from '../course-selection';
|
|
14
|
+
import CourseSections from '../../molecule/course-sections';
|
|
14
15
|
import style from './style.css';
|
|
15
16
|
|
|
16
17
|
const buildHeader = (wizardHeader, steps) => {
|
|
@@ -52,6 +53,9 @@ const buildForm = content => {
|
|
|
52
53
|
|
|
53
54
|
case 'courses':
|
|
54
55
|
return /*#__PURE__*/React.createElement(CourseSelection, content);
|
|
56
|
+
|
|
57
|
+
case 'organize-courses':
|
|
58
|
+
return /*#__PURE__*/React.createElement(CourseSections, content);
|
|
55
59
|
}
|
|
56
60
|
};
|
|
57
61
|
|
|
@@ -159,6 +163,8 @@ WizardContents.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
159
163
|
type: PropTypes.oneOf(['populations'])
|
|
160
164
|
})), PropTypes.shape(_extends(_extends({}, CourseSelection.propTypes), {}, {
|
|
161
165
|
type: PropTypes.oneOf(['courses'])
|
|
166
|
+
})), PropTypes.shape(_extends(_extends({}, CourseSections.propTypes), {}, {
|
|
167
|
+
type: PropTypes.oneOf(['organize-courses'])
|
|
162
168
|
}))]),
|
|
163
169
|
previousStep: PropTypes.shape({
|
|
164
170
|
label: PropTypes.string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/organism/wizard-contents/index.js"],"names":["React","getOr","PropTypes","ButtonLink","ButtonLinkIconOnly","WizardSteps","WizardSummary","BrandForm","ContentTranslate","OrganismSearchAndChipsResults","CourseSelection","style","buildHeader","wizardHeader","steps","title","onClick","buttonCloseIcon","size","icon","header","headerTitle","buildForm","content","type","buildButton","step","side","ICONS","previous","position","next","publish","label","buttonProps","buildActionZone","previousStep","nextStep","previousButton","nextStepType","nextButton","actionZone","button","WizardContents","props","isLoading","summary","headerView","formView","rightActionView","footerActionView","container","leftSection","form","rightSection","stickySection","summaryZone","footer","summaryFooter","actionFooter","propTypes","bool","shape","string","func","isRequired","oneOfType","oneOf"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,aAAP,MAA0B,+BAA1B;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,gBAAP,MAA6B,wBAA7B;AACA,OAAOC,6BAAP,MAA0C,6BAA1C;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,WAAW,GAAG,CAACC,YAAD,EAAeC,KAAf,KAAyB;AAC3C,QAAM;AAACC,IAAAA,KAAD;AAAQC,IAAAA;AAAR,MAAmBH,YAAzB;AAEA,QAAMI,eAAe,GAAG;AACtBC,IAAAA,IAAI,EAAE,OADgB;AAEtB,iBAAa,cAFS;AAGtB,kBAAc,cAHQ;AAItBC,IAAAA,IAAI,EAAE,OAJgB;AAKtBH,IAAAA;AALsB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AAHK,GAAhB;AAhCe,CAA3B;AAuCA,eAAerB,cAAf","sourcesContent":["import React from 'react';\nimport getOr from 'lodash/fp/getOr';\nimport PropTypes from 'prop-types';\nimport ButtonLink from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport WizardSteps from '../../atom/wizard-steps';\nimport WizardSummary from '../../molecule/wizard-summary';\nimport BrandForm from '../brand-form';\nimport ContentTranslate from '../content-translation';\nimport OrganismSearchAndChipsResults from '../search-and-chips-results';\nimport CourseSelection from '../course-selection';\nimport style from './style.css';\n\nconst buildHeader = (wizardHeader, steps) => {\n const {title, onClick} = wizardHeader;\n\n const buttonCloseIcon = {\n size: 'small',\n 'data-name': 'close-button',\n 'aria-label': 'close button',\n icon: 'close',\n onClick\n };\n\n return (\n <div>\n <div className={style.header}>\n <ButtonLinkIconOnly {...buttonCloseIcon} />\n <div className={style.headerTitle} data-name={'custom-playlist-title'}>\n {title}\n </div>\n </div>\n <WizardSteps steps={steps} />\n </div>\n );\n};\n\nconst buildForm = content => {\n const {type} = content;\n switch (type) {\n case 'form':\n return <BrandForm {...content} />;\n case 'translate':\n return <ContentTranslate {...content} />;\n case 'populations':\n return <OrganismSearchAndChipsResults {...content} />;\n case 'courses':\n return <CourseSelection {...content} />;\n }\n};\n\nconst buildButton = (type, step, side) => {\n const ICONS = {\n previous: {\n position: 'left',\n type: 'chevron-left'\n },\n next: {\n position: 'right',\n type: 'chevron-right'\n },\n publish: {\n position: 'left',\n type: 'publish'\n }\n };\n\n const {label, onClick} = step;\n const buttonProps = {\n type: type === 'previous' ? 'secondary' : 'primary',\n 'aria-label': `${type} step button`,\n 'data-name': `${type}-step-button-${side}`,\n icon: ICONS[type],\n label,\n onClick\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nconst buildActionZone = (previousStep, nextStep, side) => {\n const previousButton = previousStep ? buildButton('previous', previousStep, side) : null;\n const nextStepType = getOr('next', 'type', nextStep);\n const nextButton = nextStep ? buildButton(nextStepType, nextStep, side) : null;\n return (\n <div className={style.actionZone}>\n <div className={style.button}>{previousButton}</div>\n <div className={style.button}>{nextButton}</div>\n </div>\n );\n};\n\nconst WizardContents = props => {\n const {isLoading, wizardHeader, steps, summary, content, nextStep, previousStep} = props;\n const headerView = buildHeader(wizardHeader, steps);\n const formView = buildForm({...content, isLoading});\n const rightActionView = buildActionZone(previousStep, nextStep, 'right');\n const footerActionView = buildActionZone(previousStep, nextStep, 'footer');\n\n return (\n <div className={style.container} data-name=\"custom-playlist-summary\">\n <div className={style.leftSection}>\n {headerView}\n <div className={style.form}>{formView}</div>\n </div>\n <div className={style.rightSection} data-name=\"summary-right-section\">\n <div className={style.stickySection}>\n <div className={style.summaryZone} data-name=\"summary-zone\">\n <WizardSummary {...summary} side={'right'} />\n </div>\n {rightActionView}\n </div>\n </div>\n <div className={style.footer} data-name=\"summary-footer-section\">\n <div className={style.summaryFooter}>\n <WizardSummary {...summary} side={'footer'} />\n </div>\n <div className={style.actionFooter}>{footerActionView}</div>\n </div>\n </div>\n );\n};\n\nWizardContents.propTypes = {\n isLoading: PropTypes.bool,\n wizardHeader: PropTypes.shape({\n title: PropTypes.string,\n onClick: PropTypes.func\n }).isRequired,\n steps: WizardSteps.propTypes.steps,\n summary: PropTypes.shape({\n ...WizardSummary.propTypes\n }).isRequired,\n content: PropTypes.oneOfType([\n PropTypes.shape({\n ...BrandForm.propTypes,\n type: PropTypes.oneOf(['form'])\n }),\n PropTypes.shape({\n ...ContentTranslate.propTypes,\n type: PropTypes.oneOf(['translate'])\n }),\n PropTypes.shape({\n ...OrganismSearchAndChipsResults.propTypes,\n type: PropTypes.oneOf(['populations'])\n }),\n PropTypes.shape({\n ...CourseSelection.propTypes,\n type: PropTypes.oneOf(['courses'])\n })\n ]),\n previousStep: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func\n }),\n nextStep: PropTypes.shape({\n type: PropTypes.oneOf(['next', 'publish']),\n label: PropTypes.string,\n onClick: PropTypes.func\n })\n};\n\nexport default WizardContents;\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/organism/wizard-contents/index.js"],"names":["React","getOr","PropTypes","ButtonLink","ButtonLinkIconOnly","WizardSteps","WizardSummary","BrandForm","ContentTranslate","OrganismSearchAndChipsResults","CourseSelection","CourseSections","style","buildHeader","wizardHeader","steps","title","onClick","buttonCloseIcon","size","icon","header","headerTitle","buildForm","content","type","buildButton","step","side","ICONS","previous","position","next","publish","label","buttonProps","buildActionZone","previousStep","nextStep","previousButton","nextStepType","nextButton","actionZone","button","WizardContents","props","isLoading","summary","headerView","formView","rightActionView","footerActionView","container","leftSection","form","rightSection","stickySection","summaryZone","footer","summaryFooter","actionFooter","propTypes","bool","shape","string","func","isRequired","oneOfType","oneOf"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,aAAP,MAA0B,+BAA1B;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,gBAAP,MAA6B,wBAA7B;AACA,OAAOC,6BAAP,MAA0C,6BAA1C;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,cAAP,MAA2B,gCAA3B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,WAAW,GAAG,CAACC,YAAD,EAAeC,KAAf,KAAyB;AAC3C,QAAM;AAACC,IAAAA,KAAD;AAAQC,IAAAA;AAAR,MAAmBH,YAAzB;AAEA,QAAMI,eAAe,GAAG;AACtBC,IAAAA,IAAI,EAAE,OADgB;AAEtB,iBAAa,cAFS;AAGtB,kBAAc,cAHQ;AAItBC,IAAAA,IAAI,EAAE,OAJgB;AAKtBH,IAAAA;AALsB,GAAxB;AAQA,sBACE,8CACE;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CAAgB;AACxBtC,IAAAA,IAAI,EAAEvB,SAAS,CAACkE,KAAV,CAAgB,CAAC,MAAD,EAAS,SAAT,CAAhB,CADkB;AAExBlC,IAAAA,KAAK,EAAEhC,SAAS,CAAC8D,MAFO;AAGxB/C,IAAAA,OAAO,EAAEf,SAAS,CAAC+D;AAHK,GAAhB;AApCe,CAA3B;AA2CA,eAAerB,cAAf","sourcesContent":["import React from 'react';\nimport getOr from 'lodash/fp/getOr';\nimport PropTypes from 'prop-types';\nimport ButtonLink from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport WizardSteps from '../../atom/wizard-steps';\nimport WizardSummary from '../../molecule/wizard-summary';\nimport BrandForm from '../brand-form';\nimport ContentTranslate from '../content-translation';\nimport OrganismSearchAndChipsResults from '../search-and-chips-results';\nimport CourseSelection from '../course-selection';\nimport CourseSections from '../../molecule/course-sections';\nimport style from './style.css';\n\nconst buildHeader = (wizardHeader, steps) => {\n const {title, onClick} = wizardHeader;\n\n const buttonCloseIcon = {\n size: 'small',\n 'data-name': 'close-button',\n 'aria-label': 'close button',\n icon: 'close',\n onClick\n };\n\n return (\n <div>\n <div className={style.header}>\n <ButtonLinkIconOnly {...buttonCloseIcon} />\n <div className={style.headerTitle} data-name={'custom-playlist-title'}>\n {title}\n </div>\n </div>\n <WizardSteps steps={steps} />\n </div>\n );\n};\n\nconst buildForm = content => {\n const {type} = content;\n switch (type) {\n case 'form':\n return <BrandForm {...content} />;\n case 'translate':\n return <ContentTranslate {...content} />;\n case 'populations':\n return <OrganismSearchAndChipsResults {...content} />;\n case 'courses':\n return <CourseSelection {...content} />;\n case 'organize-courses':\n return <CourseSections {...content} />;\n }\n};\n\nconst buildButton = (type, step, side) => {\n const ICONS = {\n previous: {\n position: 'left',\n type: 'chevron-left'\n },\n next: {\n position: 'right',\n type: 'chevron-right'\n },\n publish: {\n position: 'left',\n type: 'publish'\n }\n };\n\n const {label, onClick} = step;\n const buttonProps = {\n type: type === 'previous' ? 'secondary' : 'primary',\n 'aria-label': `${type} step button`,\n 'data-name': `${type}-step-button-${side}`,\n icon: ICONS[type],\n label,\n onClick\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nconst buildActionZone = (previousStep, nextStep, side) => {\n const previousButton = previousStep ? buildButton('previous', previousStep, side) : null;\n const nextStepType = getOr('next', 'type', nextStep);\n const nextButton = nextStep ? buildButton(nextStepType, nextStep, side) : null;\n return (\n <div className={style.actionZone}>\n <div className={style.button}>{previousButton}</div>\n <div className={style.button}>{nextButton}</div>\n </div>\n );\n};\n\nconst WizardContents = props => {\n const {isLoading, wizardHeader, steps, summary, content, nextStep, previousStep} = props;\n const headerView = buildHeader(wizardHeader, steps);\n const formView = buildForm({...content, isLoading});\n const rightActionView = buildActionZone(previousStep, nextStep, 'right');\n const footerActionView = buildActionZone(previousStep, nextStep, 'footer');\n\n return (\n <div className={style.container} data-name=\"custom-playlist-summary\">\n <div className={style.leftSection}>\n {headerView}\n <div className={style.form}>{formView}</div>\n </div>\n <div className={style.rightSection} data-name=\"summary-right-section\">\n <div className={style.stickySection}>\n <div className={style.summaryZone} data-name=\"summary-zone\">\n <WizardSummary {...summary} side={'right'} />\n </div>\n {rightActionView}\n </div>\n </div>\n <div className={style.footer} data-name=\"summary-footer-section\">\n <div className={style.summaryFooter}>\n <WizardSummary {...summary} side={'footer'} />\n </div>\n <div className={style.actionFooter}>{footerActionView}</div>\n </div>\n </div>\n );\n};\n\nWizardContents.propTypes = {\n isLoading: PropTypes.bool,\n wizardHeader: PropTypes.shape({\n title: PropTypes.string,\n onClick: PropTypes.func\n }).isRequired,\n steps: WizardSteps.propTypes.steps,\n summary: PropTypes.shape({\n ...WizardSummary.propTypes\n }).isRequired,\n content: PropTypes.oneOfType([\n PropTypes.shape({\n ...BrandForm.propTypes,\n type: PropTypes.oneOf(['form'])\n }),\n PropTypes.shape({\n ...ContentTranslate.propTypes,\n type: PropTypes.oneOf(['translate'])\n }),\n PropTypes.shape({\n ...OrganismSearchAndChipsResults.propTypes,\n type: PropTypes.oneOf(['populations'])\n }),\n PropTypes.shape({\n ...CourseSelection.propTypes,\n type: PropTypes.oneOf(['courses'])\n }),\n PropTypes.shape({\n ...CourseSections.propTypes,\n type: PropTypes.oneOf(['organize-courses'])\n })\n ]),\n previousStep: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func\n }),\n nextStep: PropTypes.shape({\n type: PropTypes.oneOf(['next', 'publish']),\n label: PropTypes.string,\n onClick: PropTypes.func\n })\n};\n\nexport default WizardContents;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
/* eslint-disable no-console */
|
|
4
|
+
import wizardSummaryOrganizeCourses from '../../../../molecule/wizard-summary/test/fixtures/organize-courses';
|
|
5
|
+
import organizeCoursesForm from '../../../../molecule/course-sections/test/fixtures/default';
|
|
6
|
+
export default {
|
|
7
|
+
props: {
|
|
8
|
+
isLoading: false,
|
|
9
|
+
wizardHeader: {
|
|
10
|
+
title: 'Create a new custom playlist',
|
|
11
|
+
onClick: () => console.log('Close')
|
|
12
|
+
},
|
|
13
|
+
steps: [{
|
|
14
|
+
title: 'General Informations',
|
|
15
|
+
done: true
|
|
16
|
+
}, {
|
|
17
|
+
title: 'Translations',
|
|
18
|
+
done: true
|
|
19
|
+
}, {
|
|
20
|
+
title: 'Assign populations',
|
|
21
|
+
done: true
|
|
22
|
+
}, {
|
|
23
|
+
title: 'Add courses',
|
|
24
|
+
done: true
|
|
25
|
+
}, {
|
|
26
|
+
title: 'Organize courses',
|
|
27
|
+
done: false,
|
|
28
|
+
current: true
|
|
29
|
+
}],
|
|
30
|
+
summary: wizardSummaryOrganizeCourses.props,
|
|
31
|
+
content: _extends(_extends({}, organizeCoursesForm.props), {}, {
|
|
32
|
+
type: 'organize-courses'
|
|
33
|
+
}),
|
|
34
|
+
previousStep: {
|
|
35
|
+
label: 'Previous Step',
|
|
36
|
+
onClick: () => console.log('Previous Step')
|
|
37
|
+
},
|
|
38
|
+
nextStep: {
|
|
39
|
+
type: 'publish',
|
|
40
|
+
label: 'Publish',
|
|
41
|
+
onClick: () => console.log('Next Step')
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=playlist-organize-courses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/organism/wizard-contents/test/fixtures/playlist-organize-courses.js"],"names":["wizardSummaryOrganizeCourses","organizeCoursesForm","props","isLoading","wizardHeader","title","onClick","console","log","steps","done","current","summary","content","type","previousStep","label","nextStep"],"mappings":";;AAAA;AACA,OAAOA,4BAAP,MAAyC,oEAAzC;AACA,OAAOC,mBAAP,MAAgC,4DAAhC;AAEA,eAAe;AACbC,EAAAA,KAAK,EAAE;AACLC,IAAAA,SAAS,EAAE,KADN;AAELC,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,8BADK;AAEZC,MAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,OAAZ;AAFH,KAFT;AAMLC,IAAAA,KAAK,EAAE,CACL;AACEJ,MAAAA,KAAK,EAAE,sBADT;AAEEK,MAAAA,IAAI,EAAE;AAFR,KADK,EAKL;AACEL,MAAAA,KAAK,EAAE,cADT;AAEEK,MAAAA,IAAI,EAAE;AAFR,KALK,EASL;AACEL,MAAAA,KAAK,EAAE,oBADT;AAEEK,MAAAA,IAAI,EAAE;AAFR,KATK,EAaL;AACEL,MAAAA,KAAK,EAAE,aADT;AAEEK,MAAAA,IAAI,EAAE;AAFR,KAbK,EAiBL;AACEL,MAAAA,KAAK,EAAE,kBADT;AAEEK,MAAAA,IAAI,EAAE,KAFR;AAGEC,MAAAA,OAAO,EAAE;AAHX,KAjBK,CANF;AA6BLC,IAAAA,OAAO,EAAEZ,4BAA4B,CAACE,KA7BjC;AA8BLW,IAAAA,OAAO,wBACFZ,mBAAmB,CAACC,KADlB;AAELY,MAAAA,IAAI,EAAE;AAFD,MA9BF;AAkCLC,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,eADK;AAEZV,MAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,eAAZ;AAFH,KAlCT;AAsCLS,IAAAA,QAAQ,EAAE;AACRH,MAAAA,IAAI,EAAE,SADE;AAERE,MAAAA,KAAK,EAAE,SAFC;AAGRV,MAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,WAAZ;AAHP;AAtCL;AADM,CAAf","sourcesContent":["/* eslint-disable no-console */\nimport wizardSummaryOrganizeCourses from '../../../../molecule/wizard-summary/test/fixtures/organize-courses';\nimport organizeCoursesForm from '../../../../molecule/course-sections/test/fixtures/default';\n\nexport default {\n props: {\n isLoading: false,\n wizardHeader: {\n title: 'Create a new custom playlist',\n onClick: () => console.log('Close')\n },\n steps: [\n {\n title: 'General Informations',\n done: true\n },\n {\n title: 'Translations',\n done: true\n },\n {\n title: 'Assign populations',\n done: true\n },\n {\n title: 'Add courses',\n done: true\n },\n {\n title: 'Organize courses',\n done: false,\n current: true\n }\n ],\n summary: wizardSummaryOrganizeCourses.props,\n content: {\n ...organizeCoursesForm.props,\n type: 'organize-courses'\n },\n previousStep: {\n label: 'Previous Step',\n onClick: () => console.log('Previous Step')\n },\n nextStep: {\n type: 'publish',\n label: 'Publish',\n onClick: () => console.log('Next Step')\n }\n }\n};\n"],"file":"playlist-organize-courses.js"}
|