Skip to content

Commit

Permalink
fix: [AXIMST-736] Unit page tagging waffle flag (#225)
Browse files Browse the repository at this point in the history
Co-authored-by: Kyrylo Hudym-Levkovych <[email protected]>
  • Loading branch information
2 people authored and Kyrylo Hudym-Levkovych committed Apr 27, 2024
1 parent 2c1ee42 commit 2eb0ff7
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/course-unit/course-xblock/CourseXBlock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
import { useDispatch, useSelector } from 'react-redux';
import { useNavigate } from 'react-router-dom';
import {
ActionRow, Card, Dropdown, Icon, IconButton, useToggle, OverlayTrigger, Tooltip, Button, Sheet
ActionRow, Card, Dropdown, Icon, IconButton, useToggle, OverlayTrigger, Tooltip, Button, Sheet,
} from '@openedx/paragon';
import {
EditOutline as EditIcon,
Expand All @@ -16,7 +16,6 @@ import {
import { useIntl } from '@edx/frontend-platform/i18n';
import { find } from 'lodash';
import classNames from 'classnames';
import { getConfig } from '@edx/frontend-platform';

import ContentTagsDrawer from '../../content-tags-drawer/ContentTagsDrawer';
import { useContentTagsCount } from '../../generic/data/apiHooks';
Expand Down Expand Up @@ -69,7 +68,7 @@ const CourseXBlock = memo(({
}, [isXBlocksExpanded, isXBlocksRendered]);

const {
canCopy, canDelete, canDuplicate, canManageAccess, canMove,
canCopy, canDelete, canDuplicate, canManageAccess, canMove, canManageTags,
} = actions;

const {
Expand Down Expand Up @@ -163,7 +162,8 @@ const CourseXBlock = memo(({
actions={(
<ActionRow className="mr-2">
{
isContentTaxonomyTagsCountLoaded
canManageTags
&& isContentTaxonomyTagsCountLoaded
&& contentTaxonomyTagsCount > 0
&& <div className="ml-2"><TagCount count={contentTaxonomyTagsCount} onClick={openManageTagsModal} /></div>
}
Expand All @@ -181,26 +181,26 @@ const CourseXBlock = memo(({
iconAs={Icon}
/>
<Dropdown.Menu>
{canManageTags && (
<Dropdown.Item onClick={openManageTagsModal}>
{intl.formatMessage(messages.blockLabelButtonManageTags)}
</Dropdown.Item>
)}
{canCopy && (
<Dropdown.Item onClick={() => dispatch(copyToClipboard(id))}>
{intl.formatMessage(messages.blockLabelButtonCopyToClipboard)}
</Dropdown.Item>
)}
{canDuplicate && (
<Dropdown.Item onClick={() => unitXBlockActions.handleDuplicate(id)}>
{intl.formatMessage(messages.blockLabelButtonDuplicate)}
</Dropdown.Item>
)}
{getConfig().ENABLE_TAGGING_TAXONOMY_PAGES && (
<Dropdown.Item onClick={openManageTagsModal}>
{intl.formatMessage(messages.blockLabelButtonManageTags)}
</Dropdown.Item>
)}
{canMove && (
<Dropdown.Item>
{intl.formatMessage(messages.blockLabelButtonMove)}
</Dropdown.Item>
)}
{canCopy && (
<Dropdown.Item onClick={() => dispatch(copyToClipboard(id))}>
{intl.formatMessage(messages.blockLabelButtonCopyToClipboard)}
</Dropdown.Item>
)}
{canManageAccess && (
<Dropdown.Item onClick={openConfigureModal}>
{intl.formatMessage(messages.blockLabelButtonManageAccess)}
Expand Down Expand Up @@ -301,6 +301,7 @@ CourseXBlock.propTypes = {
canDelete: PropTypes.bool,
canDuplicate: PropTypes.bool,
canManageAccess: PropTypes.bool,
canManageTags: PropTypes.bool,
canMove: PropTypes.bool,
}).isRequired,
isXBlocksExpanded: PropTypes.bool.isRequired,
Expand Down

0 comments on commit 2eb0ff7

Please sign in to comment.