@coorpacademy/components 11.32.42 → 11.32.44-alpha.55

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 (209) hide show
  1. package/es/atom/button-link/index.d.ts.map +1 -1
  2. package/es/atom/button-link/index.js +12 -6
  3. package/es/atom/button-link/index.js.map +1 -1
  4. package/es/atom/cta/index.js +2 -2
  5. package/es/atom/cta/index.js.map +1 -1
  6. package/es/atom/icon/index.d.ts +1 -0
  7. package/es/atom/icon/index.d.ts.map +1 -1
  8. package/es/atom/icon/index.js +8 -1
  9. package/es/atom/icon/index.js.map +1 -1
  10. package/es/atom/input-file-draggable/index.js +2 -2
  11. package/es/atom/input-file-draggable/index.js.map +1 -1
  12. package/es/atom/link/index.d.ts +2 -2
  13. package/es/atom/link/index.d.ts.map +1 -1
  14. package/es/atom/link/index.js +38 -46
  15. package/es/atom/link/index.js.map +1 -1
  16. package/es/atom/select-icon/index.d.ts +17 -0
  17. package/es/atom/select-icon/index.d.ts.map +1 -0
  18. package/es/atom/select-icon/index.js +93 -0
  19. package/es/atom/select-icon/index.js.map +1 -0
  20. package/es/atom/select-icon/style.css +73 -0
  21. package/es/molecule/banner/index.js +3 -3
  22. package/es/molecule/banner/index.js.map +1 -1
  23. package/es/molecule/certification-card/index.d.ts +4 -0
  24. package/es/molecule/certification-card/index.d.ts.map +1 -1
  25. package/es/molecule/certification-card/index.js +18 -12
  26. package/es/molecule/certification-card/index.js.map +1 -1
  27. package/es/molecule/certification-card/style.css +23 -7
  28. package/es/molecule/cm-popin/types.d.ts +14 -2
  29. package/es/molecule/cm-popin/types.d.ts.map +1 -1
  30. package/es/molecule/draggable-list/index.d.ts +12 -0
  31. package/es/molecule/progress-wrapper/index.d.ts.map +1 -1
  32. package/es/molecule/progress-wrapper/index.js +22 -12
  33. package/es/molecule/progress-wrapper/index.js.map +1 -1
  34. package/es/molecule/progress-wrapper/style.css +1 -0
  35. package/es/organism/accordion/coorp-manager/part/index.js +2 -1
  36. package/es/organism/accordion/coorp-manager/part/index.js.map +1 -1
  37. package/es/organism/brand-learning-priorities/index.d.ts +12 -0
  38. package/es/organism/list-item/index.d.ts +16 -1
  39. package/es/organism/list-item/index.d.ts.map +1 -1
  40. package/es/organism/list-item/index.js +58 -9
  41. package/es/organism/list-item/index.js.map +1 -1
  42. package/es/organism/list-item/style.css +25 -11
  43. package/es/organism/list-items/index.d.ts +12 -0
  44. package/es/organism/mooc-header/index.d.ts.map +1 -1
  45. package/es/organism/mooc-header/index.js +2 -3
  46. package/es/organism/mooc-header/index.js.map +1 -1
  47. package/es/organism/sidebar/index.d.ts +28 -3
  48. package/es/organism/sidebar/index.d.ts.map +1 -1
  49. package/es/organism/sidebar/index.js +7 -3
  50. package/es/organism/sidebar/index.js.map +1 -1
  51. package/es/template/app-player/loading/index.d.ts +14 -2
  52. package/es/template/app-player/player/index.d.ts +28 -4
  53. package/es/template/app-player/player/slides/index.d.ts +14 -2
  54. package/es/template/app-player/player/slides/index.d.ts.map +1 -1
  55. package/es/template/app-player/popin-correction/index.d.ts +18 -6
  56. package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
  57. package/es/template/app-player/popin-end/index.d.ts +16 -4
  58. package/es/template/app-player/popin-end/summary.d.ts +2 -2
  59. package/es/template/app-player/popin-header/index.d.ts +2 -2
  60. package/es/template/app-review/index.d.ts +14 -2
  61. package/es/template/app-review/index.d.ts.map +1 -1
  62. package/es/template/app-review/player/prop-types.d.ts +14 -2
  63. package/es/template/app-review/player/prop-types.d.ts.map +1 -1
  64. package/es/template/app-review/prop-types.d.ts +14 -2
  65. package/es/template/app-review/prop-types.d.ts.map +1 -1
  66. package/es/template/back-office/brand-update/index.d.ts +38 -2
  67. package/es/template/certification-detail/index.d.ts +2 -1
  68. package/es/template/certification-detail/index.d.ts.map +1 -1
  69. package/es/template/certification-detail/index.js +19 -6
  70. package/es/template/certification-detail/index.js.map +1 -1
  71. package/es/template/certification-detail/style.css +0 -1
  72. package/es/template/certifications/index.d.ts +6 -0
  73. package/es/template/certifications/index.d.ts.map +1 -1
  74. package/es/template/certifications/index.js +28 -12
  75. package/es/template/certifications/index.js.map +1 -1
  76. package/es/template/certifications/style.css +8 -1
  77. package/es/template/common/dashboard/index.d.ts +28 -4
  78. package/es/template/common/search-page/index.d.ts +14 -2
  79. package/es/template/external-course/index.d.ts +14 -2
  80. package/es/template/playlist-detail/index.d.ts.map +1 -1
  81. package/es/template/playlist-detail/index.js +15 -4
  82. package/es/template/playlist-detail/index.js.map +1 -1
  83. package/es/template/playlist-detail/style.css +0 -1
  84. package/es/template/skill-detail/index.d.ts +1 -1
  85. package/es/template/skill-detail/index.d.ts.map +1 -1
  86. package/es/template/skill-detail/index.js +20 -8
  87. package/es/template/skill-detail/index.js.map +1 -1
  88. package/es/variables/colors.d.ts +1 -0
  89. package/es/variables/colors.d.ts.map +1 -1
  90. package/es/variables/colors.js +1 -0
  91. package/es/variables/colors.js.map +1 -1
  92. package/lib/atom/button-link/index.d.ts.map +1 -1
  93. package/lib/atom/button-link/index.js +12 -6
  94. package/lib/atom/button-link/index.js.map +1 -1
  95. package/lib/atom/cta/index.js +2 -2
  96. package/lib/atom/cta/index.js.map +1 -1
  97. package/lib/atom/icon/index.d.ts +1 -0
  98. package/lib/atom/icon/index.d.ts.map +1 -1
  99. package/lib/atom/icon/index.js +12 -2
  100. package/lib/atom/icon/index.js.map +1 -1
  101. package/lib/atom/input-file-draggable/index.js.map +1 -1
  102. package/lib/atom/link/index.d.ts +2 -2
  103. package/lib/atom/link/index.d.ts.map +1 -1
  104. package/lib/atom/link/index.js +38 -47
  105. package/lib/atom/link/index.js.map +1 -1
  106. package/lib/atom/select-icon/index.d.ts +17 -0
  107. package/lib/atom/select-icon/index.d.ts.map +1 -0
  108. package/lib/atom/select-icon/index.js +111 -0
  109. package/lib/atom/select-icon/index.js.map +1 -0
  110. package/lib/atom/select-icon/style.css +73 -0
  111. package/lib/molecule/banner/index.js.map +1 -1
  112. package/lib/molecule/certification-card/index.d.ts +4 -0
  113. package/lib/molecule/certification-card/index.d.ts.map +1 -1
  114. package/lib/molecule/certification-card/index.js +18 -12
  115. package/lib/molecule/certification-card/index.js.map +1 -1
  116. package/lib/molecule/certification-card/style.css +23 -7
  117. package/lib/molecule/cm-popin/types.d.ts +14 -2
  118. package/lib/molecule/cm-popin/types.d.ts.map +1 -1
  119. package/lib/molecule/draggable-list/index.d.ts +12 -0
  120. package/lib/molecule/progress-wrapper/index.d.ts.map +1 -1
  121. package/lib/molecule/progress-wrapper/index.js +26 -13
  122. package/lib/molecule/progress-wrapper/index.js.map +1 -1
  123. package/lib/molecule/progress-wrapper/style.css +1 -0
  124. package/lib/organism/accordion/coorp-manager/part/index.js +3 -1
  125. package/lib/organism/accordion/coorp-manager/part/index.js.map +1 -1
  126. package/lib/organism/brand-learning-priorities/index.d.ts +12 -0
  127. package/lib/organism/list-item/index.d.ts +16 -1
  128. package/lib/organism/list-item/index.d.ts.map +1 -1
  129. package/lib/organism/list-item/index.js +56 -5
  130. package/lib/organism/list-item/index.js.map +1 -1
  131. package/lib/organism/list-item/style.css +25 -11
  132. package/lib/organism/list-items/index.d.ts +12 -0
  133. package/lib/organism/mooc-header/index.d.ts.map +1 -1
  134. package/lib/organism/mooc-header/index.js +2 -3
  135. package/lib/organism/mooc-header/index.js.map +1 -1
  136. package/lib/organism/sidebar/index.d.ts +28 -3
  137. package/lib/organism/sidebar/index.d.ts.map +1 -1
  138. package/lib/organism/sidebar/index.js +7 -3
  139. package/lib/organism/sidebar/index.js.map +1 -1
  140. package/lib/template/app-player/loading/index.d.ts +14 -2
  141. package/lib/template/app-player/player/index.d.ts +28 -4
  142. package/lib/template/app-player/player/slides/index.d.ts +14 -2
  143. package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
  144. package/lib/template/app-player/popin-correction/index.d.ts +18 -6
  145. package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
  146. package/lib/template/app-player/popin-end/index.d.ts +16 -4
  147. package/lib/template/app-player/popin-end/summary.d.ts +2 -2
  148. package/lib/template/app-player/popin-header/index.d.ts +2 -2
  149. package/lib/template/app-review/index.d.ts +14 -2
  150. package/lib/template/app-review/index.d.ts.map +1 -1
  151. package/lib/template/app-review/player/prop-types.d.ts +14 -2
  152. package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
  153. package/lib/template/app-review/prop-types.d.ts +14 -2
  154. package/lib/template/app-review/prop-types.d.ts.map +1 -1
  155. package/lib/template/back-office/brand-update/index.d.ts +38 -2
  156. package/lib/template/certification-detail/index.d.ts +2 -1
  157. package/lib/template/certification-detail/index.d.ts.map +1 -1
  158. package/lib/template/certification-detail/index.js +18 -6
  159. package/lib/template/certification-detail/index.js.map +1 -1
  160. package/lib/template/certification-detail/style.css +0 -1
  161. package/lib/template/certifications/index.d.ts +6 -0
  162. package/lib/template/certifications/index.d.ts.map +1 -1
  163. package/lib/template/certifications/index.js +30 -14
  164. package/lib/template/certifications/index.js.map +1 -1
  165. package/lib/template/certifications/style.css +8 -1
  166. package/lib/template/common/dashboard/index.d.ts +28 -4
  167. package/lib/template/common/search-page/index.d.ts +14 -2
  168. package/lib/template/external-course/index.d.ts +14 -2
  169. package/lib/template/playlist-detail/index.d.ts.map +1 -1
  170. package/lib/template/playlist-detail/index.js +14 -4
  171. package/lib/template/playlist-detail/index.js.map +1 -1
  172. package/lib/template/playlist-detail/style.css +0 -1
  173. package/lib/template/skill-detail/index.d.ts +1 -1
  174. package/lib/template/skill-detail/index.d.ts.map +1 -1
  175. package/lib/template/skill-detail/index.js +19 -7
  176. package/lib/template/skill-detail/index.js.map +1 -1
  177. package/lib/variables/colors.d.ts +1 -0
  178. package/lib/variables/colors.d.ts.map +1 -1
  179. package/lib/variables/colors.js +1 -0
  180. package/lib/variables/colors.js.map +1 -1
  181. package/locales/bs/global.json +10 -8
  182. package/locales/cs/global.json +10 -8
  183. package/locales/de/global.json +10 -8
  184. package/locales/en/global.json +3 -1
  185. package/locales/es/global.json +10 -8
  186. package/locales/et/global.json +10 -8
  187. package/locales/fi/global.json +10 -8
  188. package/locales/fr/global.json +10 -8
  189. package/locales/hr/global.json +10 -8
  190. package/locales/hu/global.json +10 -8
  191. package/locales/hy/global.json +10 -8
  192. package/locales/it/global.json +10 -8
  193. package/locales/ja/global.json +10 -8
  194. package/locales/ko/global.json +10 -8
  195. package/locales/nl/global.json +10 -8
  196. package/locales/pl/global.json +10 -8
  197. package/locales/pt/global.json +10 -8
  198. package/locales/ro/global.json +10 -8
  199. package/locales/ru/global.json +10 -8
  200. package/locales/sk/global.json +10 -8
  201. package/locales/sl/global.json +10 -8
  202. package/locales/sv/global.json +10 -8
  203. package/locales/tl/global.json +8 -6
  204. package/locales/tr/global.json +10 -8
  205. package/locales/uk/global.json +10 -8
  206. package/locales/vi/global.json +10 -8
  207. package/locales/zh/global.json +10 -8
  208. package/locales/zh_TW/global.json +10 -8
  209. package/package.json +2 -2
