@coorpacademy/components 10.5.4 → 10.5.7-alpha.11

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.
Files changed (197) hide show
  1. package/es/atom/range/handle.css +18 -2
  2. package/es/atom/range/handle.js +7 -3
  3. package/es/atom/range/handle.js.map +1 -1
  4. package/es/atom/range/style.css +2 -2
  5. package/es/atom/select/index.js +38 -20
  6. package/es/atom/select/index.js.map +1 -1
  7. package/es/atom/select/style.css +129 -40
  8. package/es/atom/select/test/fixtures/player.js +11 -0
  9. package/es/atom/select/test/fixtures/player.js.map +1 -0
  10. package/es/atom/select/test/fixtures.js +2 -0
  11. package/es/atom/select/test/fixtures.js.map +1 -1
  12. package/es/atom/select/test/select.js +49 -0
  13. package/es/atom/select/test/select.js.map +1 -0
  14. package/es/molecule/course-section/index.js +5 -3
  15. package/es/molecule/course-section/index.js.map +1 -1
  16. package/es/molecule/course-section/style.css +2 -1
  17. package/es/molecule/course-section/test/fixtures/chapter.js +2 -1
  18. package/es/molecule/course-section/test/fixtures/chapter.js.map +1 -1
  19. package/es/molecule/course-section/test/fixtures/course.js +2 -1
  20. package/es/molecule/course-section/test/fixtures/course.js.map +1 -1
  21. package/es/molecule/course-sections/index.js +40 -0
  22. package/es/molecule/course-sections/index.js.map +1 -0
  23. package/es/molecule/course-sections/style.css +3 -0
  24. package/es/molecule/course-sections/test/fixtures/default.js +149 -0
  25. package/es/molecule/course-sections/test/fixtures/default.js.map +1 -0
  26. package/es/molecule/course-sections/test/fixtures/loading.js +9 -0
  27. package/es/molecule/course-sections/test/fixtures/loading.js.map +1 -0
  28. package/es/molecule/course-sections/test/fixtures.js +15 -0
  29. package/es/molecule/course-sections/test/fixtures.js.map +1 -0
  30. package/es/molecule/draggable/index.js +1 -1
  31. package/es/molecule/draggable/index.js.map +1 -1
  32. package/es/molecule/draggable/style.css +1 -5
  33. package/es/molecule/draggable-list/index.js +56 -0
  34. package/es/molecule/draggable-list/index.js.map +1 -0
  35. package/es/molecule/draggable-list/test/fixtures/course-sections.js +20 -0
  36. package/es/molecule/draggable-list/test/fixtures/course-sections.js.map +1 -0
  37. package/es/molecule/draggable-list/test/fixtures/dashboard-sections.js +26 -0
  38. package/es/molecule/draggable-list/test/fixtures/dashboard-sections.js.map +1 -0
  39. package/es/molecule/draggable-list/test/fixtures.js +2 -0
  40. package/es/molecule/draggable-list/test/fixtures.js.map +1 -1
  41. package/es/molecule/{setup-sections → draggable-list}/test/on-drop.js +17 -17
  42. package/es/molecule/draggable-list/test/on-drop.js.map +1 -0
  43. package/es/molecule/questions/drop-down/index.js +1 -6
  44. package/es/molecule/questions/drop-down/index.js.map +1 -1
  45. package/es/molecule/questions/free-text/index.js +35 -15
  46. package/es/molecule/questions/free-text/index.js.map +1 -1
  47. package/es/molecule/questions/free-text/style.css +35 -15
  48. package/es/molecule/questions/free-text/test/fixtures/default.js +1 -1
  49. package/es/molecule/questions/free-text/test/fixtures/default.js.map +1 -1
  50. package/es/molecule/questions/free-text/test/fixtures/with-value-on-change.js +9 -0
  51. package/es/molecule/questions/free-text/test/fixtures/with-value-on-change.js.map +1 -0
  52. package/es/molecule/questions/free-text/test/fixtures/{with-default-value.js → with-value.js} +2 -2
  53. package/es/molecule/questions/free-text/test/fixtures/with-value.js.map +1 -0
  54. package/es/molecule/questions/free-text/test/fixtures.js +4 -2
  55. package/es/molecule/questions/free-text/test/fixtures.js.map +1 -1
  56. package/es/molecule/questions/free-text/test/free-text.js +106 -0
  57. package/es/molecule/questions/free-text/test/free-text.js.map +1 -0
  58. package/es/molecule/questions/qcm/index.js +37 -25
  59. package/es/molecule/questions/qcm/index.js.map +1 -1
  60. package/es/molecule/questions/qcm/style.css +48 -14
  61. package/es/molecule/questions/qcm/test/fixtures/default.js +8 -0
  62. package/es/molecule/questions/qcm/test/fixtures/default.js.map +1 -1
  63. package/es/molecule/questions/qcm/test/qcm.js +103 -0
  64. package/es/molecule/questions/qcm/test/qcm.js.map +1 -0
  65. package/es/molecule/questions/qcm-graphic/index.js +35 -17
  66. package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
  67. package/es/molecule/questions/qcm-graphic/style.css +64 -13
  68. package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js +65 -0
  69. package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -0
  70. package/es/molecule/questions/question-range/style.css +9 -8
  71. package/es/molecule/questions/template/index.js +13 -10
  72. package/es/molecule/questions/template/index.js.map +1 -1
  73. package/es/molecule/setup-section/style.css +1 -0
  74. package/es/molecule/setup-sections/index.js +7 -33
  75. package/es/molecule/setup-sections/index.js.map +1 -1
  76. package/es/molecule/wizard-summary/test/fixtures/organize-courses.js +106 -0
  77. package/es/molecule/wizard-summary/test/fixtures/organize-courses.js.map +1 -0
  78. package/es/molecule/wizard-summary/test/fixtures.js +2 -0
  79. package/es/molecule/wizard-summary/test/fixtures.js.map +1 -1
  80. package/es/organism/wizard-contents/index.js +6 -0
  81. package/es/organism/wizard-contents/index.js.map +1 -1
  82. package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +45 -0
  83. package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -0
  84. package/es/organism/wizard-contents/test/fixtures.js +2 -0
  85. package/es/organism/wizard-contents/test/fixtures.js.map +1 -1
  86. package/es/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js +22 -0
  87. package/es/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js.map +1 -0
  88. package/es/template/back-office/brand-update/test/fixtures.js +2 -0
  89. package/es/template/back-office/brand-update/test/fixtures.js.map +1 -1
  90. package/es/util/get-shadow-box-color-from-primary.js +4 -0
  91. package/es/util/get-shadow-box-color-from-primary.js.map +1 -0
  92. package/es/util/test/get-shadow-box-color-from-primary.js +33 -0
  93. package/es/util/test/get-shadow-box-color-from-primary.js.map +1 -0
  94. package/es/variables/colors.css +3 -0
  95. package/lib/atom/range/handle.css +18 -2
  96. package/lib/atom/range/handle.js +8 -3
  97. package/lib/atom/range/handle.js.map +1 -1
  98. package/lib/atom/range/style.css +2 -2
  99. package/lib/atom/select/index.js +40 -17
  100. package/lib/atom/select/index.js.map +1 -1
  101. package/lib/atom/select/style.css +129 -40
  102. package/lib/atom/select/test/fixtures/player.js +21 -0
  103. package/lib/atom/select/test/fixtures/player.js.map +1 -0
  104. package/lib/atom/select/test/fixtures.js +3 -0
  105. package/lib/atom/select/test/fixtures.js.map +1 -1
  106. package/lib/atom/select/test/select.js +62 -0
  107. package/lib/atom/select/test/select.js.map +1 -0
  108. package/lib/molecule/course-section/index.js +5 -3
  109. package/lib/molecule/course-section/index.js.map +1 -1
  110. package/lib/molecule/course-section/style.css +2 -1
  111. package/lib/molecule/course-section/test/fixtures/chapter.js +2 -1
  112. package/lib/molecule/course-section/test/fixtures/chapter.js.map +1 -1
  113. package/lib/molecule/course-section/test/fixtures/course.js +2 -1
  114. package/lib/molecule/course-section/test/fixtures/course.js.map +1 -1
  115. package/lib/molecule/course-sections/index.js +54 -0
  116. package/lib/molecule/course-sections/index.js.map +1 -0
  117. package/lib/molecule/course-sections/style.css +3 -0
  118. package/lib/molecule/course-sections/test/fixtures/default.js +154 -0
  119. package/lib/molecule/course-sections/test/fixtures/default.js.map +1 -0
  120. package/lib/molecule/course-sections/test/fixtures/loading.js +14 -0
  121. package/lib/molecule/course-sections/test/fixtures/loading.js.map +1 -0
  122. package/lib/molecule/course-sections/test/fixtures.js +25 -0
  123. package/lib/molecule/course-sections/test/fixtures.js.map +1 -0
  124. package/lib/molecule/draggable/index.js +1 -1
  125. package/lib/molecule/draggable/index.js.map +1 -1
  126. package/lib/molecule/draggable/style.css +1 -5
  127. package/lib/molecule/draggable-list/index.js +73 -0
  128. package/lib/molecule/draggable-list/index.js.map +1 -0
  129. package/lib/molecule/draggable-list/test/fixtures/course-sections.js +29 -0
  130. package/lib/molecule/draggable-list/test/fixtures/course-sections.js.map +1 -0
  131. package/lib/molecule/draggable-list/test/fixtures/dashboard-sections.js +37 -0
  132. package/lib/molecule/draggable-list/test/fixtures/dashboard-sections.js.map +1 -0
  133. package/lib/molecule/draggable-list/test/fixtures.js +3 -0
  134. package/lib/molecule/draggable-list/test/fixtures.js.map +1 -1
  135. package/lib/molecule/{setup-sections → draggable-list}/test/on-drop.js +19 -19
  136. package/lib/molecule/draggable-list/test/on-drop.js.map +1 -0
  137. package/lib/molecule/questions/drop-down/index.js +1 -5
  138. package/lib/molecule/questions/drop-down/index.js.map +1 -1
  139. package/lib/molecule/questions/free-text/index.js +32 -14
  140. package/lib/molecule/questions/free-text/index.js.map +1 -1
  141. package/lib/molecule/questions/free-text/style.css +35 -15
  142. package/lib/molecule/questions/free-text/test/fixtures/default.js +1 -1
  143. package/lib/molecule/questions/free-text/test/fixtures/default.js.map +1 -1
  144. package/lib/molecule/questions/free-text/test/fixtures/with-value-on-change.js +14 -0
  145. package/lib/molecule/questions/free-text/test/fixtures/with-value-on-change.js.map +1 -0
  146. package/lib/molecule/questions/free-text/test/fixtures/{with-default-value.js → with-value.js} +2 -2
  147. package/lib/molecule/questions/free-text/test/fixtures/with-value.js.map +1 -0
  148. package/lib/molecule/questions/free-text/test/fixtures.js +5 -2
  149. package/lib/molecule/questions/free-text/test/fixtures.js.map +1 -1
  150. package/lib/molecule/questions/free-text/test/free-text.js +119 -0
  151. package/lib/molecule/questions/free-text/test/free-text.js.map +1 -0
  152. package/lib/molecule/questions/qcm/index.js +44 -23
  153. package/lib/molecule/questions/qcm/index.js.map +1 -1
  154. package/lib/molecule/questions/qcm/style.css +48 -14
  155. package/lib/molecule/questions/qcm/test/fixtures/default.js +8 -0
  156. package/lib/molecule/questions/qcm/test/fixtures/default.js.map +1 -1
  157. package/lib/molecule/questions/qcm/test/qcm.js +115 -0
  158. package/lib/molecule/questions/qcm/test/qcm.js.map +1 -0
  159. package/lib/molecule/questions/qcm-graphic/index.js +33 -15
  160. package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
  161. package/lib/molecule/questions/qcm-graphic/style.css +64 -13
  162. package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js +76 -0
  163. package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -0
  164. package/lib/molecule/questions/question-range/style.css +9 -8
  165. package/lib/molecule/questions/template/index.js +13 -10
  166. package/lib/molecule/questions/template/index.js.map +1 -1
  167. package/lib/molecule/setup-section/style.css +1 -0
  168. package/lib/molecule/setup-sections/index.js +7 -37
  169. package/lib/molecule/setup-sections/index.js.map +1 -1
  170. package/lib/molecule/wizard-summary/test/fixtures/organize-courses.js +111 -0
  171. package/lib/molecule/wizard-summary/test/fixtures/organize-courses.js.map +1 -0
  172. package/lib/molecule/wizard-summary/test/fixtures.js +3 -0
  173. package/lib/molecule/wizard-summary/test/fixtures.js.map +1 -1
  174. package/lib/organism/wizard-contents/index.js +7 -0
  175. package/lib/organism/wizard-contents/index.js.map +1 -1
  176. package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +54 -0
  177. package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -0
  178. package/lib/organism/wizard-contents/test/fixtures.js +3 -0
  179. package/lib/organism/wizard-contents/test/fixtures.js.map +1 -1
  180. package/lib/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js +32 -0
  181. package/lib/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js.map +1 -0
  182. package/lib/template/back-office/brand-update/test/fixtures.js +3 -0
  183. package/lib/template/back-office/brand-update/test/fixtures.js.map +1 -1
  184. package/lib/util/get-shadow-box-color-from-primary.js +12 -0
  185. package/lib/util/get-shadow-box-color-from-primary.js.map +1 -0
  186. package/lib/util/test/get-shadow-box-color-from-primary.js +40 -0
  187. package/lib/util/test/get-shadow-box-color-from-primary.js.map +1 -0
  188. package/lib/variables/colors.css +3 -0
  189. package/package.json +2 -2
  190. package/es/molecule/questions/free-text/test/fixtures/with-default-value.js.map +0 -1
  191. package/es/molecule/search/test/fixtures.js +0 -15
  192. package/es/molecule/search/test/fixtures.js.map +0 -1
  193. package/es/molecule/setup-sections/test/on-drop.js.map +0 -1
  194. package/lib/molecule/questions/free-text/test/fixtures/with-default-value.js.map +0 -1
  195. package/lib/molecule/search/test/fixtures.js +0 -25
  196. package/lib/molecule/search/test/fixtures.js.map +0 -1
  197. package/lib/molecule/setup-sections/test/on-drop.js.map +0 -1
