@coorpacademy/components 10.3.32-alpha.2 → 10.4.2-alpha.2

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 (96) hide show
  1. package/es/atom/input-switch/test/fixtures.js +10 -0
  2. package/es/atom/input-switch/test/fixtures.js.map +1 -1
  3. package/es/atom/loader/test/fixtures.js +2 -0
  4. package/es/atom/loader/test/fixtures.js.map +1 -1
  5. package/es/molecule/card/customer.css +61 -3
  6. package/es/molecule/card/customer.js +17 -5
  7. package/es/molecule/card/customer.js.map +1 -1
  8. package/es/molecule/card/index.js +15 -5
  9. package/es/molecule/card/index.js.map +1 -1
  10. package/es/molecule/card/style.css +86 -24
  11. package/es/molecule/card/test/fixtures/coorpmanager.js +18 -0
  12. package/es/molecule/card/test/fixtures/coorpmanager.js.map +1 -0
  13. package/es/molecule/card/test/fixtures.js +2 -0
  14. package/es/molecule/card/test/fixtures.js.map +1 -1
  15. package/es/molecule/card-content/index.js +11 -5
  16. package/es/molecule/card-content/index.js.map +1 -1
  17. package/es/molecule/card-content/style.css +52 -0
  18. package/es/molecule/cockpit-popin/test/fixtures.js +17 -0
  19. package/es/molecule/cockpit-popin/test/fixtures.js.map +1 -0
  20. package/es/molecule/search/test/fixtures.js +15 -0
  21. package/es/molecule/search/test/fixtures.js.map +1 -0
  22. package/es/molecule/vertical-tabs/test/fixtures.js +2 -0
  23. package/es/molecule/vertical-tabs/test/fixtures.js.map +1 -1
  24. package/es/organism/course-selection/index.js +6 -1
  25. package/es/organism/course-selection/index.js.map +1 -1
  26. package/es/organism/course-selection/style.css +7 -1
  27. package/es/organism/course-selection/test/fixtures/default.js +29 -7
  28. package/es/organism/course-selection/test/fixtures/default.js.map +1 -1
  29. package/es/organism/course-selection/test/fixtures.js +2 -0
  30. package/es/organism/course-selection/test/fixtures.js.map +1 -1
  31. package/es/organism/search-and-chips-results/index.js +6 -1
  32. package/es/organism/search-and-chips-results/index.js.map +1 -1
  33. package/es/organism/search-and-chips-results/style.css +7 -1
  34. package/es/organism/wizard-contents/index.js +1 -6
  35. package/es/organism/wizard-contents/index.js.map +1 -1
  36. package/es/organism/wizard-contents/style.css +2 -8
  37. package/es/template/back-office/brand-update/index.js +4 -2
  38. package/es/template/back-office/brand-update/index.js.map +1 -1
  39. package/es/template/back-office/brand-update/style.css +4 -0
  40. package/es/template/back-office/brand-update/test/fixtures/loader.js +6 -2
  41. package/es/template/back-office/brand-update/test/fixtures/loader.js.map +1 -1
  42. package/es/template/back-office/brand-update/test/fixtures/manageusers-edit.js +236 -1
  43. package/es/template/back-office/brand-update/test/fixtures/manageusers-edit.js.map +1 -1
  44. package/es/template/back-office/brand-update/test/fixtures/manageusers-list.js +1 -1
  45. package/es/template/back-office/brand-update/test/fixtures/manageusers-list.js.map +1 -1
  46. package/es/template/back-office/brand-update/test/fixtures/uploadusers.js +1 -1
  47. package/es/template/back-office/brand-update/test/fixtures/uploadusers.js.map +1 -1
  48. package/lib/atom/input-switch/test/fixtures.js +15 -0
  49. package/lib/atom/input-switch/test/fixtures.js.map +1 -1
  50. package/lib/atom/loader/test/fixtures.js +3 -0
  51. package/lib/atom/loader/test/fixtures.js.map +1 -1
  52. package/lib/molecule/card/customer.css +61 -3
  53. package/lib/molecule/card/customer.js +22 -6
  54. package/lib/molecule/card/customer.js.map +1 -1
  55. package/lib/molecule/card/index.js +19 -6
  56. package/lib/molecule/card/index.js.map +1 -1
  57. package/lib/molecule/card/style.css +86 -24
  58. package/lib/molecule/card/test/fixtures/coorpmanager.js +28 -0
  59. package/lib/molecule/card/test/fixtures/coorpmanager.js.map +1 -0
  60. package/lib/molecule/card/test/fixtures.js +3 -0
  61. package/lib/molecule/card/test/fixtures.js.map +1 -1
  62. package/lib/molecule/card-content/index.js +14 -6
  63. package/lib/molecule/card-content/index.js.map +1 -1
  64. package/lib/molecule/card-content/style.css +52 -0
  65. package/lib/molecule/cockpit-popin/test/fixtures.js +28 -0
  66. package/lib/molecule/cockpit-popin/test/fixtures.js.map +1 -0
  67. package/lib/molecule/search/test/fixtures.js +25 -0
  68. package/lib/molecule/search/test/fixtures.js.map +1 -0
  69. package/lib/molecule/vertical-tabs/test/fixtures.js +3 -0
  70. package/lib/molecule/vertical-tabs/test/fixtures.js.map +1 -1
  71. package/lib/organism/course-selection/index.js +7 -1
  72. package/lib/organism/course-selection/index.js.map +1 -1
  73. package/lib/organism/course-selection/style.css +7 -1
  74. package/lib/organism/course-selection/test/fixtures/default.js +30 -7
  75. package/lib/organism/course-selection/test/fixtures/default.js.map +1 -1
  76. package/lib/organism/course-selection/test/fixtures.js +3 -0
  77. package/lib/organism/course-selection/test/fixtures.js.map +1 -1
  78. package/lib/organism/search-and-chips-results/index.js +7 -1
  79. package/lib/organism/search-and-chips-results/index.js.map +1 -1
  80. package/lib/organism/search-and-chips-results/style.css +7 -1
  81. package/lib/organism/wizard-contents/index.js +1 -7
  82. package/lib/organism/wizard-contents/index.js.map +1 -1
  83. package/lib/organism/wizard-contents/style.css +2 -8
  84. package/lib/template/back-office/brand-update/index.js +4 -2
  85. package/lib/template/back-office/brand-update/index.js.map +1 -1
  86. package/lib/template/back-office/brand-update/style.css +4 -0
  87. package/lib/template/back-office/brand-update/test/fixtures/loader.js +7 -3
  88. package/lib/template/back-office/brand-update/test/fixtures/loader.js.map +1 -1
  89. package/lib/template/back-office/brand-update/test/fixtures/manageusers-edit.js +236 -1
  90. package/lib/template/back-office/brand-update/test/fixtures/manageusers-edit.js.map +1 -1
  91. package/lib/template/back-office/brand-update/test/fixtures/manageusers-list.js +2 -2
  92. package/lib/template/back-office/brand-update/test/fixtures/manageusers-list.js.map +1 -1
  93. package/lib/template/back-office/brand-update/test/fixtures/uploadusers.js +2 -2
  94. package/lib/template/back-office/brand-update/test/fixtures/uploadusers.js.map +1 -1
  95. package/locales/hy/global.json +80 -0
  96. package/package.json +2 -2
@@ -1,3 +1,4 @@
1
+ import _keys from "lodash/fp/keys";
1
2
  import _isNil from "lodash/fp/isNil";
2
3
  import React from 'react';
3
4
  import PropTypes from 'prop-types';
@@ -12,6 +13,10 @@ export const MODES = {
12
13
  HERO: 'hero',
13
14
  CARD: 'card'
14
15
  };
16
+ export const THEMES = {
17
+ default: null,
18
+ coorpmanager: style.coorpmanager
19
+ };
15
20
 
