@coorpacademy/components 11.32.34 → 11.32.35-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/es/molecule/progress-wrapper/index.d.ts +4 -5
  2. package/es/molecule/progress-wrapper/index.d.ts.map +1 -1
  3. package/es/molecule/progress-wrapper/index.js +34 -45
  4. package/es/molecule/progress-wrapper/index.js.map +1 -1
  5. package/es/molecule/progress-wrapper/style.css +3 -25
  6. package/es/template/certification-detail/index.d.ts +5 -47
  7. package/es/template/certification-detail/index.d.ts.map +1 -1
  8. package/es/template/certification-detail/index.js +22 -43
  9. package/es/template/certification-detail/index.js.map +1 -1
  10. package/es/template/certification-detail/style.css +1 -12
  11. package/es/template/skill-detail/all-courses.d.ts +1 -2
  12. package/es/template/skill-detail/all-courses.d.ts.map +1 -1
  13. package/es/template/skill-detail/all-courses.js +38 -45
  14. package/es/template/skill-detail/all-courses.js.map +1 -1
  15. package/lib/molecule/progress-wrapper/index.d.ts +4 -5
  16. package/lib/molecule/progress-wrapper/index.d.ts.map +1 -1
  17. package/lib/molecule/progress-wrapper/index.js +34 -46
  18. package/lib/molecule/progress-wrapper/index.js.map +1 -1
  19. package/lib/molecule/progress-wrapper/style.css +3 -25
  20. package/lib/template/certification-detail/index.d.ts +5 -47
  21. package/lib/template/certification-detail/index.d.ts.map +1 -1
  22. package/lib/template/certification-detail/index.js +21 -43
  23. package/lib/template/certification-detail/index.js.map +1 -1
  24. package/lib/template/certification-detail/style.css +1 -12
  25. package/lib/template/skill-detail/all-courses.d.ts +1 -2
  26. package/lib/template/skill-detail/all-courses.d.ts.map +1 -1
  27. package/lib/template/skill-detail/all-courses.js +38 -44
  28. package/lib/template/skill-detail/all-courses.js.map +1 -1
  29. package/locales/en/global.json +2 -0
  30. package/package.json +2 -2
@@ -1,7 +1,7 @@
1
1
  export default ProgressWrapper;