@@ -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 brand from colors;
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: 24px;
16
- font-weight: 700;
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: black;
31
- font-size: 15px;
32
- font-weight: 700;
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 {
@@ -23,6 +23,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
23
23
 
24
24
  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); }
25
25
 
26
+ 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; }
27
+
26
28
  const Template = ({
27
29
  template,
28
30
  answers
@@ -49,10 +51,16 @@ const Template = ({
49
51
  name: part.value
50
52
  }, answers);
51
53
  if (!field) return null;
52
- const fieldView = field.type === 'text' ? /*#__PURE__*/_react.default.createElement(_freeText.default, _extends({}, field, {
54
+
55
+ const {
56
+ type: fieldType
57
+ } = field,
58
+ fieldProps = _objectWithoutPropertiesLoose(field, ["type"]);
59
+
60
+ const fieldView = fieldType === 'text' ? /*#__PURE__*/_react.default.createElement(_freeText.default, _extends({}, fieldProps, {
53
61
  className: _style.default.text
54
- })) : /*#__PURE__*/_react.default.createElement(_dropDown.default, _extends({}, field, {
55
- theme: "template"
62
+ })) : /*#__PURE__*/_react.default.createElement(_dropDown.default, _extends({}, fieldProps, {
63
+ theme: "player"
56
64
  }));
57
65
  return /*#__PURE__*/_react.default.createElement("div", {
58
66
  className: _style.default.answerType,
@@ -68,16 +76,11 @@ const Template = ({
68
76
  };
69
77
 
70
78
  const TextPropTypes = process.env.NODE_ENV !== "production" ? _extends(_extends({}, _dropDown.default.propTypes), {}, {
71
- type: _propTypes.default.string,
72
- name: _propTypes.default.string
73
- }) : {};
74
- const DropDownPropTypes = process.env.NODE_ENV !== "production" ? _extends(_extends({}, _dropDown.default.propTypes), {}, {
75
- type: _propTypes.default.string,
76
- name: _propTypes.default.string
79
+ type: _propTypes.default.string
77
80
  }) : {};
78
81
  Template.propTypes = process.env.NODE_ENV !== "production" ? {
79
82
  template: _propTypes.default.string,
80
- answers: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.shape(DropDownPropTypes), _propTypes.default.shape(TextPropTypes)]))
83
+ answers: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.shape(_dropDown.default.propTypes), _propTypes.default.shape(TextPropTypes)]))
81
84
  } : {};
82
85
  var _default = Template;
83
86
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/molecule/questions/template/index.js"],"names":["Template","template","answers","totalTemplate","templateCompose","convert","cap","part","key","type","__html","value","field","name","fieldView","style","text","answerType","wrapper","TextPropTypes","DropDown","propTypes","PropTypes","string","DropDownPropTypes","arrayOf","oneOfType","shape"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,QAAQ,GAAG,CAAC;AAACC,EAAAA,QAAD;AAAWC,EAAAA;AAAX,CAAD,KAAyB;AACxC,QAAMC,aAAa,GAAG,kCAAoBF,QAApB,CAAtB;;AACA,QAAMG,eAAe,GAAG,cAAIC,OAAJ,CAAY;AAACC,IAAAA,GAAG,EAAE;AAAN,GAAZ,EAA0B,CAACC,IAAD,EAAOC,GAAP,KAAe;AAC/D,UAAMC,IAAI,GAAGF,IAAI,CAACE,IAAlB;;AACA,QAAIA,IAAI,KAAK,QAAb,EAAuB;AACrB,0BACE;AACE,QAAA,GAAG,EAAED,GADP,CAEE;AAFF;AAGE,QAAA,uBAAuB,EAAE;AAACE,UAAAA,MAAM,EAAEH,IAAI,CAACI;AAAd;AAH3B,QADF;AAOD;;AACD,QAAIF,IAAI,KAAK,aAAb,EAA4B;AAC1B,YAAMG,KAAK,GAAG,oBAAK;AAACC,QAAAA,IAAI,EAAEN,IAAI,CAACI;AAAZ,OAAL,EAAyBT,OAAzB,CAAd;AACA,UAAI,CAACU,KAAL,EAAY,OAAO,IAAP;AACZ,YAAME,SAAS,GACbF,KAAK,CAACH,IAAN,KAAe,MAAf,gBACE,6BAAC,iBAAD,eAAcG,KAAd;AAAqB,QAAA,SAAS,EAAEG,eAAMC;AAAtC,SADF,gBAGE,6BAAC,iBAAD,eAAcJ,KAAd;AAAqB,QAAA,KAAK,EAAC;AAA3B,SAJJ;AAOA,0BACE;AAAK,QAAA,SAAS,EAAEG,eAAME,UAAtB;AAAkC,QAAA,GAAG,EAAEV,IAAI,CAACI;AAA5C,SACGG,SADH,CADF;AAKD;AACF,GA3BuB,EA2BrBX,aA3BqB,CAAxB;;AA6BA,sBACE;AAAK,iBAAU,kBAAf;AAAkC,IAAA,SAAS,EAAEY,eAAMG;AAAnD,KACGd,eADH,CADF;AAKD,CApCD;;AAsCA,MAAMe,aAAN,iEACKC,kBAASC,SADd;AAEEZ,EAAAA,IAAI,EAAEa,mBAAUC,MAFlB;AAGEV,EAAAA,IAAI,EAAES,mBAAUC;AAHlB;AAMA,MAAMC,iBAAN,iEACKJ,kBAASC,SADd;AAEEZ,EAAAA,IAAI,EAAEa,mBAAUC,MAFlB;AAGEV,EAAAA,IAAI,EAAES,mBAAUC;AAHlB;AAMAvB,QAAQ,CAACqB,SAAT,2CAAqB;AACnBpB,EAAAA,QAAQ,EAAEqB,mBAAUC,MADD;AAEnBrB,EAAAA,OAAO,EAAEoB,mBAAUG,OAAV,CACPH,mBAAUI,SAAV,CAAoB,CAACJ,mBAAUK,KAAV,CAAgBH,iBAAhB,CAAD,EAAqCF,mBAAUK,KAAV,CAAgBR,aAAhB,CAArC,CAApB,CADO;AAFU,CAArB;eAOenB,Q","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 fieldView =\n field.type === 'text' ? (\n <FreeText {...field} className={style.text} />\n ) : (\n <DropDown {...field} theme=\"template\" />\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 name: PropTypes.string\n};\n\nconst DropDownPropTypes = {\n ...DropDown.propTypes,\n type: PropTypes.string,\n name: PropTypes.string\n};\n\nTemplate.propTypes = {\n template: PropTypes.string,\n answers: PropTypes.arrayOf(\n PropTypes.oneOfType([PropTypes.shape(DropDownPropTypes), PropTypes.shape(TextPropTypes)])\n )\n};\n\nexport default Template;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../src/molecule/questions/template/index.js"],"names":["Template","template","answers","totalTemplate","templateCompose","convert","cap","part","key","type","__html","value","field","name","fieldType","fieldProps","fieldView","style","text","answerType","wrapper","TextPropTypes","DropDown","propTypes","PropTypes","string","arrayOf","oneOfType","shape"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,QAAQ,GAAG,CAAC;AAACC,EAAAA,QAAD;AAAWC,EAAAA;AAAX,CAAD,KAAyB;AACxC,QAAMC,aAAa,GAAG,kCAAoBF,QAApB,CAAtB;;AACA,QAAMG,eAAe,GAAG,cAAIC,OAAJ,CAAY;AAACC,IAAAA,GAAG,EAAE;AAAN,GAAZ,EAA0B,CAACC,IAAD,EAAOC,GAAP,KAAe;AAC/D,UAAMC,IAAI,GAAGF,IAAI,CAACE,IAAlB;;AACA,QAAIA,IAAI,KAAK,QAAb,EAAuB;AACrB,0BACE;AACE,QAAA,GAAG,EAAED,GADP,CAEE;AAFF;AAGE,QAAA,uBAAuB,EAAE;AAACE,UAAAA,MAAM,EAAEH,IAAI,CAACI;AAAd;AAH3B,QADF;AAOD;;AACD,QAAIF,IAAI,KAAK,aAAb,EAA4B;AAC1B,YAAMG,KAAK,GAAG,oBAAK;AAACC,QAAAA,IAAI,EAAEN,IAAI,CAACI;AAAZ,OAAL,EAAyBT,OAAzB,CAAd;AACA,UAAI,CAACU,KAAL,EAAY,OAAO,IAAP;;AACZ,YAAM;AAACH,QAAAA,IAAI,EAAEK;AAAP,UAAmCF,KAAzC;AAAA,YAA2BG,UAA3B,iCAAyCH,KAAzC;;AACA,YAAMI,SAAS,GACbF,SAAS,KAAK,MAAd,gBACE,6BAAC,iBAAD,eAAcC,UAAd;AAA0B,QAAA,SAAS,EAAEE,eAAMC;AAA3C,SADF,gBAGE,6BAAC,iBAAD,eAAcH,UAAd;AAA0B,QAAA,KAAK,EAAC;AAAhC,SAJJ;AAOA,0BACE;AAAK,QAAA,SAAS,EAAEE,eAAME,UAAtB;AAAkC,QAAA,GAAG,EAAEZ,IAAI,CAACI;AAA5C,SACGK,SADH,CADF;AAKD;AACF,GA5BuB,EA4BrBb,aA5BqB,CAAxB;;AA8BA,sBACE;AAAK,iBAAU,kBAAf;AAAkC,IAAA,SAAS,EAAEc,eAAMG;AAAnD,KACGhB,eADH,CADF;AAKD,CArCD;;AAuCA,MAAMiB,aAAN,iEACKC,kBAASC,SADd;AAEEd,EAAAA,IAAI,EAAEe,mBAAUC;AAFlB;AAKAzB,QAAQ,CAACuB,SAAT,2CAAqB;AACnBtB,EAAAA,QAAQ,EAAEuB,mBAAUC,MADD;AAEnBvB,EAAAA,OAAO,EAAEsB,mBAAUE,OAAV,CACPF,mBAAUG,SAAV,CAAoB,CAACH,mBAAUI,KAAV,CAAgBN,kBAASC,SAAzB,CAAD,EAAsCC,mBAAUI,KAAV,CAAgBP,aAAhB,CAAtC,CAApB,CADO;AAFU,CAArB;eAOerB,Q","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"}
@@ -14,6 +14,7 @@
14
14
  justify-content: space-between;
15
15
  padding: 0 24px 0 48px;
16
16
  box-sizing: border-box;
17
+ border-radius: 7px;
17
18
  }
18
19
 
19
20
  .title {
@@ -3,11 +3,11 @@
3
3
  exports.__esModule = true;
4
4
  exports.default = void 0;
5
5
 
6
- var _react = _interopRequireWildcard(require("react"));
6
+ var _react = _interopRequireDefault(require("react"));
7
7
 
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
 
10
- var _draggable = _interopRequireDefault(require("../draggable"));
10
+ var _draggableList = _interopRequireDefault(require("../draggable-list"));
11
11
 
12
12
  var _setupSection = _interopRequireDefault(require("../setup-section"));
13
13
 
@@ -17,12 +17,6 @@ var _style = _interopRequireDefault(require("./style.css"));
17
17
 
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
19
 
20
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
21
-
22
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
-
24
- 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); }
25
-
26
20
  const Loading = () => /*#__PURE__*/_react.default.createElement("div", {
27
21
  className: _style.default.loading
28
22
  }, /*#__PURE__*/_react.default.createElement(_loader.default, null));
