@coorpacademy/components 11.32.41 → 11.32.42-alpha.7
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/molecule/certification-card/index.d.ts.map +1 -1
- package/es/molecule/certification-card/index.js +4 -2
- package/es/molecule/certification-card/index.js.map +1 -1
- package/es/molecule/certification-card/style.css +23 -7
- package/es/molecule/progress-wrapper/index.js +1 -1
- package/es/molecule/progress-wrapper/index.js.map +1 -1
- package/es/molecule/progress-wrapper/style.css +1 -0
- package/es/template/certification-detail/index.d.ts.map +1 -1
- package/es/template/certification-detail/index.js +15 -4
- package/es/template/certification-detail/index.js.map +1 -1
- package/es/template/certification-detail/style.css +0 -1
- package/es/template/certifications/style.css +2 -0
- package/lib/molecule/certification-card/index.d.ts.map +1 -1
- package/lib/molecule/certification-card/index.js +4 -2
- package/lib/molecule/certification-card/index.js.map +1 -1
- package/lib/molecule/certification-card/style.css +23 -7
- package/lib/molecule/progress-wrapper/index.js +1 -1
- package/lib/molecule/progress-wrapper/index.js.map +1 -1
- package/lib/molecule/progress-wrapper/style.css +1 -0
- package/lib/template/certification-detail/index.d.ts.map +1 -1
- package/lib/template/certification-detail/index.js +14 -4
- package/lib/template/certification-detail/index.js.map +1 -1
- package/lib/template/certification-detail/style.css +0 -1
- package/lib/template/certifications/style.css +2 -0
- package/locales/en/global.json +2 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/certification-card/index.js"],"names":[],"mappings":";AAQA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/certification-card/index.js"],"names":[],"mappings":";AAQA,0EA0DC"}
|
|
@@ -53,10 +53,12 @@ const CertificationCard = (props, context) => {
|
|
|
53
53
|
},
|
|
54
54
|
icon: progressIconProps
|
|
55
55
|
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
56
|
-
className: style.
|
|
56
|
+
className: style.imageSection
|
|
57
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
58
|
+
className: style.imageContainer
|
|
57
59
|
}, /*#__PURE__*/React.createElement("img", {
|
|
58
60
|
src: imgUrl
|
|
59
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
60
62
|
className: style.detailWrapper
|
|
61
63
|
}, /*#__PURE__*/React.createElement("div", {
|
|
62
64
|
className: style.titleWrapper
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","COLORS","Provider","Tag","ProgressBar","style","CertificationCard","props","context","label","goal","progress","imgUrl","onClick","title","condition","nbDone","translate","isInprogress","progressLabel","progressTagType","progressIconProps","position","iconName","iconColor","backgroundColor","size","faSize","wrapperSize","customStyle","padding","container","top","right","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","COLORS","Provider","Tag","ProgressBar","style","CertificationCard","props","context","label","goal","progress","imgUrl","onClick","title","condition","nbDone","translate","isInprogress","progressLabel","progressTagType","progressIconProps","position","iconName","iconColor","backgroundColor","size","faSize","wrapperSize","customStyle","padding","container","top","right","imageSection","imageContainer","detailWrapper","titleWrapper","moduleCount","customProgressBar","positive","contextTypes","childContextTypes","propTypes","string","shape","number","func"],"sources":["../../../src/molecule/certification-card/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {COLORS} from '../../variables/colors';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport ProgressBar from '../progress-bar';\nimport style from './style.css';\n\nconst CertificationCard = (props, context) => {\n const {label, goal, progress, imgUrl, onClick} = props;\n const {\n title,\n condition: {nbDone}\n } = goal;\n const {translate} = context;\n\n const isInprogress = progress < 100;\n const progressLabel = isInprogress ? translate('in_progress') : translate('completed');\n const progressTagType = isInprogress ? 'progress' : 'success';\n const progressIconProps = {\n position: 'left',\n iconName: isInprogress ? 'clock' : 'circle-check',\n iconColor: isInprogress ? '#B87A00' : '#05944F',\n backgroundColor: isInprogress ? '#FFEECC' : '#D6F5E5',\n size: {\n faSize: 10,\n wrapperSize: 10\n },\n customStyle: {padding: 0}\n };\n return (\n <div className={style.container} data-name={`certification-card-${label}`} onClick={onClick}>\n {progress > 0 ? (\n <Tag\n label={progressLabel}\n type={progressTagType}\n customStyle={{position: 'absolute', top: '12px', right: '12px'}}\n icon={progressIconProps}\n />\n ) : null}\n <div className={style.imageSection}>\n <div className={style.imageContainer}>\n <img src={imgUrl} />\n </div>\n </div>\n <div className={style.detailWrapper}>\n <div className={style.titleWrapper}>\n <Tag label={translate('certification')} size=\"S\" />\n <div className={style.title} data-name=\"certification-title\">\n {title}\n </div>\n <div className={style.moduleCount}>\n <span>{nbDone}</span>\n {` ${translate('certification_module')}`}\n </div>\n </div>\n <ProgressBar\n className={style.customProgressBar}\n style={{backgroundColor: COLORS.positive}}\n displayInfo={false}\n value={progress}\n max={100}\n />\n </div>\n </div>\n );\n};\n\nCertificationCard.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nCertificationCard.propTypes = {\n label: PropTypes.string,\n goal: PropTypes.shape({\n title: PropTypes.string,\n condition: PropTypes.shape({\n nbDone: PropTypes.number\n })\n }),\n progress: PropTypes.number,\n imgUrl: PropTypes.string,\n onClick: PropTypes.func\n};\n\nexport default CertificationCard;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,MAAR,QAAqB,wBAArB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,iBAAiB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC5C,MAAM;IAACC,KAAD;IAAQC,IAAR;IAAcC,QAAd;IAAwBC,MAAxB;IAAgCC;EA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
|
+
.imageSection {
|
|
26
26
|
display: flex;
|
|
27
27
|
justify-content: center;
|
|
28
28
|
align-items: center;
|
|
@@ -30,22 +30,38 @@
|
|
|
30
30
|
height: 160px;
|
|
31
31
|
width: auto;
|
|
32
32
|
transition: all 0.5s ease-out;
|
|
33
|
+
border-top-left-radius: 12px;
|
|
34
|
+
border-top-right-radius: 12px;
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
width: 100px;
|
|
36
|
+
.imageContainer {
|
|
36
37
|
transition: all 0.5s ease-out;
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
|
|
41
|
+
.imageContainer {
|
|
42
|
+
width: 202px;
|
|
43
|
+
height: 112px;
|
|
44
|
+
display: flex;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
align-items: center;
|
|
47
|
+
|
|
48
|
+
img {
|
|
49
|
+
width: 100%;
|
|
50
|
+
height: 100%;
|
|
51
|
+
object-fit: contain;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
40
55
|
.container:hover {
|
|
41
56
|
box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.14);
|
|
42
57
|
|
|
58
|
+
.imageContainer {
|
|
59
|
+
width: 244px;
|
|
60
|
+
height: 136px;
|
|
61
|
+
}
|
|
62
|
+
|
|
43
63
|
.imageWrapper {
|
|
44
64
|
background-color: cm_grey_75;
|
|
45
|
-
|
|
46
|
-
img {
|
|
47
|
-
width: 115px;
|
|
48
|
-
}
|
|
49
65
|
}
|
|
50
66
|
}
|
|
51
67
|
.detailWrapper {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","Title","ProgressBar","COLORS","Tag","ButtonLink","Icon","Provider","style","uncappedMap","convert","cap","DetailSection","index","type","isLocked","downloadUrl","stars","context","translate","isTypeStars","DownloadButton","target","href","backgroundColor","color","width","position","faIcon","name","size","customStyle","padding","LockedTag","iconName","iconColor","preset","detailsInfo","detailsInfoText","detailsTitle","img","buttonContainer","ProgressWrapper","completedModules","mandatoryModules","title","subtitle","progression","sections","mandatoryCompletedModulesLocale","container","titleContainer","statscontainer","stats","statsNumber","customProgressBar","positive","statsProgressionMobile","details","section","commonDetailSectionPropTypes","oneOf","string","number","contextTypes","childContextTypes","propTypes","bool","arrayOf","shape"],"sources":["../../../src/molecule/progress-wrapper/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, map} from 'lodash/fp';\nimport Title from '../../atom/title';\nimport ProgressBar from '../progress-bar';\nimport {COLORS} from '../../variables/colors';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport Icon from '../../atom/icon';\nimport Provider from '../../atom/provider';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from './style.css';\n\nconst uncappedMap = map.convert({cap: false});\n\nconst DetailSection = ({index, type, isLocked, downloadUrl, stars}, context) => {\n const {translate} = context;\n const isTypeStars = type === 'stars';\n\n const DownloadButton = (\n <ButtonLink\n label={translate('download')}\n link={{\n target: '_blank',\n href: downloadUrl\n }}\n data-name={`download-${type}-button`}\n aria-label={`download ${type} button`}\n customStyle={{backgroundColor: '#F1F6FE', color: '#0061FF', width: 'auto'}}\n icon={{\n position: 'left',\n faIcon: {\n name: 'download',\n color: '#0061FF',\n size: 14,\n customStyle: {padding: 0}\n }\n }}\n disabled={isLocked}\n />\n );\n\n const LockedTag = (\n <Tag\n label=\"Locked\"\n size=\"S\"\n icon={{\n position: 'left',\n iconName: 'lock',\n iconColor: '#515161',\n preset: 's',\n customStyle: {padding: 0}\n }}\n />\n );\n\n return isTypeStars ? (\n <div\n className={style[`detailsSection${index}`]}\n data-name={type}\n aria-label={`${type} informations`}\n >\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>{translate('bonus_stars')}</span>\n {isLocked ? LockedTag : null}\n </div>\n <div className={style.stars}>\n <Icon iconName=\"star\" iconColor=\"#FFCE0A\" backgroundColor=\"#FFF9D1\" preset=\"xl\" />\n <span>{stars}</span>\n </div>\n </div>\n </div>\n ) : (\n <div\n className={style[`detailsSection${index}`]}\n data-name={type}\n aria-label={`${type} informations`}\n >\n <img\n className={style.img}\n src={\n type === 'badge'\n ? downloadUrl\n : 'https://s3.eu-west-1.amazonaws.com/static.coorpacademy.com/assets/images/diploma.svg'\n }\n />\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>\n {type === 'diploma' ? translate('diploma') : translate('badge')}\n </span>\n {isLocked ? LockedTag : null}\n </div>\n\n <div className={style.buttonContainer}>{DownloadButton}</div>\n </div>\n </div>\n );\n};\n\nconst ProgressWrapper = (\n {completedModules, mandatoryModules, title, subtitle, progression, sections},\n context\n) => {\n const {translate} = context;\n const mandatoryCompletedModulesLocale = translate('modules_completed_mandatory');\n const isLocked = progression !== 100;\n\n return (\n <div\n className={style.container}\n data-name=\"prgress-wrapper\"\n aria-label=\"progress wrapper section\"\n >\n <div className={style.titleContainer}>\n <Title type=\"form-group\" titleSize=\"medium\" title={title} subtitle={subtitle} />\n </div>\n <div className={style.statscontainer}>\n <div className={style.stats}>\n <div>\n <span className={style.statsNumber} data-name=\"progress-stats\">\n {`${\n completedModules > mandatoryModules ? mandatoryModules : completedModules\n } / ${mandatoryModules}`}\n </span>\n {mandatoryCompletedModulesLocale}\n </div>\n </div>\n <div className={style.progression}>\n <span className={style.statsNumber} data-name=\"progress-value\">\n {progression}%\n </span>\n </div>\n </div>\n <ProgressBar\n className={style.customProgressBar}\n style={{backgroundColor: COLORS.positive}}\n displayInfo={false}\n value={progression}\n max={100}\n />\n <div className={style.statsProgressionMobile}>\n <span className={style.statsNumber}>{progression}%</span>\n </div>\n\n {isEmpty(sections) ? null : (\n <div className={style.details}>\n {uncappedMap(\n (section, index) => (\n <DetailSection\n {...section}\n isLocked={isLocked}\n key={`${section.type}-${index}`}\n index={index}\n />\n ),\n sections\n )}\n </div>\n )}\n </div>\n );\n};\n\nconst commonDetailSectionPropTypes = {\n type: PropTypes.oneOf(['diploma', 'badge', 'stars']),\n downloadUrl: PropTypes.string,\n stars: PropTypes.number\n};\n\nDetailSection.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nDetailSection.propTypes = {\n index: PropTypes.number,\n isLocked: PropTypes.bool,\n ...commonDetailSectionPropTypes\n};\n\nProgressWrapper.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nProgressWrapper.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n completedModules: PropTypes.number,\n mandatoryModules: PropTypes.number,\n progression: PropTypes.number,\n sections: PropTypes.arrayOf(PropTypes.shape(commonDetailSectionPropTypes))\n};\n\nexport default ProgressWrapper;\n"],"mappings":";;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,SAAQC,MAAR,QAAqB,wBAArB;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,QAAP,MAAqB,qBAArB,C,CACA;;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,WAAW,GAAG,KAAIC,OAAJ,CAAY;EAACC,GAAG,EAAE;AAAN,CAAZ,CAApB;;AAEA,MAAMC,aAAa,GAAG,CAAC;EAACC,KAAD;EAAQC,IAAR;EAAcC,QAAd;EAAwBC,WAAxB;EAAqCC;AAArC,CAAD,EAA8CC,OAA9C,KAA0D;EAC9E,MAAM;IAACC;EAAD,IAAcD,OAApB;EACA,MAAME,WAAW,GAAGN,IAAI,KAAK,OAA7B;EAEA,MAAMO,cAAc,gBAClB,oBAAC,UAAD;IACE,KAAK,EAAEF,SAAS,CAAC,UAAD,CADlB;IAEE,IAAI,EAAE;MACJG,MAAM,EAAE,QADJ;MAEJC,IAAI,EAAE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AAS,CAAC8D,MAFY;EAGnC7C,KAAK,EAAEjB,SAAS,CAAC+D;AAHkB,CAArC;AAMAnD,aAAa,CAACoD,YAAd,GAA6B;EAC3B7C,SAAS,EAAEZ,QAAQ,CAAC0D,iBAAT,CAA2B9C;AADX,CAA7B;AAIAP,aAAa,CAACsD,SAAd;EACErD,KAAK,EAAEb,SAAS,CAAC+D,MADnB;EAEEhD,QAAQ,EAAEf,SAAS,CAACmE;AAFtB,GAGKP,4BAHL;AAMAlB,eAAe,CAACsB,YAAhB,GAA+B;EAC7B7C,SAAS,EAAEZ,QAAQ,CAAC0D,iBAAT,CAA2B9C;AADT,CAA/B;AAIAuB,eAAe,CAACwB,SAAhB,2CAA4B;EAC1BrB,KAAK,EAAE7C,SAAS,CAAC8D,MADS;EAE1BhB,QAAQ,EAAE9C,SAAS,CAAC8D,MAFM;EAG1BnB,gBAAgB,EAAE3C,SAAS,CAAC+D,MAHF;EAI1BnB,gBAAgB,EAAE5C,SAAS,CAAC+D,MAJF;EAK1BhB,WAAW,EAAE/C,SAAS,CAAC+D,MALG;EAM1Bf,QAAQ,EAAEhD,SAAS,CAACoE,OAAV,CAAkBpE,SAAS,CAACqE,KAAV,CAAgBT,4BAAhB,CAAlB;AANgB,CAA5B;AASA,eAAelB,eAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","Title","ProgressBar","COLORS","Tag","ButtonLink","Icon","Provider","style","uncappedMap","convert","cap","DetailSection","index","type","isLocked","downloadUrl","stars","context","translate","isTypeStars","DownloadButton","target","href","backgroundColor","color","width","position","faIcon","name","size","customStyle","padding","LockedTag","iconName","iconColor","preset","detailsInfo","detailsInfoText","detailsTitle","img","buttonContainer","ProgressWrapper","completedModules","mandatoryModules","title","subtitle","progression","sections","mandatoryCompletedModulesLocale","container","titleContainer","statscontainer","stats","statsNumber","customProgressBar","positive","statsProgressionMobile","details","section","commonDetailSectionPropTypes","oneOf","string","number","contextTypes","childContextTypes","propTypes","bool","arrayOf","shape"],"sources":["../../../src/molecule/progress-wrapper/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, map} from 'lodash/fp';\nimport Title from '../../atom/title';\nimport ProgressBar from '../progress-bar';\nimport {COLORS} from '../../variables/colors';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport Icon from '../../atom/icon';\nimport Provider from '../../atom/provider';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from './style.css';\n\nconst uncappedMap = map.convert({cap: false});\n\nconst DetailSection = ({index, type, isLocked, downloadUrl, stars}, context) => {\n const {translate} = context;\n const isTypeStars = type === 'stars';\n\n const DownloadButton = (\n <ButtonLink\n label={translate('download')}\n link={{\n target: '_blank',\n href: downloadUrl\n }}\n data-name={`download-${type}-button`}\n aria-label={`download ${type} button`}\n customStyle={{backgroundColor: '#F1F6FE', color: '#0061FF', width: 'auto'}}\n icon={{\n position: 'left',\n faIcon: {\n name: 'download',\n color: '#0061FF',\n size: 14,\n customStyle: {padding: 0}\n }\n }}\n disabled={isLocked}\n />\n );\n\n const LockedTag = (\n <Tag\n label={translate('locked')}\n size=\"S\"\n icon={{\n position: 'left',\n iconName: 'lock',\n iconColor: '#515161',\n preset: 's',\n customStyle: {padding: 0}\n }}\n />\n );\n\n return isTypeStars ? (\n <div\n className={style[`detailsSection${index}`]}\n data-name={type}\n aria-label={`${type} informations`}\n >\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>{translate('bonus_stars')}</span>\n {isLocked ? LockedTag : null}\n </div>\n <div className={style.stars}>\n <Icon iconName=\"star\" iconColor=\"#FFCE0A\" backgroundColor=\"#FFF9D1\" preset=\"xl\" />\n <span>{stars}</span>\n </div>\n </div>\n </div>\n ) : (\n <div\n className={style[`detailsSection${index}`]}\n data-name={type}\n aria-label={`${type} informations`}\n >\n <img\n className={style.img}\n src={\n type === 'badge'\n ? downloadUrl\n : 'https://s3.eu-west-1.amazonaws.com/static.coorpacademy.com/assets/images/diploma.svg'\n }\n />\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>\n {type === 'diploma' ? translate('diploma') : translate('badge')}\n </span>\n {isLocked ? LockedTag : null}\n </div>\n\n <div className={style.buttonContainer}>{DownloadButton}</div>\n </div>\n </div>\n );\n};\n\nconst ProgressWrapper = (\n {completedModules, mandatoryModules, title, subtitle, progression, sections},\n context\n) => {\n const {translate} = context;\n const mandatoryCompletedModulesLocale = translate('modules_completed_mandatory');\n const isLocked = progression !== 100;\n\n return (\n <div\n className={style.container}\n data-name=\"prgress-wrapper\"\n aria-label=\"progress wrapper section\"\n >\n <div className={style.titleContainer}>\n <Title type=\"form-group\" titleSize=\"medium\" title={title} subtitle={subtitle} />\n </div>\n <div className={style.statscontainer}>\n <div className={style.stats}>\n <div>\n <span className={style.statsNumber} data-name=\"progress-stats\">\n {`${\n completedModules > mandatoryModules ? mandatoryModules : completedModules\n } / ${mandatoryModules}`}\n </span>\n {mandatoryCompletedModulesLocale}\n </div>\n </div>\n <div className={style.progression}>\n <span className={style.statsNumber} data-name=\"progress-value\">\n {progression}%\n </span>\n </div>\n </div>\n <ProgressBar\n className={style.customProgressBar}\n style={{backgroundColor: COLORS.positive}}\n displayInfo={false}\n value={progression}\n max={100}\n />\n <div className={style.statsProgressionMobile}>\n <span className={style.statsNumber}>{progression}%</span>\n </div>\n\n {isEmpty(sections) ? null : (\n <div className={style.details}>\n {uncappedMap(\n (section, index) => (\n <DetailSection\n {...section}\n isLocked={isLocked}\n key={`${section.type}-${index}`}\n index={index}\n />\n ),\n sections\n )}\n </div>\n )}\n </div>\n );\n};\n\nconst commonDetailSectionPropTypes = {\n type: PropTypes.oneOf(['diploma', 'badge', 'stars']),\n downloadUrl: PropTypes.string,\n stars: PropTypes.number\n};\n\nDetailSection.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nDetailSection.propTypes = {\n index: PropTypes.number,\n isLocked: PropTypes.bool,\n ...commonDetailSectionPropTypes\n};\n\nProgressWrapper.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nProgressWrapper.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n completedModules: PropTypes.number,\n mandatoryModules: PropTypes.number,\n progression: PropTypes.number,\n sections: PropTypes.arrayOf(PropTypes.shape(commonDetailSectionPropTypes))\n};\n\nexport default ProgressWrapper;\n"],"mappings":";;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,SAAQC,MAAR,QAAqB,wBAArB;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,QAAP,MAAqB,qBAArB,C,CACA;;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,WAAW,GAAG,KAAIC,OAAJ,CAAY;EAACC,GAAG,EAAE;AAAN,CAAZ,CAApB;;AAEA,MAAMC,aAAa,GAAG,CAAC;EAACC,KAAD;EAAQC,IAAR;EAAcC,QAAd;EAAwBC,WAAxB;EAAqCC;AAArC,CAAD,EAA8CC,OAA9C,KAA0D;EAC9E,MAAM;IAACC;EAAD,IAAcD,OAApB;EACA,MAAME,WAAW,GAAGN,IAAI,KAAK,OAA7B;EAEA,MAAMO,cAAc,gBAClB,oBAAC,UAAD;IACE,KAAK,EAAEF,SAAS,CAAC,UAAD,CADlB;IAEE,IAAI,EAAE;MACJG,MAAM,EAAE,QADJ;MAEJC,IAAI,EAAEP;IAFF,CAFR;IAME,aAAY,YAAWF,IAAK,SAN9B;IAOE,cAAa,YAAWA,IAAK,SAP/B;IAQE,WAAW,EAAE;MAACU,eAAe,EAAE,SAAlB;MAA6BC,KAAK,EAAE,SAApC;MAA+CC,KAAK,EAAE;IAAtD,CARf;IASE,IAA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CAA7B;AAIAP,aAAa,CAACsD,SAAd;EACErD,KAAK,EAAEb,SAAS,CAAC+D,MADnB;EAEEhD,QAAQ,EAAEf,SAAS,CAACmE;AAFtB,GAGKP,4BAHL;AAMAlB,eAAe,CAACsB,YAAhB,GAA+B;EAC7B7C,SAAS,EAAEZ,QAAQ,CAAC0D,iBAAT,CAA2B9C;AADT,CAA/B;AAIAuB,eAAe,CAACwB,SAAhB,2CAA4B;EAC1BrB,KAAK,EAAE7C,SAAS,CAAC8D,MADS;EAE1BhB,QAAQ,EAAE9C,SAAS,CAAC8D,MAFM;EAG1BnB,gBAAgB,EAAE3C,SAAS,CAAC+D,MAHF;EAI1BnB,gBAAgB,EAAE5C,SAAS,CAAC+D,MAJF;EAK1BhB,WAAW,EAAE/C,SAAS,CAAC+D,MALG;EAM1Bf,QAAQ,EAAEhD,SAAS,CAACoE,OAAV,CAAkBpE,SAAS,CAACqE,KAAV,CAAgBT,4BAAhB,CAAlB;AANgB,CAA5B;AASA,eAAelB,eAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/certification-detail/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/certification-detail/index.js"],"names":[],"mappings":";AAgBA,4EAuHC"}
|
|
@@ -2,7 +2,7 @@ import _isNil from "lodash/fp/isNil";
|
|
|
2
2
|
import _round from "lodash/fp/round";
|
|
3
3
|
import _lowerCase from "lodash/fp/lowerCase";
|
|
4
4
|
import _compact from "lodash/fp/compact";
|
|
5
|
-
import React, { useCallback, useState, useMemo } from 'react';
|
|
5
|
+
import React, { useCallback, useEffect, useRef, useState, useMemo } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import classnames from 'classnames';
|
|
8
8
|
import Markdown from 'markdown-to-jsx';
|
|
@@ -16,7 +16,6 @@ import AllCourses from '../skill-detail/all-courses';
|
|
|
16
16
|
import { ContinueLearningButton } from '../skill-detail';
|
|
17
17
|
import ProgressWrapper from '../../molecule/progress-wrapper';
|
|
18
18
|
import style from './style.css';
|
|
19
|
-
const DESCRIPTION_BREAKPOINT = 382;
|
|
20
19
|
|
|
21
20
|
const CertificationDetail = (props, context) => {
|
|
22
21
|
const {
|
|
@@ -33,6 +32,7 @@ const CertificationDetail = (props, context) => {
|
|
|
33
32
|
diplomaUrl,
|
|
34
33
|
badgeUrl
|
|
35
34
|
} = props;
|
|
35
|
+
const descriptionRef = useRef(null);
|
|
36
36
|
const {
|
|
37
37
|
translate
|
|
38
38
|
} = context;
|
|
@@ -42,10 +42,21 @@ const CertificationDetail = (props, context) => {
|
|
|
42
42
|
stars,
|
|
43
43
|
totalModules
|
|
44
44
|
} = metrics;
|
|
45
|
+
const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);
|
|
45
46
|
const [showMore, setShowMore] = useState(false);
|
|
46
47
|
const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (descriptionRef.current) {
|
|
50
|
+
const {
|
|
51
|
+
clientHeight,
|
|
52
|
+
scrollHeight
|
|
53
|
+
} = descriptionRef.current;
|
|
54
|
+
setIsDescriptionTruncated(scrollHeight > clientHeight);
|
|
55
|
+
}
|
|
56
|
+
}, [description]);
|
|
47
57
|
const Description = useCallback(() => {
|
|
48
58
|
return /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
ref: descriptionRef,
|
|
49
60
|
className: classnames(style.description, !showMore && style.truncate)
|
|
50
61
|
}, /*#__PURE__*/React.createElement(Markdown, null, description));
|
|
51
62
|
}, [showMore, description]);
|
|
@@ -58,7 +69,7 @@ const CertificationDetail = (props, context) => {
|
|
|
58
69
|
}, !_isNil(onBackClick) ? /*#__PURE__*/React.createElement(ButtonLinkIcon, {
|
|
59
70
|
faIcon: "arrow-left",
|
|
60
71
|
"data-name": "back-button",
|
|
61
|
-
"aria-label":
|
|
72
|
+
"aria-label": translate('back'),
|
|
62
73
|
onClick: onBackClick,
|
|
63
74
|
className: style.backButton,
|
|
64
75
|
tooltipPlacement: "right"
|
|
@@ -73,7 +84,7 @@ const CertificationDetail = (props, context) => {
|
|
|
73
84
|
label: translate('certification')
|
|
74
85
|
}), /*#__PURE__*/React.createElement("div", {
|
|
75
86
|
className: style.title
|
|
76
|
-
}, title), description ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Description, null),
|
|
87
|
+
}, title), description ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Description, null), isDescriptionTruncated ? /*#__PURE__*/React.createElement("div", {
|
|
77
88
|
className: style.showMoreWrapper,
|
|
78
89
|
onClick: handleShowMore
|
|
79
90
|
}, translate(showMore ? 'Show less' : 'Show more'), /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useState","useMemo","PropTypes","classnames","Markdown","Provider","Tag","SelectOptionPropTypes","ButtonLinkIcon","Icon","CardsGrid","AllCourses","ContinueLearningButton","ProgressWrapper","style","DESCRIPTION_BREAKPOINT","CertificationDetail","props","context","certificationRef","title","description","certificationCourses","ongoingCoursesAvailable","filters","onBackClick","onContinueLearningClick","metrics","logoUrl","diplomaUrl","badgeUrl","translate","progression","mandatoryModules","stars","totalModules","showMore","setShowMore","handleShowMore","Description","truncate","completedModules","backgroundContainer","container","backButton","ctaContainer","logoContainer","logo","length","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, 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 DESCRIPTION_BREAKPOINT = 382;\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 {translate} = context;\n const {progression, mandatoryModules, stars, totalModules} = metrics;\n\n const [showMore, setShowMore] = useState(false);\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n const Description = useCallback(() => {\n return (\n <div className={classnames(style.description, !showMore && style.truncate)}>\n <Markdown>{description}</Markdown>\n </div>\n );\n }, [showMore, description]);\n\n 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=\"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 {description.length >= DESCRIPTION_BREAKPOINT ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {translate(showMore ? 'Show less' : 'Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{faSize: 14, wrapperSize: 16}}\n />\n </div>\n ) : null}\n </>\n ) : null}\n <div className={style.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,\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,QAA5B,EAAsCC,OAAtC,QAAoD,OAApD;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;AAC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E/B,SAAS,CAAC4D,MAHL;IAIvB3B,YAAY,EAAEjC,SAAS,CAAC4D;EAJD,CAAhB,CALqB;EAW9BjC,UAAU,EAAE3B,SAAS,CAACyD,MAXQ;EAY9B7B,QAAQ,EAAE5B,SAAS,CAACyD,MAZU;EAa9BpC,uBAAuB,EAAErB,SAAS,CAAC6D,IAbL;EAc9BzC,oBAAoB,EAAEpB,SAAS,CAAC2D,KAAV,CAAgBnD,SAAS,CAACgD,SAA1B,CAdQ;EAe9BlC,OAAO,EAAEtB,SAAS,CAAC2D,KAAV,CAAgB;IACvBG,QAAQ,EAAE9D,SAAS,CAAC+D,IADG;IAEvBC,OAAO,EAAEhE,SAAS,CAACiE,OAAV,CAAkBjE,SAAS,CAAC2D,KAAV,CAAgBtD,qBAAhB,CAAlB;EAFc,CAAhB,CAfqB;EAmB9BkB,WAAW,EAAEvB,SAAS,CAAC+D,IAnBO;EAoB9BvC,uBAAuB,EAAExB,SAAS,CAAC+D;AApBL,CAAhC;AAuBA,eAAejD,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, scrollHeight} = 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,\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\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AAuB,EAAEvB,SAAS,CAACmE;AApBL,CAAhC;AAuBA,eAAetD,mBAAf"}
|
|
@@ -7,6 +7,7 @@
|
|
|
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;
|
|
10
11
|
|
|
11
12
|
.container {
|
|
12
13
|
font-family: "Gilroy";
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
max-width: 1080px;
|
|
15
16
|
margin: auto;
|
|
16
17
|
margin-top: 48px;
|
|
18
|
+
background-color: white;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
.sortSection {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/certification-card/index.js"],"names":[],"mappings":";AAQA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/certification-card/index.js"],"names":[],"mappings":";AAQA,0EA0DC"}
|
|
@@ -66,10 +66,12 @@ const CertificationCard = (props, context) => {
|
|
|
66
66
|
},
|
|
67
67
|
icon: progressIconProps
|
|
68
68
|
}) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
69
|
-
className: _style.default.
|
|
69
|
+
className: _style.default.imageSection
|
|
70
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
71
|
+
className: _style.default.imageContainer
|
|
70
72
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
71
73
|
src: imgUrl
|
|
72
|
-
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
74
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
73
75
|
className: _style.default.detailWrapper
|
|
74
76
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
75
77
|
className: _style.default.titleWrapper
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["CertificationCard","props","context","label","goal","progress","imgUrl","onClick","title","condition","nbDone","translate","isInprogress","progressLabel","progressTagType","progressIconProps","position","iconName","iconColor","backgroundColor","size","faSize","wrapperSize","customStyle","padding","style","container","top","right","
|
|
1
|
+
{"version":3,"file":"index.js","names":["CertificationCard","props","context","label","goal","progress","imgUrl","onClick","title","condition","nbDone","translate","isInprogress","progressLabel","progressTagType","progressIconProps","position","iconName","iconColor","backgroundColor","size","faSize","wrapperSize","customStyle","padding","style","container","top","right","imageSection","imageContainer","detailWrapper","titleWrapper","moduleCount","customProgressBar","COLORS","positive","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","shape","number","func"],"sources":["../../../src/molecule/certification-card/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {COLORS} from '../../variables/colors';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport ProgressBar from '../progress-bar';\nimport style from './style.css';\n\nconst CertificationCard = (props, context) => {\n const {label, goal, progress, imgUrl, onClick} = props;\n const {\n title,\n condition: {nbDone}\n } = goal;\n const {translate} = context;\n\n const isInprogress = progress < 100;\n const progressLabel = isInprogress ? translate('in_progress') : translate('completed');\n const progressTagType = isInprogress ? 'progress' : 'success';\n const progressIconProps = {\n position: 'left',\n iconName: isInprogress ? 'clock' : 'circle-check',\n iconColor: isInprogress ? '#B87A00' : '#05944F',\n backgroundColor: isInprogress ? '#FFEECC' : '#D6F5E5',\n size: {\n faSize: 10,\n wrapperSize: 10\n },\n customStyle: {padding: 0}\n };\n return (\n <div className={style.container} data-name={`certification-card-${label}`} onClick={onClick}>\n {progress > 0 ? (\n <Tag\n label={progressLabel}\n type={progressTagType}\n customStyle={{position: 'absolute', top: '12px', right: '12px'}}\n icon={progressIconProps}\n />\n ) : null}\n <div className={style.imageSection}>\n <div className={style.imageContainer}>\n <img src={imgUrl} />\n </div>\n </div>\n <div className={style.detailWrapper}>\n <div className={style.titleWrapper}>\n <Tag label={translate('certification')} size=\"S\" />\n <div className={style.title} data-name=\"certification-title\">\n {title}\n </div>\n <div className={style.moduleCount}>\n <span>{nbDone}</span>\n {` ${translate('certification_module')}`}\n </div>\n </div>\n <ProgressBar\n className={style.customProgressBar}\n style={{backgroundColor: COLORS.positive}}\n displayInfo={false}\n value={progress}\n max={100}\n />\n </div>\n </div>\n );\n};\n\nCertificationCard.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nCertificationCard.propTypes = {\n label: PropTypes.string,\n goal: PropTypes.shape({\n title: PropTypes.string,\n condition: PropTypes.shape({\n nbDone: PropTypes.number\n })\n }),\n progress: PropTypes.number,\n imgUrl: PropTypes.string,\n onClick: PropTypes.func\n};\n\nexport default CertificationCard;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,iBAAiB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC5C,MAAM;IAACC,KAAD;IAAQC,IAAR;IAAcC,QAAd;IAAwBC,MAAxB;IAAgCC;EAAhC,IAA2CN,KAAjD;EACA,MAAM;IACJO,KADI;IAEJC,SAAS,EAAE;MAACC;IAAD;EAFP,IAGFN,IAHJ;EAIA,MAAM;IAACO;EAAD,IAAcT,OAApB;EAEA,MAAMU,YAAY,GAAGP,QAAQ,GAAG,GAAhC;EACA,MAAMQ,aAAa,GAAGD,YAAY,GAAGD,SAAS,CAAC,aAAD,CAAZ,GAA8BA,SAAS,CAAC,WAAD,CAAzE;EACA,MAAMG,eAAe,GAAGF,YAAY,GAAG,UAAH,GAAgB,SAApD;EACA,MAAMG,iBAAiB,GAAG;IACxBC,QAAQ,EAAE,MADc;IAExBC,QAAQ,EAAEL,YAAY,GAAG,OAAH,GAAa,cAFX;IAGxBM,SAAS,EAAEN,YAAY,GAAG,SAAH,GAAe,SAHd;IAIxBO,eAAe,EAAEP,YAAY,GAAG,SAAH,GAAe,SAJpB;IAKxBQ,IAAI,EAAE;MACJC,MAAM,EAAE,EADJ;MAEJC,WAAW,EAAE;IAFT,CALkB;IASxBC,WAAW,EAAE;MAACC,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AAT,CAA2B5B;AADP,CAAjC;AAIAX,iBAAiB,CAACwC,SAAlB,2CAA8B;EAC5BrC,KAAK,EAAEsC,kBAAA,CAAUC,MADW;EAE5BtC,IAAI,EAAEqC,kBAAA,CAAUE,KAAV,CAAgB;IACpBnC,KAAK,EAAEiC,kBAAA,CAAUC,MADG;IAEpBjC,SAAS,EAAEgC,kBAAA,CAAUE,KAAV,CAAgB;MACzBjC,MAAM,EAAE+B,kBAAA,CAAUG;IADO,CAAhB;EAFS,CAAhB,CAFsB;EAQ5BvC,QAAQ,EAAEoC,kBAAA,CAAUG,MARQ;EAS5BtC,MAAM,EAAEmC,kBAAA,CAAUC,MATU;EAU5BnC,OAAO,EAAEkC,kBAAA,CAAUI;AAVS,CAA9B;eAae7C,iB"}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
transition: all 0.5s ease-out;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
.
|
|
25
|
+
.imageSection {
|
|
26
26
|
display: flex;
|
|
27
27
|
justify-content: center;
|
|
28
28
|
align-items: center;
|
|
@@ -30,22 +30,38 @@
|
|
|
30
30
|
height: 160px;
|
|
31
31
|
width: auto;
|
|
32
32
|
transition: all 0.5s ease-out;
|
|
33
|
+
border-top-left-radius: 12px;
|
|
34
|
+
border-top-right-radius: 12px;
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
width: 100px;
|
|
36
|
+
.imageContainer {
|
|
36
37
|
transition: all 0.5s ease-out;
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
|
|
41
|
+
.imageContainer {
|
|
42
|
+
width: 202px;
|
|
43
|
+
height: 112px;
|
|
44
|
+
display: flex;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
align-items: center;
|
|
47
|
+
|
|
48
|
+
img {
|
|
49
|
+
width: 100%;
|
|
50
|
+
height: 100%;
|
|
51
|
+
object-fit: contain;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
40
55
|
.container:hover {
|
|
41
56
|
box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.14);
|
|
42
57
|
|
|
58
|
+
.imageContainer {
|
|
59
|
+
width: 244px;
|
|
60
|
+
height: 136px;
|
|
61
|
+
}
|
|
62
|
+
|
|
43
63
|
.imageWrapper {
|
|
44
64
|
background-color: cm_grey_75;
|
|
45
|
-
|
|
46
|
-
img {
|
|
47
|
-
width: 115px;
|
|
48
|
-
}
|
|
49
65
|
}
|
|
50
66
|
}
|
|
51
67
|
.detailWrapper {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["uncappedMap","convert","cap","DetailSection","index","type","isLocked","downloadUrl","stars","context","translate","isTypeStars","DownloadButton","target","href","backgroundColor","color","width","position","faIcon","name","size","customStyle","padding","LockedTag","iconName","iconColor","preset","style","detailsInfo","detailsInfoText","detailsTitle","img","buttonContainer","ProgressWrapper","completedModules","mandatoryModules","title","subtitle","progression","sections","mandatoryCompletedModulesLocale","container","titleContainer","statscontainer","stats","statsNumber","customProgressBar","COLORS","positive","statsProgressionMobile","details","section","commonDetailSectionPropTypes","PropTypes","oneOf","string","number","contextTypes","Provider","childContextTypes","propTypes","bool","arrayOf","shape"],"sources":["../../../src/molecule/progress-wrapper/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, map} from 'lodash/fp';\nimport Title from '../../atom/title';\nimport ProgressBar from '../progress-bar';\nimport {COLORS} from '../../variables/colors';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport Icon from '../../atom/icon';\nimport Provider from '../../atom/provider';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from './style.css';\n\nconst uncappedMap = map.convert({cap: false});\n\nconst DetailSection = ({index, type, isLocked, downloadUrl, stars}, context) => {\n const {translate} = context;\n const isTypeStars = type === 'stars';\n\n const DownloadButton = (\n <ButtonLink\n label={translate('download')}\n link={{\n target: '_blank',\n href: downloadUrl\n }}\n data-name={`download-${type}-button`}\n aria-label={`download ${type} button`}\n customStyle={{backgroundColor: '#F1F6FE', color: '#0061FF', width: 'auto'}}\n icon={{\n position: 'left',\n faIcon: {\n name: 'download',\n color: '#0061FF',\n size: 14,\n customStyle: {padding: 0}\n }\n }}\n disabled={isLocked}\n />\n );\n\n const LockedTag = (\n <Tag\n label=\"Locked\"\n size=\"S\"\n icon={{\n position: 'left',\n iconName: 'lock',\n iconColor: '#515161',\n preset: 's',\n customStyle: {padding: 0}\n }}\n />\n );\n\n return isTypeStars ? (\n <div\n className={style[`detailsSection${index}`]}\n data-name={type}\n aria-label={`${type} informations`}\n >\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>{translate('bonus_stars')}</span>\n {isLocked ? LockedTag : null}\n </div>\n <div className={style.stars}>\n <Icon iconName=\"star\" iconColor=\"#FFCE0A\" backgroundColor=\"#FFF9D1\" preset=\"xl\" />\n <span>{stars}</span>\n </div>\n </div>\n </div>\n ) : (\n <div\n className={style[`detailsSection${index}`]}\n data-name={type}\n aria-label={`${type} informations`}\n >\n <img\n className={style.img}\n src={\n type === 'badge'\n ? downloadUrl\n : 'https://s3.eu-west-1.amazonaws.com/static.coorpacademy.com/assets/images/diploma.svg'\n }\n />\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>\n {type === 'diploma' ? translate('diploma') : translate('badge')}\n </span>\n {isLocked ? LockedTag : null}\n </div>\n\n <div className={style.buttonContainer}>{DownloadButton}</div>\n </div>\n </div>\n );\n};\n\nconst ProgressWrapper = (\n {completedModules, mandatoryModules, title, subtitle, progression, sections},\n context\n) => {\n const {translate} = context;\n const mandatoryCompletedModulesLocale = translate('modules_completed_mandatory');\n const isLocked = progression !== 100;\n\n return (\n <div\n className={style.container}\n data-name=\"prgress-wrapper\"\n aria-label=\"progress wrapper section\"\n >\n <div className={style.titleContainer}>\n <Title type=\"form-group\" titleSize=\"medium\" title={title} subtitle={subtitle} />\n </div>\n <div className={style.statscontainer}>\n <div className={style.stats}>\n <div>\n <span className={style.statsNumber} data-name=\"progress-stats\">\n {`${\n completedModules > mandatoryModules ? mandatoryModules : completedModules\n } / ${mandatoryModules}`}\n </span>\n {mandatoryCompletedModulesLocale}\n </div>\n </div>\n <div className={style.progression}>\n <span className={style.statsNumber} data-name=\"progress-value\">\n {progression}%\n </span>\n </div>\n </div>\n <ProgressBar\n className={style.customProgressBar}\n style={{backgroundColor: COLORS.positive}}\n displayInfo={false}\n value={progression}\n max={100}\n />\n <div className={style.statsProgressionMobile}>\n <span className={style.statsNumber}>{progression}%</span>\n </div>\n\n {isEmpty(sections) ? null : (\n <div className={style.details}>\n {uncappedMap(\n (section, index) => (\n <DetailSection\n {...section}\n isLocked={isLocked}\n key={`${section.type}-${index}`}\n index={index}\n />\n ),\n sections\n )}\n </div>\n )}\n </div>\n );\n};\n\nconst commonDetailSectionPropTypes = {\n type: PropTypes.oneOf(['diploma', 'badge', 'stars']),\n downloadUrl: PropTypes.string,\n stars: PropTypes.number\n};\n\nDetailSection.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nDetailSection.propTypes = {\n index: PropTypes.number,\n isLocked: PropTypes.bool,\n ...commonDetailSectionPropTypes\n};\n\nProgressWrapper.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nProgressWrapper.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n completedModules: PropTypes.number,\n mandatoryModules: PropTypes.number,\n progression: PropTypes.number,\n sections: PropTypes.arrayOf(PropTypes.shape(commonDetailSectionPropTypes))\n};\n\nexport default ProgressWrapper;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAEA,MAAMA,WAAW,GAAG,cAAIC,OAAJ,CAAY;EAACC,GAAG,EAAE;AAAN,CAAZ,CAApB;;AAEA,MAAMC,aAAa,GAAG,CAAC;EAACC,KAAD;EAAQC,IAAR;EAAcC,QAAd;EA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O,CAAC/C,IAAK,IAAGD,KAAM,EAHhC;IAIE,KAAK,EAAEA;EAJT,GAFQ,EASVoC,QATU,CADd,CArCJ,CADF;AAsDD,CA9DD;;AAgEA,MAAMa,4BAAN,2CAAqC;EACnChD,IAAI,EAAEiD,kBAAA,CAAUC,KAAV,CAAgB,CAAC,SAAD,EAAY,OAAZ,EAAqB,OAArB,CAAhB,CAD6B;EAEnChD,WAAW,EAAE+C,kBAAA,CAAUE,MAFY;EAGnChD,KAAK,EAAE8C,kBAAA,CAAUG;AAHkB,CAArC;AAMAtD,aAAa,CAACuD,YAAd,GAA6B;EAC3BhD,SAAS,EAAEiD,iBAAA,CAASC,iBAAT,CAA2BlD;AADX,CAA7B;AAIAP,aAAa,CAAC0D,SAAd;EACEzD,KAAK,EAAEkD,kBAAA,CAAUG,MADnB;EAEEnD,QAAQ,EAAEgD,kBAAA,CAAUQ;AAFtB,GAGKT,4BAHL;AAMAnB,eAAe,CAACwB,YAAhB,GAA+B;EAC7BhD,SAAS,EAAEiD,iBAAA,CAASC,iBAAT,CAA2BlD;AADT,CAA/B;AAIAwB,eAAe,CAAC2B,SAAhB,2CAA4B;EAC1BxB,KAAK,EAAEiB,kBAAA,CAAUE,MADS;EAE1BlB,QAAQ,EAAEgB,kBAAA,CAAUE,MAFM;EAG1BrB,gBAAgB,EAAEmB,kBAAA,CAAUG,MAHF;EAI1BrB,gBAAgB,EAAEkB,kBAAA,CAAUG,MAJF;EAK1BlB,WAAW,EAAEe,kBAAA,CAAUG,MALG;EAM1BjB,QAAQ,EAAEc,kBAAA,CAAUS,OAAV,CAAkBT,kBAAA,CAAUU,KAAV,CAAgBX,4BAAhB,CAAlB;AANgB,CAA5B;eASenB,e"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["uncappedMap","convert","cap","DetailSection","index","type","isLocked","downloadUrl","stars","context","translate","isTypeStars","DownloadButton","target","href","backgroundColor","color","width","position","faIcon","name","size","customStyle","padding","LockedTag","iconName","iconColor","preset","style","detailsInfo","detailsInfoText","detailsTitle","img","buttonContainer","ProgressWrapper","completedModules","mandatoryModules","title","subtitle","progression","sections","mandatoryCompletedModulesLocale","container","titleContainer","statscontainer","stats","statsNumber","customProgressBar","COLORS","positive","statsProgressionMobile","details","section","commonDetailSectionPropTypes","PropTypes","oneOf","string","number","contextTypes","Provider","childContextTypes","propTypes","bool","arrayOf","shape"],"sources":["../../../src/molecule/progress-wrapper/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, map} from 'lodash/fp';\nimport Title from '../../atom/title';\nimport ProgressBar from '../progress-bar';\nimport {COLORS} from '../../variables/colors';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport Icon from '../../atom/icon';\nimport Provider from '../../atom/provider';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from './style.css';\n\nconst uncappedMap = map.convert({cap: false});\n\nconst DetailSection = ({index, type, isLocked, downloadUrl, stars}, context) => {\n const {translate} = context;\n const isTypeStars = type === 'stars';\n\n const DownloadButton = (\n <ButtonLink\n label={translate('download')}\n link={{\n target: '_blank',\n href: downloadUrl\n }}\n data-name={`download-${type}-button`}\n aria-label={`download ${type} button`}\n customStyle={{backgroundColor: '#F1F6FE', color: '#0061FF', width: 'auto'}}\n icon={{\n position: 'left',\n faIcon: {\n name: 'download',\n color: '#0061FF',\n size: 14,\n customStyle: {padding: 0}\n }\n }}\n disabled={isLocked}\n />\n );\n\n const LockedTag = (\n <Tag\n label={translate('locked')}\n size=\"S\"\n icon={{\n position: 'left',\n iconName: 'lock',\n iconColor: '#515161',\n preset: 's',\n customStyle: {padding: 0}\n }}\n />\n );\n\n return isTypeStars ? (\n <div\n className={style[`detailsSection${index}`]}\n data-name={type}\n aria-label={`${type} informations`}\n >\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>{translate('bonus_stars')}</span>\n {isLocked ? LockedTag : null}\n </div>\n <div className={style.stars}>\n <Icon iconName=\"star\" iconColor=\"#FFCE0A\" backgroundColor=\"#FFF9D1\" preset=\"xl\" />\n <span>{stars}</span>\n </div>\n </div>\n </div>\n ) : (\n <div\n className={style[`detailsSection${index}`]}\n data-name={type}\n aria-label={`${type} informations`}\n >\n <img\n className={style.img}\n src={\n type === 'badge'\n ? downloadUrl\n : 'https://s3.eu-west-1.amazonaws.com/static.coorpacademy.com/assets/images/diploma.svg'\n }\n />\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>\n {type === 'diploma' ? translate('diploma') : translate('badge')}\n </span>\n {isLocked ? LockedTag : null}\n </div>\n\n <div className={style.buttonContainer}>{DownloadButton}</div>\n </div>\n </div>\n );\n};\n\nconst ProgressWrapper = (\n {completedModules, mandatoryModules, title, subtitle, progression, sections},\n context\n) => {\n const {translate} = context;\n const mandatoryCompletedModulesLocale = translate('modules_completed_mandatory');\n const isLocked = progression !== 100;\n\n return (\n <div\n className={style.container}\n data-name=\"prgress-wrapper\"\n aria-label=\"progress wrapper section\"\n >\n <div className={style.titleContainer}>\n <Title type=\"form-group\" titleSize=\"medium\" title={title} subtitle={subtitle} />\n </div>\n <div className={style.statscontainer}>\n <div className={style.stats}>\n <div>\n <span className={style.statsNumber} data-name=\"progress-stats\">\n {`${\n completedModules > mandatoryModules ? mandatoryModules : completedModules\n } / ${mandatoryModules}`}\n </span>\n {mandatoryCompletedModulesLocale}\n </div>\n </div>\n <div className={style.progression}>\n <span className={style.statsNumber} data-name=\"progress-value\">\n {progression}%\n </span>\n </div>\n </div>\n <ProgressBar\n className={style.customProgressBar}\n style={{backgroundColor: COLORS.positive}}\n displayInfo={false}\n value={progression}\n max={100}\n />\n <div className={style.statsProgressionMobile}>\n <span className={style.statsNumber}>{progression}%</span>\n </div>\n\n {isEmpty(sections) ? null : (\n <div className={style.details}>\n {uncappedMap(\n (section, index) => (\n <DetailSection\n {...section}\n isLocked={isLocked}\n key={`${section.type}-${index}`}\n index={index}\n />\n ),\n sections\n )}\n </div>\n )}\n </div>\n );\n};\n\nconst commonDetailSectionPropTypes = {\n type: PropTypes.oneOf(['diploma', 'badge', 'stars']),\n downloadUrl: PropTypes.string,\n stars: PropTypes.number\n};\n\nDetailSection.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nDetailSection.propTypes = {\n index: PropTypes.number,\n isLocked: PropTypes.bool,\n ...commonDetailSectionPropTypes\n};\n\nProgressWrapper.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nProgressWrapper.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n completedModules: PropTypes.number,\n mandatoryModules: PropTypes.number,\n progression: PropTypes.number,\n sections: PropTypes.arrayOf(PropTypes.shape(commonDetailSectionPropTypes))\n};\n\nexport default ProgressWrapper;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAEA,MAAMA,WAAW,GAAG,cAAIC,OAAJ,CAAY;EAACC,GAAG,EAAE;AAAN,CAAZ,CAApB;;AAEA,MAAMC,aAAa,GAAG,CAAC;EAACC,KAAD;EAAQC,IAAR;EAAcC,QAAd;EAAwBC,WAAxB;EAAqCC;AAArC,CAAD,EAA8CC,OAA9C,KAA0D;EAC9E,MAAM;IAACC;EAAD,IAAcD,OAApB;EACA,MAAME,WAAW,GAAGN,IAAI,KAAK,OAA7B;;EAEA,MAAMO,cAAc,gBAClB,6BAAC,mBAAD;IACE,KAAK,EAAEF,SAAS,CAAC,UAAD,CADlB;IAEE,IAAI,EAAE;MACJG,MAAM,EAAE,QADJ;MAEJC,IAAI,EAAEP;IAFF,CAFR;IAME,aAAY,YAAWF,IAAK,SAN9B;IAOE,cAAa,YAAWA,IAAK,SAP/B;IAQE,WAAW,EAAE;MAACU,eAAe,EAAE,SAAlB;MAA6BC,KAAK,EAAE,SAApC;MAA+CC,KAAK,EAAE;IAAtD,CARf;IASE,IAAI,EAAE;MACJC,QAAQ,EAAE,MADN;MAEJ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kD,kBAAA,CAAUG,MADnB;EAEEnD,QAAQ,EAAEgD,kBAAA,CAAUQ;AAFtB,GAGKT,4BAHL;AAMAnB,eAAe,CAACwB,YAAhB,GAA+B;EAC7BhD,SAAS,EAAEiD,iBAAA,CAASC,iBAAT,CAA2BlD;AADT,CAA/B;AAIAwB,eAAe,CAAC2B,SAAhB,2CAA4B;EAC1BxB,KAAK,EAAEiB,kBAAA,CAAUE,MADS;EAE1BlB,QAAQ,EAAEgB,kBAAA,CAAUE,MAFM;EAG1BrB,gBAAgB,EAAEmB,kBAAA,CAAUG,MAHF;EAI1BrB,gBAAgB,EAAEkB,kBAAA,CAAUG,MAJF;EAK1BlB,WAAW,EAAEe,kBAAA,CAAUG,MALG;EAM1BjB,QAAQ,EAAEc,kBAAA,CAAUS,OAAV,CAAkBT,kBAAA,CAAUU,KAAV,CAAgBX,4BAAhB,CAAlB;AANgB,CAA5B;eASenB,e"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/certification-detail/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/certification-detail/index.js"],"names":[],"mappings":";AAgBA,4EAuHC"}
|
|
@@ -45,8 +45,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
45
45
|
|
|
46
46
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
47
47
|
|
|
48
|
-
const DESCRIPTION_BREAKPOINT = 382;
|
|
49
|
-
|
|
50
48
|
const CertificationDetail = (props, context) => {
|
|
51
49
|
const {
|
|
52
50
|
certificationRef,
|
|
@@ -62,6 +60,7 @@ const CertificationDetail = (props, context) => {
|
|
|
62
60
|
diplomaUrl,
|
|
63
61
|
badgeUrl
|
|
64
62
|
} = props;
|
|
63
|
+
const descriptionRef = (0, _react.useRef)(null);
|
|
65
64
|
const {
|
|
66
65
|
translate
|
|
67
66
|
} = context;
|
|
@@ -71,10 +70,21 @@ const CertificationDetail = (props, context) => {
|
|
|
71
70
|
stars,
|
|
72
71
|
totalModules
|
|
73
72
|
} = metrics;
|
|
73
|
+
const [isDescriptionTruncated, setIsDescriptionTruncated] = (0, _react.useState)(false);
|
|
74
74
|
const [showMore, setShowMore] = (0, _react.useState)(false);
|
|
75
75
|
const handleShowMore = (0, _react.useCallback)(() => setShowMore(!showMore), [setShowMore, showMore]);
|
|
76
|
+
(0, _react.useEffect)(() => {
|
|
77
|
+
if (descriptionRef.current) {
|
|
78
|
+
const {
|
|
79
|
+
clientHeight,
|
|
80
|
+
scrollHeight
|
|
81
|
+
} = descriptionRef.current;
|
|
82
|
+
setIsDescriptionTruncated(scrollHeight > clientHeight);
|
|
83
|
+
}
|
|
84
|
+
}, [description]);
|
|
76
85
|
const Description = (0, _react.useCallback)(() => {
|
|
77
86
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
87
|
+
ref: descriptionRef,
|
|
78
88
|
className: (0, _classnames.default)(_style.default.description, !showMore && _style.default.truncate)
|
|
79
89
|
}, /*#__PURE__*/_react.default.createElement(_markdownToJsx.default, null, description));
|
|
80
90
|
}, [showMore, description]);
|
|
@@ -87,7 +97,7 @@ const CertificationDetail = (props, context) => {
|
|
|
87
97
|
}, !(0, _isNil2.default)(onBackClick) ? /*#__PURE__*/_react.default.createElement(_buttonLinkIcon.default, {
|
|
88
98
|
faIcon: "arrow-left",
|
|
89
99
|
"data-name": "back-button",
|
|
90
|
-
"aria-label":
|
|
100
|
+
"aria-label": translate('back'),
|
|
91
101
|
onClick: onBackClick,
|
|
92
102
|
className: _style.default.backButton,
|
|
93
103
|
tooltipPlacement: "right"
|
|
@@ -102,7 +112,7 @@ const CertificationDetail = (props, context) => {
|
|
|
102
112
|
label: translate('certification')
|
|
103
113
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
104
114
|
className: _style.default.title
|
|
105
|
-
}, title), description ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Description, null),
|
|
115
|
+
}, title), description ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Description, null), isDescriptionTruncated ? /*#__PURE__*/_react.default.createElement("div", {
|
|
106
116
|
className: _style.default.showMoreWrapper,
|
|
107
117
|
onClick: handleShowMore
|
|
108
118
|
}, translate(showMore ? 'Show less' : 'Show more'), /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DESCRIPTION_BREAKPOINT","CertificationDetail","props","context","certificationRef","title","description","certificationCourses","ongoingCoursesAvailable","filters","onBackClick","onContinueLearningClick","metrics","logoUrl","diplomaUrl","badgeUrl","translate","progression","mandatoryModules","stars","totalModules","showMore","setShowMore","useState","handleShowMore","useCallback","Description","classnames","style","truncate","completedModules","useMemo","backgroundContainer","container","backButton","ctaContainer","logoContainer","logo","length","showMoreWrapper","faSize","wrapperSize","contentStats","type","downloadUrl","contextTypes","skin","Provider","childContextTypes","propTypes","PropTypes","string","isRequired","shape","number","bool","CardsGrid","onChange","func","options","arrayOf","SelectOptionPropTypes"],"sources":["../../../src/template/certification-detail/index.js"],"sourcesContent":["import React, {useCallback, 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 DESCRIPTION_BREAKPOINT = 382;\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 {translate} = context;\n const {progression, mandatoryModules, stars, totalModules} = metrics;\n\n const [showMore, setShowMore] = useState(false);\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n const Description = useCallback(() => {\n return (\n <div className={classnames(style.description, !showMore && style.truncate)}>\n <Markdown>{description}</Markdown>\n </div>\n );\n }, [showMore, description]);\n\n 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=\"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 {description.length >= DESCRIPTION_BREAKPOINT ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {translate(showMore ? 'Show less' : 'Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{faSize: 14, wrapperSize: 16}}\n />\n </div>\n ) : null}\n </>\n ) : null}\n <div className={style.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,\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;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,sBAAsB,GAAG,GAA/B;;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,MAAM;IAACc;EAAD,IAAcb,OAApB;EACA,MAAM;IAACc,WAAD;IAAcC,gBAAd;IAAgCC,KAAhC;IAAuCC;EAAvC,IAAuDR,OAA7D;EAEA,MAAM,CAACS,QAAD,EAAWC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names":["CertificationDetail","props","context","certificationRef","title","description","certificationCourses","ongoingCoursesAvailable","filters","onBackClick","onContinueLearningClick","metrics","logoUrl","diplomaUrl","badgeUrl","descriptionRef","useRef","translate","progression","mandatoryModules","stars","totalModules","isDescriptionTruncated","setIsDescriptionTruncated","useState","showMore","setShowMore","handleShowMore","useCallback","useEffect","current","clientHeight","scrollHeight","Description","classnames","style","truncate","completedModules","useMemo","backgroundContainer","container","backButton","ctaContainer","logoContainer","logo","showMoreWrapper","faSize","wrapperSize","contentStats","type","downloadUrl","contextTypes","skin","Provider","childContextTypes","propTypes","PropTypes","string","isRequired","shape","number","bool","CardsGrid","onChange","func","options","arrayOf","SelectOptionPropTypes"],"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, scrollHeight} = 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,\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;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,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,IAAAC,aAAA,EAAO,IAAP,CAAvB;EACA,MAAM;IAACC;EAAD,IAAcf,OAApB;EACA,MAAM;IAACgB,WAAD;IAAcC,gBAAd;IAAgCC,KAAhC;IAAuCC;EAAvC,IAAuDV,OAA7D;EAEA,MAAM,CAACW,sBAAD,EAAyBC,yBAAzB,IAAsD,IAAAC,eAAA,EAAS,KAAT,CAA5D;EACA,MAAM,CAACC,QAAD,EAAWC,WAAX,IAA0B,IAAAF,eAAA,EAAS,KAAT,CAAhC;EAEA,MAAMG,c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CAAgBQ,6BAAhB,CAAlB;EAFc,CAAhB,CAfqB;EAmB9B1D,WAAW,EAAE+C,kBAAA,CAAUQ,IAnBO;EAoB9BtD,uBAAuB,EAAE8C,kBAAA,CAAUQ;AApBL,CAAhC;eAuBehE,mB"}
|
|
@@ -7,6 +7,7 @@
|
|
|
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;
|
|
10
11
|
|
|
11
12
|
.container {
|
|
12
13
|
font-family: "Gilroy";
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
max-width: 1080px;
|
|
15
16
|
margin: auto;
|
|
16
17
|
margin-top: 48px;
|
|
18
|
+
background-color: white;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
.sortSection {
|
package/locales/en/global.json
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"At the end of this level, you will be able to_": "At the end of this level, you will be able to:",
|
|
12
12
|
"author": "author",
|
|
13
13
|
"associated_skills": "Associated skills",
|
|
14
|
+
"back": "Back",
|
|
14
15
|
"Back to Dashboard Home": "Back to Dashboard Home",
|
|
15
16
|
"back_to_catalog": "Back to courses",
|
|
16
17
|
"badge": "Badge",
|
|
@@ -42,6 +43,7 @@
|
|
|
42
43
|
"continue_learning": "Continue learning",
|
|
43
44
|
"learning_priority_modal_title": "New learning priority",
|
|
44
45
|
"learning_priority_modal_description": "Create a learning priority by selecting either one skill, playlist or certification.",
|
|
46
|
+
"locked": "Locked",
|
|
45
47
|
"skills_change_focus": "Change skill focus",
|
|
46
48
|
"skills_choose_focus": "Choose your focus",
|
|
47
49
|
"cancel": "Cancel",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "11.32.
|
|
3
|
+
"version": "11.32.42-alpha.7+76a42ce28",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -178,5 +178,5 @@
|
|
|
178
178
|
"last 2 versions",
|
|
179
179
|
"IE 11"
|
|
180
180
|
],
|
|
181
|
-
"gitHead": "
|
|
181
|
+
"gitHead": "76a42ce2861f716ac6e86ff7da573d529d42b76e"
|
|
182
182
|
}
|