2
- declare function ProgressWrapper({ completedCourses, completedModules, title, subtitle, progression, sections }: {
3
- completedCourses: any;
2
+ declare function ProgressWrapper({ completedModules, mandatoryModules, title, subtitle, progression, sections }: {
4
3
  completedModules: any;
4
+ mandatoryModules: any;
5
5
  title: any;
6
6
  subtitle: any;
7
7
  progression: any;
@@ -14,13 +14,12 @@ declare namespace ProgressWrapper {
14
14
  namespace propTypes {
15
15
  const title: PropTypes.Requireable<string>;
16
16
  const subtitle: PropTypes.Requireable<string>;
17
- const completedCourses: PropTypes.Requireable<number>;
18
17
  const completedModules: PropTypes.Requireable<number>;
18
+ const mandatoryModules: PropTypes.Requireable<number>;
19
19
  const progression: PropTypes.Requireable<number>;
20
20
  const sections: PropTypes.Requireable<(PropTypes.InferProps<{
21
21
  type: PropTypes.Requireable<string>;
22
- badgeUrl: PropTypes.Requireable<string>;
23
- onDownload: PropTypes.Requireable<(...args: any[]) => any>;
22
+ downloadUrl: PropTypes.Requireable<string>;
24
23
  stars: PropTypes.Requireable<number>;
25
24
  }> | null | undefined)[]>;
26
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/progress-wrapper/index.js"],"names":[],"mappings":";AAyFA;;;;;;;8BA8DC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/progress-wrapper/index.js"],"names":[],"mappings":";AAqGA;;;;;;;8BA8DC"}
@@ -1,5 +1,4 @@
1
1
  import _map from "lodash/fp/map";
2
- import _lowerCase from "lodash/fp/lowerCase";
3
2
  import _isEmpty from "lodash/fp/isEmpty";
4
3
 
5
4
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -21,11 +20,11 @@ const uncappedMap = _map.convert({
21
20
  });
22
21
 
23
22
  const DetailSection = ({
23
+ dataName,
24
24
  index,
25
25
  type,
26
26
  isLocked,
27
- badgeUrl,
28
- onDownload,
27
+ downloadUrl,
29
28
  stars
30
29
  }, context) => {
31
30
  const {
@@ -34,12 +33,16 @@ const DetailSection = ({
34
33
  const isTypeStars = type === 'stars';
35
34
  const DownloadButton = /*#__PURE__*/React.createElement(ButtonLink, {
36
35
  label: translate('download'),
37
- onClick: onDownload,
38
- "data-name": "download-button",
39
- "aria-label": "download button",
36
+ link: {
37
+ target: '_blank',
38
+ href: downloadUrl
39
+ },
40
+ "data-name": `download-${type}-button`,
41
+ "aria-label": `download ${type} button`,
40
42
  customStyle: {
41
43
  backgroundColor: '#F1F6FE',
42
- color: '#0061FF'
44
+ color: '#0061FF',
45
+ width: 'auto'
43
46
  },
44
47
  icon: {
45
48
  position: 'left',
@@ -68,7 +71,9 @@ const DetailSection = ({
68
71
  }
69
72
  });
70
73
  return isTypeStars ? /*#__PURE__*/React.createElement("div", {
71
- className: style[`detailsSection${index}`]
74
+ className: style[`detailsSection${index}`],
75
+ "data-name": type,
76
+ "aria-label": `${type} informations`
72
77
  }, /*#__PURE__*/React.createElement("div", {
73
78
  className: style.detailsInfo
74
79
  }, /*#__PURE__*/React.createElement("div", {
@@ -83,10 +88,12 @@ const DetailSection = ({
83
88
  backgroundColor: "#FFF9D1",
84
89
  preset: "xl"
85
90
  }), /*#__PURE__*/React.createElement("span", null, stars)))) : /*#__PURE__*/React.createElement("div", {
86
- className: style[`detailsSection${index}`]
91
+ className: style[`detailsSection${index}`],
92
+ "data-name": type,
93
+ "aria-label": `${type} informations`
87
94
  }, /*#__PURE__*/React.createElement("img", {
88
95
  className: style.img,
89
- src: badgeUrl || 'https://s3.eu-west-1.amazonaws.com/static.coorpacademy.com/assets/images/diploma.svg'
96
+ src: type === 'badge' ? downloadUrl : 'https://s3.eu-west-1.amazonaws.com/static.coorpacademy.com/assets/images/diploma.svg'
90
97
  }), /*#__PURE__*/React.createElement("div", {
91
98
  className: style.detailsInfo
92
99
  }, /*#__PURE__*/React.createElement("div", {
@@ -99,8 +106,8 @@ const DetailSection = ({
99
106
  };
100
107
 
101
108
  const ProgressWrapper = ({
102
- completedCourses,
103
109
  completedModules,
110
+ mandatoryModules,
104
111
  title,
105
112
  subtitle,
106
113
  progression,
@@ -109,10 +116,12 @@ const ProgressWrapper = ({
109
116
  const {
110
117
  translate
111
118
  } = context;
112
- const modulesCompletedLocal = translate('modules_completed');
119
+ const mandatoryCompletedModulesLocal = translate('modules_completed_mandatory');
113
120
  const isLocked = progression !== 100;
114
121
  return /*#__PURE__*/React.createElement("div", {
115
- className: style.container
122
+ className: style.container,
123
+ "data-name": "prgress-wrapper",
124
+ "aria-label": "progress wrapper section"
116
125
  }, /*#__PURE__*/React.createElement("div", {
117
126
  className: style.titleContainer
118
127
  }, /*#__PURE__*/React.createElement(Title, {
@@ -125,17 +134,13 @@ const ProgressWrapper = ({
125
134
  }, /*#__PURE__*/React.createElement("div", {
126
135
  className: style.stats
127
136
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
128
- className: style.statsNumber
129
- }, completedCourses), _lowerCase(translate('courses_completed'))), /*#__PURE__*/React.createElement("div", {
130
- className: style.divider
131
- }), /*#__PURE__*/React.createElement("div", {
132
- className: style.statsModule
133
- }, /*#__PURE__*/React.createElement("span", {
134
- className: style.statsNumber
135
- }, completedModules), modulesCompletedLocal)), /*#__PURE__*/React.createElement("div", {
137
+ className: style.statsNumber,
138
+ "data-name": "progress-stats"
139
+ }, `${completedModules > mandatoryModules ? mandatoryModules : completedModules} / ${mandatoryModules}`), mandatoryCompletedModulesLocal)), /*#__PURE__*/React.createElement("div", {
136
140
  className: style.progression
137
141
  }, /*#__PURE__*/React.createElement("span", {
138
- className: style.statsNumber
142
+ className: style.statsNumber,
143
+ "data-name": "progress-value"
139
144
  }, progression, "%"))), /*#__PURE__*/React.createElement(ProgressBar, {
140
145
  className: style.customProgressBar,
141
146
  style: {
@@ -145,37 +150,21 @@ const ProgressWrapper = ({
145
150
  value: progression,
146
151
  max: 100
147
152
  }), /*#__PURE__*/React.createElement("div", {
148
- className: style.statsMobile
149
- }, /*#__PURE__*/React.createElement("div", {
150
- className: style.statsModuleMobile
151
- }, /*#__PURE__*/React.createElement("span", {
152
- className: style.statsNumber
153
- }, completedModules), modulesCompletedLocal), /*#__PURE__*/React.createElement("div", {
154
153
  className: style.statsProgressionMobile
155
154
  }, /*#__PURE__*/React.createElement("span", {
156
155
  className: style.statsNumber
157
- }, progression, "%"))), _isEmpty(sections) ? null : /*#__PURE__*/React.createElement("div", {
156
+ }, progression, "%")), _isEmpty(sections) ? null : /*#__PURE__*/React.createElement("div", {
158
157
  className: style.details
159
- }, uncappedMap(({
160
- type,
161
- stars,
162
- badgeUrl,
163
- onDownload
164
- }, index) => /*#__PURE__*/React.createElement(DetailSection, {
165
- type,
166
- isLocked,
167
- badgeUrl,
168
- onDownload,
169
- stars,
170
- key: `${type}-${index}`,
158
+ }, uncappedMap((section, index) => /*#__PURE__*/React.createElement(DetailSection, _extends({}, section, {
159
+ isLocked: isLocked,
160
+ key: `${section.type}-${index}`,
171
161
  index: index
172
- }), sections)));
162
+ })), sections)));
173
163
  };
174
164
 
175
165
  const commonDetailSectionPropTypes = process.env.NODE_ENV !== "production" ? {
176
166
  type: PropTypes.oneOf(['diploma', 'badge', 'stars']),
177
- badgeUrl: PropTypes.string,
178
- onDownload: PropTypes.func,
167
+ downloadUrl: PropTypes.string,
179
168
  stars: PropTypes.number
180
169
  } : {};
181
170
  DetailSection.contextTypes = {
@@ -191,8 +180,8 @@ ProgressWrapper.contextTypes = {
191
180
  ProgressWrapper.propTypes = process.env.NODE_ENV !== "production" ? {
192
181
  title: PropTypes.string,
193
182
  subtitle: PropTypes.string,
194
- completedCourses: PropTypes.number,
195
183
  completedModules: PropTypes.number,
184
+ mandatoryModules: PropTypes.number,
196
185
  progression: PropTypes.number,
197
186
  sections: PropTypes.arrayOf(PropTypes.shape(commonDetailSectionPropTypes))
198
187
  } : {};
@@ -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","badgeUrl","onDownload","stars","context","translate","isTypeStars","DownloadButton","backgroundColor","color","position","faIcon","name","size","customStyle","padding","LockedTag","iconName","iconColor","preset","detailsInfo","detailsInfoText","detailsTitle","img","buttonContainer","ProgressWrapper","completedCourses","completedModules","title","subtitle","progression","sections","modulesCompletedLocal","container","titleContainer","statscontainer","stats","statsNumber","divider","statsModule","customProgressBar","positive","statsMobile","statsModuleMobile","statsProgressionMobile","details","commonDetailSectionPropTypes","oneOf","string","func","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, lowerCase, 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, badgeUrl, onDownload, stars}, context) => {\n const {translate} = context;\n const isTypeStars = type === 'stars';\n\n const DownloadButton = (\n <ButtonLink\n label={translate('download')}\n onClick={onDownload}\n data-name=\"download-button\"\n aria-label=\"download button\"\n customStyle={{backgroundColor: '#F1F6FE', color: '#0061FF'}}\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 className={style[`detailsSection${index}`]}>\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 className={style[`detailsSection${index}`]}>\n <img\n className={style.img}\n src={\n badgeUrl ||\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 {completedCourses, completedModules, title, subtitle, progression, sections},\n context\n) => {\n const {translate} = context;\n const modulesCompletedLocal = translate('modules_completed');\n const isLocked = progression !== 100;\n\n return (\n <div className={style.container}>\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}>{completedCourses}</span>\n {lowerCase(translate('courses_completed'))}\n </div>\n <div className={style.divider} />\n <div className={style.statsModule}>\n <span className={style.statsNumber}>{completedModules}</span>\n {modulesCompletedLocal}\n </div>\n </div>\n <div className={style.progression}>\n <span className={style.statsNumber}>{progression}%</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.statsMobile}>\n <div className={style.statsModuleMobile}>\n <span className={style.statsNumber}>{completedModules}</span>\n {modulesCompletedLocal}\n </div>\n <div className={style.statsProgressionMobile}>\n <span className={style.statsNumber}>{progression}%</span>\n </div>\n </div>\n\n {isEmpty(sections) ? null : (\n <div className={style.details}>\n {uncappedMap(\n ({type, stars, badgeUrl, onDownload}, index) => (\n <DetailSection\n {...{type, isLocked, badgeUrl, onDownload, stars}}\n key={`${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 badgeUrl: PropTypes.string,\n onDownload: PropTypes.func,\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 completedCourses: PropTypes.number,\n completedModules: 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,QAAxB;EAAkCC,UAAlC;EAA8CC;AAA9C,CAAD,EAAuDC,OAAvD,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C;IAC6CC,KAD7C;IAEE,GAAG,EAAG,GAAEJ,IAAK,IAAGD,KAAM,EAFxB;IAGE,KAAK,EAAEA;EAHT,EAFQ,EAQViC,QARU,CADd,CAtCJ,CADF;AAsDD,CA9DD;;AAgEA,MAAMe,4BAAN,2CAAqC;EACnC/C,IAAI,EAAEd,SAAS,CAAC8D,KAAV,CAAgB,CAAC,SAAD,EAAY,OAAZ,EAAqB,OAArB,CAAhB,CAD6B;EAEnC9C,QAAQ,EAAEhB,SAAS,CAAC+D,MAFe;EAGnC9C,UAAU,EAAEjB,SAAS,CAACgE,IAHa;EAInC9C,KAAK,EAAElB,SAAS,CAACiE;AAJkB,CAArC;AAOArD,aAAa,CAACsD,YAAd,GAA6B;EAC3B9C,SAAS,EAAEb,QAAQ,CAAC4D,iBAAT,CAA2B/C;AADX,CAA7B;AAIAR,aAAa,CAACwD,SAAd;EACEvD,KAAK,EAAEb,SAAS,CAACiE,MADnB;EAEElD,QAAQ,EAAEf,SAAS,CAACqE;AAFtB,GAGKR,4BAHL;AAMArB,eAAe,CAAC0B,YAAhB,GAA+B;EAC7B9C,SAAS,EAAEb,QAAQ,CAAC4D,iBAAT,CAA2B/C;AADT,CAA/B;AAIAoB,eAAe,CAAC4B,SAAhB,2CAA4B;EAC1BzB,KAAK,EAAE3C,SAAS,CAAC+D,MADS;EAE1BnB,QAAQ,EAAE5C,SAAS,CAAC+D,MAFM;EAG1BtB,gBAAgB,EAAEzC,SAAS,CAACiE,MAHF;EAI1BvB,gBAAgB,EAAE1C,SAAS,CAACiE,MAJF;EAK1BpB,WAAW,EAAE7C,SAAS,CAACiE,MALG;EAM1BnB,QAAQ,EAAE9C,SAAS,CAACsE,OAAV,CAAkBtE,SAAS,CAACuE,KAAV,CAAgBV,4BAAhB,CAAlB;AANgB,CAA5B;AASA,eAAerB,eAAf"}
1
+ {"version":3,"file":"index.js","names":["React","PropTypes","Title","ProgressBar","COLORS","Tag","ButtonLink","Icon","Provider","style","uncappedMap","convert","cap","DetailSection","dataName","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","mandatoryCompletedModulesLocal","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 = ({dataName, 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 mandatoryCompletedModulesLocal = 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 {mandatoryCompletedModulesLocal}\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,QAAD;EAAWC,KAAX;EAAkBC,IAAlB;EAAwBC,QAAxB;EAAkCC,WAAlC;EAA+CC;AAA/C,CAAD,EAAwDC,OAAxD,KAAoE;EACxF,MAAM;IAACC;EAAD,IAAcD,OAApB;EACA,MAAME,WA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A9DD;;AAgEA,MAAMY,4BAAN,2CAAqC;EACnC9C,IAAI,EAAEf,SAAS,CAAC8D,KAAV,CAAgB,CAAC,SAAD,EAAY,OAAZ,EAAqB,OAArB,CAAhB,CAD6B;EAEnC7C,WAAW,EAAEjB,SAAS,CAAC+D,MAFY;EAGnC7C,KAAK,EAAElB,SAAS,CAACgE;AAHkB,CAArC;AAMApD,aAAa,CAACqD,YAAd,GAA6B;EAC3B7C,SAAS,EAAEb,QAAQ,CAAC2D,iBAAT,CAA2B9C;AADX,CAA7B;AAIAR,aAAa,CAACuD,SAAd;EACErD,KAAK,EAAEd,SAAS,CAACgE,MADnB;EAEEhD,QAAQ,EAAEhB,SAAS,CAACoE;AAFtB,GAGKP,4BAHL;AAMAlB,eAAe,CAACsB,YAAhB,GAA+B;EAC7B7C,SAAS,EAAEb,QAAQ,CAAC2D,iBAAT,CAA2B9C;AADT,CAA/B;AAIAuB,eAAe,CAACwB,SAAhB,2CAA4B;EAC1BrB,KAAK,EAAE9C,SAAS,CAAC+D,MADS;EAE1BhB,QAAQ,EAAE/C,SAAS,CAAC+D,MAFM;EAG1BnB,gBAAgB,EAAE5C,SAAS,CAACgE,MAHF;EAI1BnB,gBAAgB,EAAE7C,SAAS,CAACgE,MAJF;EAK1BhB,WAAW,EAAEhD,SAAS,CAACgE,MALG;EAM1Bf,QAAQ,EAAEjD,SAAS,CAACqE,OAAV,CAAkBrE,SAAS,CAACsE,KAAV,CAAgBT,4BAAhB,CAAlB;AANgB,CAA5B;AASA,eAAelB,eAAf"}
@@ -41,14 +41,6 @@
41
41
  gap: 16px;
42
42
  }
43
43
 
44
- .divider {
45
- width: 4px;
46
- height: 4px;
47
- background-color: #d7d7da;
48
- border: solid #d7d7da 1px;
49
- border-radius: 4px;
50
- }
51
-
52
44
  .progression {
53
45
  display: flex;
54
46
  justify-content: end;
@@ -129,10 +121,6 @@
129
121
  font-weight: 700;
130
122
  }
131
123
 
132
- .statsMobile {
133
- display: none;
134
- }
135
-
136
124
  .statsModuleMobile {
137
125
  display: none;
138
126
  }
@@ -140,6 +128,9 @@
140
128
  .statsProgressionMobile {
141
129
  composes: progression;
142
130
  display: none;
131
+ color: cm_grey_400;
132
+ font-weight: 600;
133
+ padding-top: 16px;
143
134
  }
144
135
 
145
136
  @media mobile, tablet {
@@ -160,12 +151,6 @@
160
151
  justify-content: space-around;
161
152
  gap: 0;
162
153
  }
163
- .divider {
164
- display: none;
165
- }
166
- .statsModule {
167
- display: none;
168
- }
169
154
  .progression {
170
155
  display: none;
171
156
  }
@@ -175,11 +160,4 @@
175
160
  .statsModuleMobile {
176
161
  display: block;
177
162
  }
178
- .statsMobile {
179
- display: flex;
180
- justify-content: space-between;
181
- padding-top: 16px;
182
- color: cm_grey_400;
183
- font-weight: 600;
184
- }
185
163
  }
@@ -33,21 +33,12 @@ declare namespace CertificationDetail {
33
33
  const metrics: PropTypes.Requireable<PropTypes.InferProps<{
34
34
  progression: PropTypes.Requireable<number>;
35
35
  stars: PropTypes.Requireable<number>;
36
- completedCourses: PropTypes.Requireable<number>;
37
- completedModules: PropTypes.Requireable<number>;
38
- }>>;
39
- const onDownloadDiploma: PropTypes.Requireable<(...args: any[]) => any>;
40
- const badge: PropTypes.Requireable<PropTypes.InferProps<{
41
- badgeUrl: PropTypes.Requireable<string>;
42
- onDownloadBadge: PropTypes.Requireable<(...args: any[]) => any>;
43
- }>>;
44
- const ongoingCourses: PropTypes.Requireable<PropTypes.InferProps<{
45
- list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
46
- customStyle: PropTypes.Requireable<{
47
- [x: string]: string | null | undefined;
48
- }>;
49
- loading: PropTypes.Requireable<boolean>;
36
+ mandatoryModules: PropTypes.Requireable<number>;
37
+ totalModules: PropTypes.Requireable<number>;
50
38
  }>>;
39
+ const diplomaUrl: PropTypes.Requireable<string>;
40
+ const badgeUrl: PropTypes.Requireable<string>;
41
+ const ongoingCoursesAvailable: PropTypes.Requireable<boolean>;
51
42
  const certificationCourses: PropTypes.Requireable<PropTypes.InferProps<{
52
43
  list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
53
44
  customStyle: PropTypes.Requireable<{
@@ -55,8 +46,6 @@ declare namespace CertificationDetail {
55
46
  }>;
56
47
  loading: PropTypes.Requireable<boolean>;
57
48
  }>>;
58
- const totalCourses: PropTypes.Requireable<number>;
59
- const totalModules: PropTypes.Requireable<number>;
60
49
  const filters: PropTypes.Requireable<PropTypes.InferProps<{
61
50
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
62
51
  options: PropTypes.Requireable<(PropTypes.InferProps<{
@@ -66,37 +55,6 @@ declare namespace CertificationDetail {
66
55
  validOption: PropTypes.Requireable<boolean>;
67
56
  }> | null | undefined)[]>;
68
57
  }>>;
69
- const sorting: PropTypes.Requireable<PropTypes.InferProps<{
70
- title: PropTypes.Requireable<string>;
71
- name: PropTypes.Requireable<string>;
72
- className: PropTypes.Requireable<string>;
73
- borderClassName: PropTypes.Requireable<string>;
74
- disabled: PropTypes.Requireable<boolean>;
75
- multiple: PropTypes.Requireable<boolean>;
76
- description: PropTypes.Requireable<string>;
77
- required: PropTypes.Requireable<boolean>;
78
- onChange: PropTypes.Requireable<(...args: any[]) => any>;
79
- theme: PropTypes.Requireable<string>;
80
- options: PropTypes.Requireable<(PropTypes.InferProps<{
81
- name: PropTypes.Validator<string>;
82
- value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
83
- selected: PropTypes.Requireable<boolean>;
84
- validOption: PropTypes.Requireable<boolean>;
85
- }> | null | undefined)[]>;
86
- optgroups: PropTypes.Requireable<(PropTypes.InferProps<{
87
- label: PropTypes.Validator<string>;
88
- options: PropTypes.Requireable<(PropTypes.InferProps<{
89
- name: PropTypes.Validator<string>;
90
- value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
91
- selected: PropTypes.Requireable<boolean>;
92
- validOption: PropTypes.Requireable<boolean>;
93
- }> | null | undefined)[]>;
94
- }> | null | undefined)[]>;
95
- modified: PropTypes.Requireable<boolean>;
96
- error: PropTypes.Requireable<boolean>;
97
- 'aria-label': PropTypes.Requireable<string>;
98
- 'aria-labelledby': PropTypes.Requireable<string>;
99
- }>>;
100
58
  const onBackClick: PropTypes.Requireable<(...args: any[]) => any>;
101
59
  const onContinueLearningClick: PropTypes.Requireable<(...args: any[]) => any>;
102
60
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/certification-detail/index.js"],"names":[],"mappings":";AAkBA,4EA8GC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/certification-detail/index.js"],"names":[],"mappings":";AAiBA,4EAwGC"}
@@ -1,16 +1,15 @@
1
1
  import _lowerCase from "lodash/fp/lowerCase";
2
2
  import _compact from "lodash/fp/compact";
3
- import React, { useCallback, useState } from 'react';
3
+ import React, { useCallback, useState, useMemo } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import classnames from 'classnames';
6
6
  import Provider from '../../atom/provider';
7
7
  import Tag from '../../atom/tag';
8
- import Select, { SelectOptionPropTypes } from '../../atom/select';
8
+ import { SelectOptionPropTypes } from '../../atom/select';
9
9
  import ButtonLinkIcon from '../../atom/button-link-icon';
10
10
  import Icon from '../../atom/icon';
11
11
  import CardsGrid from '../../organism/cards-grid';
12
12
  import AllCourses from '../skill-detail/all-courses';
13
- import ContinueLearning from '../skill-detail/continue-learning';
14
13
  import { ContinueLearningButton } from '../skill-detail';
15
14
  import ProgressWrapper from '../../molecule/progress-wrapper';
16
15
  import style from './style.css';
@@ -22,31 +21,24 @@ const CertificationDetail = (props, context) => {
22
21
  title,
23
22
  description,
24
23
  certificationCourses,
25
- ongoingCourses,
26
- totalCourses,
27
- totalModules,
24
+ ongoingCoursesAvailable,
28
25
  filters,
29
- sorting,
30
26
  onBackClick,
31
27
  onContinueLearningClick,
32
28
  metrics,
33
29
  logoUrl,
34
- onDownloadDiploma,
35
- badge = {}
30
+ diplomaUrl,
31
+ badgeUrl
36
32
  } = props;
37
33
  const {
38
34
  translate
39
35
  } = context;
40
36
  const {
41
37
  progression,
42
- completedCourses,
43
- completedModules,
44
- stars
38
+ mandatoryModules,
39
+ stars,
40
+ totalModules
45
41
  } = metrics;
46
- const {
47
- badgeUrl = false,
48
- onDownloadBadge
49
- } = badge;
50
42
  const [showMore, setShowMore] = useState(false);
51
43
  const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);
52
44
  const Description = useCallback(() => {
@@ -54,6 +46,7 @@ const CertificationDetail = (props, context) => {
54
46
  className: classnames(style.description, !showMore && style.truncate)
55
47
  }, description);
56
48
  }, [showMore, description]);
49
+ const completedModules = useMemo(() => mandatoryModules * progression / 100, [mandatoryModules, progression]);
57
50
  return /*#__PURE__*/React.createElement("div", {
58
51
  className: style.backgroundContainer
59
52
  }, /*#__PURE__*/React.createElement("div", {
@@ -88,37 +81,29 @@ const CertificationDetail = (props, context) => {
88
81
  }
89
82
  })) : null) : null, /*#__PURE__*/React.createElement("div", {
90
83
  className: style.contentStats
91
- }, /*#__PURE__*/React.createElement("span", null, `${totalCourses} ${_lowerCase(translate('courses'))}`), /*#__PURE__*/React.createElement("div", {
92
- className: style.divider
93
- }), /*#__PURE__*/React.createElement("span", null, `${totalModules} ${_lowerCase(translate('modules'))}`)), /*#__PURE__*/React.createElement(ContinueLearningButton, {
94
- ongoingCoursesAvailable: !!ongoingCourses.list.length,
84
+ }, /*#__PURE__*/React.createElement("span", null, `${totalModules} ${_lowerCase(translate('modules'))}`)), /*#__PURE__*/React.createElement(ContinueLearningButton, {
85
+ ongoingCoursesAvailable: ongoingCoursesAvailable,
95
86
  onClick: onContinueLearningClick
96
- }))), /*#__PURE__*/React.createElement("div", {
97
- className: style.continueLearningSection
98
- }, /*#__PURE__*/React.createElement(ContinueLearning, {
99
- ongoingCourses: ongoingCourses
100
- })), /*#__PURE__*/React.createElement(ProgressWrapper, {
87
+ }))), /*#__PURE__*/React.createElement(ProgressWrapper, {
101
88
  title: translate('your_progress'),
102
89
  subtitle: translate('certification_progress_wrapper_subtitle'),
103
90
  progression: progression,
104
- completedCourses: completedCourses,
105
91
  completedModules: completedModules,
92
+ mandatoryModules: mandatoryModules,
106
93
  sections: _compact([{
107
94
  type: 'diploma',
108
- onDownload: () => onDownloadDiploma
95
+ downloadUrl: diplomaUrl
109
96
  }, badgeUrl && {
110
97
  type: 'badge',
111
- badgeUrl,
112
- onDownload: () => onDownloadBadge
98
+ downloadUrl: badgeUrl
113
99
  }, {
114
100
  type: 'stars',
115
101
  stars
116
102
  }])
117
103
  }), /*#__PURE__*/React.createElement(AllCourses, {
118
- courses: certificationCourses,
119
- totalCourses: totalCourses,
104
+ content: certificationCourses,
120
105
  filters: filters,
121
- sorting: sorting
106
+ "data-name": "certification-courses"
122
107
  })));
123
108
  };
124
109
 
@@ -134,23 +119,17 @@ CertificationDetail.propTypes = process.env.NODE_ENV !== "production" ? {
134
119
  metrics: PropTypes.shape({
135
120
  progression: PropTypes.number,
136
121
  stars: PropTypes.number,
137
- completedCourses: PropTypes.number,
138
- completedModules: PropTypes.number
139
- }),
140
- onDownloadDiploma: PropTypes.func,
141
- badge: PropTypes.shape({
142
- badgeUrl: PropTypes.string,
143
- onDownloadBadge: PropTypes.func
122
+ mandatoryModules: PropTypes.number,
123
+ totalModules: PropTypes.number
144
124
  }),
145
- ongoingCourses: PropTypes.shape(CardsGrid.propTypes),
125
+ diplomaUrl: PropTypes.string,
126
+ badgeUrl: PropTypes.string,
127
+ ongoingCoursesAvailable: PropTypes.bool,
146
128
  certificationCourses: PropTypes.shape(CardsGrid.propTypes),
147
- totalCourses: PropTypes.number,
148
- totalModules: PropTypes.number,
149
129
  filters: PropTypes.shape({
150
130
  onChange: PropTypes.func,
151
131
  options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))
152
132
  }),
153
- sorting: PropTypes.shape(Select.propTypes),
154
133
  onBackClick: PropTypes.func,
155
134
  onContinueLearningClick: PropTypes.func
156
135
  } : {};
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useCallback","useState","PropTypes","classnames","Provider","Tag","Select","SelectOptionPropTypes","ButtonLinkIcon","Icon","CardsGrid","AllCourses","ContinueLearning","ContinueLearningButton","ProgressWrapper","style","DESCRIPTION_BREAKPOINT","CertificationDetail","props","context","certificationRef","title","description","certificationCourses","ongoingCourses","totalCourses","totalModules","filters","sorting","onBackClick","onContinueLearningClick","metrics","logoUrl","onDownloadDiploma","badge","translate","progression","completedCourses","completedModules","stars","badgeUrl","onDownloadBadge","showMore","setShowMore","handleShowMore","Description","truncate","backgroundContainer","container","backButton","ctaContainer","logoContainer","logo","length","showMoreWrapper","faSize","wrapperSize","contentStats","divider","list","continueLearningSection","type","onDownload","contextTypes","skin","childContextTypes","propTypes","string","isRequired","shape","number","func","onChange","options","arrayOf"],"sources":["../../../src/template/certification-detail/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {compact, lowerCase} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport AllCourses from '../skill-detail/all-courses';\nimport ContinueLearning from '../skill-detail/continue-learning';\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 ongoingCourses,\n totalCourses,\n totalModules,\n filters,\n sorting,\n onBackClick,\n onContinueLearningClick,\n metrics,\n logoUrl,\n onDownloadDiploma,\n badge = {}\n } = props;\n const {translate} = context;\n const {progression, completedCourses, completedModules, stars} = metrics;\n const {badgeUrl = false, onDownloadBadge} = badge;\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 {description}\n </div>\n );\n }, [showMore, description]);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={certificationRef}>\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 <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>{`${totalCourses} ${lowerCase(translate('courses'))}`}</span>\n <div className={style.divider} />\n <span>{`${totalModules} ${lowerCase(translate('modules'))}`}</span>\n </div>\n <ContinueLearningButton\n ongoingCoursesAvailable={!!ongoingCourses.list.length}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n <div className={style.continueLearningSection}>\n <ContinueLearning ongoingCourses={ongoingCourses} />\n </div>\n <ProgressWrapper\n title={translate('your_progress')}\n subtitle={translate('certification_progress_wrapper_subtitle')}\n progression={progression}\n completedCourses={completedCourses}\n completedModules={completedModules}\n sections={compact([\n {\n type: 'diploma',\n onDownload: () => onDownloadDiploma\n },\n badgeUrl && {\n type: 'badge',\n badgeUrl,\n onDownload: () => onDownloadBadge\n },\n {\n type: 'stars',\n stars\n }\n ])}\n />\n <AllCourses\n courses={certificationCourses}\n totalCourses={totalCourses}\n filters={filters}\n sorting={sorting}\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 completedCourses: PropTypes.number,\n completedModules: PropTypes.number\n }),\n onDownloadDiploma: PropTypes.func,\n badge: PropTypes.shape({\n badgeUrl: PropTypes.string,\n onDownloadBadge: PropTypes.func\n }),\n ongoingCourses: PropTypes.shape(CardsGrid.propTypes),\n certificationCourses: PropTypes.shape(CardsGrid.propTypes),\n totalCourses: PropTypes.number,\n totalModules: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes),\n onBackClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default CertificationDetail;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,QAA5B,QAA2C,OAA3C;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAOC,MAAP,IAAgBC,qBAAhB,QAA4C,mBAA5C;AACA,OAAOC,cAAP,MAA2B,6BAA3B;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,UAAP,MAAuB,6BAAvB;AACA,OAAOC,gBAAP,MAA6B,mCAA7B;AACA,SAAQC,sBAAR,QAAqC,iBAArC;AACA,OAAOC,eAAP,MAA4B,iCAA5B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,sBAAsB,GAAG,GAA/B;;AAEA,MAAMC,mBAAmB,GAA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E;EAJL,CAAhB,CALqB;EAW9BrC,iBAAiB,EAAE/B,SAAS,CAACqE,IAXC;EAY9BrC,KAAK,EAAEhC,SAAS,CAACmE,KAAV,CAAgB;IACrB7B,QAAQ,EAAEtC,SAAS,CAACiE,MADC;IAErB1B,eAAe,EAAEvC,SAAS,CAACqE;EAFN,CAAhB,CAZuB;EAgB9B/C,cAAc,EAAEtB,SAAS,CAACmE,KAAV,CAAgB3D,SAAS,CAACwD,SAA1B,CAhBc;EAiB9B3C,oBAAoB,EAAErB,SAAS,CAACmE,KAAV,CAAgB3D,SAAS,CAACwD,SAA1B,CAjBQ;EAkB9BzC,YAAY,EAAEvB,SAAS,CAACoE,MAlBM;EAmB9B5C,YAAY,EAAExB,SAAS,CAACoE,MAnBM;EAoB9B3C,OAAO,EAAEzB,SAAS,CAACmE,KAAV,CAAgB;IACvBG,QAAQ,EAAEtE,SAAS,CAACqE,IADG;IAEvBE,OAAO,EAAEvE,SAAS,CAACwE,OAAV,CAAkBxE,SAAS,CAACmE,KAAV,CAAgB9D,qBAAhB,CAAlB;EAFc,CAAhB,CApBqB;EAwB9BqB,OAAO,EAAE1B,SAAS,CAACmE,KAAV,CAAgB/D,MAAM,CAAC4D,SAAvB,CAxBqB;EAyB9BrC,WAAW,EAAE3B,SAAS,CAACqE,IAzBO;EA0B9BzC,uBAAuB,EAAE5B,SAAS,CAACqE;AA1BL,CAAhC;AA6BA,eAAetD,mBAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useCallback","useState","useMemo","PropTypes","classnames","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, pipe, get, size} from 'lodash/fp';\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 {description}\n </div>\n );\n }, [showMore, description]);\n\n const completedModules = useMemo(\n () => (mandatoryModules * progression) / 100,\n [mandatoryModules, progression]\n );\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={certificationRef}>\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 <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":";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AC0D,KAAV,CAAgB;IACvB7B,WAAW,EAAE7B,SAAS,CAAC2D,MADA;IAEvB5B,KAAK,EAAE/B,SAAS,CAAC2D,MAFM;IAGvB7B,gBAAgB,EAAE9B,SAAS,CAAC2D,MAHL;IAIvB3B,YAAY,EAAEhC,SAAS,CAAC2D;EAJD,CAAhB,CALqB;EAW9BjC,UAAU,EAAE1B,SAAS,CAACwD,MAXQ;EAY9B7B,QAAQ,EAAE3B,SAAS,CAACwD,MAZU;EAa9BpC,uBAAuB,EAAEpB,SAAS,CAAC4D,IAbL;EAc9BzC,oBAAoB,EAAEnB,SAAS,CAAC0D,KAAV,CAAgBnD,SAAS,CAACgD,SAA1B,CAdQ;EAe9BlC,OAAO,EAAErB,SAAS,CAAC0D,KAAV,CAAgB;IACvBG,QAAQ,EAAE7D,SAAS,CAAC8D,IADG;IAEvBC,OAAO,EAAE/D,SAAS,CAACgE,OAAV,CAAkBhE,SAAS,CAAC0D,KAAV,CAAgBtD,qBAAhB,CAAlB;EAFc,CAAhB,CAfqB;EAmB9BkB,WAAW,EAAEtB,SAAS,CAAC8D,IAnBO;EAoB9BvC,uBAAuB,EAAEvB,SAAS,CAAC8D;AApBL,CAAhC;AAuBA,eAAejD,mBAAf"}
@@ -8,14 +8,6 @@
8
8
  @value cm_grey_200 from colors;