@@ -32,36 +26,12 @@ const SetupSections = ({
32
26
  loading,
33
27
  onDrop
34
28
  }) => {
35
- const [dragTo, setDragTo] = (0, _react.useState)(null);
36
- const [dragFrom, setDragFrom] = (0, _react.useState)(null);
37
- const dragStartHandler = (0, _react.useCallback)(id => {
38
- setDragFrom(id);
39
- }, [setDragFrom]);
40
- const dragOverHandler = (0, _react.useCallback)(id => {
41
- if (dragTo === id) return;
42
- setDragTo(id);
43
- }, [dragTo, setDragTo]);
44
- const dragLeaveHandler = (0, _react.useCallback)(id => {
45
- setDragTo(null);
46
- }, [setDragTo]);
47
- const dropHandler = (0, _react.useCallback)(id => {
48
- if (onDrop && dragFrom) onDrop(dragFrom, id);
49
- setDragTo(null);
50
- setDragFrom(null);
51
- }, [onDrop, setDragTo, setDragFrom, dragFrom]);
52
29
  if (loading) return /*#__PURE__*/_react.default.createElement(Loading, null);
53
- const sectionsView = sections.map(section => /*#__PURE__*/_react.default.createElement(_draggable.default, {
54
- key: section.id,
55
- id: section.id,
56
- dragging: dragTo === section.id,
57
- onDragStart: dragStartHandler,
58
- onDragOver: dragOverHandler,
59
- onDragLeave: dragLeaveHandler,
60
- onDrop: dropHandler
61
- }, /*#__PURE__*/_react.default.createElement(_setupSection.default, _extends({}, section, {
62
- key: section.id
63
- }))));
64
- return /*#__PURE__*/_react.default.createElement("div", null, sectionsView);
30
+ return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_draggableList.default, {
31
+ itemType: "setup-section",
32
+ items: sections,
33
+ onDrop: onDrop
34
+ }));
65
35
  };
