-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[UU-58] Implement tagging & taxonomy feature in outline #855
Changes from 8 commits
d861813
a6c5e5f
ac4785f
0050596
50794f5
1912890
54803cc
71de03d
a409197
a6019e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
'block-v1:SampleTaxonomyOrg1+STC1+2023_1+type@vertical+block@aaf8b8eb86b54281aeeab12499d2cb01': 10, | ||
'block-v1:SampleTaxonomyOrg1+STC1+2023_1+type@vertical+block@aaf8b8eb86b54281aeeab12499d2cb02': 11, | ||
'block-v1:SampleTaxonomyOrg1+STC1+2023_1+type@vertical+block@aaf8b8eb86b54281aeeab12499d2cb03': 12, | ||
'block-v1:SampleTaxonomyOrg1+STC1+2023_1+type@vertical+block@aaf8b8eb86b54281aeeab12499d2cb04': 13, | ||
'block-v1:SampleTaxonomyOrg1+STC1+2023_1+type@vertical+block@aaf8b8eb86b54281aeeab12499d2cb05': 14, | ||
'block-v1:SampleTaxonomyOrg1+STC1+2023_1+type@vertical+block@aaf8b8eb86b54281aeeab12499d2cb06': 15, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ import { ITEM_BADGE_STATUS } from '../constants'; | |
import { scrollToElement } from '../utils'; | ||
import CardStatus from './CardStatus'; | ||
import messages from './messages'; | ||
import TagCount from '../../generic/tag-count'; | ||
|
||
const CardHeader = ({ | ||
title, | ||
|
@@ -27,6 +28,7 @@ const CardHeader = ({ | |
hasChanges, | ||
onClickPublish, | ||
onClickConfigure, | ||
onClickManageTags, | ||
onClickMenuButton, | ||
onClickEdit, | ||
isFormOpen, | ||
|
@@ -48,6 +50,7 @@ const CardHeader = ({ | |
discussionEnabled, | ||
discussionsSettings, | ||
parentInfo, | ||
tagsCount, | ||
}) => { | ||
const intl = useIntl(); | ||
const [searchParams] = useSearchParams(); | ||
|
@@ -127,6 +130,7 @@ const CardHeader = ({ | |
{(isVertical || isSequential) && ( | ||
<CardStatus status={status} showDiscussionsEnabledBadge={showDiscussionsEnabledBadge} /> | ||
)} | ||
{ tagsCount !== undefined && tagsCount !== 0 && <TagCount count={tagsCount} onClick={onClickManageTags} /> } | ||
<Dropdown data-testid={`${namePrefix}-card-header__menu`} onClick={onClickMenuButton}> | ||
<Dropdown.Toggle | ||
className="item-card-header__menu" | ||
|
@@ -162,6 +166,15 @@ const CardHeader = ({ | |
> | ||
{intl.formatMessage(messages.menuConfigure)} | ||
</Dropdown.Item> | ||
{onClickManageTags && ( | ||
<Dropdown.Item | ||
data-testid={`${namePrefix}-card-header__menu-manage-tags-button`} | ||
onClick={onClickManageTags} | ||
> | ||
{intl.formatMessage(messages.menuManageTags)} | ||
</Dropdown.Item> | ||
)} | ||
Comment on lines
+169
to
+176
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need the dropdown item and the tag count to both have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the tag count will be read only in other pages. E.g #852 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, so you will update the tag count in the header to be read only and the dropdown item will have to onclick attribute. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the course outline it is necessary that the |
||
|
||
{isVertical && enableCopyPasteUnits && ( | ||
<Dropdown.Item onClick={onClickCopy}> | ||
{intl.formatMessage(messages.menuCopy)} | ||
|
@@ -218,6 +231,8 @@ CardHeader.defaultProps = { | |
discussionEnabled: false, | ||
discussionsSettings: {}, | ||
parentInfo: {}, | ||
onClickManageTags: null, | ||
tagsCount: undefined, | ||
}; | ||
|
||
CardHeader.propTypes = { | ||
|
@@ -227,6 +242,7 @@ CardHeader.propTypes = { | |
hasChanges: PropTypes.bool.isRequired, | ||
onClickPublish: PropTypes.func.isRequired, | ||
onClickConfigure: PropTypes.func.isRequired, | ||
onClickManageTags: PropTypes.func, | ||
onClickMenuButton: PropTypes.func.isRequired, | ||
onClickEdit: PropTypes.func.isRequired, | ||
isFormOpen: PropTypes.bool.isRequired, | ||
|
@@ -261,6 +277,7 @@ CardHeader.propTypes = { | |
isTimeLimited: PropTypes.bool, | ||
graded: PropTypes.bool, | ||
}), | ||
tagsCount: PropTypes.number, | ||
}; | ||
|
||
export default CardHeader; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.