@coorpacademy/components 11.32.42-alpha.9 → 11.32.43
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/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/learner-skill-card/index.d.ts +0 -1
- package/es/molecule/learner-skill-card/index.d.ts.map +1 -1
- package/es/molecule/learner-skill-card/index.js +22 -42
- package/es/molecule/learner-skill-card/index.js.map +1 -1
- package/es/molecule/learner-skill-card/style.css +4 -7
- package/es/template/certification-detail/index.d.ts.map +1 -1
- package/es/template/certification-detail/index.js +7 -5
- package/es/template/certification-detail/index.js.map +1 -1
- package/es/template/certifications/style.css +1 -1
- package/es/template/my-learning/index.d.ts.map +1 -1
- package/es/template/my-learning/index.js +2 -4
- package/es/template/my-learning/index.js.map +1 -1
- 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.map +1 -1
- package/es/template/skill-detail/index.js +15 -3
- 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/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/learner-skill-card/index.d.ts +0 -1
- package/lib/molecule/learner-skill-card/index.d.ts.map +1 -1
- package/lib/molecule/learner-skill-card/index.js +24 -45
- package/lib/molecule/learner-skill-card/index.js.map +1 -1
- package/lib/molecule/learner-skill-card/style.css +4 -7
- package/lib/template/certification-detail/index.d.ts.map +1 -1
- package/lib/template/certification-detail/index.js +7 -5
- package/lib/template/certification-detail/index.js.map +1 -1
- package/lib/template/certifications/style.css +1 -1
- package/lib/template/my-learning/index.d.ts.map +1 -1
- package/lib/template/my-learning/index.js +2 -4
- package/lib/template/my-learning/index.js.map +1 -1
- 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.map +1 -1
- package/lib/template/skill-detail/index.js +14 -2
- 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 +2 -0
- package/locales/cs/global.json +2 -0
- package/locales/de/global.json +2 -0
- package/locales/es/global.json +2 -0
- package/locales/et/global.json +2 -0
- package/locales/fi/global.json +2 -0
- package/locales/fr/global.json +2 -0
- package/locales/hr/global.json +2 -0
- package/locales/hu/global.json +2 -0
- package/locales/hy/global.json +2 -0
- package/locales/it/global.json +2 -0
- package/locales/ja/global.json +2 -0
- package/locales/ko/global.json +2 -0
- package/locales/nl/global.json +2 -0
- package/locales/pl/global.json +2 -0
- package/locales/pt/global.json +2 -0
- package/locales/ro/global.json +2 -0
- package/locales/ru/global.json +2 -0
- package/locales/sk/global.json +2 -0
- package/locales/sl/global.json +2 -0
- package/locales/sv/global.json +2 -0
- package/locales/tl/global.json +2 -0
- package/locales/tr/global.json +2 -0
- package/locales/uk/global.json +2 -0
- package/locales/vi/global.json +2 -0
- package/locales/zh/global.json +2 -0
- package/locales/zh_TW/global.json +2 -0
- package/package.json +2 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default SelectIcon;
|
|
2
|
+
declare function SelectIcon(props: any): JSX.Element;
|
|
3
|
+
declare namespace SelectIcon {
|
|
4
|
+
const propTypes: {
|
|
5
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
6
|
+
'data-name': PropTypes.Requireable<string>;
|
|
7
|
+
faIcon: PropTypes.Requireable<string>;
|
|
8
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
9
|
+
options: PropTypes.Requireable<PropTypes.InferProps<{
|
|
10
|
+
selectionMode: PropTypes.Requireable<string>;
|
|
11
|
+
isSelected: PropTypes.Requireable<boolean>;
|
|
12
|
+
iconColor: PropTypes.Requireable<string>;
|
|
13
|
+
}>>;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
import PropTypes from "prop-types";
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select-icon/index.js"],"names":[],"mappings":";AAgDA,qDA0BC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import FaIcon from '../icon';
|
|
5
|
+
import { COLORS } from '../../variables/colors';
|
|
6
|
+
import style from './style.css';
|
|
7
|
+
const ICON_COLOR = COLORS.cm_primary_blue;
|
|
8
|
+
const BACKGROUND_COLOR = COLORS.white;
|
|
9
|
+
const CHECK_ICON_NAME_MAP = {
|
|
10
|
+
single: 'circle-check',
|
|
11
|
+
multi: 'square-check'
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const getButtonContent = (faIcon, options = {}) => {
|
|
15
|
+
const {
|
|
16
|
+
selectionMode = 'single',
|
|
17
|
+
isSelected = false,
|
|
18
|
+
iconColor = ICON_COLOR
|
|
19
|
+
} = options;
|
|
20
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
21
|
+
className: style.contentWrapper
|
|
22
|
+
}, isSelected ?
|
|
23
|
+
/*#__PURE__*/
|
|
24
|
+
|
|
25
|
+
/* checkbox icon */
|
|
26
|
+
React.createElement("div", {
|
|
27
|
+
className: style.checkIcon
|
|
28
|
+
}, /*#__PURE__*/React.createElement(FaIcon, {
|
|
29
|
+
iconName: CHECK_ICON_NAME_MAP[selectionMode],
|
|
30
|
+
iconColor: iconColor,
|
|
31
|
+
backgroundColor: BACKGROUND_COLOR,
|
|
32
|
+
size: {
|
|
33
|
+
faSize: 16,
|
|
34
|
+
wrapperSize: 16
|
|
35
|
+
}
|
|
36
|
+
})) : null,
|
|
37
|
+
/*#__PURE__*/
|
|
38
|
+
|
|
39
|
+
/* selection tick (L18) / icon */
|
|
40
|
+
React.createElement("div", {
|
|
41
|
+
className: style.iconWrapper
|
|
42
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
className: style.icon
|
|
44
|
+
}, /*#__PURE__*/React.createElement(FaIcon, {
|
|
45
|
+
iconName: faIcon,
|
|
46
|
+
iconColor: isSelected ? iconColor : '',
|
|
47
|
+
size: {
|
|
48
|
+
faSize: 32,
|
|
49
|
+
wrapperSize: 32
|
|
50
|
+
}
|
|
51
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
className: style.iconText
|
|
53
|
+
}, faIcon)));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const SelectIcon = props => {
|
|
57
|
+
const {
|
|
58
|
+
faIcon,
|
|
59
|
+
'data-name': dataName,
|
|
60
|
+
'aria-label': ariaLabel,
|
|
61
|
+
onClick,
|
|
62
|
+
options = {}
|
|
63
|
+
} = props;
|
|
64
|
+
const {
|
|
65
|
+
isSelected = false
|
|
66
|
+
} = options;
|
|
67
|
+
const contentView = getButtonContent(faIcon, options);
|
|
68
|
+
const styleButton = classnames(style.default, isSelected && style.selected);
|
|
69
|
+
const handleOnClick = useCallback(() => onClick(), [onClick]);
|
|
70
|
+
const IconButton = useCallback(() => /*#__PURE__*/React.createElement("button", {
|
|
71
|
+
type: "button",
|
|
72
|
+
"aria-label": ariaLabel,
|
|
73
|
+
"data-name": dataName,
|
|
74
|
+
"data-testid": `button-${dataName}`,
|
|
75
|
+
className: styleButton,
|
|
76
|
+
onClick: handleOnClick
|
|
77
|
+
}, contentView), [ariaLabel, contentView, dataName, handleOnClick, styleButton]);
|
|
78
|
+
return /*#__PURE__*/React.createElement(IconButton, null);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
SelectIcon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
82
|
+
'aria-label': PropTypes.string,
|
|
83
|
+
'data-name': PropTypes.string,
|
|
84
|
+
faIcon: PropTypes.string,
|
|
85
|
+
onClick: PropTypes.func,
|
|
86
|
+
options: PropTypes.shape({
|
|
87
|
+
selectionMode: PropTypes.oneOf(['single', 'multi']),
|
|
88
|
+
isSelected: PropTypes.bool,
|
|
89
|
+
iconColor: PropTypes.string
|
|
90
|
+
})
|
|
91
|
+
} : {};
|
|
92
|
+
export default SelectIcon;
|
|
93
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","PropTypes","classnames","FaIcon","COLORS","style","ICON_COLOR","cm_primary_blue","BACKGROUND_COLOR","white","CHECK_ICON_NAME_MAP","single","multi","getButtonContent","faIcon","options","selectionMode","isSelected","iconColor","contentWrapper","checkIcon","faSize","wrapperSize","iconWrapper","icon","iconText","SelectIcon","props","dataName","ariaLabel","onClick","contentView","styleButton","default","selected","handleOnClick","IconButton","propTypes","string","func","shape","oneOf","bool"],"sources":["../../../src/atom/select-icon/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport FaIcon from '../icon';\n\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\n\nconst ICON_COLOR = COLORS.cm_primary_blue;\nconst BACKGROUND_COLOR = COLORS.white;\nconst CHECK_ICON_NAME_MAP = {\n single: 'circle-check',\n multi: 'square-check'\n};\n\nconst getButtonContent = (faIcon, options = {}) => {\n const {selectionMode = 'single', isSelected = false, iconColor = ICON_COLOR} = options;\n\n return (\n <div className={style.contentWrapper}>\n {isSelected ? (\n /* checkbox icon */\n <div className={style.checkIcon}>\n <FaIcon\n iconName={CHECK_ICON_NAME_MAP[selectionMode]}\n iconColor={iconColor}\n backgroundColor={BACKGROUND_COLOR}\n size={{faSize: 16, wrapperSize: 16}}\n />\n </div>\n ) : null}\n {\n /* selection tick (L18) / icon */\n <div className={style.iconWrapper}>\n <div className={style.icon}>\n <FaIcon\n iconName={faIcon}\n iconColor={isSelected ? iconColor : ''}\n size={{faSize: 32, wrapperSize: 32}}\n />\n </div>\n <div className={style.iconText}>{faIcon}</div>\n </div>\n }\n </div>\n );\n};\n\nconst SelectIcon = props => {\n const {faIcon, 'data-name': dataName, 'aria-label': ariaLabel, onClick, options = {}} = props;\n\n const {isSelected = false} = options;\n\n const contentView = getButtonContent(faIcon, options);\n const styleButton = classnames(style.default, isSelected && style.selected);\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const IconButton = useCallback(\n () => (\n <button\n type=\"button\"\n aria-label={ariaLabel}\n data-name={dataName}\n data-testid={`button-${dataName}`}\n className={styleButton}\n onClick={handleOnClick}\n >\n {contentView}\n </button>\n ),\n [ariaLabel, contentView, dataName, handleOnClick, styleButton]\n );\n\n return <IconButton />;\n};\n\nSelectIcon.propTypes = {\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n faIcon: PropTypes.string,\n onClick: PropTypes.func,\n options: PropTypes.shape({\n selectionMode: PropTypes.oneOf(['single', 'multi']),\n isSelected: PropTypes.bool,\n iconColor: PropTypes.string\n })\n};\n\nexport default SelectIcon;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,MAAP,MAAmB,SAAnB;AAEA,SAAQC,MAAR,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colors.css";
|
|
2
|
+
@value cm_grey_100 from colors;
|
|
3
|
+
@value cm_grey_400 from colors;
|
|
4
|
+
@value cm_grey_500 from colors;
|
|
5
|
+
@value cm_grey_75 from colors;
|
|
6
|
+
@value cm_grey_50 from colors;
|
|
7
|
+
@value cm_primary_blue from colors;
|
|
8
|
+
@value white from colors;
|
|
9
|
+
|
|
10
|
+
.button {
|
|
11
|
+
font-family: Gilroy;
|
|
12
|
+
font-size: 12px;
|
|
13
|
+
font-style: normal;
|
|
14
|
+
font-weight: 600;
|
|
15
|
+
line-height: 16px;
|
|
16
|
+
color: cm_grey_400;
|
|
17
|
+
display: flex;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
align-items: center;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
border: none;
|
|
22
|
+
background-color: white;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.button:hover {
|
|
26
|
+
background-color: cm_grey_100;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.selected {
|
|
30
|
+
background-color: cm_grey_50;
|
|
31
|
+
border: 2px solid cm_primary_blue;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.selected:hover {
|
|
35
|
+
background-color: cm_grey_75;
|
|
36
|
+
color: cm_grey_500;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.default {
|
|
40
|
+
composes: button;
|
|
41
|
+
width: 144px;
|
|
42
|
+
height: 120px;
|
|
43
|
+
border-radius: 12px;
|
|
44
|
+
position: relative;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.contentWrapper {
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
height: 100%;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.checkIcon {
|
|
56
|
+
position: absolute;
|
|
57
|
+
top: 8px;
|
|
58
|
+
right: 8px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.iconWrapper {
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
align-items: center;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.icon {
|
|
68
|
+
margin-bottom: 8px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.iconText {
|
|
72
|
+
font-size: 12px;
|
|
73
|
+
}
|
|
@@ -34,7 +34,6 @@ declare namespace LearnerSkillCard {
|
|
|
34
34
|
score: PropTypes.Requireable<number>;
|
|
35
35
|
content: PropTypes.Requireable<number>;
|
|
36
36
|
questionsToReview: PropTypes.Requireable<number>;
|
|
37
|
-
contentCompleted: PropTypes.Requireable<number>;
|
|
38
37
|
}>>;
|
|
39
38
|
review: PropTypes.Requireable<boolean>;
|
|
40
39
|
onReviewClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learner-skill-card/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learner-skill-card/index.js"],"names":[],"mappings":";AAaA,yEAiHC"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import _get from "lodash/fp/get";
|
|
2
|
-
import React
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import { convert } from 'css-color-function';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import Icon from '../../atom/icon';
|
|
6
6
|
import ButtonLink from '../../atom/button-link';
|
|
7
7
|
import Provider from '../../atom/provider';
|
|
8
|
+
import ProgressBar from '../progress-bar';
|
|
9
|
+
import { COLORS } from '../../variables/colors';
|
|
8
10
|
import style from './style.css';
|
|
11
|
+
const MAX_SCORE = 100;
|
|
9
12
|
|
|
10
13
|
const LearnerSkillCard = (props, context) => {
|
|
11
14
|
const {
|
|
@@ -21,8 +24,7 @@ const LearnerSkillCard = (props, context) => {
|
|
|
21
24
|
const {
|
|
22
25
|
score,
|
|
23
26
|
content,
|
|
24
|
-
questionsToReview
|
|
25
|
-
contentCompleted = 0
|
|
27
|
+
questionsToReview = 0
|
|
26
28
|
} = metrics;
|
|
27
29
|
const {
|
|
28
30
|
skin,
|
|
@@ -33,10 +35,8 @@ const LearnerSkillCard = (props, context) => {
|
|
|
33
35
|
|
|
34
36
|
const reviewLocale = translate('Review');
|
|
35
37
|
const exploreLocale = translate('Explore');
|
|
36
|
-
const
|
|
37
|
-
const questionsLocale = translate('questions');
|
|
38
|
+
const questionsLocale = translate('skill_chart_side_panel_questions_to_review');
|
|
38
39
|
const skillFocusLocale = translate('skill_focus');
|
|
39
|
-
const contentCompletedLocale = translate('courses_completed');
|
|
40
40
|
const buttonReviewProps = {
|
|
41
41
|
customStyle: {
|
|
42
42
|
backgroundColor: '#FFF',
|
|
@@ -71,40 +71,18 @@ const LearnerSkillCard = (props, context) => {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
|
-
const ProgressBar = useCallback(() => {
|
|
75
|
-
if (!content) return null;
|
|
76
|
-
const progressBarColor = '#3EC483';
|
|
77
|
-
const inlineProgressValueStyle = {
|
|
78
|
-
backgroundColor: progressBarColor,
|
|
79
|
-
width: `${score}%`
|
|
80
|
-
};
|
|
81
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
82
|
-
className: style.progressWrapper
|
|
83
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
84
|
-
"data-name": "progress",
|
|
85
|
-
className: style.progress,
|
|
86
|
-
style: inlineProgressValueStyle,
|
|
87
|
-
role: "progressbar",
|
|
88
|
-
"aria-label": _get('progression', ariaLabel)
|
|
89
|
-
}));
|
|
90
|
-
}, [score, ariaLabel, content]);
|
|
91
74
|
return /*#__PURE__*/React.createElement("div", {
|
|
92
75
|
className: style.learnerSkillCardWrapper,
|
|
93
76
|
"data-name": "learner-skill-card-wrapper",
|
|
94
77
|
"aria-label": ariaLabel
|
|
95
|
-
},
|
|
96
|
-
className: style.
|
|
97
|
-
},
|
|
98
|
-
className: style.skillInformation,
|
|
99
|
-
"data-name": "skill-courses"
|
|
100
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
101
|
-
className: style.skillInformationNumber
|
|
102
|
-
}, content), " ", coursesLocale) : null, questionsToReview ? /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
}, questionsToReview ? /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
className: style.skillQuestionsWrapper
|
|
80
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
103
81
|
className: style.skillInformation,
|
|
104
82
|
"data-name": "skill-questions"
|
|
105
83
|
}, /*#__PURE__*/React.createElement("span", {
|
|
106
84
|
className: style.skillInformationNumber
|
|
107
|
-
}, questionsToReview), "\xA0", questionsLocale)
|
|
85
|
+
}, questionsToReview), "\xA0", questionsLocale)) : null, /*#__PURE__*/React.createElement("div", {
|
|
108
86
|
className: style.skillTitleWrapper
|
|
109
87
|
}, /*#__PURE__*/React.createElement("div", {
|
|
110
88
|
"data-name": "skill-title",
|
|
@@ -119,19 +97,22 @@ const LearnerSkillCard = (props, context) => {
|
|
|
119
97
|
faSize: 10,
|
|
120
98
|
wrapperSize: 16
|
|
121
99
|
}
|
|
122
|
-
}), skillFocusLocale) : null),
|
|
100
|
+
}), skillFocusLocale) : null), content ? /*#__PURE__*/React.createElement("div", {
|
|
123
101
|
className: style.progressInformations
|
|
124
|
-
},
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
className: style.
|
|
129
|
-
|
|
102
|
+
}, /*#__PURE__*/React.createElement(ProgressBar, {
|
|
103
|
+
value: score,
|
|
104
|
+
displayInfo: false,
|
|
105
|
+
max: MAX_SCORE,
|
|
106
|
+
className: style.progressWrapper,
|
|
107
|
+
style: {
|
|
108
|
+
backgroundColor: COLORS.positive
|
|
109
|
+
}
|
|
110
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
130
111
|
className: style.progressInformation,
|
|
131
112
|
"data-name": "completed-percentage"
|
|
132
113
|
}, /*#__PURE__*/React.createElement("span", {
|
|
133
114
|
className: style.progressInformationNumber
|
|
134
|
-
}, score, "%"))) : null
|
|
115
|
+
}, score, "%"))) : null, /*#__PURE__*/React.createElement("div", {
|
|
135
116
|
className: style.ctaWrapper,
|
|
136
117
|
"data-name": "cta-wrapper"
|
|
137
118
|
}, /*#__PURE__*/React.createElement(ButtonLink, buttonReviewProps), /*#__PURE__*/React.createElement("div", {
|
|
@@ -152,8 +133,7 @@ LearnerSkillCard.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
152
133
|
metrics: PropTypes.shape({
|
|
153
134
|
score: PropTypes.number,
|
|
154
135
|
content: PropTypes.number,
|
|
155
|
-
questionsToReview: PropTypes.number
|
|
156
|
-
contentCompleted: PropTypes.number
|
|
136
|
+
questionsToReview: PropTypes.number
|
|
157
137
|
}),
|
|
158
138
|
review: PropTypes.bool,
|
|
159
139
|
onReviewClick: PropTypes.func,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","convert","PropTypes","Icon","ButtonLink","Provider","style","LearnerSkillCard","props","context","ariaLabel","skillTitle","skillAriaLabel","focus","metrics","review","onReviewClick","onExploreClick","score","content","questionsToReview","contentCompleted","skin","translate","primarySkinColor","reviewLocale","exploreLocale","coursesLocale","questionsLocale","skillFocusLocale","contentCompletedLocale","buttonReviewProps","customStyle","backgroundColor","transition","padding","disabled","onClick","label","buttonExploreProps","color","hoverColor","hoverBackgroundColor","icon","position","faIcon","name","size","ProgressBar","progressBarColor","inlineProgressValueStyle","width","progressWrapper","progress","learnerSkillCardWrapper","skillCoursesAndQuestionsWrapper","skillInformation","skillInformationNumber","skillTitleWrapper","skillFocusBadge","faSize","wrapperSize","progressInformations","progressInformation","progressInformationNumber","ctaWrapper","buttonWrapper","contextTypes","childContextTypes","propTypes","string","bool","shape","number","func"],"sources":["../../../src/molecule/learner-skill-card/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport {convert} from 'css-color-function';\nimport {get} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport Icon from '../../atom/icon';\nimport ButtonLink from '../../atom/button-link';\nimport Provider from '../../atom/provider';\nimport style from './style.css';\n\nconst LearnerSkillCard = (props, context) => {\n const {\n 'aria-label': ariaLabel,\n skillTitle,\n skillAriaLabel,\n focus = false,\n metrics,\n review = false,\n onReviewClick,\n onExploreClick\n } = props;\n const {score, content, questionsToReview, contentCompleted = 0} = metrics;\n const {skin, translate} = context;\n const primarySkinColor = get('common.primary', skin);\n\n const reviewLocale = translate('Review');\n const exploreLocale = translate('Explore');\n const coursesLocale = translate('courses');\n const questionsLocale = translate('questions');\n const skillFocusLocale = translate('skill_focus');\n const contentCompletedLocale = translate('courses_completed');\n\n const buttonReviewProps = {\n customStyle: {\n backgroundColor: '#FFF',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',\n padding: '0px'\n },\n disabled: !review,\n onClick: onReviewClick,\n 'aria-label': `${skillTitle}, ${reviewLocale}`,\n label: reviewLocale,\n 'data-name': 'learner-skill-card-review-button'\n };\n\n const buttonExploreProps = {\n customStyle: {\n backgroundColor: convert(`color(${primarySkinColor} a(0.07))`),\n color: primarySkinColor,\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'\n },\n hoverColor: '#FFFFFF',\n hoverBackgroundColor: primarySkinColor,\n onClick: onExploreClick,\n 'aria-label': `${skillTitle}, ${exploreLocale}`,\n label: exploreLocale,\n 'data-name': 'learner-skill-card-explore-button',\n icon: {\n position: 'left',\n faIcon: {\n name: 'compass',\n backgroundColor: convert(`color(${primarySkinColor} a(0.07))`),\n color: primarySkinColor,\n size: 16\n }\n }\n };\n\n const ProgressBar = useCallback(() => {\n if (!content) return null;\n\n const progressBarColor = '#3EC483';\n const inlineProgressValueStyle = {\n backgroundColor: progressBarColor,\n width: `${score}%`\n };\n\n return (\n <div className={style.progressWrapper}>\n <div\n data-name=\"progress\"\n className={style.progress}\n style={inlineProgressValueStyle}\n role=\"progressbar\"\n aria-label={get('progression', ariaLabel)}\n />\n </div>\n );\n }, [score, ariaLabel, content]);\n\n return (\n <div\n className={style.learnerSkillCardWrapper}\n data-name=\"learner-skill-card-wrapper\"\n aria-label={ariaLabel}\n >\n {content || questionsToReview ? (\n <div className={style.skillCoursesAndQuestionsWrapper}>\n {content ? (\n <div className={style.skillInformation} data-name=\"skill-courses\">\n <span className={style.skillInformationNumber}>{content}</span> {coursesLocale}\n </div>\n ) : null}\n {questionsToReview ? (\n <div className={style.skillInformation} data-name=\"skill-questions\">\n <span className={style.skillInformationNumber}>{questionsToReview}</span>\n {questionsLocale}\n </div>\n ) : null}\n </div>\n ) : null}\n <div className={style.skillTitleWrapper}>\n <div\n data-name=\"skill-title\"\n className={style.skillTitle}\n aria-label={skillAriaLabel || skillTitle}\n >\n {skillTitle}\n </div>\n {focus ? (\n <div className={style.skillFocusBadge}>\n <Icon\n iconName=\"bullseye-arrow\"\n backgroundColor=\"#DDD1FF\"\n size={{\n faSize: 10,\n wrapperSize: 16\n }}\n />\n {skillFocusLocale}\n </div>\n ) : null}\n </div>\n <ProgressBar />\n <div className={style.progressInformations}>\n {content ? (\n <>\n <div className={style.progressInformation} data-name=\"skill-completed-courses\">\n <span className={style.progressInformationNumber}>{contentCompleted}</span>\n {` ${contentCompletedLocale}`}\n </div>\n <div className={style.progressInformation} data-name=\"completed-percentage\">\n <span className={style.progressInformationNumber}>{score}%</span>\n </div>\n </>\n ) : null}\n </div>\n <div className={style.ctaWrapper} data-name=\"cta-wrapper\">\n <ButtonLink {...buttonReviewProps} />\n <div className={style.buttonWrapper} data-name=\"button-explore-wrapper\">\n <ButtonLink {...buttonExploreProps} />\n </div>\n </div>\n </div>\n );\n};\n\nLearnerSkillCard.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nLearnerSkillCard.propTypes = {\n 'aria-label': PropTypes.string,\n skillTitle: PropTypes.string,\n skillAriaLabel: PropTypes.string,\n focus: PropTypes.bool,\n metrics: PropTypes.shape({\n score: PropTypes.number,\n content: PropTypes.number,\n questionsToReview: PropTypes.number,\n contentCompleted: PropTypes.number\n }),\n review: PropTypes.bool,\n onReviewClick: PropTypes.func,\n onExploreClick: PropTypes.func\n};\n\nexport default LearnerSkillCard;\n"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,SAAQC,OAAR,QAAsB,oBAAtB;AAEA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,gBAAgB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC3C,MAAM;IACJ,cAAcC,SADV;IAEJC,UAFI;IAGJC,cAHI;IAIJC,KAAK,GAAG,KAJJ;IAKJC,OALI;IAMJC,MAAM,GAAG,KANL;IAOJC,aAPI;IAQJC;EARI,IASFT,KATJ;EAUA,MAAM;IAACU,KAAD;IAAQC,OAAR;IAAiBC,iBAAjB;IAAoCC,gBAAgB,GAAG;EAAvD,IAA4DP,OAAlE;EACA,MAAM;IAACQ,IAAD;IAAOC;EAAP,IAAoBd,OAA1B;;EACA,MAAMe,gBAAgB,GAAG,KAAI,gBAAJ,EAAsBF,IAAtB,CAAzB;;EAEA,MAAMG,YAAY,GAAGF,SAAS,CAAC,QAAD,CAA9B;EACA,MAAMG,aAAa,GAAGH,SAAS,CAAC,SAAD,CAA/B;EACA,MAAMI,aAAa,GAAGJ,SAAS,CAAC,SAAD,CAA/B;EACA,MAAMK,eAAe,GAAGL,SAAS,CAAC,WAAD,CAAjC;EACA,MAAMM,gBAAgB,GAAGN,SAAS,CAAC,aAAD,CAAlC;EACA,MAAMO,sBAAsB,GAAGP,SAAS,CAAC,mBAAD,CAAxC;EAEA,MAAMQ,iBAAiB,GAAG;IACxB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;EAa3BzD,cAAc,EAAEf,SAAS,CAACwE;AAbC,CAA7B;AAgBA,eAAenE,gBAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","convert","PropTypes","Icon","ButtonLink","Provider","ProgressBar","COLORS","style","MAX_SCORE","LearnerSkillCard","props","context","ariaLabel","skillTitle","skillAriaLabel","focus","metrics","review","onReviewClick","onExploreClick","score","content","questionsToReview","skin","translate","primarySkinColor","reviewLocale","exploreLocale","questionsLocale","skillFocusLocale","buttonReviewProps","customStyle","backgroundColor","transition","padding","disabled","onClick","label","buttonExploreProps","color","hoverColor","hoverBackgroundColor","icon","position","faIcon","name","size","learnerSkillCardWrapper","skillQuestionsWrapper","skillInformation","skillInformationNumber","skillTitleWrapper","skillFocusBadge","faSize","wrapperSize","progressInformations","progressWrapper","positive","progressInformation","progressInformationNumber","ctaWrapper","buttonWrapper","contextTypes","childContextTypes","propTypes","string","bool","shape","number","func"],"sources":["../../../src/molecule/learner-skill-card/index.js"],"sourcesContent":["import React from 'react';\nimport {convert} from 'css-color-function';\nimport {get} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport Icon from '../../atom/icon';\nimport ButtonLink from '../../atom/button-link';\nimport Provider from '../../atom/provider';\nimport ProgressBar from '../progress-bar';\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\n\nconst MAX_SCORE = 100;\n\nconst LearnerSkillCard = (props, context) => {\n const {\n 'aria-label': ariaLabel,\n skillTitle,\n skillAriaLabel,\n focus = false,\n metrics,\n review = false,\n onReviewClick,\n onExploreClick\n } = props;\n const {score, content, questionsToReview = 0} = metrics;\n const {skin, translate} = context;\n const primarySkinColor = get('common.primary', skin);\n\n const reviewLocale = translate('Review');\n const exploreLocale = translate('Explore');\n const questionsLocale = translate('skill_chart_side_panel_questions_to_review');\n const skillFocusLocale = translate('skill_focus');\n\n const buttonReviewProps = {\n customStyle: {\n backgroundColor: '#FFF',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',\n padding: '0px'\n },\n disabled: !review,\n onClick: onReviewClick,\n 'aria-label': `${skillTitle}, ${reviewLocale}`,\n label: reviewLocale,\n 'data-name': 'learner-skill-card-review-button'\n };\n\n const buttonExploreProps = {\n customStyle: {\n backgroundColor: convert(`color(${primarySkinColor} a(0.07))`),\n color: primarySkinColor,\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'\n },\n hoverColor: '#FFFFFF',\n hoverBackgroundColor: primarySkinColor,\n onClick: onExploreClick,\n 'aria-label': `${skillTitle}, ${exploreLocale}`,\n label: exploreLocale,\n 'data-name': 'learner-skill-card-explore-button',\n icon: {\n position: 'left',\n faIcon: {\n name: 'compass',\n backgroundColor: convert(`color(${primarySkinColor} a(0.07))`),\n color: primarySkinColor,\n size: 16\n }\n }\n };\n return (\n <div\n className={style.learnerSkillCardWrapper}\n data-name=\"learner-skill-card-wrapper\"\n aria-label={ariaLabel}\n >\n {questionsToReview ? (\n <div className={style.skillQuestionsWrapper}>\n <div className={style.skillInformation} data-name=\"skill-questions\">\n <span className={style.skillInformationNumber}>{questionsToReview}</span>\n {questionsLocale}\n </div>\n </div>\n ) : null}\n <div className={style.skillTitleWrapper}>\n <div\n data-name=\"skill-title\"\n className={style.skillTitle}\n aria-label={skillAriaLabel || skillTitle}\n >\n {skillTitle}\n </div>\n {focus ? (\n <div className={style.skillFocusBadge}>\n <Icon\n iconName=\"bullseye-arrow\"\n backgroundColor=\"#DDD1FF\"\n size={{\n faSize: 10,\n wrapperSize: 16\n }}\n />\n {skillFocusLocale}\n </div>\n ) : null}\n </div>\n {content ? (\n <div className={style.progressInformations}>\n <ProgressBar\n value={score}\n displayInfo={false}\n max={MAX_SCORE}\n className={style.progressWrapper}\n style={{backgroundColor: COLORS.positive}}\n />\n <div className={style.progressInformation} data-name=\"completed-percentage\">\n <span className={style.progressInformationNumber}>{score}%</span>\n </div>\n </div>\n ) : null}\n <div className={style.ctaWrapper} data-name=\"cta-wrapper\">\n <ButtonLink {...buttonReviewProps} />\n <div className={style.buttonWrapper} data-name=\"button-explore-wrapper\">\n <ButtonLink {...buttonExploreProps} />\n </div>\n </div>\n </div>\n );\n};\n\nLearnerSkillCard.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nLearnerSkillCard.propTypes = {\n 'aria-label': PropTypes.string,\n skillTitle: PropTypes.string,\n skillAriaLabel: PropTypes.string,\n focus: PropTypes.bool,\n metrics: PropTypes.shape({\n score: PropTypes.number,\n content: PropTypes.number,\n questionsToReview: PropTypes.number\n }),\n review: PropTypes.bool,\n onReviewClick: PropTypes.func,\n onExploreClick: PropTypes.func\n};\n\nexport default LearnerSkillCard;\n"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAAQC,OAAR,QAAsB,oBAAtB;AAEA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,SAAQC,MAAR,QAAqB,wBAArB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,SAAS,GAAG,GAAlB;;AAEA,MAAMC,gBAAgB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC3C,MAAM;IACJ,cAAcC,SADV;IAEJC,UAFI;IAGJC,cAHI;IAIJC,KAAK,GAAG,KAJJ;IAKJC,OALI;IAMJC,MAAM,GAAG,KANL;IAOJC,aAPI;IAQJC;EARI,IASFT,KATJ;EAUA,MAAM;IAACU,KAAD;IAAQC,OAAR;IAAiBC,iBAAiB,GAAG;EAArC,IAA0CN,OAAhD;EACA,MAAM;IAACO,IAAD;IAAOC;EAAP,IAAoBb,OAA1B;;EACA,MAAMc,gBAAgB,GAAG,KAAI,gBAAJ,EAAsBF,IAAtB,CAAzB;;EAEA,MAAMG,YAAY,GAAGF,SAAS,CAAC,QAAD,CAA9B;EACA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9BvC,IAAI,EAAEnB,QAAQ,CAAC2D,iBAAT,CAA2BxC,IADH;EAE9BC,SAAS,EAAEpB,QAAQ,CAAC2D,iBAAT,CAA2BvC;AAFR,CAAhC;AAKAf,gBAAgB,CAACuD,SAAjB,2CAA6B;EAC3B,cAAc/D,SAAS,CAACgE,MADG;EAE3BpD,UAAU,EAAEZ,SAAS,CAACgE,MAFK;EAG3BnD,cAAc,EAAEb,SAAS,CAACgE,MAHC;EAI3BlD,KAAK,EAAEd,SAAS,CAACiE,IAJU;EAK3BlD,OAAO,EAAEf,SAAS,CAACkE,KAAV,CAAgB;IACvB/C,KAAK,EAAEnB,SAAS,CAACmE,MADM;IAEvB/C,OAAO,EAAEpB,SAAS,CAACmE,MAFI;IAGvB9C,iBAAiB,EAAErB,SAAS,CAACmE;EAHN,CAAhB,CALkB;EAU3BnD,MAAM,EAAEhB,SAAS,CAACiE,IAVS;EAW3BhD,aAAa,EAAEjB,SAAS,CAACoE,IAXE;EAY3BlD,cAAc,EAAElB,SAAS,CAACoE;AAZC,CAA7B;AAeA,eAAe5D,gBAAf"}
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.10);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
.
|
|
39
|
+
.skillQuestionsWrapper,
|
|
40
40
|
.progressInformations {
|
|
41
41
|
display: flex;
|
|
42
42
|
justify-content: space-between;
|
|
@@ -90,6 +90,7 @@
|
|
|
90
90
|
|
|
91
91
|
.progressWrapper {
|
|
92
92
|
position: relative;
|
|
93
|
+
top: 4px;
|
|
93
94
|
left: 0;
|
|
94
95
|
width: 100%;
|
|
95
96
|
height: 4px;
|
|
@@ -99,13 +100,9 @@
|
|
|
99
100
|
margin-bottom: 8px;
|
|
100
101
|
}
|
|
101
102
|
|
|
102
|
-
.progress {
|
|
103
|
-
display: block;
|
|
104
|
-
height: 4px;
|
|
105
|
-
animation: progressbar 2s ease-in-out;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
103
|
.progressInformations {
|
|
104
|
+
display: flex;
|
|
105
|
+
gap: 8px;
|
|
109
106
|
min-height: 12px;
|
|
110
107
|
margin-bottom: 24px;
|
|
111
108
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/certification-detail/index.js"],"names":[],"mappings":";AAgBA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/certification-detail/index.js"],"names":[],"mappings":";AAgBA,4EAuHC"}
|
|
@@ -46,11 +46,13 @@ const CertificationDetail = (props, context) => {
|
|
|
46
46
|
const [showMore, setShowMore] = useState(false);
|
|
47
47
|
const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);
|
|
48
48
|
useEffect(() => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
if (descriptionRef.current) {
|
|
50
|
+
const {
|
|
51
|
+
clientHeight = 0,
|
|
52
|
+
scrollHeight = 0
|
|
53
|
+
} = descriptionRef.current;
|
|
54
|
+
setIsDescriptionTruncated(scrollHeight > clientHeight);
|
|
55
|
+
}
|
|
54
56
|
}, [description]);
|
|
55
57
|
const Description = useCallback(() => {
|
|
56
58
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useEffect","useRef","useState","useMemo","PropTypes","classnames","Markdown","Provider","Tag","SelectOptionPropTypes","ButtonLinkIcon","Icon","CardsGrid","AllCourses","ContinueLearningButton","ProgressWrapper","style","CertificationDetail","props","context","certificationRef","title","description","certificationCourses","ongoingCoursesAvailable","filters","onBackClick","onContinueLearningClick","metrics","logoUrl","diplomaUrl","badgeUrl","descriptionRef","translate","progression","mandatoryModules","stars","totalModules","isDescriptionTruncated","setIsDescriptionTruncated","showMore","setShowMore","handleShowMore","clientHeight","scrollHeight","current","Description","truncate","completedModules","backgroundContainer","container","backButton","ctaContainer","logoContainer","logo","showMoreWrapper","faSize","wrapperSize","contentStats","type","downloadUrl","contextTypes","skin","childContextTypes","propTypes","string","isRequired","shape","number","bool","onChange","func","options","arrayOf"],"sources":["../../../src/template/certification-detail/index.js"],"sourcesContent":["import React, {useCallback, useEffect, useRef, useState, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {compact, lowerCase, round, isNil} from 'lodash/fp';\nimport Markdown from 'markdown-to-jsx';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport {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 {ContinueLearningButton} from '../skill-detail';\nimport ProgressWrapper from '../../molecule/progress-wrapper';\nimport style from './style.css';\n\nconst CertificationDetail = (props, context) => {\n const {\n certificationRef,\n title,\n description,\n certificationCourses,\n ongoingCoursesAvailable,\n filters,\n onBackClick,\n onContinueLearningClick,\n metrics,\n logoUrl,\n diplomaUrl,\n badgeUrl\n } = props;\n const descriptionRef = useRef(null);\n const {translate} = context;\n const {progression, mandatoryModules, stars, totalModules} = metrics;\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 const {clientHeight = 0, scrollHeight = 0} = descriptionRef.current;\n setIsDescriptionTruncated(scrollHeight > clientHeight);\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 const completedModules = useMemo(\n () => round((mandatoryModules * progression) / 100),\n [mandatoryModules, progression]\n );\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={certificationRef}>\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.logoContainer}>\n <img className={style.logo} src={logoUrl} />\n </div>\n <div>\n <Tag label={translate('certification')} />\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.contentStats}>\n <span>{`${totalModules} ${lowerCase(translate('modules'))}`}</span>\n </div>\n <ContinueLearningButton\n ongoingCoursesAvailable={ongoingCoursesAvailable}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n <ProgressWrapper\n title={translate('your_progress')}\n subtitle={translate('certification_progress_wrapper_subtitle')}\n progression={progression}\n completedModules={completedModules}\n mandatoryModules={mandatoryModules}\n sections={compact([\n {\n type: 'diploma',\n downloadUrl: diplomaUrl\n },\n badgeUrl && {\n type: 'badge',\n downloadUrl: badgeUrl\n },\n {\n type: 'stars',\n stars\n }\n ])}\n />\n <AllCourses\n content={certificationCourses}\n filters={filters}\n data-name=\"certification-courses\"\n />\n </div>\n </div>\n );\n};\n\nCertificationDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nCertificationDetail.propTypes = {\n title: PropTypes.string.isRequired,\n certificationRef: PropTypes.string.isRequired,\n description: PropTypes.string.isRequired,\n logoUrl: PropTypes.string,\n metrics: PropTypes.shape({\n progression: PropTypes.number,\n stars: PropTypes.number,\n mandatoryModules: PropTypes.number,\n totalModules: PropTypes.number\n }),\n diplomaUrl: PropTypes.string,\n badgeUrl: PropTypes.string,\n ongoingCoursesAvailable: PropTypes.bool,\n certificationCourses: PropTypes.shape(CardsGrid.propTypes),\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n onBackClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default CertificationDetail;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,SAA5B,EAAuCC,MAAvC,EAA+CC,QAA/C,EAAyDC,OAAzD,QAAuE,OAAvE;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,SAAQC,qBAAR,QAAoC,mBAApC;AACA,OAAOC,cAAP,MAA2B,6BAA3B;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,UAAP,MAAuB,6BAAvB;AACA,SAAQC,sBAAR,QAAqC,iBAArC;AACA,OAAOC,eAAP,MAA4B,iCAA5B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,mBAAmB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC9C,MAAM;IACJC,gBADI;IAEJC,KAFI;IAGJC,WAHI;IAIJC,oBAJI;IAKJC,uBALI;IAMJC,OANI;IAOJC,WAPI;IAQJC,uBARI;IASJC,OATI;IAUJC,OAVI;IAWJC,UAXI;IAYJC;EAZI,IAaFb,KAbJ;EAcA,MAAMc,cAAc,GAAG/B,MAAM,CAAC,IAAD,CAA7B;EACA,MAAM;IAACgC;EAAD,IAAcd,OAApB;EACA,MAAM;IAACe,WAAD;IAAcC,gBAAd;IAAgCC,KAAhC;IAAuCC;EAAvC,IAAuDT,OAA7D;EAEA,MAAM,CAACU,s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gB;IACvBG,QAAQ,EAAElE,SAAS,CAACmE,IADG;IAEvBC,OAAO,EAAEpE,SAAS,CAACqE,OAAV,CAAkBrE,SAAS,CAAC+D,KAAV,CAAgB1D,qBAAhB,CAAlB;EAFc,CAAhB,CAfqB;EAmB9BiB,WAAW,EAAEtB,SAAS,CAACmE,IAnBO;EAoB9B5C,uBAAuB,EAAEvB,SAAS,CAACmE;AApBL,CAAhC;AAuBA,eAAetD,mBAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useEffect","useRef","useState","useMemo","PropTypes","classnames","Markdown","Provider","Tag","SelectOptionPropTypes","ButtonLinkIcon","Icon","CardsGrid","AllCourses","ContinueLearningButton","ProgressWrapper","style","CertificationDetail","props","context","certificationRef","title","description","certificationCourses","ongoingCoursesAvailable","filters","onBackClick","onContinueLearningClick","metrics","logoUrl","diplomaUrl","badgeUrl","descriptionRef","translate","progression","mandatoryModules","stars","totalModules","isDescriptionTruncated","setIsDescriptionTruncated","showMore","setShowMore","handleShowMore","current","clientHeight","scrollHeight","Description","truncate","completedModules","backgroundContainer","container","backButton","ctaContainer","logoContainer","logo","showMoreWrapper","faSize","wrapperSize","contentStats","type","downloadUrl","contextTypes","skin","childContextTypes","propTypes","string","isRequired","shape","number","bool","onChange","func","options","arrayOf"],"sources":["../../../src/template/certification-detail/index.js"],"sourcesContent":["import React, {useCallback, useEffect, useRef, useState, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {compact, lowerCase, round, isNil} from 'lodash/fp';\nimport Markdown from 'markdown-to-jsx';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport {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 {ContinueLearningButton} from '../skill-detail';\nimport ProgressWrapper from '../../molecule/progress-wrapper';\nimport style from './style.css';\n\nconst CertificationDetail = (props, context) => {\n const {\n certificationRef,\n title,\n description,\n certificationCourses,\n ongoingCoursesAvailable,\n filters,\n onBackClick,\n onContinueLearningClick,\n metrics,\n logoUrl,\n diplomaUrl,\n badgeUrl\n } = props;\n const descriptionRef = useRef(null);\n const {translate} = context;\n const {progression, mandatoryModules, stars, totalModules} = metrics;\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 const completedModules = useMemo(\n () => round((mandatoryModules * progression) / 100),\n [mandatoryModules, progression]\n );\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={certificationRef}>\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.logoContainer}>\n <img className={style.logo} src={logoUrl} />\n </div>\n <div>\n <Tag label={translate('certification')} />\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.contentStats}>\n <span>{`${totalModules} ${lowerCase(translate('modules'))}`}</span>\n </div>\n <ContinueLearningButton\n ongoingCoursesAvailable={ongoingCoursesAvailable}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n <ProgressWrapper\n title={translate('your_progress')}\n subtitle={translate('certification_progress_wrapper_subtitle')}\n progression={progression}\n completedModules={completedModules}\n mandatoryModules={mandatoryModules}\n sections={compact([\n {\n type: 'diploma',\n downloadUrl: diplomaUrl\n },\n badgeUrl && {\n type: 'badge',\n downloadUrl: badgeUrl\n },\n {\n type: 'stars',\n stars\n }\n ])}\n />\n <AllCourses\n content={certificationCourses}\n filters={filters}\n data-name=\"certification-courses\"\n />\n </div>\n </div>\n );\n};\n\nCertificationDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nCertificationDetail.propTypes = {\n title: PropTypes.string.isRequired,\n certificationRef: PropTypes.string.isRequired,\n description: PropTypes.string.isRequired,\n logoUrl: PropTypes.string,\n metrics: PropTypes.shape({\n progression: PropTypes.number,\n stars: PropTypes.number,\n mandatoryModules: PropTypes.number,\n totalModules: PropTypes.number\n }),\n diplomaUrl: PropTypes.string,\n badgeUrl: PropTypes.string,\n ongoingCoursesAvailable: PropTypes.bool,\n certificationCourses: PropTypes.shape(CardsGrid.propTypes),\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n onBackClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default CertificationDetail;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,SAA5B,EAAuCC,MAAvC,EAA+CC,QAA/C,EAAyDC,OAAzD,QAAuE,OAAvE;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,SAAQC,qBAAR,QAAoC,mBAApC;AAC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K,EAAEjB,SAAS,CAAC6D,MAAV,CAAiBC,UADM;EAE9B9C,gBAAgB,EAAEhB,SAAS,CAAC6D,MAAV,CAAiBC,UAFL;EAG9B5C,WAAW,EAAElB,SAAS,CAAC6D,MAAV,CAAiBC,UAHA;EAI9BrC,OAAO,EAAEzB,SAAS,CAAC6D,MAJW;EAK9BrC,OAAO,EAAExB,SAAS,CAAC+D,KAAV,CAAgB;IACvBjC,WAAW,EAAE9B,SAAS,CAACgE,MADA;IAEvBhC,KAAK,EAAEhC,SAAS,CAACgE,MAFM;IAGvBjC,gBAAgB,EAAE/B,SAAS,CAACgE,MAHL;IAIvB/B,YAAY,EAAEjC,SAAS,CAACgE;EAJD,CAAhB,CALqB;EAW9BtC,UAAU,EAAE1B,SAAS,CAAC6D,MAXQ;EAY9BlC,QAAQ,EAAE3B,SAAS,CAAC6D,MAZU;EAa9BzC,uBAAuB,EAAEpB,SAAS,CAACiE,IAbL;EAc9B9C,oBAAoB,EAAEnB,SAAS,CAAC+D,KAAV,CAAgBvD,SAAS,CAACoD,SAA1B,CAdQ;EAe9BvC,OAAO,EAAErB,SAAS,CAAC+D,KAAV,CAAgB;IACvBG,QAAQ,EAAElE,SAAS,CAACmE,IADG;IAEvBC,OAAO,EAAEpE,SAAS,CAACqE,OAAV,CAAkBrE,SAAS,CAAC+D,KAAV,CAAgB1D,qBAAhB,CAAlB;EAFc,CAAhB,CAfqB;EAmB9BiB,WAAW,EAAEtB,SAAS,CAACmE,IAnBO;EAoB9B5C,uBAAuB,EAAEvB,SAAS,CAACmE;AApBL,CAAhC;AAuBA,eAAetD,mBAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/my-learning/index.js"],"names":[],"mappings":";AAgHA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/my-learning/index.js"],"names":[],"mappings":";AAgHA,mEA+ZC"}
|
|
@@ -407,8 +407,7 @@ const MyLearning = (props, context) => {
|
|
|
407
407
|
const {
|
|
408
408
|
score,
|
|
409
409
|
content,
|
|
410
|
-
questionsToReview
|
|
411
|
-
contentCompleted
|
|
410
|
+
questionsToReview
|
|
412
411
|
} = skillsInformation[skill] ? skillsInformation[skill].stats : defaultStats;
|
|
413
412
|
return /*#__PURE__*/React.createElement("div", {
|
|
414
413
|
key: index
|
|
@@ -418,8 +417,7 @@ const MyLearning = (props, context) => {
|
|
|
418
417
|
metrics: {
|
|
419
418
|
score: score.toFixed(1),
|
|
420
419
|
content,
|
|
421
|
-
questionsToReview
|
|
422
|
-
contentCompleted
|
|
420
|
+
questionsToReview
|
|
423
421
|
},
|
|
424
422
|
review: skillsInformation[skill] ? skillsInformation[skill].availableForReview : false,
|
|
425
423
|
onReviewClick: handleReviewSkill,
|