@@ -5,6 +5,9 @@ declare namespace Certifications {
5
5
  const translate: PropTypes.Requireable<(...args: any[]) => any>;
6
6
  }
7
7
  namespace propTypes {
8
+ const title: PropTypes.Requireable<string>;
9
+ const subtitle: PropTypes.Requireable<string>;
10
+ const tag: PropTypes.Requireable<string>;
8
11
  const certifications: PropTypes.Requireable<(PropTypes.InferProps<{
9
12
  label: PropTypes.Requireable<string>;
10
13
  goal: PropTypes.Requireable<PropTypes.InferProps<{
@@ -16,6 +19,9 @@ declare namespace Certifications {
16
19
  progress: PropTypes.Requireable<number>;
17
20
  imgUrl: PropTypes.Requireable<string>;
18
21
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
22
+ locales: PropTypes.Requireable<PropTypes.InferProps<{
23
+ conditionDescriptionProgress: PropTypes.Requireable<string>;
24
+ }>>;
19
25
  }> | null | undefined)[]>;
20
26
  const sorting: PropTypes.Requireable<PropTypes.InferProps<{
21
27
  title: PropTypes.Requireable<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/certifications/index.js"],"names":[],"mappings":";AASA,uEAoEC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/certifications/index.js"],"names":[],"mappings":";AAUA,uEAoEC"}
@@ -3,6 +3,8 @@
3
3
  exports.__esModule = true;
4
4
  exports.default = void 0;
5
5
 
6
+ var _map2 = _interopRequireDefault(require("lodash/fp/map"));
7
+
6
8
  var _react = _interopRequireWildcard(require("react"));
7
9
 
8
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -19,16 +21,19 @@ var _certificationCard = _interopRequireDefault(require("../../molecule/certific
19
21
 
20
22
  var _style = _interopRequireDefault(require("./style.css"));
21
23
 
22
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
-
24
24
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
25
 
26
26
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
27
27
 
28
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
+
28
30
  function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
29
31
 
30
32
  const Certifications = (props, context) => {
31
33
  const {
34
+ title,
35
+ subtitle,
36
+ tag,
32
37
  certifications,
33
38
  sorting
34
39
  } = props;
@@ -45,11 +50,13 @@ const Certifications = (props, context) => {
45
50
  setShowCompleted(!showCompleted);
46
51
  }, [showCompleted, setShowCompleted]);
47
52
  return /*#__PURE__*/_react.default.createElement("div", {
53
+ className: _style.default.backgroudnContainer
54
+ }, /*#__PURE__*/_react.default.createElement("div", {
48
55
  className: _style.default.container,
49
56
  "data-name": "Certifications"
50
57
  }, /*#__PURE__*/_react.default.createElement(_title.default, {
51
- title: translate('certificates'),
52
- subtitle: translate('certificates_subtitle'),
58
+ title: title,
59
+ subtitle: subtitle,
53
60
  type: "form-group",
54
61
  titleSize: "standard-light-weight",
55
62
  subtitleSize: "standard-without-margin",
@@ -63,7 +70,7 @@ const Certifications = (props, context) => {
63
70
  className: _style.default.sortSectionWrapper
64
71
  }, /*#__PURE__*/_react.default.createElement("div", {
65
72
  className: _style.default.certificatesCount
66
- }, `${certifications.length} ${translate('certificate(s)')}`), /*#__PURE__*/_react.default.createElement("div", {
73
+ }, `${certifications.length} ${title}`), /*#__PURE__*/_react.default.createElement("div", {
67
74
  className: _style.default.sortSection
68
75
  }, /*#__PURE__*/_react.default.createElement(_inputSwitch.default, {
69
76
  id: 'show-completed-courses-switch',
@@ -77,21 +84,27 @@ const Certifications = (props, context) => {
77
84
  className: _style.default.sortWrapper
78
85
  }, translate('sort_by'), sortView) : null)), /*#__PURE__*/_react.default.createElement("div", {
79
86
  className: _style.default.certificateList
80
- }, certifications.map(certification => {
81
- if (!showCompleted && certification.progress === 100) {
82
- return null;
83
- }
84
-
87
+ }, (0, _map2.default)(certification => {
88
+ const {
89
+ label,
90
+ progress
91
+ } = certification;
92
+ if (!showCompleted && progress === 100) return null;
85
93
  return /*#__PURE__*/_react.default.createElement("div", {
86
- key: certification.label
87
- }, /*#__PURE__*/_react.default.createElement(_certificationCard.default, certification));
88
- })));
94
+ key: label
95
+ }, /*#__PURE__*/_react.default.createElement(_certificationCard.default, _extends({}, certification, {
96
+ tag: tag
97
+ })));
98
+ }, certifications))));
89
99
  };
90
100
 
91
101
  Certifications.contextTypes = {
92
102
  translate: _provider.default.childContextTypes.translate
93
103
  };
94
104
  Certifications.propTypes = process.env.NODE_ENV !== "production" ? {
105
+ title: _propTypes.default.string,
106
+ subtitle: _propTypes.default.string,
107
+ tag: _propTypes.default.string,
95
108
  certifications: _propTypes.default.arrayOf(_propTypes.default.shape({
96
109
  label: _propTypes.default.string,
97
110
  goal: _propTypes.default.shape({
@@ -102,7 +115,10 @@ Certifications.propTypes = process.env.NODE_ENV !== "production" ? {
102
115
  }),
103
116
  progress: _propTypes.default.number,
104
117
  imgUrl: _propTypes.default.string,
105
- onClick: _propTypes.default.func
118
+ onClick: _propTypes.default.func,
119
+ locales: _propTypes.default.shape({
120
+ conditionDescriptionProgress: _propTypes.default.string
121
+ })
106
122
  })),
107
123
  sorting: _propTypes.default.shape(_select.default.propTypes)
108
124
  } : {};
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Certifications","props","context","certifications","sorting","translate","showCompleted","setShowCompleted","useState","sortView","undefined","handleShowCompletedToggle","useCallback","style","container","iconName","iconColor","borderRadius","backgroundColor","sortSectionWrapper","certificatesCount","length","sortSection","sortWrapper","certificateList","map","certification","progress","label","contextTypes","Provider","childContextTypes","propTypes","PropTypes","arrayOf","shape","string","goal","title","condition","nbDone","number","imgUrl","onClick","func","Select"],"sources":["../../../src/template/certifications/index.js"],"sourcesContent":["import React, {useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport Provider from '../../atom/provider';\nimport Title from '../../atom/title';\nimport Select from '../../atom/select';\nimport InputSwitch from '../../atom/input-switch';\nimport CertificationCard from '../../molecule/certification-card';\nimport style from './style.css';\n\nconst Certifications = (props, context) => {\n const {certifications, sorting} = props;\n const {translate} = context;\n\n const [showCompleted, setShowCompleted] = useState(true);\n\n const sortView =\n sorting !== undefined ? (\n <div data-name=\"choice\">\n <Select {...sorting} aria-label=\"All courses sort\" />\n </div>\n ) : null;\n\n const handleShowCompletedToggle = useCallback(() => {\n setShowCompleted(!showCompleted);\n }, [showCompleted, setShowCompleted]);\n\n return (\n <div className={style.container} data-name=\"Certifications\">\n <Title\n title={translate('certificates')}\n subtitle={translate('certificates_subtitle')}\n type=\"form-group\"\n titleSize=\"standard-light-weight\"\n subtitleSize=\"standard-without-margin\"\n icon={{\n iconName: 'wreath-laurel',\n iconColor: '#B87A00',\n borderRadius: '12px',\n backgroundColor: '#FFEECC'\n }}\n />\n <div className={style.sortSectionWrapper}>\n <div className={style.certificatesCount}>\n {`${certifications.length} ${translate('certificate(s)')}`}\n </div>\n <div className={style.sortSection}>\n <InputSwitch\n id={'show-completed-courses-switch'}\n type=\"switch\"\n name={translate('show_completed')}\n title={translate('show_completed')}\n aria-label={'Show completed courses aria label'}\n value={showCompleted}\n onChange={handleShowCompletedToggle}\n />\n {sorting ? (\n <div className={style.sortWrapper}>\n {translate('sort_by')}\n {sortView}\n </div>\n ) : null}\n </div>\n </div>\n <div className={style.certificateList}>\n {certifications.map(certification => {\n if (!showCompleted && certification.progress === 100) {\n return null;\n }\n return (\n <div key={certification.label}>\n <CertificationCard {...certification} />\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n\nCertifications.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nCertifications.propTypes = {\n certifications: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n goal: PropTypes.shape({\n title: PropTypes.string,\n condition: PropTypes.shape({\n nbDone: PropTypes.number\n })\n }),\n progress: PropTypes.number,\n imgUrl: PropTypes.string,\n onClick: PropTypes.func\n })\n ),\n sorting: PropTypes.shape(Select.propTypes)\n};\n\nexport default Certifications;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA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6B,kBAAA,CAAUE,KAAV,CAAgBU,eAAA,CAAOb,SAAvB;AAfgB,CAA3B;eAkBehC,c"}
1
+ {"version":3,"file":"index.js","names":["Certifications","props","context","title","subtitle","tag","certifications","sorting","translate","showCompleted","setShowCompleted","useState","sortView","undefined","handleShowCompletedToggle","useCallback","style","backgroudnContainer","container","iconName","iconColor","borderRadius","backgroundColor","sortSectionWrapper","certificatesCount","length","sortSection","sortWrapper","certificateList","certification","label","progress","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","arrayOf","shape","goal","condition","nbDone","number","imgUrl","onClick","func","locales","conditionDescriptionProgress","Select"],"sources":["../../../src/template/certifications/index.js"],"sourcesContent":["import React, {useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {map} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Title from '../../atom/title';\nimport Select from '../../atom/select';\nimport InputSwitch from '../../atom/input-switch';\nimport CertificationCard from '../../molecule/certification-card';\nimport style from './style.css';\n\nconst Certifications = (props, context) => {\n const {title, subtitle, tag, certifications, sorting} = props;\n const {translate} = context;\n\n const [showCompleted, setShowCompleted] = useState(true);\n\n const sortView =\n sorting !== undefined ? (\n <div data-name=\"choice\">\n <Select {...sorting} aria-label=\"All courses sort\" />\n </div>\n ) : null;\n\n const handleShowCompletedToggle = useCallback(() => {\n setShowCompleted(!showCompleted);\n }, [showCompleted, setShowCompleted]);\n\n return (\n <div className={style.backgroudnContainer}>\n <div className={style.container} data-name=\"Certifications\">\n <Title\n title={title}\n subtitle={subtitle}\n type=\"form-group\"\n titleSize=\"standard-light-weight\"\n subtitleSize=\"standard-without-margin\"\n icon={{\n iconName: 'wreath-laurel',\n iconColor: '#B87A00',\n borderRadius: '12px',\n backgroundColor: '#FFEECC'\n }}\n />\n <div className={style.sortSectionWrapper}>\n <div className={style.certificatesCount}>{`${certifications.length} ${title}`}</div>\n <div className={style.sortSection}>\n <InputSwitch\n id={'show-completed-courses-switch'}\n type=\"switch\"\n name={translate('show_completed')}\n title={translate('show_completed')}\n aria-label={'Show completed courses aria label'}\n value={showCompleted}\n onChange={handleShowCompletedToggle}\n />\n {sorting ? (\n <div className={style.sortWrapper}>\n {translate('sort_by')}\n {sortView}\n </div>\n ) : null}\n </div>\n </div>\n <div className={style.certificateList}>\n {map(certification => {\n const {label, progress} = certification;\n if (!showCompleted && progress === 100) return null;\n\n return (\n <div key={label}>\n <CertificationCard {...certification} tag={tag} />\n </div>\n );\n }, certifications)}\n </div>\n </div>\n </div>\n );\n};\n\nCertifications.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nCertifications.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n tag: PropTypes.string,\n certifications: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n goal: PropTypes.shape({\n title: PropTypes.string,\n condition: PropTypes.shape({\n nbDone: PropTypes.number\n })\n }),\n progress: PropTypes.number,\n imgUrl: PropTypes.string,\n onClick: PropTypes.func,\n locales: PropTypes.shape({\n conditionDescriptionProgress: PropTypes.string\n })\n })\n ),\n sorting: PropTypes.shape(Select.propTypes)\n};\n\nexport default Certifications;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,cAAc,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACzC,MAAM;IAACC,KAAD;IAAQC,QAAR;IAAkBC,GAAlB;IAAuBC,cAAvB;IAAuCC;EAAvC,IAAkDN,KAAxD;EACA,MAAM;IAACO;EAAD,IAAcN,OAApB;EAEA,MAAM,CAACO,aAAD,EAAgBC,gBAAhB,IAAoC,IAAAC,eAAA,EAAS,IAAT,CAA1C;EAEA,MAAMC,QAAQ,GACZL,OAAO,KAAKM,SAAZ,gBACE;IAAK,aAAU;EAAf,gBACE,6BAAC,eAAD,eAAYN,OAAZ;IAAqB,cAAW;EAAhC,GADF,CADF,GAII,IALN;EAOA,MAAMO,yBAAyB,GAAG,IAAAC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 from colors;
10
+ @value white from colors;
11
+
12
+ .backgroudnContainer {
13
+ background-color: white;
14
+ min-height: 100%;
15
+ width: 100%;
16
+ }
10
17
 
11
18
  .container {
12
19
  font-family: "Gilroy";
13
20
  font-style: normal;
14
21
  max-width: 1080px;
15
22
  margin: auto;
16
- margin-top: 48px;
23
+ padding-top: 48px;
17
24
  }
18
25
 
19
26
  .sortSection {
@@ -141,6 +141,7 @@ declare namespace Dashboard {
141
141
  items: PropTypes.Requireable<(PropTypes.InferProps<{
142
142
  title: PropTypes.Validator<string>;
143
143
  subtitle: PropTypes.Requireable<string>;
144
+ provider: PropTypes.Requireable<string>;
144
145
  selected: PropTypes.Requireable<boolean>;
145
146
  selectedColor: PropTypes.Requireable<string>;
146
147
  dataColumns: PropTypes.Requireable<(PropTypes.InferProps<{
@@ -193,6 +194,17 @@ declare namespace Dashboard {
193
194
  'aria-label': PropTypes.Requireable<string>;
194
195
  contentType: PropTypes.Requireable<string>;
195
196
  id: PropTypes.Requireable<string>;
197
+ leftIcon: PropTypes.Requireable<PropTypes.InferProps<{
198
+ iconName: PropTypes.Requireable<string>;
199
+ iconColor: PropTypes.Requireable<string>;
200
+ backgroundColor: PropTypes.Requireable<string>;
201
+ borderRadius: PropTypes.Requireable<string>;
202
+ preset: PropTypes.Requireable<string>;
203
+ gradientBackground: PropTypes.Requireable<boolean>;
204
+ size: PropTypes.Requireable<number>;
205
+ wrapperSize: PropTypes.Requireable<number>;
206
+ }>>;
207
+ editAsIcon: PropTypes.Requireable<boolean>;
196
208
  }> | null | undefined)[]>;
197
209
  type: PropTypes.Requireable<string>;
198
210
  itemType: PropTypes.Requireable<string>;
@@ -290,11 +302,11 @@ declare namespace Dashboard {
290
302
  'aria-label': PropTypes.Requireable<string>;
291
303
  title: PropTypes.Requireable<string>;
292
304
  target: PropTypes.Requireable<string>;
293
- skinHover: PropTypes.Requireable<boolean>;
294
305
  hoverColor: PropTypes.Requireable<string>;
306
+ hoverBackgroundColor: PropTypes.Requireable<string>;
295
307
  download: PropTypes.Requireable<boolean>;
296
308
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
297
- onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
309
+ onMouseOver: PropTypes.Requireable<(...args: any[]) => any>;
298
310
  onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
299
311
  useButtonTag: PropTypes.Requireable<boolean>;
300
312
  style: PropTypes.Requireable<PropTypes.InferProps<{}>>;
@@ -438,6 +450,7 @@ declare namespace Dashboard {
438
450
  items: PropTypes.Requireable<(PropTypes.InferProps<{
439
451
  title: PropTypes.Validator<string>;
440
452
  subtitle: PropTypes.Requireable<string>;
453
+ provider: PropTypes.Requireable<string>;
441
454
  selected: PropTypes.Requireable<boolean>;
442
455
  selectedColor: PropTypes.Requireable<string>;
443
456
  dataColumns: PropTypes.Requireable<(PropTypes.InferProps<{
@@ -490,6 +503,17 @@ declare namespace Dashboard {
490
503
  'aria-label': PropTypes.Requireable<string>;
491
504
  contentType: PropTypes.Requireable<string>;
492
505
  id: PropTypes.Requireable<string>;
506
+ leftIcon: PropTypes.Requireable<PropTypes.InferProps<{
507
+ iconName: PropTypes.Requireable<string>;
508
+ iconColor: PropTypes.Requireable<string>;
509
+ backgroundColor: PropTypes.Requireable<string>;
510
+ borderRadius: PropTypes.Requireable<string>;
511
+ preset: PropTypes.Requireable<string>;
512
+ gradientBackground: PropTypes.Requireable<boolean>;
513
+ size: PropTypes.Requireable<number>;
514
+ wrapperSize: PropTypes.Requireable<number>;
515
+ }>>;
516
+ editAsIcon: PropTypes.Requireable<boolean>;
493
517
  }> | null | undefined)[]>;
494
518
  type: PropTypes.Requireable<string>;
495
519
  itemType: PropTypes.Requireable<string>;
@@ -587,11 +611,11 @@ declare namespace Dashboard {
587
611
  'aria-label': PropTypes.Requireable<string>;
588
612
  title: PropTypes.Requireable<string>;
589
613
  target: PropTypes.Requireable<string>;
590
- skinHover: PropTypes.Requireable<boolean>;
591
614
  hoverColor: PropTypes.Requireable<string>;
615
+ hoverBackgroundColor: PropTypes.Requireable<string>;
592
616
  download: PropTypes.Requireable<boolean>;
593
617
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
594
- onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
618
+ onMouseOver: PropTypes.Requireable<(...args: any[]) => any>;
595
619
  onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
596
620
  useButtonTag: PropTypes.Requireable<boolean>;
597
621
  style: PropTypes.Requireable<PropTypes.InferProps<{}>>;
@@ -322,6 +322,7 @@ declare namespace SearchPage {
322
322
  items: PropTypes.Requireable<(PropTypes.InferProps<{
323
323
  title: PropTypes.Validator<string>;
324
324
  subtitle: PropTypes.Requireable<string>;
325
+ provider: PropTypes.Requireable<string>;
325
326
  selected: PropTypes.Requireable<boolean>;
326
327
  selectedColor: PropTypes.Requireable<string>;
327
328
  dataColumns: PropTypes.Requireable<(PropTypes.InferProps<{
@@ -374,6 +375,17 @@ declare namespace SearchPage {
374
375
  'aria-label': PropTypes.Requireable<string>;
375
376
  contentType: PropTypes.Requireable<string>;
376
377
  id: PropTypes.Requireable<string>;
378
+ leftIcon: PropTypes.Requireable<PropTypes.InferProps<{
379
+ iconName: PropTypes.Requireable<string>;
380
+ iconColor: PropTypes.Requireable<string>;
381
+ backgroundColor: PropTypes.Requireable<string>;
382
+ borderRadius: PropTypes.Requireable<string>;
383
+ preset: PropTypes.Requireable<string>;
384
+ gradientBackground: PropTypes.Requireable<boolean>;
385
+ size: PropTypes.Requireable<number>;
386
+ wrapperSize: PropTypes.Requireable<number>;
387
+ }>>;
388
+ editAsIcon: PropTypes.Requireable<boolean>;
377
389
  }> | null | undefined)[]>;
378
390
  type: PropTypes.Requireable<string>;
379
391
  itemType: PropTypes.Requireable<string>;
@@ -471,11 +483,11 @@ declare namespace SearchPage {
471
483
  'aria-label': PropTypes.Requireable<string>;
472
484
  title: PropTypes.Requireable<string>;
473
485
  target: PropTypes.Requireable<string>;
474
- skinHover: PropTypes.Requireable<boolean>;
475
486
  hoverColor: PropTypes.Requireable<string>;
487
+ hoverBackgroundColor: PropTypes.Requireable<string>;
476
488
  download: PropTypes.Requireable<boolean>;
477
489
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
478
- onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
490
+ onMouseOver: PropTypes.Requireable<(...args: any[]) => any>;
479
491
  onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
480
492
  useButtonTag: PropTypes.Requireable<boolean>;
481
493
  style: PropTypes.Requireable<PropTypes.InferProps<{}>>;
@@ -159,6 +159,7 @@ declare namespace ExternalCourse {
159
159
  items: PropTypes.Requireable<(PropTypes.InferProps<{
160
160
  title: PropTypes.Validator<string>;
161
161
  subtitle: PropTypes.Requireable<string>;
162
+ provider: PropTypes.Requireable<string>;
162
163
  selected: PropTypes.Requireable<boolean>;
163
164
  selectedColor: PropTypes.Requireable<string>;
164
165
  dataColumns: PropTypes.Requireable<(PropTypes.InferProps<{
@@ -211,6 +212,17 @@ declare namespace ExternalCourse {
211
212
  'aria-label': PropTypes.Requireable<string>;
212
213
  contentType: PropTypes.Requireable<string>;
213
214
  id: PropTypes.Requireable<string>;
215
+ leftIcon: PropTypes.Requireable<PropTypes.InferProps<{
216
+ iconName: PropTypes.Requireable<string>;
217
+ iconColor: PropTypes.Requireable<string>;
218
+ backgroundColor: PropTypes.Requireable<string>;
219
+ borderRadius: PropTypes.Requireable<string>;
220
+ preset: PropTypes.Requireable<string>;
221
+ gradientBackground: PropTypes.Requireable<boolean>;
222
+ size: PropTypes.Requireable<number>;
223
+ wrapperSize: PropTypes.Requireable<number>;
224
+ }>>;
225
+ editAsIcon: PropTypes.Requireable<boolean>;
214
226
  }> | null | undefined)[]>;
215
227
  type: PropTypes.Requireable<string>;
216
228
  itemType: PropTypes.Requireable<string>;
@@ -308,11 +320,11 @@ declare namespace ExternalCourse {
308
320
  'aria-label': PropTypes.Requireable<string>;
309
321
  title: PropTypes.Requireable<string>;
310
322
  target: PropTypes.Requireable<string>;
311
- skinHover: PropTypes.Requireable<boolean>;
312
323
  hoverColor: PropTypes.Requireable<string>;
324
+ hoverBackgroundColor: PropTypes.Requireable<string>;
313
325
  download: PropTypes.Requireable<boolean>;
314
326
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
315
- onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
327
+ onMouseOver: PropTypes.Requireable<(...args: any[]) => any>;
316
328
  onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
317
329
  useButtonTag: PropTypes.Requireable<boolean>;
318
330
  style: PropTypes.Requireable<PropTypes.InferProps<{}>>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/playlist-detail/index.js"],"names":[],"mappings":";AAkBA,uEAyEC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/playlist-detail/index.js"],"names":[],"mappings":";AAgBA,uEAqFC"}
@@ -39,8 +39,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
39
39
 
40
40
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
41
41
 
42
- const DESCRIPTION_BREAKPOINT = 382;
43
-
44
42
  const PlaylistDetail = (props, context) => {
45
43
  const {
46
44
  title,
@@ -54,13 +52,25 @@ const PlaylistDetail = (props, context) => {
54
52
  onBackClick,
55
53
  onContinueLearningClick
56
54
  } = props;
55
+ const descriptionRef = (0, _react.useRef)(null);
57
56
  const {
58
57
  translate
59
58
  } = context;
59
+ const [isDescriptionTruncated, setIsDescriptionTruncated] = (0, _react.useState)(false);
60
60
  const [showMore, setShowMore] = (0, _react.useState)(false);
61
61
  const handleShowMore = (0, _react.useCallback)(() => setShowMore(!showMore), [setShowMore, showMore]);
62
+ (0, _react.useEffect)(() => {
63
+ if (descriptionRef.current) {
64
+ const {
65
+ clientHeight = 0,
66
+ scrollHeight = 0
67
+ } = descriptionRef.current;
68
+ setIsDescriptionTruncated(scrollHeight > clientHeight);
69
+ }
70
+ }, [description]);
62
71
  const Description = (0, _react.useCallback)(() => {
63
72
  return /*#__PURE__*/_react.default.createElement("div", {
73
+ ref: descriptionRef,
64
74
  className: (0, _classnames.default)(_style.default.description, !showMore && _style.default.truncate)
65
75
  }, /*#__PURE__*/_react.default.createElement(_markdownToJsx.default, null, description));
66
76
  }, [showMore, description]);
@@ -72,7 +82,7 @@ const PlaylistDetail = (props, context) => {
72
82
  }, !(0, _isNil2.default)(onBackClick) ? /*#__PURE__*/_react.default.createElement(_buttonLinkIcon.default, {
73
83
  faIcon: "arrow-left",
74
84
  "data-name": "back-button",
75
- "aria-label": "Back",
85
+ "aria-label": translate('back'),
76
86
  onClick: onBackClick,
77
87
  className: _style.default.backButton,
78
88
  tooltipPlacement: "right"
@@ -86,7 +96,7 @@ const PlaylistDetail = (props, context) => {
86
96
  label: translate('playlist')
87
97
  }), /*#__PURE__*/_react.default.createElement("div", {
88
98
  className: _style.default.title
89
- }, title), description ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Description, null), description.length >= DESCRIPTION_BREAKPOINT ? /*#__PURE__*/_react.default.createElement("div", {
99
+ }, title), description ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Description, null), isDescriptionTruncated ? /*#__PURE__*/_react.default.createElement("div", {
90
100
  className: _style.default.showMoreWrapper,
91
101
  onClick: handleShowMore
92
102
  }, translate(showMore ? 'Show less' : 'Show more'), /*#__PURE__*/_react.default.createElement(_icon.default, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["DESCRIPTION_BREAKPOINT","PlaylistDetail","props","context","title","coverImages","playlistRef","description","ongoingCoursesAvailable","playlistCourses","filters","sorting","onBackClick","onContinueLearningClick","translate","showMore","setShowMore","useState","handleShowMore","useCallback","Description","classnames","style","truncate","backgroundContainer","container","backButton","ctaContainer","coverWrapper","length","showMoreWrapper","faSize","wrapperSize","continueLearningButton","contextTypes","skin","Provider","childContextTypes","propTypes","PropTypes","string","isRequired","PlaylistDetailCover","images","bool","shape","CardsGrid","onChange","func","options","arrayOf","SelectOptionPropTypes","Select"],"sources":["../../../src/template/playlist-detail/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {isNil} from 'lodash/fp';\nimport Markdown from 'markdown-to-jsx';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport AllCourses from '../skill-detail/all-courses';\nimport PlaylistDetailCover from '../../molecule/playlist-detail-cover';\nimport {ContinueLearningButton} from '../skill-detail';\nimport style from './style.css';\n\nconst DESCRIPTION_BREAKPOINT = 382;\n\nconst PlaylistDetail = (props, context) => {\n const {\n title,\n coverImages,\n playlistRef,\n description,\n ongoingCoursesAvailable,\n playlistCourses,\n filters,\n sorting,\n onBackClick,\n onContinueLearningClick\n } = props;\n const {translate} = context;\n\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n const Description = useCallback(() => {\n return (\n <div className={classnames(style.description, !showMore && style.truncate)}>\n <Markdown>{description}</Markdown>\n </div>\n );\n }, [showMore, description]);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={playlistRef}>\n {!isNil(onBackClick) ? (\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label=\"Back\"\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n ) : null}\n <div className={style.ctaContainer}>\n <div className={style.coverWrapper}>\n <PlaylistDetailCover images={coverImages} />\n </div>\n <div>\n <Tag label={translate('playlist')} />\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {description.length >= DESCRIPTION_BREAKPOINT ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {translate(showMore ? 'Show less' : 'Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{faSize: 14, wrapperSize: 16}}\n />\n </div>\n ) : null}\n </>\n ) : null}\n <div className={style.continueLearningButton}>\n <ContinueLearningButton\n ongoingCoursesAvailable={ongoingCoursesAvailable}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n </div>\n <AllCourses content={playlistCourses} filters={filters} sorting={sorting} />\n </div>\n </div>\n );\n};\n\nPlaylistDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nPlaylistDetail.propTypes = {\n title: PropTypes.string.isRequired,\n coverImages: PlaylistDetailCover.propTypes.images,\n playlistRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n ongoingCoursesAvailable: PropTypes.bool,\n playlistCourses: PropTypes.shape(CardsGrid.propTypes),\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes),\n onBackClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default PlaylistDetail;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,sBAAsB,GAAG,GAA/B;;AAEA,MAAMC,cAAc,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACzC,MAAM;IACJC,KADI;IAEJC,WAFI;IAGJC,WAHI;IAIJC,WAJI;IAKJC,uBALI;IAMJC,eANI;IAOJC,OAPI;IAQJC,OARI;IASJC,WATI;IAUJC;EAVI,IAWFX,KAXJ;EAYA,MAAM;IAACY;EAAD,IAAcX,OAApB;EAEA,MAAM,CAACY,QAAD,EAAWC,WAAX,IAA0B,IAAAC,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CAAgBM,6BAAhB,CAAlB;EAFc,CAAhB,CAPgB;EAWzBxC,OAAO,EAAE4B,kBAAA,CAAUM,KAAV,CAAgBO,eAAA,CAAOd,SAAvB,CAXgB;EAYzB1B,WAAW,EAAE2B,kBAAA,CAAUS,IAZE;EAazBnC,uBAAuB,EAAE0B,kBAAA,CAAUS;AAbV,CAA3B;eAgBe/C,c"}
1
+ {"version":3,"file":"index.js","names":["PlaylistDetail","props","context","title","coverImages","playlistRef","description","ongoingCoursesAvailable","playlistCourses","filters","sorting","onBackClick","onContinueLearningClick","descriptionRef","useRef","translate","isDescriptionTruncated","setIsDescriptionTruncated","useState","showMore","setShowMore","handleShowMore","useCallback","useEffect","current","clientHeight","scrollHeight","Description","classnames","style","truncate","backgroundContainer","container","backButton","ctaContainer","coverWrapper","showMoreWrapper","faSize","wrapperSize","continueLearningButton","contextTypes","skin","Provider","childContextTypes","propTypes","PropTypes","string","isRequired","PlaylistDetailCover","images","bool","shape","CardsGrid","onChange","func","options","arrayOf","SelectOptionPropTypes","Select"],"sources":["../../../src/template/playlist-detail/index.js"],"sourcesContent":["import React, {useCallback, useState, useEffect, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {isNil} from 'lodash/fp';\nimport Markdown from 'markdown-to-jsx';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport AllCourses from '../skill-detail/all-courses';\nimport PlaylistDetailCover from '../../molecule/playlist-detail-cover';\nimport {ContinueLearningButton} from '../skill-detail';\nimport style from './style.css';\n\nconst PlaylistDetail = (props, context) => {\n const {\n title,\n coverImages,\n playlistRef,\n description,\n ongoingCoursesAvailable,\n playlistCourses,\n filters,\n sorting,\n onBackClick,\n onContinueLearningClick\n } = props;\n const descriptionRef = useRef(null);\n const {translate} = context;\n\n const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n useEffect(() => {\n if (descriptionRef.current) {\n const {clientHeight = 0, scrollHeight = 0} = descriptionRef.current;\n setIsDescriptionTruncated(scrollHeight > clientHeight);\n }\n }, [description]);\n\n const Description = useCallback(() => {\n return (\n <div\n ref={descriptionRef}\n className={classnames(style.description, !showMore && style.truncate)}\n >\n <Markdown>{description}</Markdown>\n </div>\n );\n }, [showMore, description]);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={playlistRef}>\n {!isNil(onBackClick) ? (\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label={translate('back')}\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n ) : null}\n <div className={style.ctaContainer}>\n <div className={style.coverWrapper}>\n <PlaylistDetailCover images={coverImages} />\n </div>\n <div>\n <Tag label={translate('playlist')} />\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {isDescriptionTruncated ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {translate(showMore ? 'Show less' : 'Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{faSize: 14, wrapperSize: 16}}\n />\n </div>\n ) : null}\n </>\n ) : null}\n <div className={style.continueLearningButton}>\n <ContinueLearningButton\n ongoingCoursesAvailable={ongoingCoursesAvailable}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n </div>\n <AllCourses content={playlistCourses} filters={filters} sorting={sorting} />\n </div>\n </div>\n );\n};\n\nPlaylistDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nPlaylistDetail.propTypes = {\n title: PropTypes.string.isRequired,\n coverImages: PlaylistDetailCover.propTypes.images,\n playlistRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n ongoingCoursesAvailable: PropTypes.bool,\n playlistCourses: PropTypes.shape(CardsGrid.propTypes),\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes),\n onBackClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default PlaylistDetail;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,cAAc,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACzC,MAAM;IACJC,KADI;IAEJC,WAFI;IAGJC,WAHI;IAIJC,WAJI;IAKJC,uBALI;IAMJC,eANI;IAOJC,OAPI;IAQJC,OARI;IASJC,WATI;IAUJC;EAVI,IAWFX,KAXJ;EAYA,MAAMY,cAAc,GAAG,IAAAC,aAAA,EAAO,IAAP,CAAvB;EACA,MAAM;IAACC;EAAD,IAAcb,OAApB;EAEA,MAAM,CAACc,sBAAD,EAAyBC,yBAAzB,IAAsD,IAAAC,eAAA,EAAS,KAAT,CAA5D;EACA,MAAM,CAACC,QAAD,EAAWC,WAAX,IAA0B,IAAAF,eAAA,EAAS,KAAT,CAAhC;EAEA,MAAMG,cAAc,GAAG,IAAAC,kBAAA,EAAY,MAAMF,WAAW,CAAC,CAACD,QAAF,CAA7B,EAA0C,CAACC,WAAD,EAAcD,QAAd,CAA1C,CAAvB;EAEA,IAAAI,gBAAA,EAAU,MAAM;IACd,IAAIV,cAAc,CAACW,OAAnB,EAA4B;MAC1B,MAAM;QAACC,YAAY,GAAG,CAAhB;QAAmBC,YAAY,GAAG;MAAlC,IAAuCb,cAAc,CAACW,OAA5D;MACAP,yBAAyB,CAACS,YAAY,GAAGD,YAAhB,CAAzB;IACD;EACF,CALD,EAKG,CAACnB,WAAD,CALH;EAOA,MAAMqB,WAAW,GAAG,IAAAL,kBAAA,E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B,EAAEiC,kBAAA,CAAUS;AAbV,CAA3B;eAgBetD,c"}
@@ -41,7 +41,6 @@
41
41
 
42
42
  .ctaContainer {
43
43
  display: flex;
44
- align-items: center;
45
44
  width: 100%;
46
45
  gap: 40px;
47
46
  }
@@ -67,12 +67,12 @@ declare namespace SkillDetail {
67
67
  export const metrics: PropTypes.Requireable<PropTypes.InferProps<{
68
68
  score: PropTypes.Requireable<number>;
69
69
  questionsToReview: PropTypes.Requireable<number>;
70
+ totalContents: PropTypes.Requireable<number>;
70
71
  }>>;
71
72
  export const focused: PropTypes.Requireable<boolean>;
72
73
  export const availableForReview: PropTypes.Requireable<boolean>;
73
74
  const ongoingCoursesAvailable_1: PropTypes.Requireable<boolean>;
74
75
  export { ongoingCoursesAvailable_1 as ongoingCoursesAvailable };
75
- export const totalCourses: PropTypes.Requireable<number>;
76
76
  export const skillIncludedCourses: PropTypes.Requireable<PropTypes.InferProps<{
77
77
  list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
78
78
  customStyle: PropTypes.Requireable<{
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/index.js"],"names":[],"mappings":"AAeO,8EA+BN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYD,oEAwIC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/index.js"],"names":[],"mappings":"AAeO,8EA+BN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYD,oEAmJC"}
@@ -90,7 +90,6 @@ const SkillDetail = (props, context) => {
90
90
  focused,
91
91
  availableForReview,
92
92
  ongoingCoursesAvailable,
93
- totalCourses,
94
93
  skillIncludedCourses,
95
94
  filters,
96
95
  sorting,
@@ -98,17 +97,30 @@ const SkillDetail = (props, context) => {
98
97
  onReviewClick,
99
98
  onContinueLearningClick
100
99
  } = props;
100
+ const descriptionRef = (0, _react.useRef)(null);
101
101
  const {
102
102
  score = 0,
103
- questionsToReview
103
+ questionsToReview,
104
+ totalContents
104
105
  } = metrics;
105
106
  const {
106
107
  translate
107
108
  } = context;
109
+ const [isDescriptionTruncated, setIsDescriptionTruncated] = (0, _react.useState)(false);
108
110
  const [showMore, setShowMore] = (0, _react.useState)(false);
109
111
  const handleShowMore = (0, _react.useCallback)(() => setShowMore(!showMore), [setShowMore, showMore]);
112
+ (0, _react.useEffect)(() => {
113
+ if (descriptionRef.current) {
114
+ const {
115
+ clientHeight = 0,
116
+ scrollHeight = 0
117
+ } = descriptionRef.current;
118
+ setIsDescriptionTruncated(scrollHeight > clientHeight);
119
+ }
120
+ }, [description]);
110
121
  const Description = (0, _react.useCallback)(() => {
111
122
  return /*#__PURE__*/_react.default.createElement("div", {
123
+ ref: descriptionRef,
112
124
  className: (0, _classnames.default)(_style.default.description, !showMore && _style.default.truncate)
113
125
  }, /*#__PURE__*/_react.default.createElement(_markdownToJsx.default, null, description));
114
126
  }, [showMore, description]);
@@ -136,7 +148,7 @@ const SkillDetail = (props, context) => {
136
148
  }, !(0, _isNil2.default)(onBackClick) ? /*#__PURE__*/_react.default.createElement(_buttonLinkIcon.default, {
137
149
  faIcon: "arrow-left",
138
150
  "data-name": "back-button",
139
- "aria-label": "Back",
151
+ "aria-label": translate('back'),
140
152
  onClick: onBackClick,
141
153
  className: _style.default.backButton,
142
154
  tooltipPlacement: "right"
@@ -153,7 +165,7 @@ const SkillDetail = (props, context) => {
153
165
  }
154
166
  }), translate('skill_focus')) : null, /*#__PURE__*/_react.default.createElement("div", {
155
167
  className: _style.default.title
156
- }, title), description ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Description, null), description.length >= 226 ? /*#__PURE__*/_react.default.createElement("div", {
168
+ }, title), description ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Description, null), isDescriptionTruncated ? /*#__PURE__*/_react.default.createElement("div", {
157
169
  className: _style.default.showMoreWrapper,
158
170
  onClick: handleShowMore
159
171
  }, showMore ? translate('Show less') : translate('Show more'), /*#__PURE__*/_react.default.createElement(_icon.default, {
@@ -189,7 +201,7 @@ const SkillDetail = (props, context) => {
189
201
  content: skillIncludedCourses,
190
202
  filters: filters,
191
203
  sorting: sorting,
192
- totalContents: totalCourses
204
+ totalContents: totalContents
193
205
  })));
194
206
  };
195
207
 
@@ -203,12 +215,12 @@ SkillDetail.propTypes = process.env.NODE_ENV !== "production" ? {
203
215
  description: _propTypes.default.string,
204
216
  metrics: _propTypes.default.shape({
205
217
  score: _propTypes.default.number,
206
- questionsToReview: _propTypes.default.number
218
+ questionsToReview: _propTypes.default.number,
219
+ totalContents: _propTypes.default.number
207
220
  }),
208
221
  focused: _propTypes.default.bool,
209
222
  availableForReview: _propTypes.default.bool,
210
223
  ongoingCoursesAvailable: _propTypes.default.bool,
211
- totalCourses: _propTypes.default.number,
212
224
  skillIncludedCourses: _propTypes.default.shape(_cardsGrid.default.propTypes),
213
225
  filters: _propTypes.default.shape({
214
226
  onChange: _propTypes.default.func,