9
9
  @value cm_grey_400 from colors;
10
10
 
11
- .divider {
12
- width: 4px;
13
- height: 4px;
14
- background-color: cm_grey_400;
15
- border: solid cm_grey_400 1px;
16
- border-radius: 4px;
17
- }
18
-
19
11
  .textBase {
20
12
  font-family: "Gilroy";
21
13
  font-style: normal;
@@ -53,6 +45,7 @@
53
45
  align-items: center;
54
46
  width: 100%;
55
47
  gap: 40px;
48
+ margin-bottom: 40px;
56
49
  }
57
50
 
58
51
  .logoContainer {
@@ -112,10 +105,6 @@
112
105
  color: cm_grey_400;
113
106
  }
114
107
 
115
- .continueLearningSection {
116
- padding: 24px 0 32px 0;
117
- }
118
-
119
108
  @media tablet {
120
109
  .ctaContainer {
121
110
  flex-direction: column;
@@ -26,14 +26,13 @@ declare namespace AllCourses {
26
26
  const translate: PropTypes.Requireable<(...args: any[]) => any>;
27
27
  }
28
28
  namespace propTypes {
29
- const courses: PropTypes.Requireable<PropTypes.InferProps<{
29
+ const content: PropTypes.Requireable<PropTypes.InferProps<{
30
30
  list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
31
31
  customStyle: PropTypes.Requireable<{
32
32
  [x: string]: string | null | undefined;
33
33
  }>;
34
34
  loading: PropTypes.Requireable<boolean>;
35
35
  }>>;
36
- const totalCourses: PropTypes.Requireable<number>;
37
36
  const filters: PropTypes.Requireable<PropTypes.InferProps<{
38
37
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
39
38
  options: PropTypes.Requireable<(PropTypes.InferProps<{
@@ -1 +1 @@
1
- {"version":3,"file":"all-courses.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/all-courses.js"],"names":[],"mappings":";AA2CA,mEAwHC"}
1
+ {"version":3,"file":"all-courses.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/all-courses.js"],"names":[],"mappings":";AA6CA,mEAsHC"}