@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.
- package/es/atom/button-link/index.d.ts.map +1 -1
- package/es/atom/button-link/index.js +12 -6
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/cta/index.js +2 -2
- package/es/atom/cta/index.js.map +1 -1
- package/es/atom/icon/index.d.ts +1 -0
- package/es/atom/icon/index.d.ts.map +1 -1
- package/es/atom/icon/index.js +8 -1
- package/es/atom/icon/index.js.map +1 -1
- package/es/atom/input-file-draggable/index.js +2 -2
- package/es/atom/input-file-draggable/index.js.map +1 -1
- package/es/atom/link/index.d.ts +2 -2
- package/es/atom/link/index.d.ts.map +1 -1
- package/es/atom/link/index.js +38 -46
- package/es/atom/link/index.js.map +1 -1
- package/es/atom/select-icon/index.d.ts +17 -0
- package/es/atom/select-icon/index.d.ts.map +1 -0
- package/es/atom/select-icon/index.js +93 -0
- package/es/atom/select-icon/index.js.map +1 -0
- package/es/atom/select-icon/style.css +73 -0
- package/es/molecule/banner/index.js +3 -3
- package/es/molecule/banner/index.js.map +1 -1
- package/es/molecule/certification-card/index.d.ts +4 -0
- package/es/molecule/certification-card/index.d.ts.map +1 -1
- package/es/molecule/certification-card/index.js +18 -12
- package/es/molecule/certification-card/index.js.map +1 -1
- package/es/molecule/certification-card/style.css +23 -7
- package/es/molecule/cm-popin/types.d.ts +14 -2
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/draggable-list/index.d.ts +12 -0
- package/es/molecule/progress-wrapper/index.d.ts.map +1 -1
- package/es/molecule/progress-wrapper/index.js +22 -12
- package/es/molecule/progress-wrapper/index.js.map +1 -1
- package/es/molecule/progress-wrapper/style.css +1 -0
- package/es/organism/accordion/coorp-manager/part/index.js +2 -1
- package/es/organism/accordion/coorp-manager/part/index.js.map +1 -1
- package/es/organism/brand-learning-priorities/index.d.ts +12 -0
- package/es/organism/list-item/index.d.ts +16 -1
- package/es/organism/list-item/index.d.ts.map +1 -1
- package/es/organism/list-item/index.js +58 -9
- package/es/organism/list-item/index.js.map +1 -1
- package/es/organism/list-item/style.css +25 -11
- package/es/organism/list-items/index.d.ts +12 -0
- package/es/organism/mooc-header/index.d.ts.map +1 -1
- package/es/organism/mooc-header/index.js +2 -3
- package/es/organism/mooc-header/index.js.map +1 -1
- package/es/organism/sidebar/index.d.ts +28 -3
- package/es/organism/sidebar/index.d.ts.map +1 -1
- package/es/organism/sidebar/index.js +7 -3
- package/es/organism/sidebar/index.js.map +1 -1
- package/es/template/app-player/loading/index.d.ts +14 -2
- package/es/template/app-player/player/index.d.ts +28 -4
- package/es/template/app-player/player/slides/index.d.ts +14 -2
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +18 -6
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +16 -4
- package/es/template/app-player/popin-end/summary.d.ts +2 -2
- package/es/template/app-player/popin-header/index.d.ts +2 -2
- package/es/template/app-review/index.d.ts +14 -2
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +14 -2
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +14 -2
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +38 -2
- package/es/template/certification-detail/index.d.ts +2 -1
- package/es/template/certification-detail/index.d.ts.map +1 -1
- package/es/template/certification-detail/index.js +19 -6
- package/es/template/certification-detail/index.js.map +1 -1
- package/es/template/certification-detail/style.css +0 -1
- package/es/template/certifications/index.d.ts +6 -0
- package/es/template/certifications/index.d.ts.map +1 -1
- package/es/template/certifications/index.js +28 -12
- package/es/template/certifications/index.js.map +1 -1
- package/es/template/certifications/style.css +8 -1
- package/es/template/common/dashboard/index.d.ts +28 -4
- package/es/template/common/search-page/index.d.ts +14 -2
- package/es/template/external-course/index.d.ts +14 -2
- package/es/template/playlist-detail/index.d.ts.map +1 -1
- package/es/template/playlist-detail/index.js +15 -4
- package/es/template/playlist-detail/index.js.map +1 -1
- package/es/template/playlist-detail/style.css +0 -1
- package/es/template/skill-detail/index.d.ts +1 -1
- package/es/template/skill-detail/index.d.ts.map +1 -1
- package/es/template/skill-detail/index.js +20 -8
- package/es/template/skill-detail/index.js.map +1 -1
- package/es/variables/colors.d.ts +1 -0
- package/es/variables/colors.d.ts.map +1 -1
- package/es/variables/colors.js +1 -0
- package/es/variables/colors.js.map +1 -1
- package/lib/atom/button-link/index.d.ts.map +1 -1
- package/lib/atom/button-link/index.js +12 -6
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/cta/index.js +2 -2
- package/lib/atom/cta/index.js.map +1 -1
- package/lib/atom/icon/index.d.ts +1 -0
- package/lib/atom/icon/index.d.ts.map +1 -1
- package/lib/atom/icon/index.js +12 -2
- package/lib/atom/icon/index.js.map +1 -1
- package/lib/atom/input-file-draggable/index.js.map +1 -1
- package/lib/atom/link/index.d.ts +2 -2
- package/lib/atom/link/index.d.ts.map +1 -1
- package/lib/atom/link/index.js +38 -47
- package/lib/atom/link/index.js.map +1 -1
- package/lib/atom/select-icon/index.d.ts +17 -0
- package/lib/atom/select-icon/index.d.ts.map +1 -0
- package/lib/atom/select-icon/index.js +111 -0
- package/lib/atom/select-icon/index.js.map +1 -0
- package/lib/atom/select-icon/style.css +73 -0
- package/lib/molecule/banner/index.js.map +1 -1
- package/lib/molecule/certification-card/index.d.ts +4 -0
- package/lib/molecule/certification-card/index.d.ts.map +1 -1
- package/lib/molecule/certification-card/index.js +18 -12
- package/lib/molecule/certification-card/index.js.map +1 -1
- package/lib/molecule/certification-card/style.css +23 -7
- package/lib/molecule/cm-popin/types.d.ts +14 -2
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/draggable-list/index.d.ts +12 -0
- package/lib/molecule/progress-wrapper/index.d.ts.map +1 -1
- package/lib/molecule/progress-wrapper/index.js +26 -13
- package/lib/molecule/progress-wrapper/index.js.map +1 -1
- package/lib/molecule/progress-wrapper/style.css +1 -0
- package/lib/organism/accordion/coorp-manager/part/index.js +3 -1
- package/lib/organism/accordion/coorp-manager/part/index.js.map +1 -1
- package/lib/organism/brand-learning-priorities/index.d.ts +12 -0
- package/lib/organism/list-item/index.d.ts +16 -1
- package/lib/organism/list-item/index.d.ts.map +1 -1
- package/lib/organism/list-item/index.js +56 -5
- package/lib/organism/list-item/index.js.map +1 -1
- package/lib/organism/list-item/style.css +25 -11
- package/lib/organism/list-items/index.d.ts +12 -0
- package/lib/organism/mooc-header/index.d.ts.map +1 -1
- package/lib/organism/mooc-header/index.js +2 -3
- package/lib/organism/mooc-header/index.js.map +1 -1
- package/lib/organism/sidebar/index.d.ts +28 -3
- package/lib/organism/sidebar/index.d.ts.map +1 -1
- package/lib/organism/sidebar/index.js +7 -3
- package/lib/organism/sidebar/index.js.map +1 -1
- package/lib/template/app-player/loading/index.d.ts +14 -2
- package/lib/template/app-player/player/index.d.ts +28 -4
- package/lib/template/app-player/player/slides/index.d.ts +14 -2
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +18 -6
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +16 -4
- package/lib/template/app-player/popin-end/summary.d.ts +2 -2
- package/lib/template/app-player/popin-header/index.d.ts +2 -2
- package/lib/template/app-review/index.d.ts +14 -2
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +14 -2
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +14 -2
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +38 -2
- package/lib/template/certification-detail/index.d.ts +2 -1
- package/lib/template/certification-detail/index.d.ts.map +1 -1
- package/lib/template/certification-detail/index.js +18 -6
- package/lib/template/certification-detail/index.js.map +1 -1
- package/lib/template/certification-detail/style.css +0 -1
- package/lib/template/certifications/index.d.ts +6 -0
- package/lib/template/certifications/index.d.ts.map +1 -1
- package/lib/template/certifications/index.js +30 -14
- package/lib/template/certifications/index.js.map +1 -1
- package/lib/template/certifications/style.css +8 -1
- package/lib/template/common/dashboard/index.d.ts +28 -4
- package/lib/template/common/search-page/index.d.ts +14 -2
- package/lib/template/external-course/index.d.ts +14 -2
- package/lib/template/playlist-detail/index.d.ts.map +1 -1
- package/lib/template/playlist-detail/index.js +14 -4
- package/lib/template/playlist-detail/index.js.map +1 -1
- package/lib/template/playlist-detail/style.css +0 -1
- package/lib/template/skill-detail/index.d.ts +1 -1
- package/lib/template/skill-detail/index.d.ts.map +1 -1
- package/lib/template/skill-detail/index.js +19 -7
- package/lib/template/skill-detail/index.js.map +1 -1
- package/lib/variables/colors.d.ts +1 -0
- package/lib/variables/colors.d.ts.map +1 -1
- package/lib/variables/colors.js +1 -0
- package/lib/variables/colors.js.map +1 -1
- package/locales/bs/global.json +10 -8
- package/locales/cs/global.json +10 -8
- package/locales/de/global.json +10 -8
- package/locales/en/global.json +3 -1
- package/locales/es/global.json +10 -8
- package/locales/et/global.json +10 -8
- package/locales/fi/global.json +10 -8
- package/locales/fr/global.json +10 -8
- package/locales/hr/global.json +10 -8
- package/locales/hu/global.json +10 -8
- package/locales/hy/global.json +10 -8
- package/locales/it/global.json +10 -8
- package/locales/ja/global.json +10 -8
- package/locales/ko/global.json +10 -8
- package/locales/nl/global.json +10 -8
- package/locales/pl/global.json +10 -8
- package/locales/pt/global.json +10 -8
- package/locales/ro/global.json +10 -8
- package/locales/ru/global.json +10 -8
- package/locales/sk/global.json +10 -8
- package/locales/sl/global.json +10 -8
- package/locales/sv/global.json +10 -8
- package/locales/tl/global.json +8 -6
- package/locales/tr/global.json +10 -8
- package/locales/uk/global.json +10 -8
- package/locales/vi/global.json +10 -8
- package/locales/zh/global.json +10 -8
- package/locales/zh_TW/global.json +10 -8
- 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":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/certifications/index.js"],"names":[],"mappings":";AAUA,uEAoEC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _map from "lodash/fp/map";
|
|
2
|
+
|
|
1
3
|
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); }
|
|
2
4
|
|
|
3
5
|
import React, { useState, useCallback } from 'react';
|
|
@@ -11,6 +13,9 @@ import style from './style.css';
|
|
|
11
13
|
|
|
12
14
|
const Certifications = (props, context) => {
|
|
13
15
|
const {
|
|
16
|
+
title,
|
|
17
|
+
subtitle,
|
|
18
|
+
tag,
|
|
14
19
|
certifications,
|
|
15
20
|
sorting
|
|
16
21
|
} = props;
|
|
@@ -27,11 +32,13 @@ const Certifications = (props, context) => {
|
|
|
27
32
|
setShowCompleted(!showCompleted);
|
|
28
33
|
}, [showCompleted, setShowCompleted]);
|
|
29
34
|
return /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
className: style.backgroudnContainer
|
|
36
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
30
37
|
className: style.container,
|
|
31
38
|
"data-name": "Certifications"
|
|
32
39
|
}, /*#__PURE__*/React.createElement(Title, {
|
|
33
|
-
title:
|
|
34
|
-
subtitle:
|
|
40
|
+
title: title,
|
|
41
|
+
subtitle: subtitle,
|
|
35
42
|
type: "form-group",
|
|
36
43
|
titleSize: "standard-light-weight",
|
|
37
44
|
subtitleSize: "standard-without-margin",
|
|
@@ -45,7 +52,7 @@ const Certifications = (props, context) => {
|
|
|
45
52
|
className: style.sortSectionWrapper
|
|
46
53
|
}, /*#__PURE__*/React.createElement("div", {
|
|
47
54
|
className: style.certificatesCount
|
|
48
|
-
}, `${certifications.length} ${
|
|
55
|
+
}, `${certifications.length} ${title}`), /*#__PURE__*/React.createElement("div", {
|
|
49
56
|
className: style.sortSection
|
|
50
57
|
}, /*#__PURE__*/React.createElement(InputSwitch, {
|
|
51
58
|
id: 'show-completed-courses-switch',
|
|
@@ -59,21 +66,27 @@ const Certifications = (props, context) => {
|
|
|
59
66
|
className: style.sortWrapper
|
|
60
67
|
}, translate('sort_by'), sortView) : null)), /*#__PURE__*/React.createElement("div", {
|
|
61
68
|
className: style.certificateList
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
}, _map(certification => {
|
|
70
|
+
const {
|
|
71
|
+
label,
|
|
72
|
+
progress
|
|
73
|
+
} = certification;
|
|
74
|
+
if (!showCompleted && progress === 100) return null;
|
|
67
75
|
return /*#__PURE__*/React.createElement("div", {
|
|
68
|
-
key:
|
|
69
|
-
}, /*#__PURE__*/React.createElement(CertificationCard, certification
|
|
70
|
-
|
|
76
|
+
key: label
|
|
77
|
+
}, /*#__PURE__*/React.createElement(CertificationCard, _extends({}, certification, {
|
|
78
|
+
tag: tag
|
|
79
|
+
})));
|
|
80
|
+
}, certifications))));
|
|
71
81
|
};
|
|
72
82
|
|
|
73
83
|
Certifications.contextTypes = {
|
|
74
84
|
translate: Provider.childContextTypes.translate
|
|
75
85
|
};
|
|
76
86
|
Certifications.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
87
|
+
title: PropTypes.string,
|
|
88
|
+
subtitle: PropTypes.string,
|
|
89
|
+
tag: PropTypes.string,
|
|
77
90
|
certifications: PropTypes.arrayOf(PropTypes.shape({
|
|
78
91
|
label: PropTypes.string,
|
|
79
92
|
goal: PropTypes.shape({
|
|
@@ -84,7 +97,10 @@ Certifications.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
84
97
|
}),
|
|
85
98
|
progress: PropTypes.number,
|
|
86
99
|
imgUrl: PropTypes.string,
|
|
87
|
-
onClick: PropTypes.func
|
|
100
|
+
onClick: PropTypes.func,
|
|
101
|
+
locales: PropTypes.shape({
|
|
102
|
+
conditionDescriptionProgress: PropTypes.string
|
|
103
|
+
})
|
|
88
104
|
})),
|
|
89
105
|
sorting: PropTypes.shape(Select.propTypes)
|
|
90
106
|
} : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useState","useCallback","PropTypes","Provider","Title","Select","InputSwitch","CertificationCard","style","Certifications","props","context","certifications","sorting","translate","showCompleted","setShowCompleted","sortView","undefined","handleShowCompletedToggle","container","iconName","iconColor","borderRadius","backgroundColor","sortSectionWrapper","certificatesCount","length","sortSection","sortWrapper","certificateList","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useState","useCallback","PropTypes","Provider","Title","Select","InputSwitch","CertificationCard","style","Certifications","props","context","title","subtitle","tag","certifications","sorting","translate","showCompleted","setShowCompleted","sortView","undefined","handleShowCompletedToggle","backgroudnContainer","container","iconName","iconColor","borderRadius","backgroundColor","sortSectionWrapper","certificatesCount","length","sortSection","sortWrapper","certificateList","certification","label","progress","contextTypes","childContextTypes","propTypes","string","arrayOf","shape","goal","condition","nbDone","number","imgUrl","onClick","func","locales","conditionDescriptionProgress"],"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,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,WAAzB,QAA2C,OAA3C;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,iBAAP,MAA8B,mCAA9B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,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,IAAoCnB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CADc,CAJS;EAqBzBzB,OAAO,EAAEd,SAAS,CAACyC,KAAV,CAAgBtC,MAAM,CAACmC,SAAvB;AArBgB,CAA3B;AAwBA,eAAe/B,cAAf"}
|
|
@@ -7,13 +7,20 @@
|
|
|
7
7
|
@value cm_grey_200 from colors;
|
|
8
8
|
@value cm_grey_400 from colors;
|
|
9
9
|
@value cm_grey_500 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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/playlist-detail/index.js"],"names":[],"mappings":";AAgBA,uEAqFC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _isNil from "lodash/fp/isNil";
|
|
2
|
-
import React, { useCallback, useState } from 'react';
|
|
2
|
+
import React, { useCallback, useState, useEffect, useRef } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import Markdown from 'markdown-to-jsx';
|
|
@@ -13,7 +13,6 @@ import AllCourses from '../skill-detail/all-courses';
|
|
|
13
13
|
import PlaylistDetailCover from '../../molecule/playlist-detail-cover';
|
|
14
14
|
import { ContinueLearningButton } from '../skill-detail';
|
|
15
15
|
import style from './style.css';
|
|
16
|
-
const DESCRIPTION_BREAKPOINT = 382;
|
|
17
16
|
|
|
18
17
|
const PlaylistDetail = (props, context) => {
|
|
19
18
|
const {
|
|
@@ -28,13 +27,25 @@ const PlaylistDetail = (props, context) => {
|
|
|
28
27
|
onBackClick,
|
|
29
28
|
onContinueLearningClick
|
|
30
29
|
} = props;
|
|
30
|
+
const descriptionRef = useRef(null);
|
|
31
31
|
const {
|
|
32
32
|
translate
|
|
33
33
|
} = context;
|
|
34
|
+
const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);
|
|
34
35
|
const [showMore, setShowMore] = useState(false);
|
|
35
36
|
const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (descriptionRef.current) {
|
|
39
|
+
const {
|
|
40
|
+
clientHeight = 0,
|
|
41
|
+
scrollHeight = 0
|
|
42
|
+
} = descriptionRef.current;
|
|
43
|
+
setIsDescriptionTruncated(scrollHeight > clientHeight);
|
|
44
|
+
}
|
|
45
|
+
}, [description]);
|
|
36
46
|
const Description = useCallback(() => {
|
|
37
47
|
return /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
ref: descriptionRef,
|
|
38
49
|
className: classnames(style.description, !showMore && style.truncate)
|
|
39
50
|
}, /*#__PURE__*/React.createElement(Markdown, null, description));
|
|
40
51
|
}, [showMore, description]);
|
|
@@ -46,7 +57,7 @@ const PlaylistDetail = (props, context) => {
|
|
|
46
57
|
}, !_isNil(onBackClick) ? /*#__PURE__*/React.createElement(ButtonLinkIcon, {
|
|
47
58
|
faIcon: "arrow-left",
|
|
48
59
|
"data-name": "back-button",
|
|
49
|
-
"aria-label":
|
|
60
|
+
"aria-label": translate('back'),
|
|
50
61
|
onClick: onBackClick,
|
|
51
62
|
className: style.backButton,
|
|
52
63
|
tooltipPlacement: "right"
|
|
@@ -60,7 +71,7 @@ const PlaylistDetail = (props, context) => {
|
|
|
60
71
|
label: translate('playlist')
|
|
61
72
|
}), /*#__PURE__*/React.createElement("div", {
|
|
62
73
|
className: style.title
|
|
63
|
-
}, title), description ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Description, null),
|
|
74
|
+
}, title), description ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Description, null), isDescriptionTruncated ? /*#__PURE__*/React.createElement("div", {
|
|
64
75
|
className: style.showMoreWrapper,
|
|
65
76
|
onClick: handleShowMore
|
|
66
77
|
}, translate(showMore ? 'Show less' : 'Show more'), /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useState","PropTypes","classnames","Markdown","Provider","Tag","Select","SelectOptionPropTypes","ButtonLinkIcon","Icon","CardsGrid","AllCourses","PlaylistDetailCover","ContinueLearningButton","style","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useState","useEffect","useRef","PropTypes","classnames","Markdown","Provider","Tag","Select","SelectOptionPropTypes","ButtonLinkIcon","Icon","CardsGrid","AllCourses","PlaylistDetailCover","ContinueLearningButton","style","PlaylistDetail","props","context","title","coverImages","playlistRef","description","ongoingCoursesAvailable","playlistCourses","filters","sorting","onBackClick","onContinueLearningClick","descriptionRef","translate","isDescriptionTruncated","setIsDescriptionTruncated","showMore","setShowMore","handleShowMore","current","clientHeight","scrollHeight","Description","truncate","backgroundContainer","container","backButton","ctaContainer","coverWrapper","showMoreWrapper","faSize","wrapperSize","continueLearningButton","contextTypes","skin","childContextTypes","propTypes","string","isRequired","images","bool","shape","onChange","func","options","arrayOf"],"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,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,QAA5B,EAAsCC,SAAtC,EAAiDC,MAAjD,QAA8D,OAA9D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAOC,QAAP,MAAqB,iBAArB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAOC,MAAP,IAAgBC,qBAAhB,QAA4C,mBAA5C;AACA,OAAOC,cAAP,MAA2B,6BAA3B;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,UAAP,MAAuB,6BAAvB;AACA,OAAOC,mBAAP,MAAgC,sCAAhC;AACA,SAAQC,sBAAR,QAAqC,iBAArC;AACA,OAAOC,KAAP,MAAkB,aAAlB;;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,MAAMY,cAAc,GAAG5B,MAAM,CAAC,IAAD,CAA7B;EACA,MAAM;IAAC6B;EAAD,IAAcZ,OAApB;EAEA,MAA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EAAEnB,SAAS,CAACoD,MAAV,CAAiBC,UAHL;EAIzBjC,WAAW,EAAEpB,SAAS,CAACoD,MAJE;EAKzB/B,uBAAuB,EAAErB,SAAS,CAACuD,IALV;EAMzBjC,eAAe,EAAEtB,SAAS,CAACwD,KAAV,CAAgB/C,SAAS,CAAC0C,SAA1B,CANQ;EAOzB5B,OAAO,EAAEvB,SAAS,CAACwD,KAAV,CAAgB;IACvBC,QAAQ,EAAEzD,SAAS,CAAC0D,IADG;IAEvBC,OAAO,EAAE3D,SAAS,CAAC4D,OAAV,CAAkB5D,SAAS,CAACwD,KAAV,CAAgBlD,qBAAhB,CAAlB;EAFc,CAAhB,CAPgB;EAWzBkB,OAAO,EAAExB,SAAS,CAACwD,KAAV,CAAgBnD,MAAM,CAAC8C,SAAvB,CAXgB;EAYzB1B,WAAW,EAAEzB,SAAS,CAAC0D,IAZE;EAazBhC,uBAAuB,EAAE1B,SAAS,CAAC0D;AAbV,CAA3B;AAgBA,eAAe5C,cAAf"}
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/index.js"],"names":[],"mappings":"AAeO,8EA+BN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYD,oEAmJC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _isNil from "lodash/fp/isNil";
|
|
2
2
|
import _get from "lodash/fp/get";
|
|
3
|
-
import React, { useCallback, useState } from 'react';
|
|
3
|
+
import React, { useCallback, useState, useRef, useEffect } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { convert } from 'css-color-function';
|
|
6
6
|
import classnames from 'classnames';
|
|
@@ -64,7 +64,6 @@ const SkillDetail = (props, context) => {
|
|
|
64
64
|
focused,
|
|
65
65
|
availableForReview,
|
|
66
66
|
ongoingCoursesAvailable,
|
|
67
|
-
totalCourses,
|
|
68
67
|
skillIncludedCourses,
|
|
69
68
|
filters,
|
|
70
69
|
sorting,
|
|
@@ -72,17 +71,30 @@ const SkillDetail = (props, context) => {
|
|
|
72
71
|
onReviewClick,
|
|
73
72
|
onContinueLearningClick
|
|
74
73
|
} = props;
|
|
74
|
+
const descriptionRef = useRef(null);
|
|
75
75
|
const {
|
|
76
76
|
score = 0,
|
|
77
|
-
questionsToReview
|
|
77
|
+
questionsToReview,
|
|
78
|
+
totalContents
|
|
78
79
|
} = metrics;
|
|
79
80
|
const {
|
|
80
81
|
translate
|
|
81
82
|
} = context;
|
|
83
|
+
const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);
|
|
82
84
|
const [showMore, setShowMore] = useState(false);
|
|
83
85
|
const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
if (descriptionRef.current) {
|
|
88
|
+
const {
|
|
89
|
+
clientHeight = 0,
|
|
90
|
+
scrollHeight = 0
|
|
91
|
+
} = descriptionRef.current;
|
|
92
|
+
setIsDescriptionTruncated(scrollHeight > clientHeight);
|
|
93
|
+
}
|
|
94
|
+
}, [description]);
|
|
84
95
|
const Description = useCallback(() => {
|
|
85
96
|
return /*#__PURE__*/React.createElement("div", {
|
|
97
|
+
ref: descriptionRef,
|
|
86
98
|
className: classnames(style.description, !showMore && style.truncate)
|
|
87
99
|
}, /*#__PURE__*/React.createElement(Markdown, null, description));
|
|
88
100
|
}, [showMore, description]);
|
|
@@ -110,7 +122,7 @@ const SkillDetail = (props, context) => {
|
|
|
110
122
|
}, !_isNil(onBackClick) ? /*#__PURE__*/React.createElement(ButtonLinkIcon, {
|
|
111
123
|
faIcon: "arrow-left",
|
|
112
124
|
"data-name": "back-button",
|
|
113
|
-
"aria-label":
|
|
125
|
+
"aria-label": translate('back'),
|
|
114
126
|
onClick: onBackClick,
|
|
115
127
|
className: style.backButton,
|
|
116
128
|
tooltipPlacement: "right"
|
|
@@ -127,7 +139,7 @@ const SkillDetail = (props, context) => {
|
|
|
127
139
|
}
|
|
128
140
|
}), translate('skill_focus')) : null, /*#__PURE__*/React.createElement("div", {
|
|
129
141
|
className: style.title
|
|
130
|
-
}, title), description ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Description, null),
|
|
142
|
+
}, title), description ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Description, null), isDescriptionTruncated ? /*#__PURE__*/React.createElement("div", {
|
|
131
143
|
className: style.showMoreWrapper,
|
|
132
144
|
onClick: handleShowMore
|
|
133
145
|
}, showMore ? translate('Show less') : translate('Show more'), /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -163,7 +175,7 @@ const SkillDetail = (props, context) => {
|
|
|
163
175
|
content: skillIncludedCourses,
|
|
164
176
|
filters: filters,
|
|
165
177
|
sorting: sorting,
|
|
166
|
-
totalContents:
|
|
178
|
+
totalContents: totalContents
|
|
167
179
|
})));
|
|
168
180
|
};
|
|
169
181
|
|
|
@@ -177,12 +189,12 @@ SkillDetail.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
177
189
|
description: PropTypes.string,
|
|
178
190
|
metrics: PropTypes.shape({
|
|
179
191
|
score: PropTypes.number,
|
|
180
|
-
questionsToReview: PropTypes.number
|
|
192
|
+
questionsToReview: PropTypes.number,
|
|
193
|
+
totalContents: PropTypes.number
|
|
181
194
|
}),
|
|
182
195
|
focused: PropTypes.bool,
|
|
183
196
|
availableForReview: PropTypes.bool,
|
|
184
197
|
ongoingCoursesAvailable: PropTypes.bool,
|
|
185
|
-
totalCourses: PropTypes.number,
|
|
186
198
|
skillIncludedCourses: PropTypes.shape(CardsGrid.propTypes),
|
|
187
199
|
filters: PropTypes.shape({
|
|
188
200
|
onChange: PropTypes.func,
|