diff --git a/src/content-tags-drawer/ContentTagsCollapsible.jsx b/src/content-tags-drawer/ContentTagsCollapsible.jsx index 118b20d3b3..d0e1125013 100644 --- a/src/content-tags-drawer/ContentTagsCollapsible.jsx +++ b/src/content-tags-drawer/ContentTagsCollapsible.jsx @@ -6,6 +6,7 @@ import { Collapsible, SelectableBox, Button, + Spinner, } from '@openedx/paragon'; import PropTypes from 'prop-types'; import classNames from 'classnames'; @@ -32,6 +33,7 @@ const CustomMenu = (props) => { selectRef, searchTerm, value, + commitStagedTags, } = props.selectProps; return ( @@ -66,7 +68,7 @@ const CustomMenu = (props) => { @@ -103,6 +105,24 @@ CustomMenu.propTypes = { value: PropTypes.string.isRequired, label: PropTypes.string.isRequired, })).isRequired, + commitStagedTags: PropTypes.func.isRequired, + }).isRequired, +}; + +const CustomLoadingIndicator = (props) => { + const { intl } = props.selectProps; + return ( + + ); +}; + +CustomLoadingIndicator.propTypes = { + selectProps: PropTypes.shape({ + intl: intlShape.isRequired, }).isRequired, }; @@ -196,12 +216,20 @@ const ContentTagsCollapsible = ({ const selectRef = React.useRef(null); const { - tagChangeHandler, appliedContentTagsTree, stagedContentTagsTree, contentTagsCount, checkedTags, + tagChangeHandler, + removeAppliedTagHandler, + appliedContentTagsTree, + stagedContentTagsTree, + contentTagsCount, + checkedTags, + commitStagedTags, + updateTags, } = useContentTagsCollapsibleHelper( contentId, taxonomyAndTagsData, addStagedContentTag, removeStagedContentTag, + stagedContentTags, ); const [searchTerm, setSearchTerm] = React.useState(''); @@ -235,7 +263,7 @@ const ContentTagsCollapsible = ({ ); // Call the `tagChangeHandler` with the unstaged tags to unselect them from the selectbox - // and update the staged content tags tree. Since the `handleStagedTagsMenuChange` function is + // and update the staged content tags tree. Since the `handleStagedTagsMenuChange` function is={} // only called when a change occurs in the react-select menu component we know that tags can only be // removed from there, hence the tagChangeHandler is always called with `checked=false`. unstagedTags.forEach(unstagedTag => tagChangeHandler(unstagedTag.value, false)); @@ -246,7 +274,7 @@ const ContentTagsCollapsible = ({
- +
@@ -255,6 +283,8 @@ const ContentTagsCollapsible = ({