66
36
 
67
37
  SetupSections.propTypes = process.env.NODE_ENV !== "production" ? {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/molecule/setup-sections/index.js"],"names":["Loading","style","loading","SetupSections","sections","onDrop","dragTo","setDragTo","dragFrom","setDragFrom","dragStartHandler","id","dragOverHandler","dragLeaveHandler","dropHandler","sectionsView","map","section","propTypes","PropTypes","arrayOf","shape","SetupSection","bool","func"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,OAAO,GAAG,mBACd;AAAK,EAAA,SAAS,EAAEC,eAAMC;AAAtB,gBACE,6BAAC,eAAD,OADF,CADF;;AAMA,MAAMC,aAAa,GAAG,CAAC;AAACC,EAAAA,QAAD;AAAWF,EAAAA,OAAX;AAAoBG,EAAAA;AAApB,CAAD,KAAiC;AACrD,QAAM,CAACC,MAAD,EAASC,SAAT,IAAsB,qBAAS,IAAT,CAA5B;AACA,QAAM,CAACC,QAAD,EAAWC,WAAX,IAA0B,qBAAS,IAAT,CAAhC;AAEA,QAAMC,gBAAgB,GAAG,wBACvBC,EAAE,IAAI;AACJF,IAAAA,WAAW,CAACE,EAAD,CAAX;AACD,GAHsB,EAIvB,CAACF,WAAD,CAJuB,CAAzB;AAOA,QAAMG,eAAe,GAAG,wBACtBD,EAAE,IAAI;AACJ,QAAIL,MAAM,KAAKK,EAAf,EAAmB;AACnBJ,IAAAA,SAAS,CAACI,EAAD,CAAT;AACD,GAJqB,EAKtB,CAACL,MAAD,EAASC,SAAT,CALsB,CAAxB;AAQA,Q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\nimport PropTypes from 'prop-types';\nimport Draggable from '../draggable';\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 const [dragTo, setDragTo] = useState(null);\n const [dragFrom, setDragFrom] = useState(null);\n\n const dragStartHandler = useCallback(\n id => {\n setDragFrom(id);\n },\n [setDragFrom]\n );\n\n const dragOverHandler = useCallback(\n id => {\n if (dragTo === id) return;\n setDragTo(id);\n },\n [dragTo, setDragTo]\n );\n\n const dragLeaveHandler = useCallback(\n id => {\n setDragTo(null);\n },\n [setDragTo]\n );\n\n const dropHandler = useCallback(\n id => {\n if (onDrop && dragFrom) onDrop(dragFrom, id);\n\n setDragTo(null);\n setDragFrom(null);\n },\n [onDrop, setDragTo, setDragFrom, dragFrom]\n );\n\n if (loading) return <Loading />;\n\n const sectionsView = sections.map(section => (\n <Draggable\n key={section.id}\n id={section.id}\n dragging={dragTo === section.id}\n onDragStart={dragStartHandler}\n onDragOver={dragOverHandler}\n onDragLeave={dragLeaveHandler}\n onDrop={dropHandler}\n >\n <SetupSection {...section} key={section.id} />\n </Draggable>\n ));\n return <div>{sectionsView}</div>;\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"}
