From 2eb0ff73cf0f41a06ac8901c06a2998f3561c4f3 Mon Sep 17 00:00:00 2001 From: Kyr <40792129+khudym@users.noreply.github.com> Date: Tue, 2 Apr 2024 14:47:11 +0300 Subject: [PATCH] fix: [AXIMST-736] Unit page tagging waffle flag (#225) Co-authored-by: Kyrylo Hudym-Levkovych --- .../course-xblock/CourseXBlock.jsx | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/course-unit/course-xblock/CourseXBlock.jsx b/src/course-unit/course-xblock/CourseXBlock.jsx index be8bdb2415..f96b61fba5 100644 --- a/src/course-unit/course-xblock/CourseXBlock.jsx +++ b/src/course-unit/course-xblock/CourseXBlock.jsx @@ -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, @@ -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'; @@ -69,7 +68,7 @@ const CourseXBlock = memo(({ }, [isXBlocksExpanded, isXBlocksRendered]); const { - canCopy, canDelete, canDuplicate, canManageAccess, canMove, + canCopy, canDelete, canDuplicate, canManageAccess, canMove, canManageTags, } = actions; const { @@ -163,7 +162,8 @@ const CourseXBlock = memo(({ actions={( { - isContentTaxonomyTagsCountLoaded + canManageTags + && isContentTaxonomyTagsCountLoaded && contentTaxonomyTagsCount > 0 &&
} @@ -181,26 +181,26 @@ const CourseXBlock = memo(({ iconAs={Icon} /> + {canManageTags && ( + + {intl.formatMessage(messages.blockLabelButtonManageTags)} + + )} + {canCopy && ( + dispatch(copyToClipboard(id))}> + {intl.formatMessage(messages.blockLabelButtonCopyToClipboard)} + + )} {canDuplicate && ( unitXBlockActions.handleDuplicate(id)}> {intl.formatMessage(messages.blockLabelButtonDuplicate)} )} - {getConfig().ENABLE_TAGGING_TAXONOMY_PAGES && ( - - {intl.formatMessage(messages.blockLabelButtonManageTags)} - - )} {canMove && ( {intl.formatMessage(messages.blockLabelButtonMove)} )} - {canCopy && ( - dispatch(copyToClipboard(id))}> - {intl.formatMessage(messages.blockLabelButtonCopyToClipboard)} - - )} {canManageAccess && ( {intl.formatMessage(messages.blockLabelButtonManageAccess)} @@ -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,