@coorpacademy/components 10.5.5 → 10.5.7-alpha.12
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/atom/range/handle.css +18 -2
- package/es/atom/range/handle.js +7 -3
- package/es/atom/range/handle.js.map +1 -1
- package/es/atom/range/style.css +2 -2
- package/es/atom/select/index.js +38 -20
- package/es/atom/select/index.js.map +1 -1
- package/es/atom/select/style.css +129 -40
- package/es/atom/select/test/fixtures/player.js +11 -0
- package/es/atom/select/test/fixtures/player.js.map +1 -0
- package/es/atom/select/test/fixtures.js +2 -0
- package/es/atom/select/test/fixtures.js.map +1 -1
- package/es/atom/select/test/select.js +49 -0
- package/es/atom/select/test/select.js.map +1 -0
- 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-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/course-sections/test/fixtures.js +15 -0
- package/es/molecule/course-sections/test/fixtures.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 +1 -5
- package/es/molecule/draggable-list/index.js +6 -4
- package/es/molecule/draggable-list/index.js.map +1 -1
- 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.js +2 -0
- package/es/molecule/draggable-list/test/fixtures.js.map +1 -1
- package/es/molecule/draggable-list/test/on-drop.js +13 -13
- package/es/molecule/draggable-list/test/on-drop.js.map +1 -1
- package/es/molecule/questions/drop-down/index.js +1 -6
- package/es/molecule/questions/drop-down/index.js.map +1 -1
- package/es/molecule/questions/free-text/index.js +35 -15
- package/es/molecule/questions/free-text/index.js.map +1 -1
- package/es/molecule/questions/free-text/style.css +39 -15
- package/es/molecule/questions/free-text/test/fixtures/default.js +1 -1
- package/es/molecule/questions/free-text/test/fixtures/default.js.map +1 -1
- package/es/molecule/questions/free-text/test/fixtures/with-value-on-change.js +9 -0
- package/es/molecule/questions/free-text/test/fixtures/with-value-on-change.js.map +1 -0
- package/es/molecule/questions/free-text/test/fixtures/{with-default-value.js → with-value.js} +2 -2
- package/es/molecule/questions/free-text/test/fixtures/with-value.js.map +1 -0
- package/es/molecule/questions/free-text/test/fixtures.js +4 -2
- package/es/molecule/questions/free-text/test/fixtures.js.map +1 -1
- package/es/molecule/questions/free-text/test/free-text.js +106 -0
- package/es/molecule/questions/free-text/test/free-text.js.map +1 -0
- package/es/molecule/questions/qcm/index.js +37 -25
- package/es/molecule/questions/qcm/index.js.map +1 -1
- package/es/molecule/questions/qcm/style.css +48 -14
- 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 +103 -0
- package/es/molecule/questions/qcm/test/qcm.js.map +1 -0
- package/es/molecule/questions/qcm-graphic/index.js +35 -17
- package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/es/molecule/questions/qcm-graphic/style.css +64 -13
- 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/questions/question-range/style.css +9 -8
- package/es/molecule/questions/template/index.js +13 -10
- package/es/molecule/questions/template/index.js.map +1 -1
- package/es/molecule/setup-section/style.css +1 -0
- 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/molecule/wizard-summary/test/fixtures.js +2 -0
- package/es/molecule/wizard-summary/test/fixtures.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/organism/wizard-contents/test/fixtures.js +2 -0
- package/es/organism/wizard-contents/test/fixtures.js.map +1 -1
- 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/template/back-office/brand-update/test/fixtures.js +2 -0
- package/es/template/back-office/brand-update/test/fixtures.js.map +1 -1
- 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/atom/range/handle.css +18 -2
- package/lib/atom/range/handle.js +8 -3
- package/lib/atom/range/handle.js.map +1 -1
- package/lib/atom/range/style.css +2 -2
- package/lib/atom/select/index.js +40 -17
- package/lib/atom/select/index.js.map +1 -1
- package/lib/atom/select/style.css +129 -40
- package/lib/atom/select/test/fixtures/player.js +21 -0
- package/lib/atom/select/test/fixtures/player.js.map +1 -0
- package/lib/atom/select/test/fixtures.js +3 -0
- package/lib/atom/select/test/fixtures.js.map +1 -1
- package/lib/atom/select/test/select.js +62 -0
- package/lib/atom/select/test/select.js.map +1 -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-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/course-sections/test/fixtures.js +25 -0
- package/lib/molecule/course-sections/test/fixtures.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 +1 -5
- package/lib/molecule/draggable-list/index.js +7 -4
- package/lib/molecule/draggable-list/index.js.map +1 -1
- 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.js +3 -0
- package/lib/molecule/draggable-list/test/fixtures.js.map +1 -1
- package/lib/molecule/draggable-list/test/on-drop.js +13 -13
- package/lib/molecule/draggable-list/test/on-drop.js.map +1 -1
- package/lib/molecule/questions/drop-down/index.js +1 -5
- package/lib/molecule/questions/drop-down/index.js.map +1 -1
- package/lib/molecule/questions/free-text/index.js +32 -14
- package/lib/molecule/questions/free-text/index.js.map +1 -1
- package/lib/molecule/questions/free-text/style.css +39 -15
- package/lib/molecule/questions/free-text/test/fixtures/default.js +1 -1
- package/lib/molecule/questions/free-text/test/fixtures/default.js.map +1 -1
- package/lib/molecule/questions/free-text/test/fixtures/with-value-on-change.js +14 -0
- package/lib/molecule/questions/free-text/test/fixtures/with-value-on-change.js.map +1 -0
- package/lib/molecule/questions/free-text/test/fixtures/{with-default-value.js → with-value.js} +2 -2
- package/lib/molecule/questions/free-text/test/fixtures/with-value.js.map +1 -0
- package/lib/molecule/questions/free-text/test/fixtures.js +5 -2
- package/lib/molecule/questions/free-text/test/fixtures.js.map +1 -1
- package/lib/molecule/questions/free-text/test/free-text.js +119 -0
- package/lib/molecule/questions/free-text/test/free-text.js.map +1 -0
- package/lib/molecule/questions/qcm/index.js +44 -23
- package/lib/molecule/questions/qcm/index.js.map +1 -1
- package/lib/molecule/questions/qcm/style.css +48 -14
- 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 +115 -0
- package/lib/molecule/questions/qcm/test/qcm.js.map +1 -0
- package/lib/molecule/questions/qcm-graphic/index.js +33 -15
- package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/lib/molecule/questions/qcm-graphic/style.css +64 -13
- 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/questions/question-range/style.css +9 -8
- package/lib/molecule/questions/template/index.js +13 -10
- package/lib/molecule/questions/template/index.js.map +1 -1
- package/lib/molecule/setup-section/style.css +1 -0
- 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/molecule/wizard-summary/test/fixtures.js +3 -0
- package/lib/molecule/wizard-summary/test/fixtures.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/organism/wizard-contents/test/fixtures.js +3 -0
- package/lib/organism/wizard-contents/test/fixtures.js.map +1 -1
- 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/template/back-office/brand-update/test/fixtures.js +3 -0
- package/lib/template/back-office/brand-update/test/fixtures.js.map +1 -1
- 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/questions/free-text/test/fixtures/with-default-value.js.map +0 -1
- package/es/molecule/search/test/fixtures.js +0 -15
- package/es/molecule/search/test/fixtures.js.map +0 -1
- package/lib/molecule/questions/free-text/test/fixtures/with-default-value.js.map +0 -1
- package/lib/molecule/search/test/fixtures.js +0 -25
- package/lib/molecule/search/test/fixtures.js.map +0 -1
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
@value mobile from breakpoints;
|
|
3
3
|
@value colors: "../../../variables/colors.css";
|
|
4
4
|
@value white from colors;
|
|
5
|
-
@value xtraLightGrey from colors;
|
|
6
|
-
@value light from colors;
|
|
7
5
|
@value black from colors;
|
|
6
|
+
@value cm_grey_75 from colors;
|
|
7
|
+
@value cm_primary_blue from colors;
|
|
8
|
+
@value cm_blue_900 from colors;
|
|
8
9
|
|
|
9
10
|
.wrapper {
|
|
10
11
|
display: flex;
|
|
@@ -15,16 +16,34 @@
|
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
.answer {
|
|
18
|
-
|
|
19
|
+
position: relative;
|
|
20
|
+
color: cm_blue_900;
|
|
19
21
|
background-color: white;
|
|
20
|
-
border: 1px solid color(black lightness(85%));
|
|
21
|
-
border-radius: 3px;
|
|
22
22
|
box-sizing: border-box;
|
|
23
23
|
cursor: pointer;
|
|
24
24
|
padding: 8px;
|
|
25
25
|
width: 200px;
|
|
26
26
|
min-height: 245px;
|
|
27
27
|
margin: 0 4px 8px;
|
|
28
|
+
box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.12);
|
|
29
|
+
border-radius: 16px;
|
|
30
|
+
transition: background-color 0.25s linear;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.background {
|
|
34
|
+
top: 0;
|
|
35
|
+
left: 0;
|
|
36
|
+
position: absolute;
|
|
37
|
+
border-radius: 16px;
|
|
38
|
+
height: 100%;
|
|
39
|
+
width: 100%;
|
|
40
|
+
transition: opacity 0.25s linear, background-color 0.25s linear;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.content {
|
|
44
|
+
height: 100%;
|
|
45
|
+
width: 100%;
|
|
46
|
+
position: relative;
|
|
28
47
|
}
|
|
29
48
|
|
|
30
49
|
.imageWrapper {
|
|
@@ -33,12 +52,21 @@
|
|
|
33
52
|
align-items: center;
|
|
34
53
|
height: 110px;
|
|
35
54
|
margin-bottom: 16px;
|
|
36
|
-
background-size:
|
|
55
|
+
background-size: cover;
|
|
37
56
|
background-repeat: no-repeat;
|
|
38
57
|
background-position: center center;
|
|
58
|
+
border-radius: 12px;
|
|
39
59
|
}
|
|
40
60
|
|
|
41
61
|
.titleWrapper {
|
|
62
|
+
display: flex;
|
|
63
|
+
height: calc(100% - 126px);
|
|
64
|
+
width: 100%;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.title {
|
|
42
70
|
font-family: 'Gilroy';
|
|
43
71
|
font-size: 17px;
|
|
44
72
|
line-height: 20px;
|
|
@@ -49,7 +77,16 @@
|
|
|
49
77
|
}
|
|
50
78
|
|
|
51
79
|
.answer:hover {
|
|
52
|
-
background
|
|
80
|
+
background: cm_grey_75;
|
|
81
|
+
box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.12);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.answer .background{
|
|
85
|
+
opacity: 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.answer:hover .background{
|
|
89
|
+
opacity: 1;
|
|
53
90
|
}
|
|
54
91
|
|
|
55
92
|
.selected {
|
|
@@ -57,10 +94,23 @@
|
|
|
57
94
|
color: white;
|
|
58
95
|
}
|
|
59
96
|
|
|
97
|
+
.selected .background{
|
|
98
|
+
opacity: 1;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.selected:hover .background{
|
|
102
|
+
opacity: 0.8;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.selected.answer:hover {
|
|
106
|
+
background-color: black;
|
|
107
|
+
}
|
|
108
|
+
|
|
60
109
|
@media mobile {
|
|
61
110
|
.wrapper {
|
|
62
111
|
flex-direction: column;
|
|
63
|
-
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
64
114
|
width: 100%;
|
|
65
115
|
padding-bottom: 0;
|
|
66
116
|
}
|
|
@@ -69,17 +119,18 @@
|
|
|
69
119
|
display: flex;
|
|
70
120
|
align-items: center;
|
|
71
121
|
flex-flow: row nowrap;
|
|
72
|
-
width: 100
|
|
122
|
+
width: calc(100% - 45px);
|
|
73
123
|
min-height: 82px;
|
|
74
124
|
height: inherit;
|
|
75
125
|
margin: 0 0 8px;
|
|
76
126
|
overflow: hidden;
|
|
77
127
|
}
|
|
78
128
|
|
|
79
|
-
.
|
|
80
|
-
|
|
129
|
+
.content {
|
|
130
|
+
display: flex;
|
|
131
|
+
align-items: center;
|
|
81
132
|
}
|
|
82
|
-
|
|
133
|
+
|
|
83
134
|
.answer:last-child {
|
|
84
135
|
margin-bottom: 0;
|
|
85
136
|
}
|
|
@@ -96,7 +147,7 @@
|
|
|
96
147
|
white-space: wrap;
|
|
97
148
|
overflow: hidden;
|
|
98
149
|
padding: 0;
|
|
99
|
-
|
|
150
|
+
justify-content: left;
|
|
100
151
|
font-size: 15px;
|
|
101
152
|
}
|
|
102
153
|
}
|
|
@@ -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, unselected's no background", 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,EAAiB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GF,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, unselected's no background\", 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"}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
@value breakpoints: "../../../variables/breakpoints.css";
|
|
2
2
|
@value mobile from breakpoints;
|
|
3
3
|
@value colors: "../../../variables/colors.css";
|
|
4
|
-
@value
|
|
5
|
-
@value black from colors;
|
|
4
|
+
@value cm_blue_900 from colors;
|
|
6
5
|
|
|
7
6
|
.wrapper {
|
|
8
7
|
width: 500px;
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
.title {
|
|
12
|
-
color: brand;
|
|
13
11
|
display: table;
|
|
14
12
|
font-family: "Gilroy";
|
|
15
|
-
font-size:
|
|
16
|
-
font-weight:
|
|
13
|
+
font-size: 28px;
|
|
14
|
+
font-weight: bold;
|
|
15
|
+
line-height: 36px;
|
|
17
16
|
margin: 0 auto 15px;
|
|
18
17
|
text-align: center;
|
|
19
18
|
user-select: none;
|
|
@@ -27,11 +26,13 @@
|
|
|
27
26
|
|
|
28
27
|
.label {
|
|
29
28
|
font-family: "Gilroy";
|
|
30
|
-
color:
|
|
31
|
-
font-size:
|
|
32
|
-
font-weight:
|
|
29
|
+
color: cm_blue_900;
|
|
30
|
+
font-size: 18px;
|
|
31
|
+
font-weight: 600;
|
|
33
32
|
display: inline-block;
|
|
33
|
+
line-height: 24px;
|
|
34
34
|
user-select: none;
|
|
35
|
+
font-style: normal;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
@media mobile {
|
|
@@ -3,6 +3,8 @@ import _map from "lodash/fp/map";
|
|
|
3
3
|
|
|
4
4
|
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); }
|
|
5
5
|
|
|
6
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
7
|
+
|
|
6
8
|
import React from 'react';
|
|
7
9
|
import PropTypes from 'prop-types';
|
|
8
10
|
import parseTemplateString from '../../../util/parse-template-string';
|
|
@@ -37,10 +39,16 @@ const Template = ({
|
|
|
37
39
|
}, answers);
|
|
38
40
|
|
|
39
41
|
if (!field) return null;
|
|
40
|
-
|
|
42
|
+
|
|
43
|
+
const {
|
|
44
|
+
type: fieldType
|
|
45
|
+
} = field,
|
|
46
|
+
fieldProps = _objectWithoutPropertiesLoose(field, ["type"]);
|
|
47
|
+
|
|
48
|
+
const fieldView = fieldType === 'text' ? /*#__PURE__*/React.createElement(FreeText, _extends({}, fieldProps, {
|
|
41
49
|
className: style.text
|
|
42
|
-
})) : /*#__PURE__*/React.createElement(DropDown, _extends({},
|
|
43
|
-
theme: "
|
|
50
|
+
})) : /*#__PURE__*/React.createElement(DropDown, _extends({}, fieldProps, {
|
|
51
|
+
theme: "player"
|
|
44
52
|
}));
|
|
45
53
|
return /*#__PURE__*/React.createElement("div", {
|
|
46
54
|
className: style.answerType,
|
|
@@ -56,16 +64,11 @@ const Template = ({
|
|
|
56
64
|
};
|
|
57
65
|
|
|
58
66
|
const TextPropTypes = process.env.NODE_ENV !== "production" ? _extends(_extends({}, DropDown.propTypes), {}, {
|
|
59
|
-
type: PropTypes.string
|
|
60
|
-
name: PropTypes.string
|
|
61
|
-
}) : {};
|
|
62
|
-
const DropDownPropTypes = process.env.NODE_ENV !== "production" ? _extends(_extends({}, DropDown.propTypes), {}, {
|
|
63
|
-
type: PropTypes.string,
|
|
64
|
-
name: PropTypes.string
|
|
67
|
+
type: PropTypes.string
|
|
65
68
|
}) : {};
|
|
66
69
|
Template.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
67
70
|
template: PropTypes.string,
|
|
68
|
-
answers: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape(
|
|
71
|
+
answers: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape(DropDown.propTypes), PropTypes.shape(TextPropTypes)]))
|
|
69
72
|
} : {};
|
|
70
73
|
export default Template;
|
|
71
74
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/questions/template/index.js"],"names":["React","PropTypes","parseTemplateString","DropDown","FreeText","style","Template","template","answers","totalTemplate","templateCompose","convert","cap","part","key","type","__html","value","field","name","fieldView","text","answerType","wrapper","TextPropTypes","propTypes","string","
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/questions/template/index.js"],"names":["React","PropTypes","parseTemplateString","DropDown","FreeText","style","Template","template","answers","totalTemplate","templateCompose","convert","cap","part","key","type","__html","value","field","name","fieldType","fieldProps","fieldView","text","answerType","wrapper","TextPropTypes","propTypes","string","arrayOf","oneOfType","shape"],"mappings":";;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,mBAAP,MAAgC,qCAAhC;AACA,OAAOC,QAAP,MAAqB,cAArB;AACA,OAAOC,QAAP,MAAqB,cAArB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,QAAQ,GAAG,CAAC;AAACC,EAAAA,QAAD;AAAWC,EAAAA;AAAX,CAAD,KAAyB;AACxC,QAAMC,aAAa,GAAGP,mBAAmB,CAACK,QAAD,CAAzC;;AACA,QAAMG,eAAe,GAAG,KAAIC,OAAJ,CAAY;AAACC,IAAAA,GAAG,EAAE;AAAN,GAAZ,EAA0B,CAACC,IAAD,EAAOC,GAA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AAV,CACP5B,SAAS,CAAC6B,SAAV,CAAoB,CAAC7B,SAAS,CAAC8B,KAAV,CAAgB5B,QAAQ,CAACwB,SAAzB,CAAD,EAAsC1B,SAAS,CAAC8B,KAAV,CAAgBL,aAAhB,CAAtC,CAApB,CADO;AAFU,CAArB;AAOA,eAAepB,QAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map, find} from 'lodash/fp';\nimport parseTemplateString from '../../../util/parse-template-string';\nimport DropDown from '../drop-down';\nimport FreeText from '../free-text';\nimport style from './style.css';\n\nconst Template = ({template, answers}) => {\n const totalTemplate = parseTemplateString(template);\n const templateCompose = map.convert({cap: false})((part, key) => {\n const type = part.type;\n if (type === 'string') {\n return (\n <span\n key={key}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: part.value}}\n />\n );\n }\n if (type === 'answerField') {\n const field = find({name: part.value}, answers);\n if (!field) return null;\n const {type: fieldType, ...fieldProps} = field;\n const fieldView =\n fieldType === 'text' ? (\n <FreeText {...fieldProps} className={style.text} />\n ) : (\n <DropDown {...fieldProps} theme=\"player\" />\n );\n\n return (\n <div className={style.answerType} key={part.value}>\n {fieldView}\n </div>\n );\n }\n }, totalTemplate);\n\n return (\n <div data-name=\"template-wrapper\" className={style.wrapper}>\n {templateCompose}\n </div>\n );\n};\n\nconst TextPropTypes = {\n ...DropDown.propTypes,\n type: PropTypes.string\n};\n\nTemplate.propTypes = {\n template: PropTypes.string,\n answers: PropTypes.arrayOf(\n PropTypes.oneOfType([PropTypes.shape(DropDown.propTypes), PropTypes.shape(TextPropTypes)])\n )\n};\n\nexport default Template;\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,QAAA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;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"}
|
|
@@ -4,6 +4,7 @@ import renderComponentMacro from '../../../test/helpers/render-component';
|
|
|
4
4
|
import MoleculeWizardSummary from '..';
|
|
5
5
|
import fixtureDefault from './fixtures/default';
|
|
6
6
|
import fixtureOneSection from './fixtures/one-section';
|
|
7
|
+
import fixtureOrganizeCourses from './fixtures/organize-courses';
|
|
7
8
|
import fixtureTabletClosed from './fixtures/tablet-closed';
|
|
8
9
|
import fixtureThreeSections from './fixtures/three-sections';
|
|
9
10
|
import fixtureTwoSections from './fixtures/two-sections';
|
|
@@ -15,6 +16,7 @@ test('Molecule › MoleculeWizardSummary > should have valid propTypes', t => {
|
|
|
15
16
|
});
|
|
16
17
|
test('Molecule › MoleculeWizardSummary › Default › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureDefault);
|
|
17
18
|
test('Molecule › MoleculeWizardSummary › OneSection › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureOneSection);
|
|
19
|
+
test('Molecule › MoleculeWizardSummary › OrganizeCourses › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureOrganizeCourses);
|
|
18
20
|
test('Molecule › MoleculeWizardSummary › TabletClosed › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureTabletClosed);
|
|
19
21
|
test('Molecule › MoleculeWizardSummary › ThreeSections › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureThreeSections);
|
|
20
22
|
test('Molecule › MoleculeWizardSummary › TwoSections › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureTwoSections);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/wizard-summary/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeWizardSummary","fixtureDefault","fixtureOneSection","fixtureTabletClosed","fixtureThreeSections","fixtureTwoSections","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,qBAAP,MAAkC,IAAlC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,iBAAP,MAA8B,wBAA9B;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,oBAAP,MAAiC,2BAAjC;AACA,OAAOC,kBAAP,MAA+B,yBAA/B;
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/wizard-summary/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeWizardSummary","fixtureDefault","fixtureOneSection","fixtureOrganizeCourses","fixtureTabletClosed","fixtureThreeSections","fixtureTwoSections","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,qBAAP,MAAkC,IAAlC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,iBAAP,MAA8B,wBAA9B;AACA,OAAOC,sBAAP,MAAmC,6BAAnC;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,oBAAP,MAAiC,2BAAjC;AACA,OAAOC,kBAAP,MAA+B,yBAA/B;AAEAT,IAAI,CAAC,gEAAD,EAAmEU,CAAC,IAAI;AAC1EA,EAAAA,CAAC,CAACC,IAAF;AACAV,EAAAA,OAAO,CAACE,qBAAqB,CAACS,SAAvB,EAAkC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACvDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,0DAAyDF,GAAI,mEAAtF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAd,IAAI,CAAC,iEAAD,EAAoEE,oBAApE,EAA0FC,qBAA1F,EAAiHC,cAAjH,CAAJ;AACAJ,IAAI,CAAC,oEAAD,EAAuEE,oBAAvE,EAA6FC,qBAA7F,EAAoHE,iBAApH,CAAJ;AACAL,IAAI,CAAC,yEAAD,EAA4EE,oBAA5E,EAAkGC,qBAAlG,EAAyHG,sBAAzH,CAAJ;AACAN,IAAI,CAAC,sEAAD,EAAyEE,oBAAzE,EAA+FC,qBAA/F,EAAsHI,mBAAtH,CAAJ;AACAP,IAAI,CAAC,uEAAD,EAA0EE,oBAA1E,EAAgGC,qBAAhG,EAAuHK,oBAAvH,CAAJ;AACAR,IAAI,CAAC,qEAAD,EAAwEE,oBAAxE,EAA8FC,qBAA9F,EAAqHM,kBAArH,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeWizardSummary from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureOneSection from './fixtures/one-section';\nimport fixtureOrganizeCourses from './fixtures/organize-courses';\nimport fixtureTabletClosed from './fixtures/tablet-closed';\nimport fixtureThreeSections from './fixtures/three-sections';\nimport fixtureTwoSections from './fixtures/two-sections';\n\ntest('Molecule › MoleculeWizardSummary > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeWizardSummary.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeWizardSummary.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeWizardSummary › Default › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureDefault);\ntest('Molecule › MoleculeWizardSummary › OneSection › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureOneSection);\ntest('Molecule › MoleculeWizardSummary › OrganizeCourses › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureOrganizeCourses);\ntest('Molecule › MoleculeWizardSummary › TabletClosed › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureTabletClosed);\ntest('Molecule › MoleculeWizardSummary › ThreeSections › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureThreeSections);\ntest('Molecule › MoleculeWizardSummary › TwoSections › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureTwoSections);\n"],"file":"fixtures.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,GAAxB;AAQA,sBACE,8CACE;AAAK,IAAA,SAAS,EAAEL,KAAK,CAACS;AAAtB,kBACE,oBAAC,kBAAD,EAAwBH,eAAxB,CADF,eAEE;AAAK,IAAA,SAAS,EAAEN,KAAK,CAACU,W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EAAAA,OAAO,EAAErB,SAAS,CAACgE,SAAV,CAAoB,CAC3BhE,SAAS,CAAC4D,KAAV,uBACKvD,SAAS,CAACqD,SADf;AAEEpC,IAAAA,IAAI,EAAEtB,SAAS,CAACiE,KAAV,CAAgB,CAAC,MAAD,CAAhB;AAFR,KAD2B,EAK3BjE,SAAS,CAAC4D,KAAV,uBACKtD,gBAAgB,CAACoD,SADtB;AAEEpC,IAAAA,IAAI,EAAEtB,SAAS,CAACiE,KAAV,CAAgB,CAAC,WAAD,CAAhB;AAFR,KAL2B,EAS3BjE,SAAS,CAAC4D,KAAV,uBACKrD,6BAA6B,CAACmD,SADnC;AAEEpC,IAAAA,IAAI,EAAEtB,SAAS,CAACiE,KAAV,CAAgB,CAAC,aAAD,CAAhB;AAFR,KAT2B,EAa3BjE,SAAS,CAAC4D,KAAV,uBACKpD,eAAe,CAACkD,SADrB;AAEEpC,IAAAA,IAAI,EAAEtB,SAAS,CAACiE,KAAV,CAAgB,CAAC,SAAD,CAAhB;AAFR,KAb2B,CAApB,CAVgB;AA4BzB/B,EAAAA,YAAY,EAAElC,SAAS,CAAC4D,KAAV,CAAgB;AAC5B7B,IAAAA,KAAK,EAAE/B,SAAS,CAAC6D,MADW;AAE5B/C,IAAAA,OAAO,EAAEd,SAAS,CAAC8D;AAFS,GAAhB,CA5BW;AAgCzB3B,EAAAA,QAAQ,EAAEnC,SAAS,CAAC4D,KAAV,CAAgB;AACxBtC,IAAAA,IAAI,EAAEtB,SAAS,CAACiE,KAAV,CAAgB,CAAC,MAAD,EAAS,SAAT,CAAhB,CADkB;AAExBlC,IAAAA,KAAK,EAAE/B,SAAS,CAAC6D,MAFO;AAGxB/C,IAAAA,OAAO,EAAEd,SAAS,CAAC8D;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;AAAK,IAAA,SAAS,EAAEL,KAAK,CAACS;AAAtB,kBACE,oBAAC,kBAAD,EAAwBH,eAAxB,CADF,eAEE;AAAK,IAAA,SAAS,EAAEN,KAAK,CAACU,WAAtB;AAAmC,iBAAW;AAA9C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B/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"}
|