1
+ {"version":3,"sources":["../../../src/molecule/setup-sections/index.js"],"names":["Loading","style","loading","SetupSections","sections","onDrop","propTypes","PropTypes","arrayOf","shape","SetupSection","bool","func"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,OAAO,GAAG,mBACd;AAAK,EAAA,SAAS,EAAEC,eAAMC;AAAtB,gBACE,6BAAC,eAAD,OADF,CADF;;AAMA,MAAMC,aAAa,GAAG,CAAC;AAACC,EAAAA,QAAD;AAAWF,EAAAA,OAAX;AAAoBG,EAAAA;AAApB,CAAD,KAAiC;AACrD,MAAIH,OAAJ,EAAa,oBAAO,6BAAC,OAAD,OAAP;AAEb,sBACE,uDACE,6BAAC,sBAAD;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,EAAEG,mBAAUC,OAAV,CAAkBD,mBAAUE,KAAV,CAAgBC,sBAAaJ,SAA7B,CAAlB,CADc;AAExBJ,EAAAA,OAAO,EAAEK,mBAAUI,IAFK;AAGxBN,EAAAA,MAAM,EAAEE,mBAAUK;AAHM,CAA1B;eAMeT,a","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,111 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ var _default = {
6
+ props: {
7
+ title: 'Certification summary',
8
+ sections: [{
9
+ items: [{
10
+ type: 'mainElement',
11
+ title: 'Language',
12
+ value: '🇬🇧 English'
13
+ }, {
14
+ type: 'mainElement',
15
+ title: 'Name',
16
+ value: 'Marketing expert'
17
+ }]
18
+ }, {
19
+ title: 'Translation',
20
+ items: [{
21
+ type: 'text',
22
+ text: '🇫🇷 French'
23
+ }, {
24
+ type: 'text',
25
+ text: '🇪🇸 Spanish'
26
+ }, {
27
+ type: 'text',
28
+ text: '🇮🇹 Italian'
29
+ }]
30
+ }, {
31
+ title: 'Populations',
32
+ items: [{
33
+ type: 'text',
34
+ text: 'Population 2'
35
+ }],
36
+ counterText: '1 population'
37
+ }, {
38
+ title: 'Courses',
39
+ items: [{
40
+ type: 'content',
41
+ title: 'Marketing and online advertising Marketing and online advertising Marketing and online advertising Marketing and online advertising',
42
+ author: 'Author',
43
+ category: 'course',
44
+ label: 'Course'
45
+ }, {
46
+ type: 'content',
47
+ title: 'Social networks',
48
+ author: 'Author',
49
+ category: 'chapter',
50
+ label: "5' learning"
51
+ }, {
52
+ type: 'content',
53
+ title: 'Other title',
54
+ author: 'Author 2',
55
+ category: 'course',
56
+ label: 'Course'
57
+ }, {
58
+ type: 'content',
59
+ title: 'Social others',
60
+ author: 'Author XXX',
61
+ category: 'chapter',
62
+ label: "5' learning"
63
+ }, {
64
+ type: 'content',
65
+ title: 'Social others others',
66
+ author: 'Author XXX',
67
+ label: "5' learning",
68
+ category: 'chapter'
69
+ }, {
70
+ type: 'content',
71
+ title: 'Something about empowerment',
72
+ author: 'Author XXX',
73
+ label: 'course',
74
+ category: 'course'
75
+ }, {
76
+ type: 'content',
77
+ title: 'Be a better human being',
78
+ author: 'Author XXX',
79
+ label: "5' learning",
80
+ category: 'chapter'
81
+ }, {
82
+ type: 'content',
83
+ title: 'Stronger faster better',
84
+ author: 'Author XXX',
85
+ label: 'course',
86
+ category: 'course'
87
+ }, {
88
+ type: 'content',
89
+ title: 'Relativity beyond time',
90
+ author: 'Author XXX',
91
+ label: 'course',
92
+ category: 'course'
93
+ }, {
94
+ type: 'content',
95
+ title: 'Are you awake?',
96
+ author: 'Author XXX',
97
+ label: "5' learning",
98
+ category: 'chapter'
99
+ }],
100
+ counterText: '12 courses'
101
+ }],
102
+ action: {
103
+ icon: 'save',
104
+ text: 'Save in drafts',
105
+ 'aria-label': 'Save in drafts',
106
+ onClick: () => console.log('save')
107
+ }
108
+ }
109
+ };
110
+ exports.default = _default;
111
+ //# 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":";;;;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,EAAE;AAFR,OALK,EASL;AACEF,QAAAA,IAAI,EAAE,MADR;AAEEE,QAAAA,IAAI,EAAE;AAFR,OATK;AAFT,KAfQ,EAgCR;AACEL,MAAAA,KAAK,EAAE,aADT;AAEEE,MAAAA,KAAK,EAAE,CACL;AACEC,QAAAA,IAAI,EAAE,MADR;AAEEE,QAAAA,IAAI,EAAE;AAFR,OADK,CAFT;AAQEC,MAAAA,WAAW,EAAE;AARf,KAhCQ,EA0CR;AACEN,MAAAA,KAAK,EAAE,SADT;AAEEE,MAAAA,KAAK,EAAE,CACL;AACEC,QAAAA,IAAI,EAAE,SADR;AAEEH,QAAAA,KAAK,EACH,qIAHJ;AAIEO,QAAAA,MAAM,EAAE,QAJV;AAKEC,Q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K,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,C","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"}
@@ -12,6 +12,8 @@ var _default = _interopRequireDefault(require("./fixtures/default"));
12
12
 
13
13
  var _oneSection = _interopRequireDefault(require("./fixtures/one-section"));
14
14
 
15
+ var _organizeCourses = _interopRequireDefault(require("./fixtures/organize-courses"));
16
+
15
17
  var _tabletClosed = _interopRequireDefault(require("./fixtures/tablet-closed"));
16
18
 
17
19
  var _threeSections = _interopRequireDefault(require("./fixtures/three-sections"));
@@ -28,6 +30,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
28
30
  });
29
31
  (0, _ava.default)('Molecule › MoleculeWizardSummary › Default › should be rendered', _renderComponent.default, _.default, _default.default);
30
32
  (0, _ava.default)('Molecule › MoleculeWizardSummary › OneSection › should be rendered', _renderComponent.default, _.default, _oneSection.default);
33
+ (0, _ava.default)('Molecule › MoleculeWizardSummary › OrganizeCourses › should be rendered', _renderComponent.default, _.default, _organizeCourses.default);
31
34
  (0, _ava.default)('Molecule › MoleculeWizardSummary › TabletClosed › should be rendered', _renderComponent.default, _.default, _tabletClosed.default);
32
35
  (0, _ava.default)('Molecule › MoleculeWizardSummary › ThreeSections › should be rendered', _renderComponent.default, _.default, _threeSections.default);