16
21
  const ContentTypeInfo = ({
17
22
  mode,
@@ -30,8 +35,7 @@ const ContentTypeInfo = ({
30
35
  return /*#__PURE__*/React.createElement("div", {
31
36
  className: style.microLearningIcon
32
37
  }, /*#__PURE__*/React.createElement(TimerIcon, {
33
- height: 40,
34
- width: 40
38
+ className: style.timerIcon
35
39
  }), /*#__PURE__*/React.createElement("span", {
36
40
  className: style.microLearninglabel
37
41
  }, "5' learning"));
@@ -117,7 +121,8 @@ const ContentInfo = ({
117
121
  title,
118
122
  type,
119
123
  badgeCategory,
120
- badgeLabel
124
+ badgeLabel,
125
+ theme = 'default'
121
126
  }) => {
122
127
  const progressBarColor = '#3EC483';
123
128
  const inlineProgressValueStyle = {
@@ -141,7 +146,7 @@ const ContentInfo = ({
141
146
  })) : null;
142
147
  return /*#__PURE__*/React.createElement("div", {
143
148
  "data-name": "info",
144
- className: classnames(style.infoWrapper, mode === MODES.HERO ? style.hero : style.card, disabled ? style.progressBarDisabled : null, externalContent ? style.externalContent : null)
149
+ className: classnames(THEMES[theme], style.infoWrapper, mode === MODES.HERO ? style.hero : style.card, disabled ? style.progressBarDisabled : null, externalContent ? style.externalContent : null)
145
150
  }, /*#__PURE__*/React.createElement(ContentTypeInfo, {
146
151
  mode: mode,
147
152
  type: type,
@@ -179,7 +184,8 @@ ContentInfo.propTypes = process.env.NODE_ENV !== "production" ? {
179
184
  type: PropTypes.string,
180
185
  mode: PropTypes.string,
181
186
  badgeCategory: ContentBadge.propTypes.category,
182
- badgeLabel: ContentBadge.propTypes.label
187
+ badgeLabel: ContentBadge.propTypes.label,
188
+ theme: PropTypes.oneOf(_keys(THEMES))
183
189
  } : {};
184
190
  export default ContentInfo;
185
191
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/molecule/card-content/index.js"],"names":["React","PropTypes","classnames","NovaCompositionCoorpacademyAdaptive","AdaptivIcon","NovaSolidStatusCheckCircle2","CheckIcon","NovaCompositionCoorpacademyTimer","TimerIcon","isExternalContent","EXTERNAL_CONTENT_ICONS","Provider","ContentBadge","innerHTML","style","MODES","HERO","CARD","ContentTypeInfo","mode","type","externalContent","context","translate","microLearningIcon","microLearninglabel","textColor","color","contentTypeInfo","contextTypes","skin","childContextTypes","propTypes","bool","string","CardTitle","title","empty","courseContent","lightTitle","darkTitle","__html","AuthorName","author","certifiedAuthor","checkIcon","authorIcon","iconShadow","darkAuthorTitle","ContentInfo","adaptiv","disabled","progress","badgeCategory","badgeLabel","progressBarColor","inlineProgressValueStyle","backgroundColor","width","chapterContent","progressBar","progressWrapper","hideProgressBar","adaptiveIcon","infoWrapper","hero","card","progressBarDisabled","cardInfo","microLearningCardInfo","iconWrapper","number","category","label"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,mCAAmC,IAAIC,WADzC,EAEEC,2BAA2B,IAAIC,SAFjC,EAGEC,gCAAgC,IAAIC,SAHtC,QAIO,0BAJP;AAKA,SAAQC,iBAAR,EAA2BC,sBAA3B,QAAwD,6BAAxD;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,YAAP,MAAyB,0BAAzB;AACA,SAAQC,SAAR,QAAwB,4BAAxB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,OAAO,MAAMC,KAAK,GAAG;AACnBC,EAAAA,IAAI,EAAE,MADa;AAEnBC,EAAAA,IAAI,EAAE;AAFa,CAAd;;AAKP,MAAMC,eAAe,GAAG,CAAC;AAACC,EAAAA,IAAD;AAAOC,EAAAA,IAAP;AAAaC,EAAAA;AAAb,CAAD,EAAgCC,OAAhC,KAA4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AAuC,IAAA,KAAK,EAAEC;AAA9C,IADD,GAEG,IAJN,CAHF,eASE,oBAAC,SAAD;AAAW,IAAA,KAAK,EAAElB,KAAlB;AAAyB,IAAA,KAAK,EAAEC,KAAhC;AAAuC,IAAA,aAAa,EAAEC;AAAtD,IATF,eAUE,oBAAC,UAAD;AACE,IAAA,MAAM,EAAEK,MADV;AAEE,IAAA,KAAK,EAAEN,KAFT;AAGE,IAAA,aAAa,EAAEC,aAHjB;AAIE,IAAA,eAAe,EAAEM;AAJnB,IAVF,CAVF,EA2BGgB,WA3BH,CADF;AA+BD,CApED;;AAsEAX,WAAW,CAACpB,YAAZ,GAA2B;AACzBC,EAAAA,IAAI,EAAEnB,QAAQ,CAACoB,iBAAT,CAA2BD;AADR,CAA3B;AAIAmB,WAAW,CAACjB,SAAZ,2CAAwB;AACtBkB,EAAAA,OAAO,EAAEjD,SAAS,CAACgC,IADG;AAEtBU,EAAAA,MAAM,EAAE1C,SAAS,CAACiC,MAFI;AAGtBU,EAAAA,eAAe,EAAE3C,SAAS,CAACgC,IAHL;AAItBkB,EAAAA,QAAQ,EAAElD,SAAS,CAACgC,IAJE;AAKtBI,EAAAA,KAAK,EAAEpC,SAAS,CAACgC,IALK;AAMtBmB,EAAAA,QAAQ,EAAEnD,SAAS,CAACsE,MANE;AAOtBnC,EAAAA,KAAK,EAAEnC,SAAS,CAACiC,MAPK;AAQtBd,EAAAA,IAAI,EAAEnB,SAAS,CAACiC,MARM;AAStBf,EAAAA,IAAI,EAAElB,SAAS,CAACiC,MATM;AAUtBmB,EAAAA,aAAa,EAAEzC,YAAY,CAACoB,SAAb,CAAuBwC,QAVhB;AAWtBlB,EAAAA,UAAU,EAAE1C,YAAY,CAACoB,SAAb,CAAuByC;AAXb,CAAxB;AAcA,eAAexB,WAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {isNil} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyAdaptive as AdaptivIcon,\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaCompositionCoorpacademyTimer as TimerIcon\n} from '@coorpacademy/nova-icons';\nimport {isExternalContent, EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport ContentBadge from '../../atom/content-badge';\nimport {innerHTML} from '../../atom/label/style.css';\nimport style from './style.css';\n\nexport const MODES = {\n HERO: 'hero',\n CARD: 'card'\n};\n\nconst ContentTypeInfo = ({mode, type, externalContent}, context) => {\n const {translate} = context;\n if (mode !== MODES.CARD) {\n return null;\n }\n\n if (type === 'chapter') {\n return (\n <div className={style.microLearningIcon}>\n <TimerIcon height={40} width={40} />\n <span className={style.microLearninglabel}>{\"5' learning\"}</span>\n </div>\n );\n }\n if (externalContent && EXTERNAL_CONTENT_ICONS[type]) {\n const textColor = EXTERNAL_CONTENT_ICONS[type].color;\n\n return (\n <div className={style.contentTypeInfo} style={{color: textColor}}>\n {type === 'scorm' ? translate('external_content_scorm') : ''}\n {type === 'video' ? translate('external_content_video') : ''}\n {type === 'article' ? translate('external_content_article') : ''}\n {type === 'podcast' ? translate('external_content_podcast') : ''}\n </div>\n );\n }\n\n return null;\n};\n\nContentTypeInfo.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nContentTypeInfo.propTypes = {\n externalContent: PropTypes.bool,\n type: PropTypes.string,\n mode: PropTypes.string\n};\n\nconst CardTitle = ({title, empty, courseContent}) => {\n return (\n <div\n className={classnames(\n style.title,\n innerHTML,\n courseContent ? style.lightTitle : style.darkTitle,\n empty ? style.empty : null\n )}\n data-name=\"title\"\n title={title}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n );\n};\n\nCardTitle.propTypes = {\n title: PropTypes.string,\n empty: PropTypes.bool,\n courseContent: PropTypes.bool\n};\n\nconst AuthorName = ({author, empty, courseContent, certifiedAuthor}) => {\n const checkIcon = certifiedAuthor ? (\n <CheckIcon\n className={classnames(style.authorIcon, courseContent ? style.iconShadow : null)}\n color=\"inherit\"\n />\n ) : null;\n\n return (\n <div\n data-name=\"author\"\n title={author}\n className={classnames(\n style.author,\n courseContent ? style.lightTitle : style.darkAuthorTitle,\n empty ? style.empty : null\n )}\n >\n <span>{author}</span>\n {checkIcon}\n </div>\n );\n};\n\nAuthorName.propTypes = {\n author: PropTypes.string,\n empty: PropTypes.bool,\n courseContent: PropTypes.bool,\n certifiedAuthor: PropTypes.bool\n};\n\nconst ContentInfo = ({\n adaptiv,\n author,\n certifiedAuthor = false,\n disabled = false,\n empty = false,\n mode = MODES.CARD,\n progress,\n title,\n type,\n badgeCategory,\n badgeLabel\n}) => {\n const progressBarColor = '#3EC483';\n const inlineProgressValueStyle = {\n backgroundColor: progressBarColor,\n width: `${progress * 100}%`\n };\n const externalContent = isExternalContent(type);\n const courseContent = type === 'course';\n const chapterContent = type === 'chapter';\n\n const progressBar =\n mode === MODES.HERO || (!empty && !disabled) ? (\n <div className={!isNil(progress) ? style.progressWrapper : style.hideProgressBar}>\n {!disabled ? (\n <div data-name=\"progress\" className={style.progress} style={inlineProgressValueStyle} />\n ) : null}\n </div>\n ) : null;\n\n const adaptiveIcon = adaptiv ? (\n <div className={classnames(style.adaptiveIcon, courseContent ? style.iconShadow : null)}>\n <AdaptivIcon height={25} />\n </div>\n ) : null;\n\n return (\n <div\n data-name=\"info\"\n className={classnames(\n style.infoWrapper,\n mode === MODES.HERO ? style.hero : style.card,\n disabled ? style.progressBarDisabled : null,\n externalContent ? style.externalContent : null\n )}\n >\n <ContentTypeInfo mode={mode} type={type} externalContent={externalContent} />\n <div\n className={classnames(style.cardInfo, chapterContent ? style.microLearningCardInfo : null)}\n >\n <div className={style.iconWrapper}>\n {adaptiveIcon}\n {!empty && badgeLabel && badgeCategory && courseContent ? (\n <ContentBadge category={badgeCategory} label={badgeLabel} />\n ) : null}\n </div>\n <CardTitle title={title} empty={empty} courseContent={courseContent} />\n <AuthorName\n author={author}\n empty={empty}\n courseContent={courseContent}\n certifiedAuthor={certifiedAuthor}\n />\n </div>\n {progressBar}\n </div>\n );\n};\n\nContentInfo.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nContentInfo.propTypes = {\n adaptiv: PropTypes.bool,\n author: PropTypes.string,\n certifiedAuthor: PropTypes.bool,\n disabled: PropTypes.bool,\n empty: PropTypes.bool,\n progress: PropTypes.number,\n title: PropTypes.string,\n type: PropTypes.string,\n mode: PropTypes.string,\n badgeCategory: ContentBadge.propTypes.category,\n badgeLabel: ContentBadge.propTypes.label\n};\n\nexport default ContentInfo;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/molecule/card-content/index.js"],"names":["React","PropTypes","classnames","NovaCompositionCoorpacademyAdaptive","AdaptivIcon","NovaSolidStatusCheckCircle2","CheckIcon","NovaCompositionCoorpacademyTimer","TimerIcon","isExternalContent","EXTERNAL_CONTENT_ICONS","Provider","ContentBadge","innerHTML","style","MODES","HERO","CARD","THEMES","default","coorpmanager","ContentTypeInfo","mode","type","externalContent","context","translate","microLearningIcon","timerIcon","microLearninglabel","textColor","color","contentTypeInfo","contextTypes","skin","childContextTypes","propTypes","bool","string","CardTitle","title","empty","courseContent","lightTitle","darkTitle","__html","AuthorName","author","certifiedAuthor","checkIcon","authorIcon","iconShadow","darkAuthorTitle","ContentInfo","adaptiv","disabled","progress","badgeCategory","badgeLabel","theme","progressBarColor","inlineProgressValueStyle","backgroundColor","width","chapterContent","progressBar","progressWrapper","hideProgressBar","adaptiveIcon","infoWrapper","hero","card","progressBarDisabled","cardInfo","microLearningCardInfo","iconWrapper","number","category","label","oneOf"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,mCAAmC,IAAIC,WADzC,EAEEC,2BAA2B,IAAIC,SAFjC,EAGEC,gCAAgC,IAAIC,SAHtC,QAIO,0BAJP;AAKA,SAAQC,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BkB,EAAAA,QAAQ,EAAEtD,SAAS,CAACoC,IAJE;AAKtBI,EAAAA,KAAK,EAAExC,SAAS,CAACoC,IALK;AAMtBmB,EAAAA,QAAQ,EAAEvD,SAAS,CAAC2E,MANE;AAOtBpC,EAAAA,KAAK,EAAEvC,SAAS,CAACqC,MAPK;AAQtBf,EAAAA,IAAI,EAAEtB,SAAS,CAACqC,MARM;AAStBhB,EAAAA,IAAI,EAAErB,SAAS,CAACqC,MATM;AAUtBmB,EAAAA,aAAa,EAAE7C,YAAY,CAACwB,SAAb,CAAuByC,QAVhB;AAWtBnB,EAAAA,UAAU,EAAE9C,YAAY,CAACwB,SAAb,CAAuB0C,KAXb;AAYtBnB,EAAAA,KAAK,EAAE1D,SAAS,CAAC8E,KAAV,CAAgB,MAAK7D,MAAL,CAAhB;AAZe,CAAxB;AAeA,eAAemC,WAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {isNil, keys} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyAdaptive as AdaptivIcon,\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaCompositionCoorpacademyTimer as TimerIcon\n} from '@coorpacademy/nova-icons';\nimport {isExternalContent, EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport ContentBadge from '../../atom/content-badge';\nimport {innerHTML} from '../../atom/label/style.css';\nimport style from './style.css';\n\nexport const MODES = {\n HERO: 'hero',\n CARD: 'card'\n};\n\nexport const THEMES = {\n default: null,\n coorpmanager: style.coorpmanager\n};\n\nconst ContentTypeInfo = ({mode, type, externalContent}, context) => {\n const {translate} = context;\n if (mode !== MODES.CARD) {\n return null;\n }\n\n if (type === 'chapter') {\n return (\n <div className={style.microLearningIcon}>\n <TimerIcon className={style.timerIcon} />\n <span className={style.microLearninglabel}>{\"5' learning\"}</span>\n </div>\n );\n }\n if (externalContent && EXTERNAL_CONTENT_ICONS[type]) {\n const textColor = EXTERNAL_CONTENT_ICONS[type].color;\n\n return (\n <div className={style.contentTypeInfo} style={{color: textColor}}>\n {type === 'scorm' ? translate('external_content_scorm') : ''}\n {type === 'video' ? translate('external_content_video') : ''}\n {type === 'article' ? translate('external_content_article') : ''}\n {type === 'podcast' ? translate('external_content_podcast') : ''}\n </div>\n );\n }\n\n return null;\n};\n\nContentTypeInfo.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nContentTypeInfo.propTypes = {\n externalContent: PropTypes.bool,\n type: PropTypes.string,\n mode: PropTypes.string\n};\n\nconst CardTitle = ({title, empty, courseContent}) => {\n return (\n <div\n className={classnames(\n style.title,\n innerHTML,\n courseContent ? style.lightTitle : style.darkTitle,\n empty ? style.empty : null\n )}\n data-name=\"title\"\n title={title}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n );\n};\n\nCardTitle.propTypes = {\n title: PropTypes.string,\n empty: PropTypes.bool,\n courseContent: PropTypes.bool\n};\n\nconst AuthorName = ({author, empty, courseContent, certifiedAuthor}) => {\n const checkIcon = certifiedAuthor ? (\n <CheckIcon\n className={classnames(style.authorIcon, courseContent ? style.iconShadow : null)}\n color=\"inherit\"\n />\n ) : null;\n\n return (\n <div\n data-name=\"author\"\n title={author}\n className={classnames(\n style.author,\n courseContent ? style.lightTitle : style.darkAuthorTitle,\n empty ? style.empty : null\n )}\n >\n <span>{author}</span>\n {checkIcon}\n </div>\n );\n};\n\nAuthorName.propTypes = {\n author: PropTypes.string,\n empty: PropTypes.bool,\n courseContent: PropTypes.bool,\n certifiedAuthor: PropTypes.bool\n};\n\nconst ContentInfo = ({\n adaptiv,\n author,\n certifiedAuthor = false,\n disabled = false,\n empty = false,\n mode = MODES.CARD,\n progress,\n title,\n type,\n badgeCategory,\n badgeLabel,\n theme = 'default'\n}) => {\n const progressBarColor = '#3EC483';\n const inlineProgressValueStyle = {\n backgroundColor: progressBarColor,\n width: `${progress * 100}%`\n };\n const externalContent = isExternalContent(type);\n const courseContent = type === 'course';\n const chapterContent = type === 'chapter';\n\n const progressBar =\n mode === MODES.HERO || (!empty && !disabled) ? (\n <div className={!isNil(progress) ? style.progressWrapper : style.hideProgressBar}>\n {!disabled ? (\n <div data-name=\"progress\" className={style.progress} style={inlineProgressValueStyle} />\n ) : null}\n </div>\n ) : null;\n\n const adaptiveIcon = adaptiv ? (\n <div className={classnames(style.adaptiveIcon, courseContent ? style.iconShadow : null)}>\n <AdaptivIcon height={25} />\n </div>\n ) : null;\n\n return (\n <div\n data-name=\"info\"\n className={classnames(\n THEMES[theme],\n style.infoWrapper,\n mode === MODES.HERO ? style.hero : style.card,\n disabled ? style.progressBarDisabled : null,\n externalContent ? style.externalContent : null\n )}\n >\n <ContentTypeInfo mode={mode} type={type} externalContent={externalContent} />\n <div\n className={classnames(style.cardInfo, chapterContent ? style.microLearningCardInfo : null)}\n >\n <div className={style.iconWrapper}>\n {adaptiveIcon}\n {!empty && badgeLabel && badgeCategory && courseContent ? (\n <ContentBadge category={badgeCategory} label={badgeLabel} />\n ) : null}\n </div>\n <CardTitle title={title} empty={empty} courseContent={courseContent} />\n <AuthorName\n author={author}\n empty={empty}\n courseContent={courseContent}\n certifiedAuthor={certifiedAuthor}\n />\n </div>\n {progressBar}\n </div>\n );\n};\n\nContentInfo.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nContentInfo.propTypes = {\n adaptiv: PropTypes.bool,\n author: PropTypes.string,\n certifiedAuthor: PropTypes.bool,\n disabled: PropTypes.bool,\n empty: PropTypes.bool,\n progress: PropTypes.number,\n title: PropTypes.string,\n type: PropTypes.string,\n mode: PropTypes.string,\n badgeCategory: ContentBadge.propTypes.category,\n badgeLabel: ContentBadge.propTypes.label,\n theme: PropTypes.oneOf(keys(THEMES))\n};\n\nexport default ContentInfo;\n"],"file":"index.js"}
@@ -21,6 +21,23 @@
21
21
  margin-top: 53px;
22
22
  }
23
23
 
24
+ .coorpmanager .microLearningIcon {
25
+ display: flex;
26
+ flex-direction: column;
27
+ align-self: center;
28
+ margin-top: 35px;
29
+ }
30
+
31
+ .timerIcon {
32
+ height: 40px;
33
+ width: 40px;
34
+ }
35
+
36
+ .coorpmanager .timerIcon {
37
+ height: 30px;
38
+ width: 30px;
39
+ }
40
+
24
41
  .microLearningIcon svg {
25
42
  background:white;
26
43
  border-radius: 50%;
@@ -38,6 +55,10 @@
38
55
  text-transform: uppercase;
39
56
  }
40
57
 
58
+ .coorpmanager .microLearninglabel {
59
+ font-size: 6px;
60
+ }
61
+
41
62
  .infoWrapper {
42
63
  display: flex;
43
64
  flex-direction: column;
@@ -58,6 +79,11 @@
58
79
  user-select: none;
59
80
  }
60
81
 
82
+ .coorpmanager .title {
83
+ font-size: 12px;
84
+ font-weight: bold;
85
+ }
86
+
61
87
  .lightTitle {
62
88
  color: white;
63
89
  text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.5);
@@ -85,6 +111,10 @@
85
111
  user-select: none;
86
112
  }
87
113
 
114
+ .coorpmanager .author {
115
+ font-size: 8px;
116
+ }
117
+
88
118
  .hero .title {
89
119
  text-align: center;
90
120
  color: white;
@@ -97,6 +127,14 @@
97
127
  margin-top: 5px;
98
128
  }
99
129
 
130
+ .card .coorpmanager .author {
131
+ margin-top: 0px;
132
+ }
133
+
134
+ .externalContent.coorpmanager .author {
135
+ margin-top: 5px;
136
+ }
137
+
100
138
  .hero .author {
101
139
  margin-top: 9px;
102
140
  margin-bottom: 24px;
@@ -179,6 +217,11 @@
179
217
  background: light;
180
218
  }
181
219
 
220
+ .coorpmanager .progressWrapper {
221
+ height: 2px;
222
+ margin: 11px auto;
223
+ }
224
+
182
225
  .card .progressWrapper {
183
226
  width: 150px;
184
227
  }
@@ -193,12 +236,21 @@
193
236
  font-weight: 700;
194
237
  }
195
238
 
239
+ .coorpmanager.externalContent .contentTypeInfo {
240
+ font-size: 6px;
241
+ }
242
+
196
243
  .externalContent .cardInfo {
197
244
  flex-grow: 2;
198
245
  max-height: 115px;
199
246
  overflow: hidden;
200
247
  }
201
248
 
249
+ .coorpmanager.externalContent .cardInfo {
250
+ flex-grow: 2;
251
+ max-height: 79px;
252
+ }
253
+
202
254
  @media mobile {
203
255
  .author {
204
256
  font-size: 12px;
@@ -0,0 +1,17 @@
1
+ import test from 'ava';
2
+ import forEach from 'lodash/forEach';
3
+ import renderComponentMacro from '../../../test/helpers/render-component';
4
+ import MoleculeCockpitPopin from '..';
5
+ import fixtureDefault from './fixtures/default';
6
+ import fixtureLoading from './fixtures/loading';
7
+ import fixtureVideoTranslate from './fixtures/video-translate';
8
+ test('Molecule › MoleculeCockpitPopin > should have valid propTypes', t => {
9
+ t.pass();
10
+ forEach(MoleculeCockpitPopin.propTypes, (value, key) => {
11
+ t.not(value, undefined, `PropType for "Molecule.MoleculeCockpitPopin.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
12
+ });
13
+ });
14
+ test('Molecule › MoleculeCockpitPopin › Default › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureDefault);
15
+ test('Molecule › MoleculeCockpitPopin › Loading › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureLoading);
16
+ test('Molecule › MoleculeCockpitPopin › VideoTranslate › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureVideoTranslate);
17
+ //# sourceMappingURL=fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/molecule/cockpit-popin/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeCockpitPopin","fixtureDefault","fixtureLoading","fixtureVideoTranslate","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,oBAAP,MAAiC,IAAjC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AAEAN,IAAI,CAAC,+DAAD,EAAkEO,CAAC,IAAI;AACzEA,EAAAA,CAAC,CAACC,IAAF;AACAP,EAAAA,OAAO,CAACE,oBAAoB,CAACM,SAAtB,EAAiC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACtDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,yDAAwDF,GAAI,mEAArF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAX,IAAI,CAAC,gEAAD,EAAmEE,oBAAnE,EAAyFC,oBAAzF,EAA+GC,cAA/G,CAAJ;AACAJ,IAAI,CAAC,gEAAD,EAAmEE,oBAAnE,EAAyFC,oBAAzF,EAA+GE,cAA/G,CAAJ;AACAL,IAAI,CAAC,uEAAD,EAA0EE,oBAA1E,EAAgGC,oBAAhG,EAAsHG,qBAAtH,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeCockpitPopin from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureLoading from './fixtures/loading';\nimport fixtureVideoTranslate from './fixtures/video-translate';\n\ntest('Molecule › MoleculeCockpitPopin > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeCockpitPopin.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeCockpitPopin.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeCockpitPopin › Default › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureDefault);\ntest('Molecule › MoleculeCockpitPopin › Loading › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureLoading);\ntest('Molecule › MoleculeCockpitPopin › VideoTranslate › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureVideoTranslate);\n"],"file":"fixtures.js"}
@@ -0,0 +1,15 @@
1
+ import test from 'ava';
2
+ import forEach from 'lodash/forEach';
3
+ import renderComponentMacro from '../../../test/helpers/render-component';
4
+ import MoleculeSearch from '..';
5
+ import fixtureDefault from './fixtures/default';
6
+ import fixtureWithValue from './fixtures/with-value';
7
+ test('Molecule › MoleculeSearch > should have valid propTypes', t => {
8
+ t.pass();
9
+ forEach(MoleculeSearch.propTypes, (value, key) => {
10
+ t.not(value, undefined, `PropType for "Molecule.MoleculeSearch.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
11
+ });
12
+ });
13
+ test('Molecule › MoleculeSearch › Default › should be rendered', renderComponentMacro, MoleculeSearch, fixtureDefault);
14
+ test('Molecule › MoleculeSearch › WithValue › should be rendered', renderComponentMacro, MoleculeSearch, fixtureWithValue);
15
+ //# sourceMappingURL=fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/molecule/search/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeSearch","fixtureDefault","fixtureWithValue","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,cAAP,MAA2B,IAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AAEAL,IAAI,CAAC,yDAAD,EAA4DM,CAAC,IAAI;AACnEA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,cAAc,CAACK,SAAhB,EAA2B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAChDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,mDAAkDF,GAAI,mEAA/E;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,0DAAD,EAA6DE,oBAA7D,EAAmFC,cAAnF,EAAmGC,cAAnG,CAAJ;AACAJ,IAAI,CAAC,4DAAD,EAA+DE,oBAA/D,EAAqFC,cAArF,EAAqGE,gBAArG,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeSearch from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureWithValue from './fixtures/with-value';\n\ntest('Molecule › MoleculeSearch > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeSearch.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeSearch.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeSearch › Default › should be rendered', renderComponentMacro, MoleculeSearch, fixtureDefault);\ntest('Molecule › MoleculeSearch › WithValue › should be rendered', renderComponentMacro, MoleculeSearch, fixtureWithValue);\n"],"file":"fixtures.js"}
@@ -3,6 +3,7 @@ import forEach from 'lodash/forEach';
3
3
  import renderComponentMacro from '../../../test/helpers/render-component';
4
4
  import MoleculeVerticalTabs from '..';
5
5
  import fixtureDefault from './fixtures/default';
6
+ import fixtureWithMultipleErrors from './fixtures/with-multiple-errors';
6
7
  import fixtureWithSelectedItem from './fixtures/with-selected-item';
7
8
  test('Molecule › MoleculeVerticalTabs > should have valid propTypes', t => {
8
9
  t.pass();
@@ -11,5 +12,6 @@ test('Molecule › MoleculeVerticalTabs > should have valid propTypes', t => {
11
12
  });
12
13
  });
13
14
  test('Molecule › MoleculeVerticalTabs › Default › should be rendered', renderComponentMacro, MoleculeVerticalTabs, fixtureDefault);
15
+ test('Molecule › MoleculeVerticalTabs › WithMultipleErrors › should be rendered', renderComponentMacro, MoleculeVerticalTabs, fixtureWithMultipleErrors);
14
16
  test('Molecule › MoleculeVerticalTabs › WithSelectedItem › should be rendered', renderComponentMacro, MoleculeVerticalTabs, fixtureWithSelectedItem);
15
17
  //# sourceMappingURL=fixtures.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/molecule/vertical-tabs/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeVerticalTabs","fixtureDefault","fixtureWithSelectedItem","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,oBAAP,MAAiC,IAAjC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,uBAAP,MAAoC,+BAApC;AAEAL,IAAI,CAAC,+DAAD,EAAkEM,CAAC,IAAI;AACzEA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,oBAAoB,CAACK,SAAtB,EAAiC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACtDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,yDAAwDF,GAAI,mEAArF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,gEAAD,EAAmEE,oBAAnE,EAAyFC,oBAAzF,EAA+GC,cAA/G,CAAJ;AACAJ,IAAI,CAAC,yEAAD,EAA4EE,oBAA5E,EAAkGC,oBAAlG,EAAwHE,uBAAxH,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeVerticalTabs from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureWithSelectedItem from './fixtures/with-selected-item';\n\ntest('Molecule › MoleculeVerticalTabs > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeVerticalTabs.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeVerticalTabs.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeVerticalTabs › Default › should be rendered', renderComponentMacro, MoleculeVerticalTabs, fixtureDefault);\ntest('Molecule › MoleculeVerticalTabs › WithSelectedItem › should be rendered', renderComponentMacro, MoleculeVerticalTabs, fixtureWithSelectedItem);\n"],"file":"fixtures.js"}
1
+ {"version":3,"sources":["../../../../src/molecule/vertical-tabs/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeVerticalTabs","fixtureDefault","fixtureWithMultipleErrors","fixtureWithSelectedItem","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,oBAAP,MAAiC,IAAjC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,yBAAP,MAAsC,iCAAtC;AACA,OAAOC,uBAAP,MAAoC,+BAApC;AAEAN,IAAI,CAAC,+DAAD,EAAkEO,CAAC,IAAI;AACzEA,EAAAA,CAAC,CAACC,IAAF;AACAP,EAAAA,OAAO,CAACE,oBAAoB,CAACM,SAAtB,EAAiC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACtDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,yDAAwDF,GAAI,mEAArF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAX,IAAI,CAAC,gEAAD,EAAmEE,oBAAnE,EAAyFC,oBAAzF,EAA+GC,cAA/G,CAAJ;AACAJ,IAAI,CAAC,2EAAD,EAA8EE,oBAA9E,EAAoGC,oBAApG,EAA0HE,yBAA1H,CAAJ;AACAL,IAAI,CAAC,yEAAD,EAA4EE,oBAA5E,EAAkGC,oBAAlG,EAAwHG,uBAAxH,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeVerticalTabs from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureWithMultipleErrors from './fixtures/with-multiple-errors';\nimport fixtureWithSelectedItem from './fixtures/with-selected-item';\n\ntest('Molecule › MoleculeVerticalTabs > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeVerticalTabs.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeVerticalTabs.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeVerticalTabs › Default › should be rendered', renderComponentMacro, MoleculeVerticalTabs, fixtureDefault);\ntest('Molecule › MoleculeVerticalTabs › WithMultipleErrors › should be rendered', renderComponentMacro, MoleculeVerticalTabs, fixtureWithMultipleErrors);\ntest('Molecule › MoleculeVerticalTabs › WithSelectedItem › should be rendered', renderComponentMacro, MoleculeVerticalTabs, fixtureWithSelectedItem);\n"],"file":"fixtures.js"}
@@ -9,6 +9,7 @@ import Search from '../../atom/input-search';
9
9
  import SelectMultiple from '../../molecule/select-multiple';
10
10
  import Card from '../../molecule/card';
11
11
  import InputSwitch from '../../atom/input-switch';
12
+ import Loader from '../../atom/loader';
12
13
  import style from './style.css';
13
14
 
14
15
  const buildResultView = (courses, coursesSelectionAriaLabel, emptyMessages, isLoading) => {
@@ -51,7 +52,11 @@ const CourseSelection = props => {
51
52
  className: style.contentFilter
52
53
  }, /*#__PURE__*/React.createElement(SelectMultiple, contentTypeFilter)), /*#__PURE__*/React.createElement(InputSwitch, switchButton)), /*#__PURE__*/React.createElement("div", {
53
54
  className: style.cardsContainer
54
- }, resultView));
55
+ }, isLoading ? /*#__PURE__*/React.createElement("div", {
56
+ className: style.loader
57
+ }, /*#__PURE__*/React.createElement(Loader, {
58
+ theme: "coorpmanager"
59
+ })) : resultView));
55
60
  };
56
61
 
57
62
  CourseSelection.propTypes = process.env.NODE_ENV !== "production" ? {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/organism/course-selection/index.js"],"names":["React","PropTypes","EmptySearchResult","Search","SelectMultiple","Card","InputSwitch","style","buildResultView","courses","coursesSelectionAriaLabel","emptyMessages","isLoading","items","map","card","index","cards","CourseSelection","props","search","contentTypeFilter","switchButton","resultView","container","filters","contentFilter","cardsContainer","propTypes","shape","bool","arrayOf","string","firstMessage","secondMessage"],"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B,KAAK,CAACkB;AAAtB,kBACE;AAAK,IAAA,SAAS,EAAElB,KAAK,CAACa;AAAtB,kBACE,oBAAC,MAAD,eAAYA,MAAZ;AAAoB,IAAA,KAAK,EAAC;AAA1B,KADF,CADF,eAIE;AAAK,IAAA,SAAS,EAAEb,KAAK,CAACmB;AAAtB,kBACE,oBAAC,cAAD,EAAoBL,iBAApB,CADF,CAJF,eAOE,oBAAC,WAAD,EAAiBC,YAAjB,CAPF,CADF,eAUE;AAAK,IAAA,SAAS,EAAEf,KAAK,CAACoB;AAAtB,KAAuCJ,UAAvC,CAVF,CADF;AAcD,CA3BD;;AA6BAL,eAAe,CAACU,SAAhB,2CAA4B;AAC1BR,EAAAA,MAAM,EAAEnB,SAAS,CAAC4B,KAAV,CAAgB1B,MAAM,CAACF,SAAvB,CADkB;AAE1BW,EAAAA,SAAS,EAAEX,SAAS,CAAC6B,IAFK;AAG1BT,EAAAA,iBAAiB,EAAEpB,SAAS,CAAC4B,KAAV,CAAgBzB,cAAc,CAACH,SAA/B,CAHO;AAI1BQ,EAAAA,OAAO,EAAER,SAAS,CAAC8B,OAAV,CAAkB9B,SAAS,CAAC4B,KAAV,CAAgBxB,IAAI,CAACuB,SAArB,CAAlB,CAJiB;AAK1B,kCAAgC3B,SAAS,CAAC+B,MALhB;AAM1BrB,EAAAA,aAAa,EAAEV,SAAS,CAAC4B,KAAV,CAAgB;AAC7BI,IAAAA,YAAY,EAAEhC,SAAS,CAAC+B,MADK;AAE7BE,IAAAA,aAAa,EAAEjC,SAAS,CAAC+B;AAFI,GAAhB,CANW;AAU1BV,EAAAA,YAAY,EAAErB,SAAS,CAAC4B,KAAV,CAAgBvB,WAAW,CAACL,SAA5B;AAVY,CAA5B;AAaA,eAAeiB,eAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty} from 'lodash/fp';\nimport EmptySearchResult from '../../atom/empty-search-result';\nimport Search from '../../atom/input-search';\nimport SelectMultiple from '../../molecule/select-multiple';\nimport Card from '../../molecule/card';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\n\nconst buildResultView = (courses, coursesSelectionAriaLabel, emptyMessages, isLoading) => {\n if (!isLoading && isEmpty(courses)) {\n return <EmptySearchResult {...emptyMessages} />;\n }\n\n const items = courses.map((card, index) => {\n return (\n <li className={style.cards} key={`card-${index}`} data-name={`course-${index}`}>\n <Card {...card} />\n </li>\n );\n });\n\n return <ul aria-label={coursesSelectionAriaLabel}>{items}</ul>;\n};\n\nconst CourseSelection = props => {\n const {\n search,\n contentTypeFilter,\n courses,\n emptyMessages,\n isLoading = false,\n 'courses-selection-aria-label': coursesSelectionAriaLabel,\n switchButton\n } = props;\n\n const resultView = buildResultView(courses, coursesSelectionAriaLabel, emptyMessages, isLoading);\n\n return (\n <div className={style.container}>\n <div className={style.filters}>\n <div className={style.search}>\n <Search {...search} theme=\"coorpmanager\" />\n </div>\n <div className={style.contentFilter}>\n <SelectMultiple {...contentTypeFilter} />\n </div>\n <InputSwitch {...switchButton} />\n </div>\n <div className={style.cardsContainer}>{resultView}</div>\n </div>\n );\n};\n\nCourseSelection.propTypes = {\n search: PropTypes.shape(Search.PropTypes),\n isLoading: PropTypes.bool,\n contentTypeFilter: PropTypes.shape(SelectMultiple.PropTypes),\n courses: PropTypes.arrayOf(PropTypes.shape(Card.propTypes)),\n 'courses-selection-aria-label': PropTypes.string,\n emptyMessages: PropTypes.shape({\n firstMessage: PropTypes.string,\n secondMessage: PropTypes.string\n }),\n switchButton: PropTypes.shape(InputSwitch.PropTypes)\n};\n\nexport default CourseSelection;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/organism/course-selection/index.js"],"names":["React","PropTypes","EmptySearchResult","Search","SelectMultiple","Card","InputSwitch","Loader","style","buildResultView","courses","coursesSelectionAriaLabel","emptyMessages","isLoading","items","map","card","index","cards","CourseSelection","props","search","contentTypeFilter","switchButton","resultView","container","filters","contentFilter","cardsContainer","loader","propTypes","shape","bool","arrayOf","string","fir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;AAaA,eAAekB,eAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty} from 'lodash/fp';\nimport EmptySearchResult from '../../atom/empty-search-result';\nimport Search from '../../atom/input-search';\nimport SelectMultiple from '../../molecule/select-multiple';\nimport Card from '../../molecule/card';\nimport InputSwitch from '../../atom/input-switch';\nimport Loader from '../../atom/loader';\nimport style from './style.css';\n\nconst buildResultView = (courses, coursesSelectionAriaLabel, emptyMessages, isLoading) => {\n if (!isLoading && isEmpty(courses)) {\n return <EmptySearchResult {...emptyMessages} />;\n }\n\n const items = courses.map((card, index) => {\n return (\n <li className={style.cards} key={`card-${index}`} data-name={`course-${index}`}>\n <Card {...card} />\n </li>\n );\n });\n\n return <ul aria-label={coursesSelectionAriaLabel}>{items}</ul>;\n};\n\nconst CourseSelection = props => {\n const {\n search,\n contentTypeFilter,\n courses,\n emptyMessages,\n isLoading = false,\n 'courses-selection-aria-label': coursesSelectionAriaLabel,\n switchButton\n } = props;\n\n const resultView = buildResultView(courses, coursesSelectionAriaLabel, emptyMessages, isLoading);\n\n return (\n <div className={style.container}>\n <div className={style.filters}>\n <div className={style.search}>\n <Search {...search} theme=\"coorpmanager\" />\n </div>\n <div className={style.contentFilter}>\n <SelectMultiple {...contentTypeFilter} />\n </div>\n <InputSwitch {...switchButton} />\n </div>\n <div className={style.cardsContainer}>\n {isLoading ? (\n <div className={style.loader}>\n <Loader theme=\"coorpmanager\" />\n </div>\n ) : (\n resultView\n )}\n </div>\n </div>\n );\n};\n\nCourseSelection.propTypes = {\n search: PropTypes.shape(Search.PropTypes),\n isLoading: PropTypes.bool,\n contentTypeFilter: PropTypes.shape(SelectMultiple.PropTypes),\n courses: PropTypes.arrayOf(PropTypes.shape(Card.propTypes)),\n 'courses-selection-aria-label': PropTypes.string,\n emptyMessages: PropTypes.shape({\n firstMessage: PropTypes.string,\n secondMessage: PropTypes.string\n }),\n switchButton: PropTypes.shape(InputSwitch.PropTypes)\n};\n\nexport default CourseSelection;\n"],"file":"index.js"}
@@ -31,4 +31,10 @@
31
31
  .cards {
32
32
  display: inline-block;
33
33
  margin: 0 16px 16px 0px;
34
- }
34
+ }
35
+
36
+ .loader {
37
+ position: relative;
38
+ min-height: 50vh;
39
+ width: 100%;
40
+ }
@@ -5,6 +5,7 @@ import SelectedCard from '../../../../molecule/card/test/fixtures/selectable-tru
5
5
  import Article from '../../../../molecule/card/test/fixtures/article';
6
6
  import Scorm from '../../../../molecule/card/test/fixtures/scorm';
7
7
  import ExternalContent from '../../../../molecule/card/test/fixtures/external-content';
8
+ import Chaptercard from '../../../../molecule/card/test/fixtures/freerun';
8
9
  export default {
9
10
  props: {
10
11
  search: {
@@ -42,19 +43,40 @@ export default {
42
43
  multiple: false
43
44
  },
44
45
  'courses-selection-aria-label': 'Courses results',
45
- courses: [SelectedCard.props, UnSelectedCard.props, _extends(_extends({}, Article.props), {}, {
46
- isSelected: false
47
- }), SelectedCard.props, _extends(_extends({}, Scorm.props), {}, {
48
- isSelected: true
46
+ courses: [_extends(_extends({}, SelectedCard.props), {}, {
47
+ theme: 'coorpmanager',
48
+ progress: undefined
49
+ }), _extends(_extends({}, UnSelectedCard.props), {}, {
50
+ theme: 'coorpmanager',
51
+ progress: undefined
52
+ }), _extends(_extends({}, Article.props), {}, {
53
+ isSelected: false,
54
+ theme: 'coorpmanager',
55
+ progress: undefined
56
+ }), _extends(_extends({}, Chaptercard.props), {}, {
57
+ theme: 'coorpmanager',
58
+ progress: undefined,
59
+ isSelected: false,
60
+ favorite: false
61
+ }), _extends(_extends({}, Scorm.props), {}, {
62
+ isSelected: true,
63
+ theme: 'coorpmanager',
64
+ progress: undefined
49
65
  }), _extends(_extends({}, UnSelectedCard.props), {}, {
50
66
  isSelected: false,
51
- title: 'Standard course'
67
+ title: 'Standard course',
68
+ theme: 'coorpmanager',
69
+ progress: undefined
52
70
  }), _extends(_extends({}, ExternalContent.props), {}, {
53
71
  isSelected: false,
54
- title: 'External course'
72
+ title: 'External course',
73
+ theme: 'coorpmanager',
74
+ progress: undefined
55
75
  }), _extends(_extends({}, Scorm.props), {}, {
56
76
  isSelected: false,
57
- title: 'Scorm course'
77
+ title: 'Scorm course',
78
+ theme: 'coorpmanager',
79
+ progress: undefined
58
80
  })],
59
81
  switchButton: {
60
82
  type: 'switch',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/organism/course-selection/test/fixtures/default.js"],"names":["UnSelectedCard","SelectedCard","Article","Scorm","ExternalContent","props","search","title","placeholder","value","description","onChange","console","log","isLoading","contentTypeFilter","type","theme","size","options","name","selected","multiple","courses","isSelected","switchButton","titlePosition"],"mappings":";;AAAA,OAAOA,cAAP,MAA2B,0DAA3B;AACA,OAAOC,YAAP,MAAyB,yDAAzB;AACA,OAAOC,OAAP,MAAoB,iDAApB;AACA,OAAOC,KAAP,MAAkB,+CAAlB;AACA,OAAOC,eAAP,MAA4B,0DAA5B;AAEA,eAAe;AACbC,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,EAAE;AACNC,MAAAA,KAAK,EAAE,WADD;AAENC,MAAAA,WAAW,EAAE,WAFP;AAGNC,MAAAA,KAAK,EAAE,EAHD;AAINC,MAAAA,WAAW,EAAE,4BAJP;AAKNC,MAAAA,QAAQ,EAAEF,KAAK,IAAIG,OAAO,CAACC,GAAR,CAAYJ,KAAZ;AALb,KADH;AAQLK,IAAAA,SAAS,EAAE,KARN;AASLC,IAAAA,iBAAiB,EAAE;AACjBC,MAAAA,IAAI,EAAE,gBADW;AAEjBT,MAAAA,KAAK,EAAE,cAFU;AAGjBC,MAAAA,WAAW,EAAE,cAHI;AAIjBE,MAAAA,WAAW,EAAE,0BAJI;AAKjBO,MAAAA,KAAK,EAAE,cALU;AAMjBC,MAAAA,IAAI,EAAE,SANW;AAOjBC,MAAAA,OAAO,EAAE,CACP;AACEC,QAAAA,IAAI,EAAE,QADR;AAEEX,QAAAA,KAAK,EAAE,QAFT;AAGEY,QAAAA,QAAQ,EAAE;AAHZ,OADO,EA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edCard from '../../../../molecule/card/test/fixtures/selectable-false';\nimport SelectedCard from '../../../../molecule/card/test/fixtures/selectable-true';\nimport Article from '../../../../molecule/card/test/fixtures/article';\nimport Scorm from '../../../../molecule/card/test/fixtures/scorm';\nimport ExternalContent from '../../../../molecule/card/test/fixtures/external-content';\n\nexport default {\n props: {\n search: {\n title: 'Search...',\n placeholder: 'Search...',\n value: '',\n description: 'Type to filter the courses',\n onChange: value => console.log(value)\n },\n isLoading: false,\n contentTypeFilter: {\n type: 'selectMultiple',\n title: 'Content type',\n placeholder: 'Content type',\n description: 'This filters the courses',\n theme: 'coorpmanager',\n size: 'default',\n options: [\n {\n name: 'Course',\n value: 'course',\n selected: true\n },\n {\n name: \"5' learning\",\n value: 'chapter',\n selected: false\n },\n {\n name: 'Interactive slides',\n value: 'scorm',\n selected: false\n },\n {\n name: 'Video',\n value: 'video',\n selected: false\n }\n ],\n multiple: false\n },\n 'courses-selection-aria-label': 'Courses results',\n courses: [\n SelectedCard.props,\n UnSelectedCard.props,\n {...Article.props, isSelected: false},\n SelectedCard.props,\n {...Scorm.props, isSelected: true},\n {...UnSelectedCard.props, isSelected: false, title: 'Standard course'},\n {...ExternalContent.props, isSelected: false, title: 'External course'},\n {...Scorm.props, isSelected: false, title: 'Scorm course'}\n ],\n switchButton: {\n type: 'switch',\n title: 'Show selected courses only',\n value: false,\n onChange: value => console.log(value),\n titlePosition: 'right',\n theme: 'coorpmanager'\n }\n }\n};\n"],"file":"default.js"}
1
+ {"version":3,"sources":["../../../../../src/organism/course-selection/test/fixtures/default.js"],"names":["UnSelectedCard","SelectedCard","Article","Scorm","ExternalContent","Chaptercard","props","search","title","placeholder","value","description","onChange","console","log","isLoading","contentTypeFilter","type","theme","size","options","name","selected","multiple","courses","progress","undefined","isSelected","favorite","switchButton","titlePosition"],"mappings":";;AAAA,OAAOA,cAAP,MAA2B,0DAA3B;AACA,OAAOC,YAAP,MAAyB,yDAAzB;AACA,OAAOC,OAAP,MAAoB,iDAApB;AAC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;AAIZE,MAAAA,QAAQ,EAAEF,KAAK,IAAIG,OAAO,CAACC,GAAR,CAAYJ,KAAZ,CAJP;AAKZoB,MAAAA,aAAa,EAAE,OALH;AAMZZ,MAAAA,KAAK,EAAE;AANK;AA3ET;AADM,CAAf","sourcesContent":["import UnSelectedCard from '../../../../molecule/card/test/fixtures/selectable-false';\nimport SelectedCard from '../../../../molecule/card/test/fixtures/selectable-true';\nimport Article from '../../../../molecule/card/test/fixtures/article';\nimport Scorm from '../../../../molecule/card/test/fixtures/scorm';\nimport ExternalContent from '../../../../molecule/card/test/fixtures/external-content';\nimport Chaptercard from '../../../../molecule/card/test/fixtures/freerun';\n\nexport default {\n props: {\n search: {\n title: 'Search...',\n placeholder: 'Search...',\n value: '',\n description: 'Type to filter the courses',\n onChange: value => console.log(value)\n },\n isLoading: false,\n contentTypeFilter: {\n type: 'selectMultiple',\n title: 'Content type',\n placeholder: 'Content type',\n description: 'This filters the courses',\n theme: 'coorpmanager',\n size: 'default',\n options: [\n {\n name: 'Course',\n value: 'course',\n selected: true\n },\n {\n name: \"5' learning\",\n value: 'chapter',\n selected: false\n },\n {\n name: 'Interactive slides',\n value: 'scorm',\n selected: false\n },\n {\n name: 'Video',\n value: 'video',\n selected: false\n }\n ],\n multiple: false\n },\n 'courses-selection-aria-label': 'Courses results',\n courses: [\n {...SelectedCard.props, theme: 'coorpmanager', progress: undefined},\n {...UnSelectedCard.props, theme: 'coorpmanager', progress: undefined},\n {...Article.props, isSelected: false, theme: 'coorpmanager', progress: undefined},\n {\n ...Chaptercard.props,\n theme: 'coorpmanager',\n progress: undefined,\n isSelected: false,\n favorite: false\n },\n {...Scorm.props, isSelected: true, theme: 'coorpmanager', progress: undefined},\n {\n ...UnSelectedCard.props,\n isSelected: false,\n title: 'Standard course',\n theme: 'coorpmanager',\n progress: undefined\n },\n {\n ...ExternalContent.props,\n isSelected: false,\n title: 'External course',\n theme: 'coorpmanager',\n progress: undefined\n },\n {\n ...Scorm.props,\n isSelected: false,\n title: 'Scorm course',\n theme: 'coorpmanager',\n progress: undefined\n }\n ],\n switchButton: {\n type: 'switch',\n title: 'Show selected courses only',\n value: false,\n onChange: value => console.log(value),\n titlePosition: 'right',\n theme: 'coorpmanager'\n }\n }\n};\n"],"file":"default.js"}
@@ -6,6 +6,7 @@ import fixtureDefault from './fixtures/default';
6
6
  import fixtureEmpty from './fixtures/empty';
7
7
  import fixtureFiltered from './fixtures/filtered';
8
8
  import fixtureSortedSelected from './fixtures/sorted-selected';
9
+ import fixtureSwitchActivated from './fixtures/switch-activated';
9
10
  import fixtureUnsortedSelected from './fixtures/unsorted-selected';
10
11
  test('Organism › OrganismCourseSelection > should have valid propTypes', t => {
11
12
  t.pass();
@@ -17,5 +18,6 @@ test('Organism › OrganismCourseSelection › Default › should be rendered',
17
18
  test('Organism › OrganismCourseSelection › Empty › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureEmpty);
18
19
  test('Organism › OrganismCourseSelection › Filtered › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureFiltered);
19
20
  test('Organism › OrganismCourseSelection › SortedSelected › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureSortedSelected);
21
+ test('Organism › OrganismCourseSelection › SwitchActivated › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureSwitchActivated);
20
22
  test('Organism › OrganismCourseSelection › UnsortedSelected › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureUnsortedSelected);
21
23
  //# sourceMappingURL=fixtures.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/organism/course-selection/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","OrganismCourseSelection","fixtureDefault","fixtureEmpty","fixtureFiltered","fixtureSortedSelected","fixtureUnsortedSelected","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,uBAAP,MAAoC,IAApC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AAEAR,IAAI,CAAC,kEAAD,EAAqES,CAAC,IAAI;AAC5EA,EAAAA,CAAC,CAACC,IAAF;AACAT,EAAAA,OAAO,CAACE,uBAAuB,CAACQ,SAAzB,EAAoC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACzDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,4DAA2DF,GAAI,mEAAxF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAb,IAAI,CAAC,mEAAD,EAAsEE,oBAAtE,EAA4FC,uBAA5F,EAAqHC,cAArH,CAAJ;AACAJ,IAAI,CAAC,iEAAD,EAAoEE,oBAApE,EAA0FC,uBAA1F,EAAmHE,YAAnH,CAAJ;AACAL,IAAI,CAAC,oEAAD,EAAuEE,oBAAvE,EAA6FC,uBAA7F,EAAsHG,eAAtH,CAAJ;AACAN,IAAI,CAAC,0EAAD,EAA6EE,oBAA7E,EAAmGC,uBAAnG,EAA4HI,qBAA5H,CAAJ;AACAP,IAAI,CAAC,4EAAD,EAA+EE,oBAA/E,EAAqGC,uBAArG,EAA8HK,uBAA9H,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport OrganismCourseSelection from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureEmpty from './fixtures/empty';\nimport fixtureFiltered from './fixtures/filtered';\nimport fixtureSortedSelected from './fixtures/sorted-selected';\nimport fixtureUnsortedSelected from './fixtures/unsorted-selected';\n\ntest('Organism › OrganismCourseSelection > should have valid propTypes', t => {\n t.pass();\n forEach(OrganismCourseSelection.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Organism.OrganismCourseSelection.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Organism › OrganismCourseSelection › Default › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureDefault);\ntest('Organism › OrganismCourseSelection › Empty › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureEmpty);\ntest('Organism › OrganismCourseSelection › Filtered › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureFiltered);\ntest('Organism › OrganismCourseSelection › SortedSelected › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureSortedSelected);\ntest('Organism › OrganismCourseSelection › UnsortedSelected › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureUnsortedSelected);\n"],"file":"fixtures.js"}
1
+ {"version":3,"sources":["../../../../src/organism/course-selection/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","OrganismCourseSelection","fixtureDefault","fixtureEmpty","fixtureFiltered","fixtureSortedSelected","fixtureSwitchActivated","fixtureUnsortedSelected","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,uBAAP,MAAoC,IAApC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AACA,OAAOC,sBAAP,MAAmC,6BAAnC;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AAEAT,IAAI,CAAC,kEAAD,EAAqEU,CAAC,IAAI;AAC5EA,EAAAA,CAAC,CAACC,IAAF;AACAV,EAAAA,OAAO,CAACE,uBAAuB,CAACS,SAAzB,EAAoC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACzDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,4DAA2DF,GAAI,mEAAxF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAd,IAAI,CAAC,mEAAD,EAAsEE,oBAAtE,EAA4FC,uBAA5F,EAAqHC,cAArH,CAAJ;AACAJ,IAAI,CAAC,iEAAD,EAAoEE,oBAApE,EAA0FC,uBAA1F,EAAmHE,YAAnH,CAAJ;AACAL,IAAI,CAAC,oEAAD,EAAuEE,oBAAvE,EAA6FC,uBAA7F,EAAsHG,eAAtH,CAAJ;AACAN,IAAI,CAAC,0EAAD,EAA6EE,oBAA7E,EAAmGC,uBAAnG,EAA4HI,qBAA5H,CAAJ;AACAP,IAAI,CAAC,2EAAD,EAA8EE,oBAA9E,EAAoGC,uBAApG,EAA6HK,sBAA7H,CAAJ;AACAR,IAAI,CAAC,4EAAD,EAA+EE,oBAA/E,EAAqGC,uBAArG,EAA8HM,uBAA9H,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport OrganismCourseSelection from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureEmpty from './fixtures/empty';\nimport fixtureFiltered from './fixtures/filtered';\nimport fixtureSortedSelected from './fixtures/sorted-selected';\nimport fixtureSwitchActivated from './fixtures/switch-activated';\nimport fixtureUnsortedSelected from './fixtures/unsorted-selected';\n\ntest('Organism › OrganismCourseSelection > should have valid propTypes', t => {\n t.pass();\n forEach(OrganismCourseSelection.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Organism.OrganismCourseSelection.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Organism › OrganismCourseSelection › Default › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureDefault);\ntest('Organism › OrganismCourseSelection › Empty › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureEmpty);\ntest('Organism › OrganismCourseSelection › Filtered › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureFiltered);\ntest('Organism › OrganismCourseSelection › SortedSelected › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureSortedSelected);\ntest('Organism › OrganismCourseSelection › SwitchActivated › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureSwitchActivated);\ntest('Organism › OrganismCourseSelection › UnsortedSelected › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureUnsortedSelected);\n"],"file":"fixtures.js"}
@@ -8,6 +8,7 @@ import EmptySearchResult from '../../atom/empty-search-result';
8
8
  import Search from '../../atom/input-search';
9
9
  import ButtonLink from '../../atom/button-link';
10
10
  import Chips from '../../atom/chips';
11
+ import Loader from '../../atom/loader';
11
12
  import style from './style.css';
12
13
 
13
14
  const buildResultView = (results, resultsAriaLabel, emptyMessages, isLoading) => {
@@ -67,7 +68,11 @@ const SearchAndChipsResults = props => {
67
68
  theme: "coorpmanager"
68
69
  })))), /*#__PURE__*/React.createElement("div", {
69
70
  className: style.resultContainer
70
- }, resultView));
71
+ }, isLoading ? /*#__PURE__*/React.createElement("div", {
72
+ className: style.loader
73
+ }, /*#__PURE__*/React.createElement(Loader, {
74
+ theme: "coorpmanager"
75
+ })) : resultView));
71
76
  };
72
77
 
73
78
  SearchAndChipsResults.propTypes = process.env.NODE_ENV !== "production" ? {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/organism/search-and-chips-results/index.js"],"names":["React","PropTypes","EmptySearchResult","Search","ButtonLink","Chips","style","buildResultView","results","resultsAriaLabel","emptyMessages","isLoading","items","map","result","index","SearchAndChipsResults","props","search","selectAllButton","onClick","label","disabled","ariaLabel","resultView","buttonProps","type","icon","position","container","header","button","resultContainer","propTypes","shape","string","func","bool","arrayOf","firstMessage","secondMessage"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,iBAAP,MAA8B,gCAA9B;AACA,OAAOC,MAAP,MAAmB,yBAAnB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,KAAP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AhB;AAXiB,CAAlC;AAiBA,eAAenB,qBAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty} from 'lodash/fp';\nimport EmptySearchResult from '../../atom/empty-search-result';\nimport Search from '../../atom/input-search';\nimport ButtonLink from '../../atom/button-link';\nimport Chips from '../../atom/chips';\nimport style from './style.css';\n\nconst buildResultView = (results, resultsAriaLabel, emptyMessages, isLoading) => {\n if (!isLoading && isEmpty(results)) {\n return <EmptySearchResult {...emptyMessages} />;\n }\n\n const items = results.map((result, index) => {\n return (\n <li className={style.result} key={`result-${index}`} data-name={`result-${index}`}>\n <Chips {...result} />\n </li>\n );\n });\n\n return <ul aria-label={resultsAriaLabel}>{items}</ul>;\n};\n\nconst SearchAndChipsResults = props => {\n const {\n search,\n selectAllButton,\n results,\n emptyMessages,\n isLoading = false,\n 'results-aria-label': resultsAriaLabel\n } = props;\n\n const {onClick, label, disabled = false, 'aria-label': ariaLabel} = selectAllButton;\n const resultView = buildResultView(results, resultsAriaLabel, emptyMessages, isLoading);\n const buttonProps = {\n type: 'secondary',\n label,\n 'aria-label': ariaLabel,\n 'data-name': `select-all-button`,\n icon: {\n position: 'right',\n type: 'add'\n },\n onClick,\n disabled\n };\n\n return (\n <div className={style.container}>\n <div className={style.header}>\n <div className={style.button}>\n <ButtonLink {...buttonProps} />\n </div>\n <div className={style.search}>\n <Search {...search} theme=\"coorpmanager\" />\n </div>\n </div>\n <div className={style.resultContainer}>{resultView}</div>\n </div>\n );\n};\n\nSearchAndChipsResults.propTypes = {\n selectAllButton: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func,\n disabled: PropTypes.bool,\n 'aria-label': PropTypes.string\n }),\n isLoading: PropTypes.bool,\n search: PropTypes.shape(Search.PropTypes),\n results: PropTypes.arrayOf(PropTypes.shape(Chips.propTypes)),\n 'results-aria-label': PropTypes.string,\n emptyMessages: PropTypes.shape({\n firstMessage: PropTypes.string,\n secondMessage: PropTypes.string\n })\n};\n\nexport default SearchAndChipsResults;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/organism/search-and-chips-results/index.js"],"names":["React","PropTypes","EmptySearchResult","Search","ButtonLink","Chips","Loader","style","buildResultView","results","resultsAriaLabel","emptyMessages","isLoading","items","map","result","index","SearchAndChipsResults","props","search","selectAllButton","onClick","label","disabled","ariaLabel","resultView","buttonProps","type","icon","position","container","header","button","resultContainer","loader","propTypes","shape","string","func","bool","arrayOf","firstMessage","secondMessage"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,iBAAP,MAA8B,gCAA9B;AACA,OAAOC,MAAP,MAAmB,yBAAnB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,eAAe,GAAG,CAACC,OAAD,EAAUC,gBAAV,EAA4BC,aAA5B,EAA2CC,SAA3C,KAAyD;AAC/E,MAAI,CAACA,SAAD,IAAc,SAAQH,OAAR,CAAlB,EAAoC;AAClC,wBAAO,oBAAC,iBAAD,EAAuBE,aAAvB,CAAP;AACD;;AAED,QAAME,KAAK,GAAGJ,OAAO,CAACK,GAAR,CAAY,CAACC,MAAD,EAASC,KAAT,KAAmB;AAC3C,wBACE;AAAI,MAAA,SAAS,EAAET,KAAK,CAACQ,MAArB;AAA6B,MAAA,GAAG,EAAG,UAASC,KAAM,EAAlD;AAAqD,mBAAY,UAASA,KAAM;AAAhF,oBACE,oBAAC,KAAD,EAAWD,MAAX,CADF,CADF;AAKD,GANa,CAAd;AAQA,sBAAO;AAAI,kBAAYL;AAAhB,KAAmCG,KAAnC,CAAP;AACD,CAdD;;AAgBA,MAAMI,qBAAqB,GAAGC,KAAK,IAAI;AACrC,QAAM;AACJC,IAAAA,MADI;AAEJC,IAAAA,eAFI;AAGJX,IAAA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AV,CAAgB;AAC/Bd,IAAAA,KAAK,EAAErB,SAAS,CAACoC,MADc;AAE/BhB,IAAAA,OAAO,EAAEpB,SAAS,CAACqC,IAFY;AAG/Bf,IAAAA,QAAQ,EAAEtB,SAAS,CAACsC,IAHW;AAI/B,kBAActC,SAAS,CAACoC;AAJO,GAAhB,CADe;AAOhCzB,EAAAA,SAAS,EAAEX,SAAS,CAACsC,IAPW;AAQhCpB,EAAAA,MAAM,EAAElB,SAAS,CAACmC,KAAV,CAAgBjC,MAAM,CAACF,SAAvB,CARwB;AAShCQ,EAAAA,OAAO,EAAER,SAAS,CAACuC,OAAV,CAAkBvC,SAAS,CAACmC,KAAV,CAAgB/B,KAAK,CAAC8B,SAAtB,CAAlB,CATuB;AAUhC,wBAAsBlC,SAAS,CAACoC,MAVA;AAWhC1B,EAAAA,aAAa,EAAEV,SAAS,CAACmC,KAAV,CAAgB;AAC7BK,IAAAA,YAAY,EAAExC,SAAS,CAACoC,MADK;AAE7BK,IAAAA,aAAa,EAAEzC,SAAS,CAACoC;AAFI,GAAhB;AAXiB,CAAlC;AAiBA,eAAepB,qBAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty} from 'lodash/fp';\nimport EmptySearchResult from '../../atom/empty-search-result';\nimport Search from '../../atom/input-search';\nimport ButtonLink from '../../atom/button-link';\nimport Chips from '../../atom/chips';\nimport Loader from '../../atom/loader';\nimport style from './style.css';\n\nconst buildResultView = (results, resultsAriaLabel, emptyMessages, isLoading) => {\n if (!isLoading && isEmpty(results)) {\n return <EmptySearchResult {...emptyMessages} />;\n }\n\n const items = results.map((result, index) => {\n return (\n <li className={style.result} key={`result-${index}`} data-name={`result-${index}`}>\n <Chips {...result} />\n </li>\n );\n });\n\n return <ul aria-label={resultsAriaLabel}>{items}</ul>;\n};\n\nconst SearchAndChipsResults = props => {\n const {\n search,\n selectAllButton,\n results,\n emptyMessages,\n isLoading = false,\n 'results-aria-label': resultsAriaLabel\n } = props;\n\n const {onClick, label, disabled = false, 'aria-label': ariaLabel} = selectAllButton;\n const resultView = buildResultView(results, resultsAriaLabel, emptyMessages, isLoading);\n const buttonProps = {\n type: 'secondary',\n label,\n 'aria-label': ariaLabel,\n 'data-name': `select-all-button`,\n icon: {\n position: 'right',\n type: 'add'\n },\n onClick,\n disabled\n };\n\n return (\n <div className={style.container}>\n <div className={style.header}>\n <div className={style.button}>\n <ButtonLink {...buttonProps} />\n </div>\n <div className={style.search}>\n <Search {...search} theme=\"coorpmanager\" />\n </div>\n </div>\n <div className={style.resultContainer}>\n {isLoading ? (\n <div className={style.loader}>\n <Loader theme=\"coorpmanager\" />\n </div>\n ) : (\n resultView\n )}\n </div>\n </div>\n );\n};\n\nSearchAndChipsResults.propTypes = {\n selectAllButton: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func,\n disabled: PropTypes.bool,\n 'aria-label': PropTypes.string\n }),\n isLoading: PropTypes.bool,\n search: PropTypes.shape(Search.PropTypes),\n results: PropTypes.arrayOf(PropTypes.shape(Chips.propTypes)),\n 'results-aria-label': PropTypes.string,\n emptyMessages: PropTypes.shape({\n firstMessage: PropTypes.string,\n secondMessage: PropTypes.string\n })\n};\n\nexport default SearchAndChipsResults;\n"],"file":"index.js"}
@@ -32,4 +32,10 @@
32
32
  max-width: 268px;
33
33
  display: inline-block;
34
34
  margin: 0 16px 16px 0px;
35
- }
35
+ }
36
+
37
+ .loader {
38
+ position: relative;
39
+ min-height: 50vh;
40
+ width: 100%;
41
+ }
@@ -11,7 +11,6 @@ import BrandForm from '../brand-form';
11
11
  import ContentTranslate from '../content-translation';
12
12
  import OrganismSearchAndChipsResults from '../search-and-chips-results';
13
13
  import CourseSelection from '../course-selection';
14
- import Loader from '../../atom/loader';
15
14
  import style from './style.css';
16
15
 
17
16
  const buildHeader = (wizardHeader, steps) => {
@@ -122,11 +121,7 @@ const WizardContents = props => {
122
121
  className: style.leftSection
123
122
  }, headerView, /*#__PURE__*/React.createElement("div", {
124
123
  className: style.form
125
- }, isLoading ? /*#__PURE__*/React.createElement("div", {
126
- className: style.loader
127
- }, /*#__PURE__*/React.createElement(Loader, {
128
- theme: "coorpmanager"
129
- })) : formView)), /*#__PURE__*/React.createElement("div", {
124
+ }, formView)), /*#__PURE__*/React.createElement("div", {
130
125
  className: style.rightSection,
131
126
  "data-name": "summary-right-section"
132
127
  }, /*#__PURE__*/React.createElement("div", {