@coorpacademy/components 10.13.0 → 10.13.3-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/checkbox-with-title/test/fixtures.js +15 -0
- package/es/atom/checkbox-with-title/test/fixtures.js.map +1 -0
- package/es/atom/drag-and-drop/index.js +39 -36
- package/es/atom/drag-and-drop/index.js.map +1 -1
- package/es/atom/drag-and-drop/style.css +110 -75
- package/es/atom/drag-and-drop/test/fixtures/default.js +3 -3
- package/es/atom/drag-and-drop/test/fixtures/default.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/loading.js +2 -1
- package/es/atom/drag-and-drop/test/fixtures/loading.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/with-children.js +1 -0
- package/es/atom/drag-and-drop/test/fixtures/with-children.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/with-image.js +2 -1
- package/es/atom/drag-and-drop/test/fixtures/with-image.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/with-video.js +3 -1
- package/es/atom/drag-and-drop/test/fixtures/with-video.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/withLongDescription.js +9 -0
- package/es/atom/drag-and-drop/test/fixtures/withLongDescription.js.map +1 -0
- package/es/atom/drag-and-drop/test/fixtures.js +2 -0
- package/es/atom/drag-and-drop/test/fixtures.js.map +1 -1
- package/es/atom/input-text-with-title/index.js +35 -0
- package/es/atom/input-text-with-title/index.js.map +1 -0
- package/es/atom/input-text-with-title/style.css +24 -0
- package/es/atom/input-text-with-title/test/fixtures/default.js +12 -0
- package/es/atom/input-text-with-title/test/fixtures/default.js.map +1 -0
- package/es/atom/input-text-with-title/test/fixtures/error.js +13 -0
- package/es/atom/input-text-with-title/test/fixtures/error.js.map +1 -0
- package/es/atom/input-text-with-title/test/fixtures.js +15 -0
- package/es/atom/input-text-with-title/test/fixtures.js.map +1 -0
- package/es/atom/loader/style.css +7 -3
- package/es/molecule/course-sections/index.js +20 -4
- package/es/molecule/course-sections/index.js.map +1 -1
- package/es/molecule/course-sections/style.css +17 -0
- package/es/molecule/course-sections/test/fixtures/with-mandatory-courses-input.js +11 -0
- package/es/molecule/course-sections/test/fixtures/with-mandatory-courses-input.js.map +1 -0
- package/es/molecule/course-sections/test/fixtures.js +2 -0
- package/es/molecule/course-sections/test/fixtures.js.map +1 -1
- package/es/molecule/input-text-with-titeled-checkbox/test/fixtures.js +15 -0
- package/es/molecule/input-text-with-titeled-checkbox/test/fixtures.js.map +1 -0
- package/es/organism/course-selection/index.js +2 -1
- package/es/organism/course-selection/index.js.map +1 -1
- package/es/organism/course-selection/style.css +12 -3
- package/es/organism/course-selection/test/fixtures/loading.js +9 -0
- package/es/organism/course-selection/test/fixtures/loading.js.map +1 -0
- package/es/organism/course-selection/test/fixtures.js +2 -0
- package/es/organism/course-selection/test/fixtures.js.map +1 -1
- package/es/organism/search-and-chips-results/index.js +2 -1
- package/es/organism/search-and-chips-results/index.js.map +1 -1
- package/es/organism/search-and-chips-results/style.css +10 -3
- package/es/organism/search-and-chips-results/test/fixtures/loading.js +9 -0
- package/es/organism/search-and-chips-results/test/fixtures/loading.js.map +1 -0
- package/es/organism/search-and-chips-results/test/fixtures.js +2 -0
- package/es/organism/search-and-chips-results/test/fixtures.js.map +1 -1
- package/es/organism/wizard-contents/style.css +0 -1
- package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +1 -1
- package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -1
- package/es/template/back-office/brand-update/index.js +5 -2
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/back-office/brand-update/style.css +10 -1
- package/es/util/button-icons.js +3 -2
- package/es/util/button-icons.js.map +1 -1
- package/lib/{molecule → atom}/checkbox-with-title/test/fixtures.js +4 -4
- package/lib/atom/checkbox-with-title/test/fixtures.js.map +1 -0
- package/lib/atom/drag-and-drop/index.js +39 -34
- package/lib/atom/drag-and-drop/index.js.map +1 -1
- package/lib/atom/drag-and-drop/style.css +110 -75
- package/lib/atom/drag-and-drop/test/fixtures/default.js +3 -3
- package/lib/atom/drag-and-drop/test/fixtures/default.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/loading.js +2 -1
- package/lib/atom/drag-and-drop/test/fixtures/loading.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-children.js +1 -0
- package/lib/atom/drag-and-drop/test/fixtures/with-children.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-image.js +2 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-image.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-video.js +3 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-video.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/withLongDescription.js +18 -0
- package/lib/atom/drag-and-drop/test/fixtures/withLongDescription.js.map +1 -0
- package/lib/atom/drag-and-drop/test/fixtures.js +3 -0
- package/lib/atom/drag-and-drop/test/fixtures.js.map +1 -1
- package/lib/atom/input-text-with-title/index.js +46 -0
- package/lib/atom/input-text-with-title/index.js.map +1 -0
- package/lib/atom/input-text-with-title/style.css +24 -0
- package/lib/atom/input-text-with-title/test/fixtures/default.js +21 -0
- package/lib/atom/input-text-with-title/test/fixtures/default.js.map +1 -0
- package/lib/atom/input-text-with-title/test/fixtures/error.js +22 -0
- package/lib/atom/input-text-with-title/test/fixtures/error.js.map +1 -0
- package/lib/atom/input-text-with-title/test/fixtures.js +25 -0
- package/lib/atom/input-text-with-title/test/fixtures.js.map +1 -0
- package/lib/atom/loader/style.css +7 -3
- package/lib/molecule/course-sections/index.js +21 -4
- package/lib/molecule/course-sections/index.js.map +1 -1
- package/lib/molecule/course-sections/style.css +17 -0
- package/lib/molecule/course-sections/test/fixtures/with-mandatory-courses-input.js +21 -0
- package/lib/molecule/course-sections/test/fixtures/with-mandatory-courses-input.js.map +1 -0
- package/lib/molecule/course-sections/test/fixtures.js +3 -0
- package/lib/molecule/course-sections/test/fixtures.js.map +1 -1
- package/lib/molecule/input-text-with-titeled-checkbox/test/fixtures.js +25 -0
- package/lib/molecule/input-text-with-titeled-checkbox/test/fixtures.js.map +1 -0
- package/lib/organism/course-selection/index.js +2 -1
- package/lib/organism/course-selection/index.js.map +1 -1
- package/lib/organism/course-selection/style.css +12 -3
- package/lib/organism/course-selection/test/fixtures/loading.js +19 -0
- package/lib/organism/course-selection/test/fixtures/loading.js.map +1 -0
- package/lib/organism/course-selection/test/fixtures.js +3 -0
- package/lib/organism/course-selection/test/fixtures.js.map +1 -1
- package/lib/organism/search-and-chips-results/index.js +2 -1
- package/lib/organism/search-and-chips-results/index.js.map +1 -1
- package/lib/organism/search-and-chips-results/style.css +10 -3
- package/lib/organism/search-and-chips-results/test/fixtures/loading.js +19 -0
- package/lib/organism/search-and-chips-results/test/fixtures/loading.js.map +1 -0
- package/lib/organism/search-and-chips-results/test/fixtures.js +3 -0
- package/lib/organism/search-and-chips-results/test/fixtures.js.map +1 -1
- package/lib/organism/wizard-contents/style.css +0 -1
- package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +2 -2
- package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -1
- package/lib/template/back-office/brand-update/index.js +5 -2
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/back-office/brand-update/style.css +10 -1
- package/lib/util/button-icons.js +2 -1
- package/lib/util/button-icons.js.map +1 -1
- package/package.json +2 -2
- package/es/molecule/checkbox-with-title/test/fixtures.js +0 -15
- package/es/molecule/checkbox-with-title/test/fixtures.js.map +0 -1
- package/es/molecule/cockpit-popin/test/fixtures.js +0 -17
- package/es/molecule/cockpit-popin/test/fixtures.js.map +0 -1
- package/lib/molecule/checkbox-with-title/test/fixtures.js.map +0 -1
- package/lib/molecule/cockpit-popin/test/fixtures.js +0 -28
- package/lib/molecule/cockpit-popin/test/fixtures.js.map +0 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import InputText from '../input-text';
|
|
6
|
+
import style from './style.css';
|
|
7
|
+
|
|
8
|
+
const InputTextWithTitle = props => {
|
|
9
|
+
const {
|
|
10
|
+
inputText,
|
|
11
|
+
title,
|
|
12
|
+
'data-name': dataName,
|
|
13
|
+
'aria-label': ariaLabel
|
|
14
|
+
} = props;
|
|
15
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
className: style.container,
|
|
17
|
+
"data-name": dataName,
|
|
18
|
+
"aria-label": ariaLabel
|
|
19
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
20
|
+
className: style.title
|
|
21
|
+
}, title), /*#__PURE__*/React.createElement("div", {
|
|
22
|
+
className: style.inputText
|
|
23
|
+
}, /*#__PURE__*/React.createElement(InputText, inputText)));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
InputTextWithTitle.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
27
|
+
inputText: PropTypes.shape(_extends(_extends({}, InputText.propTypes), {}, {
|
|
28
|
+
theme: PropTypes.string
|
|
29
|
+
})),
|
|
30
|
+
title: PropTypes.string,
|
|
31
|
+
'aria-label': PropTypes.string,
|
|
32
|
+
'data-name': PropTypes.string
|
|
33
|
+
} : {};
|
|
34
|
+
export default InputTextWithTitle;
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/input-text-with-title/index.js"],"names":["React","PropTypes","InputText","style","InputTextWithTitle","props","inputText","title","dataName","ariaLabel","container","propTypes","shape","theme","string"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,kBAAkB,GAAGC,KAAK,IAAI;AAClC,QAAM;AAACC,IAAAA,SAAD;AAAYC,IAAAA,KAAZ;AAAmB,iBAAaC,QAAhC;AAA0C,kBAAcC;AAAxD,MAAqEJ,KAA3E;AAEA,sBACE;AAAK,IAAA,SAAS,EAAEF,KAAK,CAACO,SAAtB;AAAiC,iBAAWF,QAA5C;AAAsD,kBAAYC;AAAlE,kBACE;AAAM,IAAA,SAAS,EAAEN,KAAK,CAACI;AAAvB,KAA+BA,KAA/B,CADF,eAEE;AAAK,IAAA,SAAS,EAAEJ,KAAK,CAACG;AAAtB,kBACE,oBAAC,SAAD,EAAeA,SAAf,CADF,CAFF,CADF;AAQD,CAXD;;AAaAF,kBAAkB,CAACO,SAAnB,2CAA+B;AAC7BL,EAAAA,SAAS,EAAEL,SAAS,CAACW,KAAV,uBAAoBV,SAAS,CAACS,SAA9B;AAAyCE,IAAAA,KAAK,EAAEZ,SAAS,CAACa;AAA1D,KADkB;AAE7BP,EAAAA,KAAK,EAAEN,SAAS,CAACa,MAFY;AAG7B,gBAAcb,SAAS,CAACa,MAHK;AAI7B,eAAab,SAAS,CAACa;AAJM,CAA/B;AAMA,eAAeV,kBAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport InputText from '../input-text';\nimport style from './style.css';\n\nconst InputTextWithTitle = props => {\n const {inputText, title, 'data-name': dataName, 'aria-label': ariaLabel} = props;\n\n return (\n <div className={style.container} data-name={dataName} aria-label={ariaLabel}>\n <span className={style.title}>{title}</span>\n <div className={style.inputText}>\n <InputText {...inputText} />\n </div>\n </div>\n );\n};\n\nInputTextWithTitle.propTypes = {\n inputText: PropTypes.shape({...InputText.propTypes, theme: PropTypes.string}),\n title: PropTypes.string,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string\n};\nexport default InputTextWithTitle;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
@value colors: "../../variables/colors.css";
|
|
2
|
+
@value white from colors;
|
|
3
|
+
@value dark from colors;
|
|
4
|
+
@value cm_grey_200 from colors;
|
|
5
|
+
@value cm_grey_100 from colors;
|
|
6
|
+
@value black from colors;
|
|
7
|
+
@value cm_primary_blue from colors;
|
|
8
|
+
|
|
9
|
+
.container {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.title {
|
|
15
|
+
padding-bottom: 8px;
|
|
16
|
+
font-family: "Gilroy";
|
|
17
|
+
font-weight: bold;
|
|
18
|
+
font-size: 16px;
|
|
19
|
+
font-style: normal;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.inputText {
|
|
23
|
+
width: 173px;
|
|
24
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import inputText from '../../../input-text/test/fixtures/cm-default';
|
|
4
|
+
export default {
|
|
5
|
+
props: {
|
|
6
|
+
title: 'Mandatory courses to complete certification',
|
|
7
|
+
inputText: _extends(_extends({}, inputText.props), {}, {
|
|
8
|
+
hint: ''
|
|
9
|
+
})
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=default.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/input-text-with-title/test/fixtures/default.js"],"names":["inputText","props","title","hint"],"mappings":";;AAAA,OAAOA,SAAP,MAAsB,8CAAtB;AAEA,eAAe;AACbC,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,6CADF;AAELF,IAAAA,SAAS,wBAAMA,SAAS,CAACC,KAAhB;AAAuBE,MAAAA,IAAI,EAAE;AAA7B;AAFJ;AADM,CAAf","sourcesContent":["import inputText from '../../../input-text/test/fixtures/cm-default';\n\nexport default {\n props: {\n title: 'Mandatory courses to complete certification',\n inputText: {...inputText.props, hint: ''}\n }\n};\n"],"file":"default.js"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import inputText from '../../../input-text/test/fixtures/cm-default';
|
|
4
|
+
export default {
|
|
5
|
+
props: {
|
|
6
|
+
title: 'Mandatory courses to complete certification',
|
|
7
|
+
inputText: _extends(_extends({}, inputText.props), {}, {
|
|
8
|
+
error: 'this is error',
|
|
9
|
+
hint: ''
|
|
10
|
+
})
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/input-text-with-title/test/fixtures/error.js"],"names":["inputText","props","title","error","hint"],"mappings":";;AAAA,OAAOA,SAAP,MAAsB,8CAAtB;AAEA,eAAe;AACbC,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,6CADF;AAELF,IAAAA,SAAS,wBAAMA,SAAS,CAACC,KAAhB;AAAuBE,MAAAA,KAAK,EAAE,eAA9B;AAA+CC,MAAAA,IAAI,EAAE;AAArD;AAFJ;AADM,CAAf","sourcesContent":["import inputText from '../../../input-text/test/fixtures/cm-default';\n\nexport default {\n props: {\n title: 'Mandatory courses to complete certification',\n inputText: {...inputText.props, error: 'this is error', hint: ''}\n }\n};\n"],"file":"error.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 AtomInputTextWithTitle from '..';
|
|
5
|
+
import fixtureDefault from './fixtures/default';
|
|
6
|
+
import fixtureError from './fixtures/error';
|
|
7
|
+
test('Atom › AtomInputTextWithTitle > should have valid propTypes', t => {
|
|
8
|
+
t.pass();
|
|
9
|
+
forEach(AtomInputTextWithTitle.propTypes, (value, key) => {
|
|
10
|
+
t.not(value, undefined, `PropType for "Atom.AtomInputTextWithTitle.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
test('Atom › AtomInputTextWithTitle › Default › should be rendered', renderComponentMacro, AtomInputTextWithTitle, fixtureDefault);
|
|
14
|
+
test('Atom › AtomInputTextWithTitle › Error › should be rendered', renderComponentMacro, AtomInputTextWithTitle, fixtureError);
|
|
15
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/input-text-with-title/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomInputTextWithTitle","fixtureDefault","fixtureError","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,sBAAP,MAAmC,IAAnC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AAEAL,IAAI,CAAC,6DAAD,EAAgEM,CAAC,IAAI;AACvEA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,sBAAsB,CAACK,SAAxB,EAAmC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACxDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,uDAAsDF,GAAI,mEAAnF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,8DAAD,EAAiEE,oBAAjE,EAAuFC,sBAAvF,EAA+GC,cAA/G,CAAJ;AACAJ,IAAI,CAAC,4DAAD,EAA+DE,oBAA/D,EAAqFC,sBAArF,EAA6GE,YAA7G,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomInputTextWithTitle from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureError from './fixtures/error';\n\ntest('Atom › AtomInputTextWithTitle > should have valid propTypes', t => {\n t.pass();\n forEach(AtomInputTextWithTitle.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomInputTextWithTitle.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomInputTextWithTitle › Default › should be rendered', renderComponentMacro, AtomInputTextWithTitle, fixtureDefault);\ntest('Atom › AtomInputTextWithTitle › Error › should be rendered', renderComponentMacro, AtomInputTextWithTitle, fixtureError);\n"],"file":"fixtures.js"}
|
package/es/atom/loader/style.css
CHANGED
|
@@ -32,7 +32,11 @@
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.cmLoaderContainer {
|
|
35
|
-
|
|
35
|
+
position: relative;
|
|
36
|
+
top: 0;
|
|
37
|
+
left: 0;
|
|
38
|
+
height: 100%;
|
|
39
|
+
width: 100%;
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
.dots {
|
|
@@ -73,8 +77,8 @@
|
|
|
73
77
|
}
|
|
74
78
|
|
|
75
79
|
.icon {
|
|
76
|
-
width:
|
|
77
|
-
height:
|
|
80
|
+
width: 100%;
|
|
81
|
+
height: 100%;
|
|
78
82
|
position: absolute;
|
|
79
83
|
}
|
|
80
84
|
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import InputTextWithTitle from '../../atom/input-text-with-title';
|
|
3
4
|
import CourseSection from '../course-section';
|
|
4
5
|
import DraggableList from '../draggable-list';
|
|
5
6
|
import Loader from '../../atom/loader';
|
|
6
7
|
import Title from '../../atom/title';
|
|
7
8
|
import style from './style.css';
|
|
8
9
|
|
|
9
|
-
const Loading = () => /*#__PURE__*/React.createElement("div",
|
|
10
|
+
const Loading = () => /*#__PURE__*/React.createElement("div", {
|
|
11
|
+
className: style.loaderContainer
|
|
12
|
+
}, /*#__PURE__*/React.createElement(Loader, {
|
|
13
|
+
className: style.loader,
|
|
10
14
|
theme: "coorpmanager"
|
|
11
15
|
}));
|
|
12
16
|
|
|
@@ -14,10 +18,20 @@ const CourseSections = ({
|
|
|
14
18
|
sections,
|
|
15
19
|
onDrop,
|
|
16
20
|
isLoading,
|
|
17
|
-
title
|
|
21
|
+
title,
|
|
22
|
+
mandatoryCoursesInput,
|
|
23
|
+
inputTitle
|
|
18
24
|
}) => {
|
|
19
25
|
if (isLoading) return /*#__PURE__*/React.createElement(Loading, null);
|
|
20
|
-
return /*#__PURE__*/React.createElement("div", null,
|
|
26
|
+
return /*#__PURE__*/React.createElement("div", null, inputTitle ? /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
className: style.title
|
|
28
|
+
}, /*#__PURE__*/React.createElement(Title, {
|
|
29
|
+
title: inputTitle,
|
|
30
|
+
type: 'form-group',
|
|
31
|
+
"data-name": 'mandatory-courses-input-title'
|
|
32
|
+
})) : null, mandatoryCoursesInput ? /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: style.mandatoryCoursesInput
|
|
34
|
+
}, /*#__PURE__*/React.createElement(InputTextWithTitle, mandatoryCoursesInput)) : null, title ? /*#__PURE__*/React.createElement("div", {
|
|
21
35
|
className: style.title
|
|
22
36
|
}, /*#__PURE__*/React.createElement(Title, {
|
|
23
37
|
title: title,
|
|
@@ -31,10 +45,12 @@ const CourseSections = ({
|
|
|
31
45
|
};
|
|
32
46
|
|
|
33
47
|
CourseSections.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
48
|
+
inputTitle: PropTypes.string,
|
|
34
49
|
title: PropTypes.string,
|
|
35
50
|
sections: PropTypes.arrayOf(PropTypes.shape(CourseSection.propTypes)),
|
|
36
51
|
onDrop: PropTypes.func,
|
|
37
|
-
isLoading: PropTypes.bool
|
|
52
|
+
isLoading: PropTypes.bool,
|
|
53
|
+
mandatoryCoursesInput: PropTypes.shape(InputTextWithTitle.propTypes)
|
|
38
54
|
} : {};
|
|
39
55
|
export default CourseSections;
|
|
40
56
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/course-sections/index.js"],"names":["React","PropTypes","CourseSection","DraggableList","Loader","Title","style","Loading","CourseSections","sections","onDrop","isLoading","title","propTypes","string","arrayOf","shape","func","bool"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,OAAO,GAAG,mBACd,
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/course-sections/index.js"],"names":["React","PropTypes","InputTextWithTitle","CourseSection","DraggableList","Loader","Title","style","Loading","loaderContainer","loader","CourseSections","sections","onDrop","isLoading","title","mandatoryCoursesInput","inputTitle","propTypes","string","arrayOf","shape","func","bool"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,KAAP,MA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AA,QAAQ,EAAEX,SAAS,CAACmB,OAAV,CAAkBnB,SAAS,CAACoB,KAAV,CAAgBlB,aAAa,CAACe,SAA9B,CAAlB,CAHe;AAIzBL,EAAAA,MAAM,EAAEZ,SAAS,CAACqB,IAJO;AAKzBR,EAAAA,SAAS,EAAEb,SAAS,CAACsB,IALI;AAMzBP,EAAAA,qBAAqB,EAAEf,SAAS,CAACoB,KAAV,CAAgBnB,kBAAkB,CAACgB,SAAnC;AANE,CAA3B;AASA,eAAeP,cAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport InputTextWithTitle from '../../atom/input-text-with-title';\nimport CourseSection from '../course-section';\nimport DraggableList from '../draggable-list';\nimport Loader from '../../atom/loader';\nimport Title from '../../atom/title';\nimport style from './style.css';\n\nconst Loading = () => (\n <div className={style.loaderContainer}>\n <Loader className={style.loader} theme=\"coorpmanager\" />\n </div>\n);\n\nconst CourseSections = ({\n sections,\n onDrop,\n isLoading,\n title,\n mandatoryCoursesInput,\n inputTitle\n}) => {\n if (isLoading) return <Loading />;\n\n return (\n <div>\n {inputTitle ? (\n <div className={style.title}>\n <Title\n title={inputTitle}\n type={'form-group'}\n data-name={'mandatory-courses-input-title'}\n />\n </div>\n ) : null}\n {mandatoryCoursesInput ? (\n <div className={style.mandatoryCoursesInput}>\n <InputTextWithTitle {...mandatoryCoursesInput} />\n </div>\n ) : null}\n {title ? (\n <div className={style.title}>\n <Title title={title} type={'form-group'} data-name={'course-sections-title'} />\n </div>\n ) : null}\n <DraggableList itemType=\"course-section\" items={sections} onDrop={onDrop} />\n </div>\n );\n};\n\nCourseSections.propTypes = {\n inputTitle: PropTypes.string,\n title: PropTypes.string,\n sections: PropTypes.arrayOf(PropTypes.shape(CourseSection.propTypes)),\n onDrop: PropTypes.func,\n isLoading: PropTypes.bool,\n mandatoryCoursesInput: PropTypes.shape(InputTextWithTitle.propTypes)\n};\n\nexport default CourseSections;\n"],"file":"index.js"}
|
|
@@ -1,3 +1,20 @@
|
|
|
1
1
|
.title {
|
|
2
2
|
margin-bottom: 16px;
|
|
3
3
|
}
|
|
4
|
+
|
|
5
|
+
.mandatoryCoursesInput {
|
|
6
|
+
margin: 0 0 16px 16px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.loader {
|
|
10
|
+
width: 60px;
|
|
11
|
+
height: 60px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.loaderContainer {
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
align-items: center;
|
|
18
|
+
height: 50vh;
|
|
19
|
+
width: 100%;
|
|
20
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import mandatoryCoursesInput from '../../../../atom/input-text-with-title/test/fixtures/error';
|
|
4
|
+
import props from './default';
|
|
5
|
+
export default {
|
|
6
|
+
props: _extends(_extends({}, props.props), {}, {
|
|
7
|
+
mandatoryCoursesInput: mandatoryCoursesInput.props,
|
|
8
|
+
inputTitle: 'Minimun courses completion'
|
|
9
|
+
})
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=with-mandatory-courses-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/course-sections/test/fixtures/with-mandatory-courses-input.js"],"names":["mandatoryCoursesInput","props","inputTitle"],"mappings":";;AAAA,OAAOA,qBAAP,MAAkC,4DAAlC;AACA,OAAOC,KAAP,MAAkB,WAAlB;AAEA,eAAe;AACbA,EAAAA,KAAK,wBACAA,KAAK,CAACA,KADN;AAEHD,IAAAA,qBAAqB,EAAEA,qBAAqB,CAACC,KAF1C;AAGHC,IAAAA,UAAU,EAAE;AAHT;AADQ,CAAf","sourcesContent":["import mandatoryCoursesInput from '../../../../atom/input-text-with-title/test/fixtures/error';\nimport props from './default';\n\nexport default {\n props: {\n ...props.props,\n mandatoryCoursesInput: mandatoryCoursesInput.props,\n inputTitle: 'Minimun courses completion'\n }\n};\n"],"file":"with-mandatory-courses-input.js"}
|
|
@@ -4,6 +4,7 @@ import renderComponentMacro from '../../../test/helpers/render-component';
|
|
|
4
4
|
import MoleculeCourseSections from '..';
|
|
5
5
|
import fixtureDefault from './fixtures/default';
|
|
6
6
|
import fixtureLoading from './fixtures/loading';
|
|
7
|
+
import fixtureWithMandatoryCoursesInput from './fixtures/with-mandatory-courses-input';
|
|
7
8
|
test('Molecule › MoleculeCourseSections > should have valid propTypes', t => {
|
|
8
9
|
t.pass();
|
|
9
10
|
forEach(MoleculeCourseSections.propTypes, (value, key) => {
|
|
@@ -12,4 +13,5 @@ test('Molecule › MoleculeCourseSections > should have valid propTypes', t => {
|
|
|
12
13
|
});
|
|
13
14
|
test('Molecule › MoleculeCourseSections › Default › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureDefault);
|
|
14
15
|
test('Molecule › MoleculeCourseSections › Loading › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureLoading);
|
|
16
|
+
test('Molecule › MoleculeCourseSections › WithMandatoryCoursesInput › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureWithMandatoryCoursesInput);
|
|
15
17
|
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/course-sections/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeCourseSections","fixtureDefault","fixtureLoading","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,sBAAP,MAAmC,IAAnC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/course-sections/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeCourseSections","fixtureDefault","fixtureLoading","fixtureWithMandatoryCoursesInput","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,sBAAP,MAAmC,IAAnC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,gCAAP,MAA6C,yCAA7C;AAEAN,IAAI,CAAC,iEAAD,EAAoEO,CAAC,IAAI;AAC3EA,EAAAA,CAAC,CAACC,IAAF;AACAP,EAAAA,OAAO,CAACE,sBAAsB,CAACM,SAAxB,EAAmC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACxDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,2DAA0DF,GAAI,mEAAvF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAX,IAAI,CAAC,kEAAD,EAAqEE,oBAArE,EAA2FC,sBAA3F,EAAmHC,cAAnH,CAAJ;AACAJ,IAAI,CAAC,kEAAD,EAAqEE,oBAArE,EAA2FC,sBAA3F,EAAmHE,cAAnH,CAAJ;AACAL,IAAI,CAAC,oFAAD,EAAuFE,oBAAvF,EAA6GC,sBAA7G,EAAqIG,gCAArI,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeCourseSections from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureLoading from './fixtures/loading';\nimport fixtureWithMandatoryCoursesInput from './fixtures/with-mandatory-courses-input';\n\ntest('Molecule › MoleculeCourseSections > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeCourseSections.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeCourseSections.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeCourseSections › Default › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureDefault);\ntest('Molecule › MoleculeCourseSections › Loading › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureLoading);\ntest('Molecule › MoleculeCourseSections › WithMandatoryCoursesInput › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureWithMandatoryCoursesInput);\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 MoleculeInputTextWithTiteledCheckbox from '..';
|
|
5
|
+
import fixtureChecked from './fixtures/checked';
|
|
6
|
+
import fixtureUnchecked from './fixtures/unchecked';
|
|
7
|
+
test('Molecule › MoleculeInputTextWithTiteledCheckbox > should have valid propTypes', t => {
|
|
8
|
+
t.pass();
|
|
9
|
+
forEach(MoleculeInputTextWithTiteledCheckbox.propTypes, (value, key) => {
|
|
10
|
+
t.not(value, undefined, `PropType for "Molecule.MoleculeInputTextWithTiteledCheckbox.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
test('Molecule › MoleculeInputTextWithTiteledCheckbox › Checked › should be rendered', renderComponentMacro, MoleculeInputTextWithTiteledCheckbox, fixtureChecked);
|
|
14
|
+
test('Molecule › MoleculeInputTextWithTiteledCheckbox › Unchecked › should be rendered', renderComponentMacro, MoleculeInputTextWithTiteledCheckbox, fixtureUnchecked);
|
|
15
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/input-text-with-titeled-checkbox/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeInputTextWithTiteledCheckbox","fixtureChecked","fixtureUnchecked","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,oCAAP,MAAiD,IAAjD;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AAEAL,IAAI,CAAC,+EAAD,EAAkFM,CAAC,IAAI;AACzFA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,oCAAoC,CAACK,SAAtC,EAAiD,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACtEJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,yEAAwEF,GAAI,mEAArG;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,gFAAD,EAAmFE,oBAAnF,EAAyGC,oCAAzG,EAA+IC,cAA/I,CAAJ;AACAJ,IAAI,CAAC,kFAAD,EAAqFE,oBAArF,EAA2GC,oCAA3G,EAAiJE,gBAAjJ,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeInputTextWithTiteledCheckbox from '..';\nimport fixtureChecked from './fixtures/checked';\nimport fixtureUnchecked from './fixtures/unchecked';\n\ntest('Molecule › MoleculeInputTextWithTiteledCheckbox > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeInputTextWithTiteledCheckbox.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeInputTextWithTiteledCheckbox.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeInputTextWithTiteledCheckbox › Checked › should be rendered', renderComponentMacro, MoleculeInputTextWithTiteledCheckbox, fixtureChecked);\ntest('Molecule › MoleculeInputTextWithTiteledCheckbox › Unchecked › should be rendered', renderComponentMacro, MoleculeInputTextWithTiteledCheckbox, fixtureUnchecked);\n"],"file":"fixtures.js"}
|
|
@@ -60,8 +60,9 @@ const CourseSelection = props => {
|
|
|
60
60
|
className: style.cardsContainer,
|
|
61
61
|
"data-name": 'courses-result'
|
|
62
62
|
}, isLoading ? /*#__PURE__*/React.createElement("div", {
|
|
63
|
-
className: style.
|
|
63
|
+
className: style.loaderContainer
|
|
64
64
|
}, /*#__PURE__*/React.createElement(Loader, {
|
|
65
|
+
className: style.loader,
|
|
65
66
|
theme: "coorpmanager"
|
|
66
67
|
})) : resultView));
|
|
67
68
|
};
|
|
@@ -1 +1 @@
|
|
|
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","title","type","cards","CourseSelection","props","search","contentTypeFilter","switchButton","resultView","container","filters","contentFilter","cardsContainer","loader","propTypes","shape","bool","arrayOf","string","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,cAAP,MAA2B,gCAA3B;AACA,OAAOC,IAAP,MAAiB,qBAAjB;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,eAAe,GAAG,CAACC,OAAD,EAAUC,yBAAV,EAAqCC,aAArC,EAAoDC,SAApD,KAAkE;AACxF,MAAI,CAACA,SAAD,IAAc,SAAQH,OAAR,CAAlB,EAAoC;AAClC,wBAAO,oBAAC,iBAAD,EAAuBE,aAAvB,CAAP;AACD;;AAED,QAAME,KAAK,GAAGJ,OAAO,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,KACGjB,SAAS,gBACR;AAAK,IAAA,SAAS,EAAEL,KAAK,CAACuB;AAAtB,kBACE,oBAAC,MAAD;AAAQ,IAAA,KAAK,EAAC;
|
|
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","title","type","cards","CourseSelection","props","search","contentTypeFilter","switchButton","resultView","container","filters","contentFilter","cardsContainer","loaderContainer","loader","propTypes","shape","bool","arrayOf","string","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,cAAP,MAA2B,gCAA3B;AACA,OAAOC,IAAP,MAAiB,qBAAjB;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,eAAe,GAAG,CAACC,OAAD,EAAUC,yBAAV,EAAqCC,aAArC,EAAoDC,SAApD,KAAkE;AACxF,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,IAAD,EAAOC,KAAP,KAAiB;AACzC,UAAMC,KAAK,GAAG,KAAI,OAAJ,EAAaF,IAAb,CAAd;;AACA,UAAMG,IAAI,GAAG,KAAI,MAAJ,EAAYH,IAAZ,CAAb;;AACA,wBACE;AAAI,MAAA,SAAS,EAAER,KAAK,CAACY,KAArB;AAA4B,MAAA,GAAG,EAAG,QAAOH,KAAM,EAA/C;AAAkD,mBAAY,GAAEE,IAAK,IAA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AV,CAAgB/B,MAAM,CAACF,SAAvB,CADkB;AAE1BY,EAAAA,SAAS,EAAEZ,SAAS,CAACkC,IAFK;AAG1BX,EAAAA,iBAAiB,EAAEvB,SAAS,CAACiC,KAAV,CAAgB9B,cAAc,CAACH,SAA/B,CAHO;AAI1BS,EAAAA,OAAO,EAAET,SAAS,CAACmC,OAAV,CAAkBnC,SAAS,CAACiC,KAAV,CAAgB7B,IAAI,CAAC4B,SAArB,CAAlB,CAJiB;AAK1B,kCAAgChC,SAAS,CAACoC,MALhB;AAM1BzB,EAAAA,aAAa,EAAEX,SAAS,CAACiC,KAAV,CAAgB;AAC7BI,IAAAA,YAAY,EAAErC,SAAS,CAACoC,MADK;AAE7BE,IAAAA,aAAa,EAAEtC,SAAS,CAACoC;AAFI,GAAhB,CANW;AAU1BZ,EAAAA,YAAY,EAAExB,SAAS,CAACiC,KAAV,CAAgB5B,WAAW,CAACL,SAA5B;AAVY,CAA5B;AAaA,eAAeoB,eAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, get, kebabCase} 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 const title = get('title', card);\n const type = get('type', card);\n return (\n <li className={style.cards} key={`card-${index}`} data-name={`${type}-${kebabCase(title)}`}>\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} data-name={'courses-result'}>\n {isLoading ? (\n <div className={style.loaderContainer}>\n <Loader className={style.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"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
@value cm_grey_900 from colors;
|
|
5
5
|
|
|
6
6
|
.container {
|
|
7
|
+
height: 100%;
|
|
7
8
|
width: 100%;
|
|
8
9
|
}
|
|
9
10
|
|
|
@@ -26,6 +27,7 @@
|
|
|
26
27
|
|
|
27
28
|
.cardsContainer {
|
|
28
29
|
margin: 24px 0 0 0;
|
|
30
|
+
height: 100%;
|
|
29
31
|
width: 100%;
|
|
30
32
|
}
|
|
31
33
|
|
|
@@ -34,8 +36,15 @@
|
|
|
34
36
|
margin: 0 16px 16px 0px;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
|
-
.
|
|
38
|
-
position: relative;
|
|
39
|
-
min-height: 50vh;
|
|
39
|
+
.loaderContainer {
|
|
40
40
|
width: 100%;
|
|
41
|
+
height: 50vh;
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.loader {
|
|
48
|
+
height: 60px;
|
|
49
|
+
width: 60px;
|
|
41
50
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import props from './default';
|
|
4
|
+
export default _extends(_extends({}, props), {}, {
|
|
5
|
+
props: _extends(_extends({}, props.props), {}, {
|
|
6
|
+
isLoading: true
|
|
7
|
+
})
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=loading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/organism/course-selection/test/fixtures/loading.js"],"names":["props","isLoading"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,WAAlB;AAEA,qCACOA,KADP;AAEIA,EAAAA,KAAK,wBACEA,KAAK,CAACA,KADR;AAEDC,IAAAA,SAAS,EAAE;AAFV;AAFT","sourcesContent":["import props from './default';\n\nexport default {\n ...props,\n props: {\n ...props.props,\n isLoading: true\n }\n}\n"],"file":"loading.js"}
|
|
@@ -5,6 +5,7 @@ import OrganismCourseSelection from '..';
|
|
|
5
5
|
import fixtureDefault from './fixtures/default';
|
|
6
6
|
import fixtureEmpty from './fixtures/empty';
|
|
7
7
|
import fixtureFiltered from './fixtures/filtered';
|
|
8
|
+
import fixtureLoading from './fixtures/loading';
|
|
8
9
|
import fixtureSortedSelected from './fixtures/sorted-selected';
|
|
9
10
|
import fixtureSwitchActivated from './fixtures/switch-activated';
|
|
10
11
|
import fixtureUnsortedSelected from './fixtures/unsorted-selected';
|
|
@@ -17,6 +18,7 @@ test('Organism › OrganismCourseSelection > should have valid propTypes', t =>
|
|
|
17
18
|
test('Organism › OrganismCourseSelection › Default › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureDefault);
|
|
18
19
|
test('Organism › OrganismCourseSelection › Empty › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureEmpty);
|
|
19
20
|
test('Organism › OrganismCourseSelection › Filtered › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureFiltered);
|
|
21
|
+
test('Organism › OrganismCourseSelection › Loading › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureLoading);
|
|
20
22
|
test('Organism › OrganismCourseSelection › SortedSelected › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureSortedSelected);
|
|
21
23
|
test('Organism › OrganismCourseSelection › SwitchActivated › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureSwitchActivated);
|
|
22
24
|
test('Organism › OrganismCourseSelection › UnsortedSelected › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureUnsortedSelected);
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
1
|
+
{"version":3,"sources":["../../../../src/organism/course-selection/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","OrganismCourseSelection","fixtureDefault","fixtureEmpty","fixtureFiltered","fixtureLoading","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,cAAP,MAA2B,oBAA3B;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AACA,OAAOC,sBAAP,MAAmC,6BAAnC;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AAEAV,IAAI,CAAC,kEAAD,EAAqEW,CAAC,IAAI;AAC5EA,EAAAA,CAAC,CAACC,IAAF;AACAX,EAAAA,OAAO,CAACE,uBAAuB,CAACU,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;AAOAf,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,mEAAD,EAAsEE,oBAAtE,EAA4FC,uBAA5F,EAAqHI,cAArH,CAAJ;AACAP,IAAI,CAAC,0EAAD,EAA6EE,oBAA7E,EAAmGC,uBAAnG,EAA4HK,qBAA5H,CAAJ;AACAR,IAAI,CAAC,2EAAD,EAA8EE,oBAA9E,EAAoGC,uBAApG,EAA6HM,sBAA7H,CAAJ;AACAT,IAAI,CAAC,4EAAD,EAA+EE,oBAA/E,EAAqGC,uBAArG,EAA8HO,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 fixtureLoading from './fixtures/loading';\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 › Loading › should be rendered', renderComponentMacro, OrganismCourseSelection, fixtureLoading);\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"}
|
|
@@ -69,8 +69,9 @@ const SearchAndChipsResults = props => {
|
|
|
69
69
|
})))), /*#__PURE__*/React.createElement("div", {
|
|
70
70
|
className: style.resultContainer
|
|
71
71
|
}, isLoading ? /*#__PURE__*/React.createElement("div", {
|
|
72
|
-
className: style.
|
|
72
|
+
className: style.loaderContainer
|
|
73
73
|
}, /*#__PURE__*/React.createElement(Loader, {
|
|
74
|
+
className: style.loader,
|
|
74
75
|
theme: "coorpmanager"
|
|
75
76
|
})) : resultView));
|
|
76
77
|
};
|
|
@@ -1 +1 @@
|
|
|
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,M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AAK,CAAC2B;AAAtB,kBACE,oBAAC,MAAD;AAAQ,IAAA,KAAK,EAAC;
|
|
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","loaderContainer","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;A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AAqBD,CA9CD;;AAgDAR,qBAAqB,CAACmB,SAAtB,2CAAkC;AAChChB,EAAAA,eAAe,EAAEnB,SAAS,CAACoC,KAAV,CAAgB;AAC/Bf,IAAAA,KAAK,EAAErB,SAAS,CAACqC,MADc;AAE/BjB,IAAAA,OAAO,EAAEpB,SAAS,CAACsC,IAFY;AAG/BhB,IAAAA,QAAQ,EAAEtB,SAAS,CAACuC,IAHW;AAI/B,kBAAcvC,SAAS,CAACqC;AAJO,GAAhB,CADe;AAOhC1B,EAAAA,SAAS,EAAEX,SAAS,CAACuC,IAPW;AAQhCrB,EAAAA,MAAM,EAAElB,SAAS,CAACoC,KAAV,CAAgBlC,MAAM,CAACF,SAAvB,CARwB;AAShCQ,EAAAA,OAAO,EAAER,SAAS,CAACwC,OAAV,CAAkBxC,SAAS,CAACoC,KAAV,CAAgBhC,KAAK,CAAC+B,SAAtB,CAAlB,CATuB;AAUhC,wBAAsBnC,SAAS,CAACqC,MAVA;AAWhC3B,EAAAA,aAAa,EAAEV,SAAS,CAACoC,KAAV,CAAgB;AAC7BK,IAAAA,YAAY,EAAEzC,SAAS,CAACqC,MADK;AAE7BK,IAAAA,aAAa,EAAE1C,SAAS,CAACqC;AAFI,GAAhB;AAXiB,CAAlC;AAiBA,eAAerB,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.loaderContainer}>\n <Loader className={style.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"}
|
|
@@ -34,8 +34,15 @@
|
|
|
34
34
|
margin: 0 16px 16px 0px;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
.
|
|
38
|
-
position: relative;
|
|
39
|
-
min-height: 50vh;
|
|
37
|
+
.loaderContainer {
|
|
40
38
|
width: 100%;
|
|
39
|
+
height: 50vh;
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: center;
|
|
41
43
|
}
|
|
44
|
+
|
|
45
|
+
.loader {
|
|
46
|
+
height: 60px;
|
|
47
|
+
width: 60px;
|
|
48
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import props from './default';
|
|
4
|
+
export default _extends(_extends({}, props), {}, {
|
|
5
|
+
props: _extends(_extends({}, props.props), {}, {
|
|
6
|
+
isLoading: true
|
|
7
|
+
})
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=loading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/organism/search-and-chips-results/test/fixtures/loading.js"],"names":["props","isLoading"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,WAAlB;AAEA,qCACOA,KADP;AAEIA,EAAAA,KAAK,wBACEA,KAAK,CAACA,KADR;AAEDC,IAAAA,SAAS,EAAE;AAFV;AAFT","sourcesContent":["import props from './default';\n\nexport default {\n ...props,\n props: {\n ...props.props,\n isLoading: true\n }\n}\n"],"file":"loading.js"}
|
|
@@ -5,6 +5,7 @@ import OrganismSearchAndChipsResults from '..';
|
|
|
5
5
|
import fixtureDefault from './fixtures/default';
|
|
6
6
|
import fixtureEmpty from './fixtures/empty';
|
|
7
7
|
import fixtureFiltered from './fixtures/filtered';
|
|
8
|
+
import fixtureLoading from './fixtures/loading';
|
|
8
9
|
import fixtureSortedSelected from './fixtures/sorted-selected';
|
|
9
10
|
import fixtureUnsortedSelected from './fixtures/unsorted-selected';
|
|
10
11
|
test('Organism › OrganismSearchAndChipsResults > should have valid propTypes', t => {
|
|
@@ -16,6 +17,7 @@ test('Organism › OrganismSearchAndChipsResults > should have valid propTypes',
|
|
|
16
17
|
test('Organism › OrganismSearchAndChipsResults › Default › should be rendered', renderComponentMacro, OrganismSearchAndChipsResults, fixtureDefault);
|
|
17
18
|
test('Organism › OrganismSearchAndChipsResults › Empty › should be rendered', renderComponentMacro, OrganismSearchAndChipsResults, fixtureEmpty);
|
|
18
19
|
test('Organism › OrganismSearchAndChipsResults › Filtered › should be rendered', renderComponentMacro, OrganismSearchAndChipsResults, fixtureFiltered);
|
|
20
|
+
test('Organism › OrganismSearchAndChipsResults › Loading › should be rendered', renderComponentMacro, OrganismSearchAndChipsResults, fixtureLoading);
|
|
19
21
|
test('Organism › OrganismSearchAndChipsResults › SortedSelected › should be rendered', renderComponentMacro, OrganismSearchAndChipsResults, fixtureSortedSelected);
|
|
20
22
|
test('Organism › OrganismSearchAndChipsResults › UnsortedSelected › should be rendered', renderComponentMacro, OrganismSearchAndChipsResults, fixtureUnsortedSelected);
|
|
21
23
|
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/organism/search-and-chips-results/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","OrganismSearchAndChipsResults","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,6BAAP,MAA0C,IAA1C;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;
|
|
1
|
+
{"version":3,"sources":["../../../../src/organism/search-and-chips-results/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","OrganismSearchAndChipsResults","fixtureDefault","fixtureEmpty","fixtureFiltered","fixtureLoading","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,6BAAP,MAA0C,IAA1C;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AAEAT,IAAI,CAAC,wEAAD,EAA2EU,CAAC,IAAI;AAClFA,EAAAA,CAAC,CAACC,IAAF;AACAV,EAAAA,OAAO,CAACE,6BAA6B,CAACS,SAA/B,EAA0C,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC/DJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,kEAAiEF,GAAI,mEAA9F;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAd,IAAI,CAAC,yEAAD,EAA4EE,oBAA5E,EAAkGC,6BAAlG,EAAiIC,cAAjI,CAAJ;AACAJ,IAAI,CAAC,uEAAD,EAA0EE,oBAA1E,EAAgGC,6BAAhG,EAA+HE,YAA/H,CAAJ;AACAL,IAAI,CAAC,0EAAD,EAA6EE,oBAA7E,EAAmGC,6BAAnG,EAAkIG,eAAlI,CAAJ;AACAN,IAAI,CAAC,yEAAD,EAA4EE,oBAA5E,EAAkGC,6BAAlG,EAAiII,cAAjI,CAAJ;AACAP,IAAI,CAAC,gFAAD,EAAmFE,oBAAnF,EAAyGC,6BAAzG,EAAwIK,qBAAxI,CAAJ;AACAR,IAAI,CAAC,kFAAD,EAAqFE,oBAArF,EAA2GC,6BAA3G,EAA0IM,uBAA1I,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport OrganismSearchAndChipsResults from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureEmpty from './fixtures/empty';\nimport fixtureFiltered from './fixtures/filtered';\nimport fixtureLoading from './fixtures/loading';\nimport fixtureSortedSelected from './fixtures/sorted-selected';\nimport fixtureUnsortedSelected from './fixtures/unsorted-selected';\n\ntest('Organism › OrganismSearchAndChipsResults > should have valid propTypes', t => {\n t.pass();\n forEach(OrganismSearchAndChipsResults.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Organism.OrganismSearchAndChipsResults.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Organism › OrganismSearchAndChipsResults › Default › should be rendered', renderComponentMacro, OrganismSearchAndChipsResults, fixtureDefault);\ntest('Organism › OrganismSearchAndChipsResults › Empty › should be rendered', renderComponentMacro, OrganismSearchAndChipsResults, fixtureEmpty);\ntest('Organism › OrganismSearchAndChipsResults › Filtered › should be rendered', renderComponentMacro, OrganismSearchAndChipsResults, fixtureFiltered);\ntest('Organism › OrganismSearchAndChipsResults › Loading › should be rendered', renderComponentMacro, OrganismSearchAndChipsResults, fixtureLoading);\ntest('Organism › OrganismSearchAndChipsResults › SortedSelected › should be rendered', renderComponentMacro, OrganismSearchAndChipsResults, fixtureSortedSelected);\ntest('Organism › OrganismSearchAndChipsResults › UnsortedSelected › should be rendered', renderComponentMacro, OrganismSearchAndChipsResults, fixtureUnsortedSelected);\n"],"file":"fixtures.js"}
|
|
@@ -2,7 +2,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
2
2
|
|
|
3
3
|
/* eslint-disable no-console */
|
|
4
4
|
import wizardSummaryOrganizeCourses from '../../../../molecule/wizard-summary/test/fixtures/organize-courses';
|
|
5
|
-
import organizeCoursesForm from '../../../../molecule/course-sections/test/fixtures/
|
|
5
|
+
import organizeCoursesForm from '../../../../molecule/course-sections/test/fixtures/with-mandatory-courses-input';
|
|
6
6
|
export default {
|
|
7
7
|
props: {
|
|
8
8
|
isLoading: false,
|