33
36
  (0, _ava.default)('Molecule › MoleculeWizardSummary › TwoSections › should be rendered', _renderComponent.default, _.default, _twoSections.default);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/molecule/wizard-summary/test/fixtures.js"],"names":["t","pass","MoleculeWizardSummary","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureOneSection","fixtureTabletClosed","fixtureThreeSections","fixtureTwoSections"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,gEAAL,EAAuEA,CAAC,IAAI;AAC1EA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAsBC,SAA9B,EAAyC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACvDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,0DAAyDF,GAAI,mEAAtF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,iEAAL,EAAwEG,wBAAxE,EAA8FN,SAA9F,EAAqHO,gBAArH;AACA,kBAAK,oEAAL,EAA2ED,wBAA3E,EAAiGN,SAAjG,EAAwHQ,mBAAxH;AACA,kBAAK,sEAAL,EAA6EF,wBAA7E,EAAmGN,SAAnG,EAA0HS,qBAA1H;AACA,kBAAK,uEAAL,EAA8EH,wBAA9E,EAAoGN,SAApG,EAA2HU,sBAA3H;AACA,kBAAK,qEAAL,EAA4EJ,wBAA5E,EAAkGN,SAAlG,EAAyHW,oBAAzH","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 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 › 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"}
1
+ {"version":3,"sources":["../../../../src/molecule/wizard-summary/test/fixtures.js"],"names":["t","pass","MoleculeWizardSummary","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureOneSection","fixtureOrganizeCourses","fixtureTabletClosed","fixtureThreeSections","fixtureTwoSections"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,gEAAL,EAAuEA,CAAC,IAAI;AAC1EA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAsBC,SAA9B,EAAyC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACvDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,0DAAyDF,GAAI,mEAAtF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,iEAAL,EAAwEG,wBAAxE,EAA8FN,SAA9F,EAAqHO,gBAArH;AACA,kBAAK,oEAAL,EAA2ED,wBAA3E,EAAiGN,SAAjG,EAAwHQ,mBAAxH;AACA,kBAAK,yEAAL,EAAgFF,wBAAhF,EAAsGN,SAAtG,EAA6HS,wBAA7H;AACA,kBAAK,sEAAL,EAA6EH,wBAA7E,EAAmGN,SAAnG,EAA0HU,qBAA1H;AACA,kBAAK,uEAAL,EAA8EJ,wBAA9E,EAAoGN,SAApG,EAA2HW,sBAA3H;AACA,kBAAK,qEAAL,EAA4EL,wBAA5E,EAAkGN,SAAlG,EAAyHY,oBAAzH","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"}
@@ -25,6 +25,8 @@ var _searchAndChipsResults = _interopRequireDefault(require("../search-and-chips
25
25
 
26
26
  var _courseSelection = _interopRequireDefault(require("../course-selection"));
27
27
 
28
+ var _courseSections = _interopRequireDefault(require("../../molecule/course-sections"));
29
+
28
30
  var _style = _interopRequireDefault(require("./style.css"));
29
31
 
30
32
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -70,6 +72,9 @@ const buildForm = content => {
70
72
 
71
73
  case 'courses':
72
74
  return /*#__PURE__*/_react.default.createElement(_courseSelection.default, content);
75
+
76
+ case 'organize-courses':
77
+ return /*#__PURE__*/_react.default.createElement(_courseSections.default, content);
73
78
  }
74
79
  };
75
80
 
@@ -177,6 +182,8 @@ WizardContents.propTypes = process.env.NODE_ENV !== "production" ? {
177
182
  type: _propTypes.default.oneOf(['populations'])
178
183
  })), _propTypes.default.shape(_extends(_extends({}, _courseSelection.default.propTypes), {}, {
179
184
  type: _propTypes.default.oneOf(['courses'])
185
+ })), _propTypes.default.shape(_extends(_extends({}, _courseSections.default.propTypes), {}, {
186
+ type: _propTypes.default.oneOf(['organize-courses'])
180
187
  }))]),
