@coorpacademy/components 11.42.0 → 11.42.3
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/index.d.ts +1 -0
- package/es/atom/checkbox-with-title/index.d.ts.map +1 -1
- package/es/atom/checkbox-with-title/index.js +6 -3
- package/es/atom/checkbox-with-title/index.js.map +1 -1
- package/es/atom/radio-group/index.d.ts +13 -7
- package/es/atom/radio-group/index.d.ts.map +1 -1
- package/es/atom/radio-group/index.js +51 -0
- package/es/atom/radio-group/index.js.map +1 -1
- package/es/atom/radio-group/style.css +37 -0
- package/es/atom/radio-with-title/index.d.ts +3 -0
- package/es/atom/radio-with-title/index.d.ts.map +1 -1
- package/es/atom/radio-with-title/index.js +23 -5
- package/es/atom/radio-with-title/index.js.map +1 -1
- package/es/atom/radio-with-title/style.css +27 -0
- package/es/atom/radio-with-title/types.d.ts +6 -0
- package/es/atom/radio-with-title/types.d.ts.map +1 -1
- package/es/atom/radio-with-title/types.js +3 -0
- package/es/atom/radio-with-title/types.js.map +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/index.js.map +1 -1
- package/es/molecule/cm-popin/index.d.ts.map +1 -1
- package/es/molecule/cm-popin/index.js +20 -3
- package/es/molecule/cm-popin/index.js.map +1 -1
- package/es/molecule/cm-popin/style.css +17 -0
- package/es/molecule/cm-popin/types.d.ts +36 -0
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/cm-popin/types.js +3 -0
- package/es/molecule/cm-popin/types.js.map +1 -1
- package/es/molecule/draggable-list/index.d.ts +12 -0
- package/es/molecule/progress-bar/index.d.ts +16 -7
- package/es/molecule/progress-bar/index.d.ts.map +1 -1
- package/es/molecule/progress-bar/index.js +61 -4
- package/es/molecule/progress-bar/index.js.map +1 -1
- package/es/molecule/progress-bar/style.css +56 -0
- package/es/molecule/setup-section/index.d.ts +6 -0
- package/es/molecule/setup-sections/index.d.ts +6 -0
- package/es/molecule/table/index.d.ts +8 -0
- package/es/molecule/table/index.d.ts.map +1 -1
- package/es/molecule/table/index.js +43 -5
- package/es/molecule/table/index.js.map +1 -1
- package/es/molecule/table/style.css +24 -0
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +1 -0
- package/es/molecule/title-radio-wrapper/index.d.ts +3 -0
- package/es/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/es/molecule/title-radio-wrapper/types.d.ts +3 -0
- package/es/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/es/molecule/wizard-summary/index.d.ts +3 -0
- package/es/molecule/wizard-summary/index.d.ts.map +1 -1
- package/es/molecule/wizard-summary/index.js +35 -3
- package/es/molecule/wizard-summary/index.js.map +1 -1
- package/es/molecule/wizard-summary/style.css +54 -1
- package/es/organism/assignment-audience/index.d.ts +23 -11
- package/es/organism/assignment-audience/index.d.ts.map +1 -1
- package/es/organism/assignment-audience/index.js +100 -59
- package/es/organism/assignment-audience/index.js.map +1 -1
- package/es/organism/assignment-audience/types.d.ts +39 -15
- package/es/organism/assignment-audience/types.d.ts.map +1 -1
- package/es/organism/assignment-audience/types.js +17 -5
- package/es/organism/assignment-audience/types.js.map +1 -1
- package/es/organism/brand-learning-priorities/index.d.ts +12 -0
- package/es/organism/brand-table/index.d.ts +8 -0
- package/es/organism/content-selection-list/index.d.ts +95 -0
- package/es/organism/content-selection-list/index.d.ts.map +1 -0
- package/es/organism/content-selection-list/index.js +175 -0
- package/es/organism/content-selection-list/index.js.map +1 -0
- package/es/organism/content-selection-list/style.css +8 -0
- package/es/organism/content-selection-list/types.d.ts +113 -0
- package/es/organism/content-selection-list/types.d.ts.map +1 -0
- package/es/organism/content-selection-list/types.js +58 -0
- package/es/organism/content-selection-list/types.js.map +1 -0
- package/es/organism/content-skill-modal/index.d.ts +7 -0
- package/es/organism/content-skill-modal/index.d.ts.map +1 -1
- package/es/organism/content-skill-modal/types.d.ts +7 -0
- package/es/organism/content-skill-modal/types.d.ts.map +1 -1
- package/es/organism/header-with-actions/index.d.ts +13 -4
- package/es/organism/header-with-actions/index.d.ts.map +1 -1
- package/es/organism/header-with-actions/index.js +31 -6
- package/es/organism/header-with-actions/index.js.map +1 -1
- package/es/organism/header-with-actions/style.css +42 -0
- package/es/organism/header-with-actions/types.d.ts +24 -6
- package/es/organism/header-with-actions/types.d.ts.map +1 -1
- package/es/organism/header-with-actions/types.js +7 -2
- package/es/organism/header-with-actions/types.js.map +1 -1
- package/es/organism/list-item/index.d.ts +9 -1
- package/es/organism/list-item/index.d.ts.map +1 -1
- package/es/organism/list-item/index.js +16 -3
- package/es/organism/list-item/index.js.map +1 -1
- package/es/organism/list-item/style.css +15 -0
- package/es/organism/list-items/index.d.ts +7 -0
- package/es/organism/rewards-form/index.d.ts +1 -0
- package/es/organism/select-opponents/index.d.ts +1 -0
- package/es/organism/select-opponents/index.d.ts.map +1 -1
- package/es/organism/select-opponents/types.d.ts +1 -0
- package/es/organism/select-opponents/types.d.ts.map +1 -1
- package/es/organism/skill-edition/index.d.ts +8 -3
- package/es/organism/skill-edition/index.d.ts.map +1 -1
- package/es/organism/skill-edition/index.js +3 -168
- package/es/organism/skill-edition/index.js.map +1 -1
- package/es/organism/skill-edition/styles.d.ts +10 -0
- package/es/organism/skill-edition/styles.d.ts.map +1 -0
- package/es/organism/skill-edition/styles.js +10 -0
- package/es/organism/skill-edition/styles.js.map +1 -0
- package/es/organism/skill-edition/types.d.ts +10 -54
- package/es/organism/skill-edition/types.d.ts.map +1 -1
- package/es/organism/skill-edition/types.js +3 -52
- package/es/organism/skill-edition/types.js.map +1 -1
- package/es/organism/title-and-input/index.d.ts +1 -0
- package/es/organism/title-and-input/index.d.ts.map +1 -1
- package/es/organism/title-and-input/types.d.ts +1 -0
- package/es/organism/title-and-input/types.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +4 -0
- package/es/template/app-player/loading/index.d.ts +33 -0
- package/es/template/app-player/player/index.d.ts +66 -0
- package/es/template/app-player/player/slides/index.d.ts +33 -0
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +33 -0
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +33 -0
- package/es/template/app-review/index.d.ts +33 -0
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +33 -0
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +33 -0
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +120 -7
- package/es/template/back-office/brand-update/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.js +19 -4
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/back-office/brand-update/style.css +18 -0
- package/es/template/certification-detail/index.d.ts +33 -0
- package/es/template/common/dashboard/index.d.ts +66 -0
- package/es/template/common/search-page/index.d.ts +33 -0
- package/es/template/external-course/index.d.ts +33 -0
- package/es/template/playlist-detail/index.d.ts +33 -0
- package/lib/atom/checkbox-with-title/index.d.ts +1 -0
- package/lib/atom/checkbox-with-title/index.d.ts.map +1 -1
- package/lib/atom/checkbox-with-title/index.js +6 -3
- package/lib/atom/checkbox-with-title/index.js.map +1 -1
- package/lib/atom/radio-group/index.d.ts +13 -7
- package/lib/atom/radio-group/index.d.ts.map +1 -1
- package/lib/atom/radio-group/index.js +51 -0
- package/lib/atom/radio-group/index.js.map +1 -1
- package/lib/atom/radio-group/style.css +37 -0
- package/lib/atom/radio-with-title/index.d.ts +3 -0
- package/lib/atom/radio-with-title/index.d.ts.map +1 -1
- package/lib/atom/radio-with-title/index.js +23 -5
- package/lib/atom/radio-with-title/index.js.map +1 -1
- package/lib/atom/radio-with-title/style.css +27 -0
- package/lib/atom/radio-with-title/types.d.ts +6 -0
- package/lib/atom/radio-with-title/types.d.ts.map +1 -1
- package/lib/atom/radio-with-title/types.js +3 -0
- package/lib/atom/radio-with-title/types.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib/molecule/cm-popin/index.d.ts.map +1 -1
- package/lib/molecule/cm-popin/index.js +20 -3
- package/lib/molecule/cm-popin/index.js.map +1 -1
- package/lib/molecule/cm-popin/style.css +17 -0
- package/lib/molecule/cm-popin/types.d.ts +36 -0
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/cm-popin/types.js +3 -0
- package/lib/molecule/cm-popin/types.js.map +1 -1
- package/lib/molecule/draggable-list/index.d.ts +12 -0
- package/lib/molecule/progress-bar/index.d.ts +16 -7
- package/lib/molecule/progress-bar/index.d.ts.map +1 -1
- package/lib/molecule/progress-bar/index.js +61 -4
- package/lib/molecule/progress-bar/index.js.map +1 -1
- package/lib/molecule/progress-bar/style.css +56 -0
- package/lib/molecule/setup-section/index.d.ts +6 -0
- package/lib/molecule/setup-sections/index.d.ts +6 -0
- package/lib/molecule/table/index.d.ts +8 -0
- package/lib/molecule/table/index.d.ts.map +1 -1
- package/lib/molecule/table/index.js +43 -5
- package/lib/molecule/table/index.js.map +1 -1
- package/lib/molecule/table/style.css +24 -0
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +1 -0
- package/lib/molecule/title-radio-wrapper/index.d.ts +3 -0
- package/lib/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/lib/molecule/title-radio-wrapper/types.d.ts +3 -0
- package/lib/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/lib/molecule/wizard-summary/index.d.ts +3 -0
- package/lib/molecule/wizard-summary/index.d.ts.map +1 -1
- package/lib/molecule/wizard-summary/index.js +35 -3
- package/lib/molecule/wizard-summary/index.js.map +1 -1
- package/lib/molecule/wizard-summary/style.css +54 -1
- package/lib/organism/assignment-audience/index.d.ts +23 -11
- package/lib/organism/assignment-audience/index.d.ts.map +1 -1
- package/lib/organism/assignment-audience/index.js +100 -59
- package/lib/organism/assignment-audience/index.js.map +1 -1
- package/lib/organism/assignment-audience/types.d.ts +39 -15
- package/lib/organism/assignment-audience/types.d.ts.map +1 -1
- package/lib/organism/assignment-audience/types.js +17 -5
- package/lib/organism/assignment-audience/types.js.map +1 -1
- package/lib/organism/brand-learning-priorities/index.d.ts +12 -0
- package/lib/organism/brand-table/index.d.ts +8 -0
- package/lib/organism/content-selection-list/index.d.ts +95 -0
- package/lib/organism/content-selection-list/index.d.ts.map +1 -0
- package/lib/organism/content-selection-list/index.js +181 -0
- package/lib/organism/content-selection-list/index.js.map +1 -0
- package/lib/organism/content-selection-list/style.css +8 -0
- package/lib/organism/content-selection-list/types.d.ts +113 -0
- package/lib/organism/content-selection-list/types.d.ts.map +1 -0
- package/lib/organism/content-selection-list/types.js +63 -0
- package/lib/organism/content-selection-list/types.js.map +1 -0
- package/lib/organism/content-skill-modal/index.d.ts +7 -0
- package/lib/organism/content-skill-modal/index.d.ts.map +1 -1
- package/lib/organism/content-skill-modal/types.d.ts +7 -0
- package/lib/organism/content-skill-modal/types.d.ts.map +1 -1
- package/lib/organism/header-with-actions/index.d.ts +13 -4
- package/lib/organism/header-with-actions/index.d.ts.map +1 -1
- package/lib/organism/header-with-actions/index.js +31 -6
- package/lib/organism/header-with-actions/index.js.map +1 -1
- package/lib/organism/header-with-actions/style.css +42 -0
- package/lib/organism/header-with-actions/types.d.ts +24 -6
- package/lib/organism/header-with-actions/types.d.ts.map +1 -1
- package/lib/organism/header-with-actions/types.js +7 -2
- package/lib/organism/header-with-actions/types.js.map +1 -1
- package/lib/organism/list-item/index.d.ts +9 -1
- package/lib/organism/list-item/index.d.ts.map +1 -1
- package/lib/organism/list-item/index.js +16 -3
- package/lib/organism/list-item/index.js.map +1 -1
- package/lib/organism/list-item/style.css +15 -0
- package/lib/organism/list-items/index.d.ts +7 -0
- package/lib/organism/rewards-form/index.d.ts +1 -0
- package/lib/organism/select-opponents/index.d.ts +1 -0
- package/lib/organism/select-opponents/index.d.ts.map +1 -1
- package/lib/organism/select-opponents/types.d.ts +1 -0
- package/lib/organism/select-opponents/types.d.ts.map +1 -1
- package/lib/organism/skill-edition/index.d.ts +8 -3
- package/lib/organism/skill-edition/index.d.ts.map +1 -1
- package/lib/organism/skill-edition/index.js +11 -174
- package/lib/organism/skill-edition/index.js.map +1 -1
- package/lib/organism/skill-edition/styles.d.ts +10 -0
- package/lib/organism/skill-edition/styles.d.ts.map +1 -0
- package/lib/organism/skill-edition/styles.js +15 -0
- package/lib/organism/skill-edition/styles.js.map +1 -0
- package/lib/organism/skill-edition/types.d.ts +10 -54
- package/lib/organism/skill-edition/types.d.ts.map +1 -1
- package/lib/organism/skill-edition/types.js +6 -53
- package/lib/organism/skill-edition/types.js.map +1 -1
- package/lib/organism/title-and-input/index.d.ts +1 -0
- package/lib/organism/title-and-input/index.d.ts.map +1 -1
- package/lib/organism/title-and-input/types.d.ts +1 -0
- package/lib/organism/title-and-input/types.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +4 -0
- package/lib/template/app-player/loading/index.d.ts +33 -0
- package/lib/template/app-player/player/index.d.ts +66 -0
- package/lib/template/app-player/player/slides/index.d.ts +33 -0
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +33 -0
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +33 -0
- package/lib/template/app-review/index.d.ts +33 -0
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +33 -0
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +33 -0
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +120 -7
- package/lib/template/back-office/brand-update/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.js +19 -4
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/back-office/brand-update/style.css +18 -0
- package/lib/template/certification-detail/index.d.ts +33 -0
- package/lib/template/common/dashboard/index.d.ts +66 -0
- package/lib/template/common/search-page/index.d.ts +33 -0
- package/lib/template/external-course/index.d.ts +33 -0
- package/lib/template/playlist-detail/index.d.ts +33 -0
- package/locales/bs/global.json +2 -2
- package/locales/cs/global.json +2 -2
- package/locales/de/global.json +2 -2
- package/locales/es/global.json +2 -2
- package/locales/et/global.json +2 -2
- package/locales/fi/global.json +2 -2
- package/locales/fr/global.json +2 -2
- package/locales/hr/global.json +2 -2
- package/locales/hu/global.json +2 -2
- package/locales/hy/global.json +2 -2
- package/locales/it/global.json +2 -2
- package/locales/ja/global.json +2 -2
- package/locales/ko/global.json +2 -2
- package/locales/lt/global.json +2 -2
- package/locales/nl/global.json +2 -2
- package/locales/pl/global.json +2 -2
- package/locales/pt/global.json +2 -2
- package/locales/ro/global.json +2 -2
- package/locales/ru/global.json +2 -2
- package/locales/sk/global.json +2 -2
- package/locales/sl/global.json +2 -2
- package/locales/sv/global.json +2 -2
- package/locales/tl/global.json +2 -2
- package/locales/tr/global.json +2 -2
- package/locales/uk/global.json +2 -2
- package/locales/vi/global.json +2 -2
- package/locales/zh/global.json +2 -2
- package/locales/zh_TW/global.json +2 -2
- package/package.json +2 -2
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
1
2
|
import React, { useCallback, useMemo } from 'react';
|
|
2
3
|
import uniqueId from 'lodash/fp/uniqueId';
|
|
3
4
|
import InputSwitch from '../../atom/input-switch';
|
|
4
5
|
import SelectMultiple from '../../molecule/select-multiple';
|
|
6
|
+
import Banner from '../../molecule/banner';
|
|
5
7
|
import InputFileDraggable from '../../atom/input-file-draggable';
|
|
6
8
|
import Autocomplete from '../../atom/autocomplete';
|
|
7
9
|
import Title from '../../atom/title';
|
|
@@ -59,60 +61,62 @@ const AssignmentAudience = ({
|
|
|
59
61
|
subtitle,
|
|
60
62
|
disabledExplanation,
|
|
61
63
|
everyone,
|
|
64
|
+
team,
|
|
65
|
+
invalidTargets,
|
|
66
|
+
invalidLabel,
|
|
67
|
+
error,
|
|
68
|
+
disabled = false,
|
|
62
69
|
populations,
|
|
63
70
|
upload,
|
|
64
71
|
individuals,
|
|
65
72
|
total
|
|
66
73
|
}) => {
|
|
67
|
-
const
|
|
68
|
-
const loading = upload
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
selected = [],
|
|
84
|
-
onSearch,
|
|
85
|
-
onAdd,
|
|
86
|
-
onRemove
|
|
87
|
-
} = individuals;
|
|
74
|
+
const sourcesDisabled = disabled || Boolean(everyone?.value);
|
|
75
|
+
const loading = upload?.status === 'loading';
|
|
76
|
+
const onEveryoneChange = everyone?.onChange;
|
|
77
|
+
const handleEveryoneChange = useCallback(nextValue => {
|
|
78
|
+
if (!disabled) onEveryoneChange?.(nextValue);
|
|
79
|
+
}, [disabled, onEveryoneChange]);
|
|
80
|
+
const populationOptions = populations?.options;
|
|
81
|
+
const onPopulationsChange = populations?.onChange;
|
|
82
|
+
const onUpload = upload?.onUpload;
|
|
83
|
+
const onRemoveFile = upload?.onRemove;
|
|
84
|
+
const value = individuals?.value || '';
|
|
85
|
+
const suggestions = individuals?.suggestions;
|
|
86
|
+
const selected = individuals?.selected;
|
|
87
|
+
const onSearch = individuals?.onSearch;
|
|
88
|
+
const onAdd = individuals?.onAdd;
|
|
89
|
+
const onRemove = individuals?.onRemove;
|
|
88
90
|
const explanationId = useMemo(() => uniqueId('assignment-audience-explanation-'), []);
|
|
89
|
-
const handlePopulations = useCallback(choices => onPopulationsChange(populationOptions.filter(option => choices.some(choice => choice.value === option.value)).map(option => ({
|
|
91
|
+
const handlePopulations = useCallback(choices => !sourcesDisabled && onPopulationsChange?.((populationOptions || []).filter(option => choices.some(choice => choice.value === option.value)).map(option => ({
|
|
90
92
|
...option,
|
|
91
93
|
selected: true
|
|
92
|
-
}))), [populationOptions, onPopulationsChange]);
|
|
93
|
-
const selectedPopulations = useMemo(() => populationOptions.filter(option => option.selected), [populationOptions]);
|
|
94
|
-
const handleRemovePopulation = useCallback(populationValue => () => onPopulationsChange(selectedPopulations.filter(option => option.value !== populationValue)), [selectedPopulations, onPopulationsChange]);
|
|
94
|
+
}))), [sourcesDisabled, populationOptions, onPopulationsChange]);
|
|
95
|
+
const selectedPopulations = useMemo(() => (populationOptions || []).filter(option => option.selected), [populationOptions]);
|
|
96
|
+
const handleRemovePopulation = useCallback(populationValue => () => !sourcesDisabled && onPopulationsChange?.(selectedPopulations.filter(option => option.value !== populationValue)), [sourcesDisabled, selectedPopulations, onPopulationsChange]);
|
|
95
97
|
|
|
96
98
|
// The native input receives both a browse and a drop, and fires change for each.
|
|
97
99
|
const handleFileChange = useCallback(event => {
|
|
98
100
|
const file = event.target.files && event.target.files[0];
|
|
99
|
-
if (
|
|
100
|
-
onUpload(file);
|
|
101
|
-
}, [
|
|
101
|
+
if (sourcesDisabled || loading || !file) return;
|
|
102
|
+
onUpload?.(file);
|
|
103
|
+
}, [sourcesDisabled, loading, onUpload]);
|
|
102
104
|
|
|
103
105
|
// The loader's cross cancels the check: the file is dropped, as with Remove.
|
|
104
106
|
const handleCancelCheck = useCallback(() => {
|
|
105
|
-
if (
|
|
106
|
-
}, [onRemoveFile]);
|
|
107
|
-
const availableSuggestions = useMemo(() => suggestions.filter(suggestion => !selected
|
|
108
|
-
const handleSearch = useCallback(event => onSearch(event.target.value), [onSearch]);
|
|
107
|
+
if (!sourcesDisabled) onRemoveFile?.();
|
|
108
|
+
}, [sourcesDisabled, onRemoveFile]);
|
|
109
|
+
const availableSuggestions = useMemo(() => sourcesDisabled ? [] : (suggestions || []).filter(suggestion => !selected?.some(learner => learner.id === suggestion.id)), [sourcesDisabled, suggestions, selected]);
|
|
110
|
+
const handleSearch = useCallback(event => !sourcesDisabled && onSearch?.(event.target.value), [sourcesDisabled, onSearch]);
|
|
109
111
|
const handleAdd = useCallback(({
|
|
110
112
|
suggestion
|
|
111
113
|
}) => {
|
|
112
114
|
const learner = availableSuggestions.find(item => item.id === suggestion.value);
|
|
113
|
-
if (learner) onAdd(learner);
|
|
114
|
-
}, [availableSuggestions, onAdd]);
|
|
115
|
-
const handleRemove = useCallback(id => () =>
|
|
115
|
+
if (!sourcesDisabled && learner) onAdd?.(learner);
|
|
116
|
+
}, [sourcesDisabled, availableSuggestions, onAdd]);
|
|
117
|
+
const handleRemove = useCallback(id => () => {
|
|
118
|
+
if (!sourcesDisabled) onRemove?.(id);
|
|
119
|
+
}, [sourcesDisabled, onRemove]);
|
|
116
120
|
return /*#__PURE__*/React.createElement("section", {
|
|
117
121
|
className: style.container,
|
|
118
122
|
"data-name": "assignment-audience",
|
|
@@ -123,25 +127,54 @@ const AssignmentAudience = ({
|
|
|
123
127
|
title: title,
|
|
124
128
|
subtitle: subtitle,
|
|
125
129
|
headingLevel: 2
|
|
126
|
-
}), /*#__PURE__*/React.createElement(
|
|
130
|
+
}), error ? /*#__PURE__*/React.createElement("div", {
|
|
131
|
+
role: "alert"
|
|
132
|
+
}, /*#__PURE__*/React.createElement(Banner, {
|
|
133
|
+
type: "error",
|
|
134
|
+
message: error
|
|
135
|
+
})) : null, team ? /*#__PURE__*/React.createElement(Block, {
|
|
136
|
+
name: "team"
|
|
137
|
+
}, /*#__PURE__*/React.createElement(Chip, {
|
|
138
|
+
text: team.label,
|
|
139
|
+
subText: team.name,
|
|
140
|
+
customIcon: "none"
|
|
141
|
+
})) : null, invalidTargets?.length ? /*#__PURE__*/React.createElement("fieldset", {
|
|
142
|
+
disabled: disabled,
|
|
143
|
+
className: style.sources,
|
|
144
|
+
"data-name": "invalid-targets"
|
|
145
|
+
}, invalidTargets.map(target => /*#__PURE__*/React.createElement("div", {
|
|
146
|
+
key: target.ref,
|
|
147
|
+
"data-target-ref": target.ref
|
|
148
|
+
}, /*#__PURE__*/React.createElement(Banner, {
|
|
149
|
+
type: "error",
|
|
150
|
+
message: invalidLabel ? `${target.label}: ${invalidLabel}` : target.label,
|
|
151
|
+
cta: [{
|
|
152
|
+
type: 'button',
|
|
153
|
+
label: 'Remove',
|
|
154
|
+
action: () => {
|
|
155
|
+
if (!disabled) target.onRemove();
|
|
156
|
+
}
|
|
157
|
+
}]
|
|
158
|
+
})))) : null, everyone ? /*#__PURE__*/React.createElement(Block, {
|
|
127
159
|
name: "everyone",
|
|
128
160
|
title: everyone.title
|
|
129
161
|
}, /*#__PURE__*/React.createElement(InputSwitch, {
|
|
130
162
|
title: everyone.label,
|
|
131
163
|
value: everyone.value,
|
|
132
|
-
|
|
164
|
+
disabled: disabled,
|
|
165
|
+
onChange: handleEveryoneChange,
|
|
133
166
|
theme: "coorpmanager",
|
|
134
167
|
"data-name": "assignment-everyone",
|
|
135
168
|
"aria-label": everyone.label
|
|
136
|
-
}),
|
|
169
|
+
}), everyone.value ? /*#__PURE__*/React.createElement("p", {
|
|
137
170
|
id: explanationId,
|
|
138
171
|
className: style.explanation
|
|
139
|
-
}, disabledExplanation) : null), /*#__PURE__*/React.createElement("fieldset", {
|
|
140
|
-
disabled:
|
|
141
|
-
"aria-describedby":
|
|
172
|
+
}, disabledExplanation) : null) : null, /*#__PURE__*/React.createElement("fieldset", {
|
|
173
|
+
disabled: sourcesDisabled,
|
|
174
|
+
"aria-describedby": everyone?.value && disabledExplanation ? explanationId : undefined,
|
|
142
175
|
className: style.sources,
|
|
143
176
|
"data-name": "audience-sources"
|
|
144
|
-
}, /*#__PURE__*/React.createElement(Block, {
|
|
177
|
+
}, populations ? /*#__PURE__*/React.createElement(Block, {
|
|
145
178
|
name: "populations",
|
|
146
179
|
title: populations.title,
|
|
147
180
|
subtitle: populations.subtitle
|
|
@@ -150,7 +183,7 @@ const AssignmentAudience = ({
|
|
|
150
183
|
options: populations.options,
|
|
151
184
|
multiple: true,
|
|
152
185
|
theme: "coorpmanager",
|
|
153
|
-
disabled:
|
|
186
|
+
disabled: sourcesDisabled,
|
|
154
187
|
onChange: handlePopulations
|
|
155
188
|
}), selectedPopulations.length > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
156
189
|
className: style.chips,
|
|
@@ -160,21 +193,21 @@ const AssignmentAudience = ({
|
|
|
160
193
|
text: option.name,
|
|
161
194
|
subText: option.count === undefined ? undefined : `${option.count}`,
|
|
162
195
|
selected: true,
|
|
163
|
-
customIcon:
|
|
164
|
-
ariaLabel:
|
|
165
|
-
onClick:
|
|
166
|
-
}))) : null), /*#__PURE__*/React.createElement(Block, {
|
|
196
|
+
customIcon: sourcesDisabled ? 'none' : 'times',
|
|
197
|
+
ariaLabel: sourcesDisabled ? undefined : chipLabel(populations.removeLabel, option.name),
|
|
198
|
+
onClick: sourcesDisabled ? undefined : handleRemovePopulation(option.value)
|
|
199
|
+
}))) : null) : null, upload ? /*#__PURE__*/React.createElement(Block, {
|
|
167
200
|
name: "upload",
|
|
168
201
|
title: upload.title,
|
|
169
202
|
subtitle: upload.subtitle,
|
|
170
203
|
button: upload.templateLink ? {
|
|
171
204
|
type: 'text',
|
|
172
205
|
label: upload.templateLink.label,
|
|
173
|
-
link:
|
|
206
|
+
link: sourcesDisabled ? undefined : {
|
|
174
207
|
href: upload.templateLink.href,
|
|
175
208
|
download: true
|
|
176
209
|
},
|
|
177
|
-
disabled,
|
|
210
|
+
disabled: sourcesDisabled,
|
|
178
211
|
'data-name': 'upload-template-link',
|
|
179
212
|
customStyle: FIT_CONTENT
|
|
180
213
|
} : undefined
|
|
@@ -185,7 +218,15 @@ const AssignmentAudience = ({
|
|
|
185
218
|
"aria-busy": loading,
|
|
186
219
|
"aria-live": "polite",
|
|
187
220
|
"data-name": "upload-dropzone"
|
|
188
|
-
}, upload.status === 'done' ? /*#__PURE__*/React.createElement(UploadResult,
|
|
221
|
+
}, upload.status === 'done' ? /*#__PURE__*/React.createElement(UploadResult, _extends({}, upload, {
|
|
222
|
+
onRemove: upload.onRemove ? handleCancelCheck : undefined,
|
|
223
|
+
report: upload.report ? {
|
|
224
|
+
...upload.report,
|
|
225
|
+
onDownload: () => {
|
|
226
|
+
if (!sourcesDisabled) upload.report?.onDownload();
|
|
227
|
+
}
|
|
228
|
+
} : undefined
|
|
229
|
+
})) : /*#__PURE__*/React.createElement(InputFileDraggable, {
|
|
189
230
|
name: "assignment-audience-file",
|
|
190
231
|
filesTypes: ACCEPTED_FILES,
|
|
191
232
|
description: upload.dropzone?.description,
|
|
@@ -194,11 +235,11 @@ const AssignmentAudience = ({
|
|
|
194
235
|
dragAndDropLabel: upload.dropzone?.dropLabel,
|
|
195
236
|
loadingLabel: upload.dropzone?.loadingLabel,
|
|
196
237
|
loading: loading,
|
|
197
|
-
disabled:
|
|
238
|
+
disabled: sourcesDisabled,
|
|
198
239
|
error: upload.status === 'error' ? upload.error : '',
|
|
199
240
|
onChange: handleFileChange,
|
|
200
241
|
onReset: handleCancelCheck
|
|
201
|
-
})))), /*#__PURE__*/React.createElement(Block, {
|
|
242
|
+
})))) : null, individuals ? /*#__PURE__*/React.createElement(Block, {
|
|
202
243
|
name: "individuals",
|
|
203
244
|
title: individuals.title
|
|
204
245
|
}, /*#__PURE__*/React.createElement(Autocomplete, {
|
|
@@ -211,17 +252,17 @@ const AssignmentAudience = ({
|
|
|
211
252
|
})),
|
|
212
253
|
onInput: handleSearch,
|
|
213
254
|
onSuggestionSelected: handleAdd
|
|
214
|
-
}), selected
|
|
255
|
+
}), (selected?.length || 0) > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
215
256
|
className: style.chips
|
|
216
|
-
}, selected
|
|
257
|
+
}, selected?.map(learner => /*#__PURE__*/React.createElement(Chip, {
|
|
217
258
|
key: learner.id,
|
|
218
259
|
text: learner.label,
|
|
219
260
|
subText: learner.login,
|
|
220
261
|
selected: true,
|
|
221
|
-
customIcon:
|
|
222
|
-
ariaLabel:
|
|
223
|
-
onClick:
|
|
224
|
-
}))) : null)), /*#__PURE__*/React.createElement("div", {
|
|
262
|
+
customIcon: sourcesDisabled ? 'none' : 'times',
|
|
263
|
+
ariaLabel: sourcesDisabled ? undefined : chipLabel(individuals.removeLabel, learner.label),
|
|
264
|
+
onClick: sourcesDisabled ? undefined : handleRemove(learner.id)
|
|
265
|
+
}))) : null) : null), total ? /*#__PURE__*/React.createElement("div", {
|
|
225
266
|
className: style.total,
|
|
226
267
|
"data-name": "estimated-audience",
|
|
227
268
|
"aria-live": "polite"
|
|
@@ -229,7 +270,7 @@ const AssignmentAudience = ({
|
|
|
229
270
|
className: style.totalLabel
|
|
230
271
|
}, total.label), total.detail ? /*#__PURE__*/React.createElement("span", {
|
|
231
272
|
className: style.muted
|
|
232
|
-
}, total.detail) : null));
|
|
273
|
+
}, total.detail) : null) : null);
|
|
233
274
|
};
|
|
234
275
|
AssignmentAudience.propTypes = process.env.NODE_ENV !== "production" ? AssignmentAudiencePropTypes : {};
|
|
235
276
|
export default AssignmentAudience;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","uniqueId","InputSwitch","SelectMultiple","InputFileDraggable","Autocomplete","Title","Chip","UploadResult","AssignmentAudiencePropTypes","style","FIT_CONTENT","width","ACCEPTED_FILES","join","Block","name","title","subtitle","button","children","createElement","className","block","blockHead","type","titleSize","headingLevel","TemplatePreview","header","rows","templatePreview","templateHeader","templateRows","map","row","key","chipLabel","removeLabel","undefined","AssignmentAudience","disabledExplanation","everyone","populations","upload","individuals","total","disabled","value","loading","status","onChange","onEveryoneChange","options","populationOptions","onPopulationsChange","onUpload","onRemove","onRemoveFile","suggestions","selected","onSearch","onAdd","explanationId","handlePopulations","choices","filter","option","some","choice","selectedPopulations","handleRemovePopulation","populationValue","handleFileChange","event","file","target","files","handleCancelCheck","availableSuggestions","suggestion","learner","id","handleSearch","handleAdd","find","item","handleRemove","container","label","theme","explanation","sources","multiple","length","chips","text","subText","count","customIcon","ariaLabel","onClick","templateLink","link","href","download","customStyle","uploadMain","dropzone","filesTypes","description","uploadLabel","browse","errorButtonLabel","dragAndDropLabel","dropLabel","loadingLabel","error","onReset","placeholder","login","onInput","onSuggestionSelected","totalLabel","detail","muted","propTypes","process","env","NODE_ENV"],"sources":["../../../src/organism/assignment-audience/index.tsx"],"sourcesContent":["import React, {useCallback, useMemo} from 'react';\nimport uniqueId from 'lodash/fp/uniqueId';\nimport InputSwitch from '../../atom/input-switch';\nimport SelectMultiple from '../../molecule/select-multiple';\nimport InputFileDraggable from '../../atom/input-file-draggable';\nimport Autocomplete from '../../atom/autocomplete';\nimport Title from '../../atom/title';\nimport Chip from '../../atom/chip';\nimport UploadResult from './upload-result';\nimport AssignmentAudiencePropTypes, {\n AssignmentAudienceProps,\n Learner,\n PopulationOption\n} from './types';\nimport style from './style.css';\n\n// ButtonLink is full width by default: in the Title row it would squeeze the title column.\nconst FIT_CONTENT = {width: 'fit-content'};\n\n// csv, xls and xlsx, as the types FilesPropType knows\nconst ACCEPTED_FILES = [\n 'text/csv',\n 'application/vnd.ms-excel',\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\n].join(',');\n\ntype BlockProps = {\n name: string;\n title?: string;\n subtitle?: string;\n // The Title's right-hand ButtonLink\n button?: Record<string, unknown>;\n children?: React.ReactNode;\n};\n\nconst Block = ({name, title, subtitle, button, children}: BlockProps) => (\n <section data-name={name} className={style.block}>\n {title ? (\n <div className={style.blockHead}>\n <Title\n type=\"form-group\"\n titleSize=\"medium\"\n title={title}\n subtitle={subtitle}\n button={button}\n headingLevel={3}\n />\n </div>\n ) : null}\n {children}\n </section>\n);\n\n// A sample of the file to upload: its one column, a header and two example logins.\nconst TemplatePreview = ({header, rows = []}: {header: string; rows?: string[]}) => (\n <div className={style.templatePreview} data-name=\"upload-template-preview\">\n <div className={style.templateHeader}>{header}</div>\n <ul className={style.templateRows}>\n {rows.map(row => (\n <li key={row}>{row}</li>\n ))}\n </ul>\n </div>\n);\n\n// A removable chip says what a click does, e.g. « Remove Camille Durand »; no label, its text.\nconst chipLabel = (removeLabel: string | undefined, name: string) =>\n removeLabel ? `${removeLabel} ${name}` : undefined;\n\nconst AssignmentAudience = ({\n title,\n subtitle,\n disabledExplanation,\n everyone,\n populations,\n upload,\n individuals,\n total\n}: AssignmentAudienceProps) => {\n const disabled = everyone.value;\n const loading = upload.status === 'loading';\n const {onChange: onEveryoneChange} = everyone;\n const {options: populationOptions, onChange: onPopulationsChange} = populations;\n const {onUpload, onRemove: onRemoveFile} = upload;\n const {value = '', suggestions = [], selected = [], onSearch, onAdd, onRemove} = individuals;\n const explanationId = useMemo(() => uniqueId('assignment-audience-explanation-'), []);\n const handlePopulations = useCallback(\n (choices: PopulationOption[]) =>\n onPopulationsChange(\n populationOptions\n .filter(option => choices.some(choice => choice.value === option.value))\n .map(option => ({...option, selected: true}))\n ),\n [populationOptions, onPopulationsChange]\n );\n const selectedPopulations = useMemo(\n () => populationOptions.filter(option => option.selected),\n [populationOptions]\n );\n const handleRemovePopulation = useCallback(\n (populationValue: string) => () =>\n onPopulationsChange(selectedPopulations.filter(option => option.value !== populationValue)),\n [selectedPopulations, onPopulationsChange]\n );\n\n // The native input receives both a browse and a drop, and fires change for each.\n const handleFileChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files && event.target.files[0];\n if (disabled || loading || !file) return;\n onUpload(file);\n },\n [disabled, loading, onUpload]\n );\n\n // The loader's cross cancels the check: the file is dropped, as with Remove.\n const handleCancelCheck = useCallback(() => {\n if (onRemoveFile) onRemoveFile();\n }, [onRemoveFile]);\n\n const availableSuggestions = useMemo(\n () => suggestions.filter(suggestion => !selected.some(learner => learner.id === suggestion.id)),\n [suggestions, selected]\n );\n const handleSearch = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => onSearch(event.target.value),\n [onSearch]\n );\n const handleAdd = useCallback(\n ({suggestion}: {suggestion: {value: string}}) => {\n const learner = availableSuggestions.find(item => item.id === suggestion.value);\n if (learner) onAdd(learner);\n },\n [availableSuggestions, onAdd]\n );\n const handleRemove = useCallback((id: string) => () => onRemove(id), [onRemove]);\n\n return (\n <section className={style.container} data-name=\"assignment-audience\" aria-label={title}>\n <Title\n type=\"form-group\"\n titleSize=\"xl-strong\"\n title={title}\n subtitle={subtitle}\n headingLevel={2}\n />\n <Block name=\"everyone\" title={everyone.title}>\n <InputSwitch\n title={everyone.label}\n value={everyone.value}\n onChange={onEveryoneChange}\n theme=\"coorpmanager\"\n data-name=\"assignment-everyone\"\n aria-label={everyone.label}\n />\n {disabled ? (\n <p id={explanationId} className={style.explanation}>\n {disabledExplanation}\n </p>\n ) : null}\n </Block>\n <fieldset\n disabled={disabled}\n aria-describedby={disabled && disabledExplanation ? explanationId : undefined}\n className={style.sources}\n data-name=\"audience-sources\"\n >\n <Block name=\"populations\" title={populations.title} subtitle={populations.subtitle}>\n <SelectMultiple\n title={populations.label}\n options={populations.options}\n multiple\n theme=\"coorpmanager\"\n disabled={disabled}\n onChange={handlePopulations}\n />\n {selectedPopulations.length > 0 ? (\n <div className={style.chips} data-name=\"population-chips\">\n {selectedPopulations.map(option => (\n <Chip\n key={option.value}\n text={option.name}\n subText={option.count === undefined ? undefined : `${option.count}`}\n selected\n customIcon={disabled ? 'none' : 'times'}\n ariaLabel={disabled ? undefined : chipLabel(populations.removeLabel, option.name)}\n onClick={disabled ? undefined : handleRemovePopulation(option.value)}\n />\n ))}\n </div>\n ) : null}\n </Block>\n <Block\n name=\"upload\"\n title={upload.title}\n subtitle={upload.subtitle}\n button={\n upload.templateLink\n ? {\n type: 'text',\n label: upload.templateLink.label,\n link: disabled ? undefined : {href: upload.templateLink.href, download: true},\n disabled,\n 'data-name': 'upload-template-link',\n customStyle: FIT_CONTENT\n }\n : undefined\n }\n >\n <div className={style.upload}>\n {upload.templatePreview ? <TemplatePreview {...upload.templatePreview} /> : null}\n <div\n className={upload.status === 'done' ? style.uploadMain : style.dropzone}\n aria-busy={loading}\n aria-live=\"polite\"\n data-name=\"upload-dropzone\"\n >\n {upload.status === 'done' ? (\n <UploadResult {...upload} />\n ) : (\n <InputFileDraggable\n name=\"assignment-audience-file\"\n filesTypes={ACCEPTED_FILES}\n description={upload.dropzone?.description}\n uploadLabel={upload.dropzone?.browse}\n errorButtonLabel={upload.dropzone?.browse}\n dragAndDropLabel={upload.dropzone?.dropLabel}\n loadingLabel={upload.dropzone?.loadingLabel}\n loading={loading}\n disabled={disabled}\n error={upload.status === 'error' ? upload.error : ''}\n onChange={handleFileChange}\n onReset={handleCancelCheck}\n />\n )}\n </div>\n </div>\n </Block>\n <Block name=\"individuals\" title={individuals.title}>\n <Autocomplete\n title={individuals.placeholder}\n theme=\"coorpmanager\"\n value={value}\n suggestions={availableSuggestions.map(learner => ({\n name: `${learner.label} · ${learner.login}`,\n value: learner.id\n }))}\n onInput={handleSearch}\n onSuggestionSelected={handleAdd}\n />\n {selected.length > 0 ? (\n <div className={style.chips}>\n {selected.map((learner: Learner) => (\n <Chip\n key={learner.id}\n text={learner.label}\n subText={learner.login}\n selected\n customIcon={disabled ? 'none' : 'times'}\n ariaLabel={\n disabled ? undefined : chipLabel(individuals.removeLabel, learner.label)\n }\n onClick={disabled ? undefined : handleRemove(learner.id)}\n />\n ))}\n </div>\n ) : null}\n </Block>\n </fieldset>\n <div className={style.total} data-name=\"estimated-audience\" aria-live=\"polite\">\n <span className={style.totalLabel}>{total.label}</span>\n {total.detail ? <span className={style.muted}>{total.detail}</span> : null}\n </div>\n </section>\n );\n};\n\nAssignmentAudience.propTypes = AssignmentAudiencePropTypes;\n\nexport default AssignmentAudience;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,OAAO,QAAO,OAAO;AACjD,OAAOC,QAAQ,MAAM,oBAAoB;AACzC,OAAOC,WAAW,MAAM,y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AA;IAAKC,SAAS,EAAEZ,KAAK,CAACqF;EAAM,GACzBnC,QAAQ,CAAC1B,GAAG,CAAE+C,OAAgB,iBAC7BnF,KAAA,CAAAuB,aAAA,CAACd,IAAI;IACH6B,GAAG,EAAE6C,OAAO,CAACC,EAAG;IAChBc,IAAI,EAAEf,OAAO,CAACQ,KAAM;IACpBQ,OAAO,EAAEhB,OAAO,CAACuC,KAAM;IACvB5D,QAAQ;IACRuC,UAAU,EAAEpD,QAAQ,GAAG,MAAM,GAAG,OAAQ;IACxCqD,SAAS,EACPrD,QAAQ,GAAGR,SAAS,GAAGF,SAAS,CAACQ,WAAW,CAACP,WAAW,EAAE2C,OAAO,CAACQ,KAAK,CACxE;IACDY,OAAO,EAAEtD,QAAQ,GAAGR,SAAS,GAAGgD,YAAY,CAACN,OAAO,CAACC,EAAE;EAAE,CAC1D,CACF,CACE,CAAC,GACJ,IACC,CACC,CAAC,eACXpF,KAAA,CAAAuB,aAAA;IAAKC,SAAS,EAAEZ,KAAK,CAACoC,KAAM;IAAC,aAAU,oBAAoB;IAAC,aAAU;EAAQ,gBAC5EhD,KAAA,CAAAuB,aAAA;IAAMC,SAAS,EAAEZ,KAAK,CAACiH;EAAW,GAAE7E,KAAK,CAAC2C,KAAY,CAAC,EACtD3C,KAAK,CAAC8E,MAAM,gBAAG9H,KAAA,CAAAuB,aAAA;IAAMC,SAAS,EAAEZ,KAAK,CAACmH;EAAM,GAAE/E,KAAK,CAAC8E,MAAa,CAAC,GAAG,IACnE,CACE,CAAC;AAEd,CAAC;AAEDpF,kBAAkB,CAACsF,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGxH,2BAA2B;AAE1D,eAAe+B,kBAAkB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","uniqueId","InputSwitch","SelectMultiple","Banner","InputFileDraggable","Autocomplete","Title","Chip","UploadResult","AssignmentAudiencePropTypes","style","FIT_CONTENT","width","ACCEPTED_FILES","join","Block","name","title","subtitle","button","children","createElement","className","block","blockHead","type","titleSize","headingLevel","TemplatePreview","header","rows","templatePreview","templateHeader","templateRows","map","row","key","chipLabel","removeLabel","undefined","AssignmentAudience","disabledExplanation","everyone","team","invalidTargets","invalidLabel","error","disabled","populations","upload","individuals","total","sourcesDisabled","Boolean","value","loading","status","onEveryoneChange","onChange","handleEveryoneChange","nextValue","populationOptions","options","onPopulationsChange","onUpload","onRemoveFile","onRemove","suggestions","selected","onSearch","onAdd","explanationId","handlePopulations","choices","filter","option","some","choice","selectedPopulations","handleRemovePopulation","populationValue","handleFileChange","event","file","target","files","handleCancelCheck","availableSuggestions","suggestion","learner","id","handleSearch","handleAdd","find","item","handleRemove","container","role","message","text","label","subText","customIcon","length","sources","ref","cta","action","theme","explanation","multiple","chips","count","ariaLabel","onClick","templateLink","link","href","download","customStyle","uploadMain","dropzone","_extends","report","onDownload","filesTypes","description","uploadLabel","browse","errorButtonLabel","dragAndDropLabel","dropLabel","loadingLabel","onReset","placeholder","login","onInput","onSuggestionSelected","totalLabel","detail","muted","propTypes","process","env","NODE_ENV"],"sources":["../../../src/organism/assignment-audience/index.tsx"],"sourcesContent":["import React, {useCallback, useMemo} from 'react';\nimport uniqueId from 'lodash/fp/uniqueId';\nimport InputSwitch from '../../atom/input-switch';\nimport SelectMultiple from '../../molecule/select-multiple';\nimport Banner from '../../molecule/banner';\nimport InputFileDraggable from '../../atom/input-file-draggable';\nimport Autocomplete from '../../atom/autocomplete';\nimport Title from '../../atom/title';\nimport Chip from '../../atom/chip';\nimport UploadResult from './upload-result';\nimport AssignmentAudiencePropTypes, {\n AssignmentAudienceProps,\n Learner,\n PopulationOption\n} from './types';\nimport style from './style.css';\n\n// ButtonLink is full width by default: in the Title row it would squeeze the title column.\nconst FIT_CONTENT = {width: 'fit-content'};\n\n// csv, xls and xlsx, as the types FilesPropType knows\nconst ACCEPTED_FILES = [\n 'text/csv',\n 'application/vnd.ms-excel',\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\n].join(',');\n\ntype BlockProps = {\n name: string;\n title?: string;\n subtitle?: string;\n // The Title's right-hand ButtonLink\n button?: Record<string, unknown>;\n children?: React.ReactNode;\n};\n\nconst Block = ({name, title, subtitle, button, children}: BlockProps) => (\n <section data-name={name} className={style.block}>\n {title ? (\n <div className={style.blockHead}>\n <Title\n type=\"form-group\"\n titleSize=\"medium\"\n title={title}\n subtitle={subtitle}\n button={button}\n headingLevel={3}\n />\n </div>\n ) : null}\n {children}\n </section>\n);\n\n// A sample of the file to upload: its one column, a header and two example logins.\nconst TemplatePreview = ({header, rows = []}: {header: string; rows?: string[]}) => (\n <div className={style.templatePreview} data-name=\"upload-template-preview\">\n <div className={style.templateHeader}>{header}</div>\n <ul className={style.templateRows}>\n {rows.map(row => (\n <li key={row}>{row}</li>\n ))}\n </ul>\n </div>\n);\n\n// A removable chip says what a click does, e.g. « Remove Camille Durand »; no label, its text.\nconst chipLabel = (removeLabel: string | undefined, name: string) =>\n removeLabel ? `${removeLabel} ${name}` : undefined;\n\nconst AssignmentAudience = ({\n title,\n subtitle,\n disabledExplanation,\n everyone,\n team,\n invalidTargets,\n invalidLabel,\n error,\n disabled = false,\n populations,\n upload,\n individuals,\n total\n}: AssignmentAudienceProps) => {\n const sourcesDisabled = disabled || Boolean(everyone?.value);\n const loading = upload?.status === 'loading';\n const onEveryoneChange = everyone?.onChange;\n const handleEveryoneChange = useCallback(\n (nextValue: boolean) => {\n if (!disabled) onEveryoneChange?.(nextValue);\n },\n [disabled, onEveryoneChange]\n );\n const populationOptions = populations?.options;\n const onPopulationsChange = populations?.onChange;\n const onUpload = upload?.onUpload;\n const onRemoveFile = upload?.onRemove;\n const value = individuals?.value || '';\n const suggestions = individuals?.suggestions;\n const selected = individuals?.selected;\n const onSearch = individuals?.onSearch;\n const onAdd = individuals?.onAdd;\n const onRemove = individuals?.onRemove;\n const explanationId = useMemo(() => uniqueId('assignment-audience-explanation-'), []);\n const handlePopulations = useCallback(\n (choices: PopulationOption[]) =>\n !sourcesDisabled &&\n onPopulationsChange?.(\n (populationOptions || [])\n .filter(option => choices.some(choice => choice.value === option.value))\n .map(option => ({...option, selected: true}))\n ),\n [sourcesDisabled, populationOptions, onPopulationsChange]\n );\n const selectedPopulations = useMemo(\n () => (populationOptions || []).filter(option => option.selected),\n [populationOptions]\n );\n const handleRemovePopulation = useCallback(\n (populationValue: string) => () =>\n !sourcesDisabled &&\n onPopulationsChange?.(selectedPopulations.filter(option => option.value !== populationValue)),\n [sourcesDisabled, selectedPopulations, onPopulationsChange]\n );\n\n // The native input receives both a browse and a drop, and fires change for each.\n const handleFileChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files && event.target.files[0];\n if (sourcesDisabled || loading || !file) return;\n onUpload?.(file);\n },\n [sourcesDisabled, loading, onUpload]\n );\n\n // The loader's cross cancels the check: the file is dropped, as with Remove.\n const handleCancelCheck = useCallback(() => {\n if (!sourcesDisabled) onRemoveFile?.();\n }, [sourcesDisabled, onRemoveFile]);\n\n const availableSuggestions = useMemo(\n () =>\n sourcesDisabled\n ? []\n : (suggestions || []).filter(\n suggestion => !selected?.some(learner => learner.id === suggestion.id)\n ),\n [sourcesDisabled, suggestions, selected]\n );\n const handleSearch = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) =>\n !sourcesDisabled && onSearch?.(event.target.value),\n [sourcesDisabled, onSearch]\n );\n const handleAdd = useCallback(\n ({suggestion}: {suggestion: {value: string}}) => {\n const learner = availableSuggestions.find(item => item.id === suggestion.value);\n if (!sourcesDisabled && learner) onAdd?.(learner);\n },\n [sourcesDisabled, availableSuggestions, onAdd]\n );\n const handleRemove = useCallback(\n (id: string) => () => {\n if (!sourcesDisabled) onRemove?.(id);\n },\n [sourcesDisabled, onRemove]\n );\n\n return (\n <section className={style.container} data-name=\"assignment-audience\" aria-label={title}>\n <Title\n type=\"form-group\"\n titleSize=\"xl-strong\"\n title={title}\n subtitle={subtitle}\n headingLevel={2}\n />\n {error ? (\n <div role=\"alert\">\n <Banner type=\"error\" message={error} />\n </div>\n ) : null}\n {team ? (\n <Block name=\"team\">\n <Chip text={team.label} subText={team.name} customIcon=\"none\" />\n </Block>\n ) : null}\n {invalidTargets?.length ? (\n <fieldset disabled={disabled} className={style.sources} data-name=\"invalid-targets\">\n {invalidTargets.map(target => (\n <div key={target.ref} data-target-ref={target.ref}>\n <Banner\n type=\"error\"\n message={invalidLabel ? `${target.label}: ${invalidLabel}` : target.label}\n cta={[\n {\n type: 'button',\n label: 'Remove',\n action: () => {\n if (!disabled) target.onRemove();\n }\n }\n ]}\n />\n </div>\n ))}\n </fieldset>\n ) : null}\n {everyone ? (\n <Block name=\"everyone\" title={everyone.title}>\n <InputSwitch\n title={everyone.label}\n value={everyone.value}\n disabled={disabled}\n onChange={handleEveryoneChange}\n theme=\"coorpmanager\"\n data-name=\"assignment-everyone\"\n aria-label={everyone.label}\n />\n {everyone.value ? (\n <p id={explanationId} className={style.explanation}>\n {disabledExplanation}\n </p>\n ) : null}\n </Block>\n ) : null}\n <fieldset\n disabled={sourcesDisabled}\n aria-describedby={everyone?.value && disabledExplanation ? explanationId : undefined}\n className={style.sources}\n data-name=\"audience-sources\"\n >\n {populations ? (\n <Block name=\"populations\" title={populations.title} subtitle={populations.subtitle}>\n <SelectMultiple\n title={populations.label}\n options={populations.options}\n multiple\n theme=\"coorpmanager\"\n disabled={sourcesDisabled}\n onChange={handlePopulations}\n />\n {selectedPopulations.length > 0 ? (\n <div className={style.chips} data-name=\"population-chips\">\n {selectedPopulations.map(option => (\n <Chip\n key={option.value}\n text={option.name}\n subText={option.count === undefined ? undefined : `${option.count}`}\n selected\n customIcon={sourcesDisabled ? 'none' : 'times'}\n ariaLabel={\n sourcesDisabled ? undefined : chipLabel(populations.removeLabel, option.name)\n }\n onClick={sourcesDisabled ? undefined : handleRemovePopulation(option.value)}\n />\n ))}\n </div>\n ) : null}\n </Block>\n ) : null}\n {upload ? (\n <Block\n name=\"upload\"\n title={upload.title}\n subtitle={upload.subtitle}\n button={\n upload.templateLink\n ? {\n type: 'text',\n label: upload.templateLink.label,\n link: sourcesDisabled\n ? undefined\n : {href: upload.templateLink.href, download: true},\n disabled: sourcesDisabled,\n 'data-name': 'upload-template-link',\n customStyle: FIT_CONTENT\n }\n : undefined\n }\n >\n <div className={style.upload}>\n {upload.templatePreview ? <TemplatePreview {...upload.templatePreview} /> : null}\n <div\n className={upload.status === 'done' ? style.uploadMain : style.dropzone}\n aria-busy={loading}\n aria-live=\"polite\"\n data-name=\"upload-dropzone\"\n >\n {upload.status === 'done' ? (\n <UploadResult\n {...upload}\n onRemove={upload.onRemove ? handleCancelCheck : undefined}\n report={\n upload.report\n ? {\n ...upload.report,\n onDownload: () => {\n if (!sourcesDisabled) upload.report?.onDownload();\n }\n }\n : undefined\n }\n />\n ) : (\n <InputFileDraggable\n name=\"assignment-audience-file\"\n filesTypes={ACCEPTED_FILES}\n description={upload.dropzone?.description}\n uploadLabel={upload.dropzone?.browse}\n errorButtonLabel={upload.dropzone?.browse}\n dragAndDropLabel={upload.dropzone?.dropLabel}\n loadingLabel={upload.dropzone?.loadingLabel}\n loading={loading}\n disabled={sourcesDisabled}\n error={upload.status === 'error' ? upload.error : ''}\n onChange={handleFileChange}\n onReset={handleCancelCheck}\n />\n )}\n </div>\n </div>\n </Block>\n ) : null}\n {individuals ? (\n <Block name=\"individuals\" title={individuals.title}>\n <Autocomplete\n title={individuals.placeholder}\n theme=\"coorpmanager\"\n value={value}\n suggestions={availableSuggestions.map(learner => ({\n name: `${learner.label} · ${learner.login}`,\n value: learner.id\n }))}\n onInput={handleSearch}\n onSuggestionSelected={handleAdd}\n />\n {(selected?.length || 0) > 0 ? (\n <div className={style.chips}>\n {selected?.map((learner: Learner) => (\n <Chip\n key={learner.id}\n text={learner.label}\n subText={learner.login}\n selected\n customIcon={sourcesDisabled ? 'none' : 'times'}\n ariaLabel={\n sourcesDisabled\n ? undefined\n : chipLabel(individuals.removeLabel, learner.label)\n }\n onClick={sourcesDisabled ? undefined : handleRemove(learner.id)}\n />\n ))}\n </div>\n ) : null}\n </Block>\n ) : null}\n </fieldset>\n {total ? (\n <div className={style.total} data-name=\"estimated-audience\" aria-live=\"polite\">\n <span className={style.totalLabel}>{total.label}</span>\n {total.detail ? <span className={style.muted}>{total.detail}</span> : null}\n </div>\n ) : null}\n </section>\n );\n};\n\nAssignmentAudience.propTypes = AssignmentAudiencePropTypes;\n\nexport default AssignmentAudience;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,OAAO,QAAO,OAAO;AACjD,OAAOC,QAAQ,MAAM,oBAAoB;AACzC,OAAOC,WAAW,MAAM,yBAAyB;AACjD,OAAOC,cAAc,MAAM,gCAAgC;AAC3D,OAAOC,MAAM,MAAM,uBAAuB;AAC1C,OAAOC,kBAAkB,MAAM,iCAAiC;AAChE,OAAOC,YAAY,MAAM,yBAAyB;AAClD,OAAOC,KAAK,MAAM,kBAAkB;AACpC,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,2BAA2B,MAI3B,SAAS;AAChB,OAAOC,KAAK,MAAM,aAAa;;AAE/B;AACA,MAAMC,WAAW,GAAG;EAACC,KAAK,EAAE;AAAa,CAAC;;AAE1C;AACA,MAAMC,cAAc,GAAG,CACrB,UAAU,EACV,0BAA0B,EAC1B,mEAAmE,CACpE,CAACC,IAAI,CAAC,GAAG,CAAC;AAWX,MAAMC,KAAK,GAAGA,CAAC;EAACC,IAAI;EAAEC,KAAK;EAAEC,QAAQ;EAAEC,MAAM;EAAEC;AAAoB,CAAC,kBAClEvB,KAAA,CAAAwB,aAAA;EAAS,aAAWL,IAAK;EAACM,SAAS,EAAEZ,KAAK,CAACa;AAAM,GAC9CN,KAAK,gBACJpB,KAAA,CAAAwB,aAAA;EAAKC,SAAS,EAAEZ,KAAK,CAACc;AAAU,gBAC9B3B,KAAA,CAAAwB,aAAA,CAACf,KAA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AACwF,MAAM,gBAAG9I,KAAA,CAAAwB,aAAA;IAAMC,SAAS,EAAEZ,KAAK,CAACkI;EAAM,GAAEzF,KAAK,CAACwF,MAAa,CAAC,GAAG,IACnE,CAAC,GACJ,IACG,CAAC;AAEd,CAAC;AAEDnG,kBAAkB,CAACqG,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGvI,2BAA2B;AAE1D,eAAe+B,kBAAkB","ignoreList":[]}
|
|
@@ -24,13 +24,25 @@ declare const AssignmentAudiencePropTypes: {
|
|
|
24
24
|
title: PropTypes.Validator<string>;
|
|
25
25
|
subtitle: PropTypes.Requireable<string>;
|
|
26
26
|
disabledExplanation: PropTypes.Requireable<string>;
|
|
27
|
-
|
|
27
|
+
team: PropTypes.Requireable<PropTypes.InferProps<{
|
|
28
|
+
label: PropTypes.Validator<string>;
|
|
29
|
+
name: PropTypes.Validator<string>;
|
|
30
|
+
}>>;
|
|
31
|
+
invalidTargets: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
32
|
+
ref: PropTypes.Validator<string>;
|
|
33
|
+
label: PropTypes.Validator<string>;
|
|
34
|
+
onRemove: PropTypes.Validator<(...args: any[]) => any>;
|
|
35
|
+
}> | null | undefined)[]>;
|
|
36
|
+
invalidLabel: PropTypes.Requireable<string>;
|
|
37
|
+
error: PropTypes.Requireable<string>;
|
|
38
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
39
|
+
everyone: PropTypes.Requireable<PropTypes.InferProps<{
|
|
28
40
|
title: PropTypes.Requireable<string>;
|
|
29
41
|
label: PropTypes.Validator<string>;
|
|
30
42
|
value: PropTypes.Validator<boolean>;
|
|
31
43
|
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
32
|
-
}
|
|
33
|
-
populations: PropTypes.
|
|
44
|
+
}>>;
|
|
45
|
+
populations: PropTypes.Requireable<PropTypes.InferProps<{
|
|
34
46
|
title: PropTypes.Requireable<string>;
|
|
35
47
|
subtitle: PropTypes.Requireable<string>;
|
|
36
48
|
label: PropTypes.Requireable<string>;
|
|
@@ -42,8 +54,8 @@ declare const AssignmentAudiencePropTypes: {
|
|
|
42
54
|
}> | null | undefined)[]>;
|
|
43
55
|
removeLabel: PropTypes.Requireable<string>;
|
|
44
56
|
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
45
|
-
}
|
|
46
|
-
upload: PropTypes.
|
|
57
|
+
}>>;
|
|
58
|
+
upload: PropTypes.Requireable<PropTypes.InferProps<{
|
|
47
59
|
title: PropTypes.Requireable<string>;
|
|
48
60
|
subtitle: PropTypes.Requireable<string>;
|
|
49
61
|
templateLink: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -80,8 +92,8 @@ declare const AssignmentAudiencePropTypes: {
|
|
|
80
92
|
}>>;
|
|
81
93
|
removeLabel: PropTypes.Requireable<string>;
|
|
82
94
|
onRemove: PropTypes.Requireable<(...args: any[]) => any>;
|
|
83
|
-
}
|
|
84
|
-
individuals: PropTypes.
|
|
95
|
+
}>>;
|
|
96
|
+
individuals: PropTypes.Requireable<PropTypes.InferProps<{
|
|
85
97
|
title: PropTypes.Requireable<string>;
|
|
86
98
|
placeholder: PropTypes.Requireable<string>;
|
|
87
99
|
value: PropTypes.Requireable<string>;
|
|
@@ -99,11 +111,11 @@ declare const AssignmentAudiencePropTypes: {
|
|
|
99
111
|
onSearch: PropTypes.Validator<(...args: any[]) => any>;
|
|
100
112
|
onAdd: PropTypes.Validator<(...args: any[]) => any>;
|
|
101
113
|
onRemove: PropTypes.Validator<(...args: any[]) => any>;
|
|
102
|
-
}
|
|
103
|
-
total: PropTypes.
|
|
114
|
+
}>>;
|
|
115
|
+
total: PropTypes.Requireable<PropTypes.InferProps<{
|
|
104
116
|
label: PropTypes.Validator<string>;
|
|
105
117
|
detail: PropTypes.Requireable<string>;
|
|
106
|
-
}
|
|
118
|
+
}>>;
|
|
107
119
|
};
|
|
108
120
|
export default AssignmentAudiencePropTypes;
|
|
109
121
|
declare type LabelsByStatus = Partial<Record<UploadRowStatus, string>>;
|
|
@@ -136,13 +148,25 @@ export declare type AssignmentAudienceProps = {
|
|
|
136
148
|
title: string;
|
|
137
149
|
subtitle?: string;
|
|
138
150
|
disabledExplanation?: string;
|
|
139
|
-
|
|
151
|
+
team?: {
|
|
152
|
+
label: string;
|
|
153
|
+
name: string;
|
|
154
|
+
};
|
|
155
|
+
invalidTargets?: Array<{
|
|
156
|
+
ref: string;
|
|
157
|
+
label: string;
|
|
158
|
+
onRemove: () => void;
|
|
159
|
+
}>;
|
|
160
|
+
invalidLabel?: string;
|
|
161
|
+
error?: string;
|
|
162
|
+
disabled?: boolean;
|
|
163
|
+
everyone?: {
|
|
140
164
|
title?: string;
|
|
141
165
|
label: string;
|
|
142
166
|
value: boolean;
|
|
143
167
|
onChange: (value: boolean) => void;
|
|
144
168
|
};
|
|
145
|
-
populations
|
|
169
|
+
populations?: {
|
|
146
170
|
title?: string;
|
|
147
171
|
subtitle?: string;
|
|
148
172
|
label?: string;
|
|
@@ -150,7 +174,7 @@ export declare type AssignmentAudienceProps = {
|
|
|
150
174
|
removeLabel?: string;
|
|
151
175
|
onChange: (selected: PopulationOption[]) => void;
|
|
152
176
|
};
|
|
153
|
-
upload
|
|
177
|
+
upload?: UploadResultProps & {
|
|
154
178
|
title?: string;
|
|
155
179
|
subtitle?: string;
|
|
156
180
|
templateLink?: {
|
|
@@ -171,7 +195,7 @@ export declare type AssignmentAudienceProps = {
|
|
|
171
195
|
error?: string;
|
|
172
196
|
onUpload: (file: File) => void;
|
|
173
197
|
};
|
|
174
|
-
individuals
|
|
198
|
+
individuals?: {
|
|
175
199
|
title?: string;
|
|
176
200
|
placeholder?: string;
|
|
177
201
|
value?: string;
|
|
@@ -182,7 +206,7 @@ export declare type AssignmentAudienceProps = {
|
|
|
182
206
|
onAdd: (learner: Learner) => void;
|
|
183
207
|
onRemove: (id: string) => void;
|
|
184
208
|
};
|
|
185
|
-
total
|
|
209
|
+
total?: {
|
|
186
210
|
label: string;
|
|
187
211
|
detail?: string;
|
|
188
212
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/organism/assignment-audience/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAInC,eAAO,MAAM,QAAQ,wDAAyD,CAAC;AAC/E,oBAAY,eAAe,GAAG,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/organism/assignment-audience/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAInC,eAAO,MAAM,QAAQ,wDAAyD,CAAC;AAC/E,oBAAY,eAAe,GAAG,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;AActD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;CAYjC,CAAC;AAQF,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwFhC,CAAC;AAEF,eAAe,2BAA2B,CAAC;AAE3C,aAAK,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC;AAE/D,oBAAY,iBAAiB,GAAG;IAC9B,IAAI,CAAC,EAAE;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;IACxC,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,IAAI,CAAA;KAAC,CAAC;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,C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MAAM,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;CAC1C,CAAC;AAEF,oBAAY,8BAA8B,GAAG;IAAC,KAAK,EAAE,uBAAuB,CAAA;CAAC,CAAC"}
|
|
@@ -35,13 +35,25 @@ const AssignmentAudiencePropTypes = {
|
|
|
35
35
|
title: PropTypes.string.isRequired,
|
|
36
36
|
subtitle: PropTypes.string,
|
|
37
37
|
disabledExplanation: PropTypes.string,
|
|
38
|
+
team: PropTypes.shape({
|
|
39
|
+
label: PropTypes.string.isRequired,
|
|
40
|
+
name: PropTypes.string.isRequired
|
|
41
|
+
}),
|
|
42
|
+
invalidTargets: PropTypes.arrayOf(PropTypes.shape({
|
|
43
|
+
ref: PropTypes.string.isRequired,
|
|
44
|
+
label: PropTypes.string.isRequired,
|
|
45
|
+
onRemove: PropTypes.func.isRequired
|
|
46
|
+
})),
|
|
47
|
+
invalidLabel: PropTypes.string,
|
|
48
|
+
error: PropTypes.string,
|
|
49
|
+
disabled: PropTypes.bool,
|
|
38
50
|
everyone: PropTypes.shape({
|
|
39
51
|
title: PropTypes.string,
|
|
40
52
|
label: PropTypes.string.isRequired,
|
|
41
53
|
value: PropTypes.bool.isRequired,
|
|
42
54
|
// Receives the new boolean
|
|
43
55
|
onChange: PropTypes.func.isRequired
|
|
44
|
-
})
|
|
56
|
+
}),
|
|
45
57
|
populations: PropTypes.shape({
|
|
46
58
|
title: PropTypes.string,
|
|
47
59
|
subtitle: PropTypes.string,
|
|
@@ -57,7 +69,7 @@ const AssignmentAudiencePropTypes = {
|
|
|
57
69
|
removeLabel: PropTypes.string,
|
|
58
70
|
// Receives the selected options, with selected: true
|
|
59
71
|
onChange: PropTypes.func.isRequired
|
|
60
|
-
})
|
|
72
|
+
}),
|
|
61
73
|
upload: PropTypes.shape({
|
|
62
74
|
// The file line and the result, once the file is checked
|
|
63
75
|
...UploadResultPropTypes,
|
|
@@ -83,7 +95,7 @@ const AssignmentAudiencePropTypes = {
|
|
|
83
95
|
error: PropTypes.string,
|
|
84
96
|
// Receives the first File. Parsing and login resolution belong to the consumer.
|
|
85
97
|
onUpload: PropTypes.func.isRequired
|
|
86
|
-
})
|
|
98
|
+
}),
|
|
87
99
|
individuals: PropTypes.shape({
|
|
88
100
|
title: PropTypes.string,
|
|
89
101
|
placeholder: PropTypes.string,
|
|
@@ -98,11 +110,11 @@ const AssignmentAudiencePropTypes = {
|
|
|
98
110
|
onAdd: PropTypes.func.isRequired,
|
|
99
111
|
// Receives the learner id
|
|
100
112
|
onRemove: PropTypes.func.isRequired
|
|
101
|
-
})
|
|
113
|
+
}),
|
|
102
114
|
total: PropTypes.shape({
|
|
103
115
|
label: PropTypes.string.isRequired,
|
|
104
116
|
detail: PropTypes.string
|
|
105
|
-
})
|
|
117
|
+
})
|
|
106
118
|
};
|
|
107
119
|
export default AssignmentAudiencePropTypes;
|
|
108
120
|
//# sourceMappingURL=types.js.map
|