181
188
  previousStep: _propTypes.default.shape({
182
189
  label: _propTypes.default.string,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/organism/wizard-contents/index.js"],"names":["buildHeader","wizardHeader","steps","title","onClick","buttonCloseIcon","size","icon","style","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","PropTypes","bool","shape","string","func","isRequired","WizardSteps","WizardSummary","oneOfType","BrandForm","oneOf","ContentTranslate","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BvC,IAAAA,IAAI,EAAEqC,mBAAUU,KAAV,CAAgB,CAAC,MAAD,EAAS,SAAT,CAAhB,CADkB;AAExBtC,IAAAA,KAAK,EAAE4B,mBAAUG,MAFO;AAGxBjD,IAAAA,OAAO,EAAE8C,mBAAUI;AAHK,GAAhB;AAhCe,CAA3B;eAuCetB,c","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":["buildHeader","wizardHeader","steps","title","onClick","buttonCloseIcon","size","icon","style","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","PropTypes","bool","shape","string","func","isRequired","WizardSteps","WizardSummary","oneOfType","BrandForm","oneOf","ContentTranslate","OrganismSearchAndChipsResults","CourseSelection","CourseSections"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,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,uDACE;AAAK,IAAA,SAAS,EAAEI,eAAMC;AAAtB,kBACE,6BAAC,2BAAD,EAAwBJ,eAAxB,CADF,eAEE;AAAK,IAAA,SAAS,EAAEG,eAAME,WAAtB;AAAmC,iBAAW;AAA9C,KACGP,KADH,CAFF,CADF,eAOE,6BAAC,oBAAD;AAAa,IAAA,KAAK,EAAED;AAApB,IAPF,CADF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D,CAAhB;AAFR,KAD2B,EAK3BV,mBAAUE,KAAV,uBACKS,4BAAiBZ,SADtB;AAEEpC,IAAAA,IAAI,EAAEqC,mBAAUU,KAAV,CAAgB,CAAC,WAAD,CAAhB;AAFR,KAL2B,EAS3BV,mBAAUE,KAAV,uBACKU,+BAA8Bb,SADnC;AAEEpC,IAAAA,IAAI,EAAEqC,mBAAUU,KAAV,CAAgB,CAAC,aAAD,CAAhB;AAFR,KAT2B,EAa3BV,mBAAUE,KAAV,uBACKW,yBAAgBd,SADrB;AAEEpC,IAAAA,IAAI,EAAEqC,mBAAUU,KAAV,CAAgB,CAAC,SAAD,CAAhB;AAFR,KAb2B,EAiB3BV,mBAAUE,KAAV,uBACKY,wBAAef,SADpB;AAEEpC,IAAAA,IAAI,EAAEqC,mBAAUU,KAAV,CAAgB,CAAC,kBAAD,CAAhB;AAFR,KAjB2B,CAApB,CAVgB;AAgCzBnC,EAAAA,YAAY,EAAEyB,mBAAUE,KAAV,CAAgB;AAC5B9B,IAAAA,KAAK,EAAE4B,mBAAUG,MADW;AAE5BjD,IAAAA,OAAO,EAAE8C,mBAAUI;AAFS,GAAhB,CAhCW;AAoCzB5B,EAAAA,QAAQ,EAAEwB,mBAAUE,KAAV,CAAgB;AACxBvC,IAAAA,IAAI,EAAEqC,mBAAUU,KAAV,CAAgB,CAAC,MAAD,EAAS,SAAT,CAAhB,CADkB;AAExBtC,IAAAA,KAAK,EAAE4B,mBAAUG,MAFO;AAGxBjD,IAAAA,OAAO,EAAE8C,mBAAUI;AAHK,GAAhB;AApCe,CAA3B;eA2CetB,c","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,54 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _organizeCourses = _interopRequireDefault(require("../../../../molecule/wizard-summary/test/fixtures/organize-courses"));
7
+
8
+ var _default2 = _interopRequireDefault(require("../../../../molecule/course-sections/test/fixtures/default"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
12
+ 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); }
13
+
14
+ var _default = {
15
+ props: {
16
+ isLoading: false,
17
+ wizardHeader: {
18
+ title: 'Create a new custom playlist',
19
+ onClick: () => console.log('Close')
20
+ },
21
+ steps: [{
22
+ title: 'General Informations',
23
+ done: true
24
+ }, {
25
+ title: 'Translations',
26
+ done: true
27
+ }, {
28
+ title: 'Assign populations',
29
+ done: true
30
+ }, {
31
+ title: 'Add courses',
32
+ done: true
33
+ }, {
34
+ title: 'Organize courses',
35
+ done: false,
36
+ current: true
37
+ }],
38
+ summary: _organizeCourses.default.props,
39
+ content: _extends(_extends({}, _default2.default.props), {}, {
40
+ type: 'organize-courses'
41
+ }),
42
+ previousStep: {
43
+ label: 'Previous Step',
44
+ onClick: () => console.log('Previous Step')
45
+ },
46
+ nextStep: {
47
+ type: 'publish',
48
+ label: 'Publish',
49
+ onClick: () => console.log('Next Step')
50
+ }
51
+ }
52
+ };
53
+ exports.default = _default;
54
+ //# sourceMappingURL=playlist-organize-courses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/organism/wizard-contents/test/fixtures/playlist-organize-courses.js"],"names":["props","isLoading","wizardHeader","title","onClick","console","log","steps","done","current","summary","wizardSummaryOrganizeCourses","content","organizeCoursesForm","type","previousStep","label","nextStep"],"mappings":";;;;;AACA;;AACA;;;;;;eAEe;AACbA,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,EAAEC,yBAA6BX,KA7BjC;AA8BLY,IAAAA,OAAO,wBACFC,kBAAoBb,KADlB;AAELc,MAAAA,IAAI,EAAE;AAFD,MA9BF;AAkCLC,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,eADK;AAEZZ,MAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,eAAZ;AAFH,KAlCT;AAsCLW,IAAAA,QAAQ,EAAE;AACRH,MAAAA,IAAI,EAAE,SADE;AAERE,MAAAA,KAAK,EAAE,SAFC;AAGRZ,MAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,WAAZ;AAHP;AAtCL;AADM,C","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"}
@@ -14,6 +14,8 @@ var _playlistGeneralSettingsCreate = _interopRequireDefault(require("./fixtures/
14
14
 
15
15
  var _playlistGeneralSettingsEdit = _interopRequireDefault(require("./fixtures/playlist-general-settings-edit"));
16
16
 
17
+ var _playlistOrganizeCourses = _interopRequireDefault(require("./fixtures/playlist-organize-courses"));
18
+
17
19
  var _playlistPopulationsCreate = _interopRequireDefault(require("./fixtures/playlist-populations-create"));
18
20
 
19
21
  var _playlistTranslateEdit = _interopRequireDefault(require("./fixtures/playlist-translate-edit"));
@@ -29,6 +31,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
29
31
  (0, _ava.default)('Organism › OrganismWizardContents › PlaylistAddCoursesCreate › should be rendered', _renderComponent.default, _.default, _playlistAddCoursesCreate.default);
30
32
  (0, _ava.default)('Organism › OrganismWizardContents › PlaylistGeneralSettingsCreate › should be rendered', _renderComponent.default, _.default, _playlistGeneralSettingsCreate.default);
31
33
  (0, _ava.default)('Organism › OrganismWizardContents › PlaylistGeneralSettingsEdit › should be rendered', _renderComponent.default, _.default, _playlistGeneralSettingsEdit.default);
34
+ (0, _ava.default)('Organism › OrganismWizardContents › PlaylistOrganizeCourses › should be rendered', _renderComponent.default, _.default, _playlistOrganizeCourses.default);
32
35
  (0, _ava.default)('Organism › OrganismWizardContents › PlaylistPopulationsCreate › should be rendered', _renderComponent.default, _.default, _playlistPopulationsCreate.default);
33
36
  (0, _ava.default)('Organism › OrganismWizardContents › PlaylistTranslateEdit › should be rendered', _renderComponent.default, _.default, _playlistTranslateEdit.default);
34
37
  //# sourceMappingURL=fixtures.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/organism/wizard-contents/test/fixtures.js"],"names":["t","pass","OrganismWizardContents","propTypes","value","key","not","undefined","renderComponentMacro","fixturePlaylistAddCoursesCreate","fixturePlaylistGeneralSettingsCreate","fixturePlaylistGeneralSettingsEdit","fixturePlaylistPopulationsCreate","fixturePlaylistTranslateEdit"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,iEAAL,EAAwEA,CAAC,IAAI;AAC3EA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAuBC,SAA/B,EAA0C,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACxDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,2DAA0DF,GAAI,mEAAvF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,mFAAL,EAA0FG,wBAA1F,EAAgHN,SAAhH,EAAwIO,iCAAxI;AACA,kBAAK,wFAAL,EAA+FD,wBAA/F,EAAqHN,SAArH,EAA6IQ,sCAA7I;AACA,kBAAK,sFAAL,EAA6FF,wBAA7F,EAAmHN,SAAnH,EAA2IS,oCAA3I;AACA,kBAAK,oFAAL,EAA2FH,wBAA3F,EAAiHN,SAAjH,EAAyIU,kCAAzI;AACA,kBAAK,gFAAL,EAAuFJ,wBAAvF,EAA6GN,SAA7G,EAAqIW,8BAArI","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport OrganismWizardContents from '..';\nimport fixturePlaylistAddCoursesCreate from './fixtures/playlist-add-courses-create';\nimport fixturePlaylistGeneralSettingsCreate from './fixtures/playlist-general-settings-create';\nimport fixturePlaylistGeneralSettingsEdit from './fixtures/playlist-general-settings-edit';\nimport fixturePlaylistPopulationsCreate from './fixtures/playlist-populations-create';\nimport fixturePlaylistTranslateEdit from './fixtures/playlist-translate-edit';\n\ntest('Organism › OrganismWizardContents > should have valid propTypes', t => {\n t.pass();\n forEach(OrganismWizardContents.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Organism.OrganismWizardContents.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Organism › OrganismWizardContents › PlaylistAddCoursesCreate › should be rendered', renderComponentMacro, OrganismWizardContents, fixturePlaylistAddCoursesCreate);\ntest('Organism › OrganismWizardContents › PlaylistGeneralSettingsCreate › should be rendered', renderComponentMacro, OrganismWizardContents, fixturePlaylistGeneralSettingsCreate);\ntest('Organism › OrganismWizardContents › PlaylistGeneralSettingsEdit › should be rendered', renderComponentMacro, OrganismWizardContents, fixturePlaylistGeneralSettingsEdit);\ntest('Organism › OrganismWizardContents › PlaylistPopulationsCreate › should be rendered', renderComponentMacro, OrganismWizardContents, fixturePlaylistPopulationsCreate);\ntest('Organism › OrganismWizardContents › PlaylistTranslateEdit › should be rendered', renderComponentMacro, OrganismWizardContents, fixturePlaylistTranslateEdit);\n"],"file":"fixtures.js"}
1
+ {"version":3,"sources":["../../../../src/organism/wizard-contents/test/fixtures.js"],"names":["t","pass","OrganismWizardContents","propTypes","value","key","not","undefined","renderComponentMacro","fixturePlaylistAddCoursesCreate","fixturePlaylistGeneralSettingsCreate","fixturePlaylistGeneralSettingsEdit","fixturePlaylistOrganizeCourses","fixturePlaylistPopulationsCreate","fixturePlaylistTranslateEdit"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,iEAAL,EAAwEA,CAAC,IAAI;AAC3EA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAuBC,SAA/B,EAA0C,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACxDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,2DAA0DF,GAAI,mEAAvF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,mFAAL,EAA0FG,wBAA1F,EAAgHN,SAAhH,EAAwIO,iCAAxI;AACA,kBAAK,wFAAL,EAA+FD,wBAA/F,EAAqHN,SAArH,EAA6IQ,sCAA7I;AACA,kBAAK,sFAAL,EAA6FF,wBAA7F,EAAmHN,SAAnH,EAA2IS,oCAA3I;AACA,kBAAK,kFAAL,EAAyFH,wBAAzF,EAA+GN,SAA/G,EAAuIU,gCAAvI;AACA,kBAAK,oFAAL,EAA2FJ,wBAA3F,EAAiHN,SAAjH,EAAyIW,kCAAzI;AACA,kBAAK,gFAAL,EAAuFL,wBAAvF,EAA6GN,SAA7G,EAAqIY,8BAArI","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport OrganismWizardContents from '..';\nimport fixturePlaylistAddCoursesCreate from './fixtures/playlist-add-courses-create';\nimport fixturePlaylistGeneralSettingsCreate from './fixtures/playlist-general-settings-create';\nimport fixturePlaylistGeneralSettingsEdit from './fixtures/playlist-general-settings-edit';\nimport fixturePlaylistOrganizeCourses from './fixtures/playlist-organize-courses';\nimport fixturePlaylistPopulationsCreate from './fixtures/playlist-populations-create';\nimport fixturePlaylistTranslateEdit from './fixtures/playlist-translate-edit';\n\ntest('Organism › OrganismWizardContents > should have valid propTypes', t => {\n t.pass();\n forEach(OrganismWizardContents.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Organism.OrganismWizardContents.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Organism › OrganismWizardContents › PlaylistAddCoursesCreate › should be rendered', renderComponentMacro, OrganismWizardContents, fixturePlaylistAddCoursesCreate);\ntest('Organism › OrganismWizardContents › PlaylistGeneralSettingsCreate › should be rendered', renderComponentMacro, OrganismWizardContents, fixturePlaylistGeneralSettingsCreate);\ntest('Organism › OrganismWizardContents › PlaylistGeneralSettingsEdit › should be rendered', renderComponentMacro, OrganismWizardContents, fixturePlaylistGeneralSettingsEdit);\ntest('Organism › OrganismWizardContents › PlaylistOrganizeCourses › should be rendered', renderComponentMacro, OrganismWizardContents, fixturePlaylistOrganizeCourses);\ntest('Organism › OrganismWizardContents › PlaylistPopulationsCreate › should be rendered', renderComponentMacro, OrganismWizardContents, fixturePlaylistPopulationsCreate);\ntest('Organism › OrganismWizardContents › PlaylistTranslateEdit › should be rendered', renderComponentMacro, OrganismWizardContents, fixturePlaylistTranslateEdit);\n"],"file":"fixtures.js"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _playlistOrganizeCourses = _interopRequireDefault(require("../../../../../organism/wizard-contents/test/fixtures/playlist-organize-courses"));
7
+
8
+ var _default2 = _interopRequireDefault(require("./default"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
12
+ 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); }
13
+
14
+ const {
15
+ header,
16
+ items
17
+ } = _default2.default.props;
18
+ const form = _playlistOrganizeCourses.default.props;
19
+ var _default = {
20
+ props: {
21
+ header,
22
+ items,
23
+ notifications: [],
24
+ content: _extends(_extends({}, form), {}, {
25
+ isLoading: false,
26
+ key: 'add-courses',
27
+ type: 'wizard'
28
+ })
29
+ }
30
+ };
31
+ exports.default = _default;
32
+ //# sourceMappingURL=wizard-organize-courses-playlist.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../src/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js"],"names":["header","items","headerAndMenu","props","form","WizardForm","notifications","content","isLoading","key","type"],"mappings":";;;;;AAAA;;AACA;;;;;;AAEA,MAAM;AAACA,EAAAA,MAAD;AAASC,EAAAA;AAAT,IAAkBC,kBAAcC,KAAtC;AACA,MAAMC,IAAI,GAAGC,iCAAWF,KAAxB;eAEe;AACbA,EAAAA,KAAK,EAAE;AACLH,IAAAA,MADK;AAELC,IAAAA,KAFK;AAGLK,IAAAA,aAAa,EAAE,EAHV;AAILC,IAAAA,OAAO,wBACFH,IADE;AAELI,MAAAA,SAAS,EAAE,KAFN;AAGLC,MAAAA,GAAG,EAAE,aAHA;AAILC,MAAAA,IAAI,EAAE;AAJD;AAJF;AADM,C","sourcesContent":["import WizardForm from '../../../../../organism/wizard-contents/test/fixtures/playlist-organize-courses';\nimport headerAndMenu from './default';\n\nconst {header, items} = headerAndMenu.props;\nconst form = WizardForm.props;\n\nexport default {\n props: {\n header,\n items,\n notifications: [],\n content: {\n ...form,\n isLoading: false,\n key: 'add-courses',\n type: 'wizard'\n }\n }\n};\n"],"file":"wizard-organize-courses-playlist.js"}
@@ -76,6 +76,8 @@ var _wizardFormCreatePlaylist = _interopRequireDefault(require("./fixtures/wizar
76
76
 
77
77
  var _wizardFormEditPlaylist = _interopRequireDefault(require("./fixtures/wizard-form-edit-playlist"));
78
78
 
79
+ var _wizardOrganizeCoursesPlaylist = _interopRequireDefault(require("./fixtures/wizard-organize-courses-playlist"));
80
+
79
81
  var _wizardPopulationsPlaylistWithPopin = _interopRequireDefault(require("./fixtures/wizard-populations-playlist-with-popin"));
80
82
 
81
83
  var _wizardPopulationsPlaylist = _interopRequireDefault(require("./fixtures/wizard-populations-playlist"));
@@ -124,6 +126,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
124
126
  (0, _ava.default)('TemplateBackOffice › TemplateBackOfficeBrandUpdate › WizardAddCoursesPlaylist › should be rendered', _renderComponent.default, _.default, _wizardAddCoursesPlaylist.default);
125
127
  (0, _ava.default)('TemplateBackOffice › TemplateBackOfficeBrandUpdate › WizardFormCreatePlaylist › should be rendered', _renderComponent.default, _.default, _wizardFormCreatePlaylist.default);
126
128
  (0, _ava.default)('TemplateBackOffice › TemplateBackOfficeBrandUpdate › WizardFormEditPlaylist › should be rendered', _renderComponent.default, _.default, _wizardFormEditPlaylist.default);
129
+ (0, _ava.default)('TemplateBackOffice › TemplateBackOfficeBrandUpdate › WizardOrganizeCoursesPlaylist › should be rendered', _renderComponent.default, _.default, _wizardOrganizeCoursesPlaylist.default);
127
130
  (0, _ava.default)('TemplateBackOffice › TemplateBackOfficeBrandUpdate › WizardPopulationsPlaylistWithPopin › should be rendered', _renderComponent.default, _.default, _wizardPopulationsPlaylistWithPopin.default);
128
131
  (0, _ava.default)('TemplateBackOffice › TemplateBackOfficeBrandUpdate › WizardPopulationsPlaylist › should be rendered', _renderComponent.default, _.default, _wizardPopulationsPlaylist.default);
129
132
  (0, _ava.default)('TemplateBackOffice › TemplateBackOfficeBrandUpdate › WizardTranslatePlaylist › should be rendered', _renderComponent.default, _.default, _wizardTranslatePlaylist.default);