diff --git a/src/course-outline/CourseOutline.jsx b/src/course-outline/CourseOutline.jsx index fc1581687d..0ebbdf3497 100644 --- a/src/course-outline/CourseOutline.jsx +++ b/src/course-outline/CourseOutline.jsx @@ -45,12 +45,12 @@ import HighlightsModal from './highlights-modal/HighlightsModal'; import EmptyPlaceholder from './empty-placeholder/EmptyPlaceholder'; import PublishModal from './publish-modal/PublishModal'; import PageAlerts from './page-alerts/PageAlerts'; -import DraggableList from './drag-helper/DraggableList'; +import DraggableList from '../generic/drag-helper/DraggableList'; import { canMoveSection, possibleUnitMoves, possibleSubsectionMoves, -} from './drag-helper/utils'; +} from '../generic/drag-helper/utils'; import { useCourseOutline } from './hooks'; import messages from './messages'; diff --git a/src/course-outline/CourseOutline.scss b/src/course-outline/CourseOutline.scss index 19bdb37c40..0403ee542d 100644 --- a/src/course-outline/CourseOutline.scss +++ b/src/course-outline/CourseOutline.scss @@ -7,7 +7,7 @@ @import "./empty-placeholder/EmptyPlaceholder"; @import "./highlights-modal/HighlightsModal"; @import "./publish-modal/PublishModal"; -@import "./drag-helper/SortableItem"; +@import "../generic/drag-helper/SortableItem"; @import "./xblock-status/XBlockStatus"; div.row:has(> div > div.highlight) { diff --git a/src/course-outline/CourseOutline.test.jsx b/src/course-outline/CourseOutline.test.jsx index ce85ec1b9a..d59231ccf4 100644 --- a/src/course-outline/CourseOutline.test.jsx +++ b/src/course-outline/CourseOutline.test.jsx @@ -56,7 +56,7 @@ import { moveUnitOver, moveSubsection, moveUnit, -} from './drag-helper/utils'; +} from '../generic/drag-helper/utils'; let axiosMock; let store; diff --git a/src/course-outline/section-card/SectionCard.jsx b/src/course-outline/section-card/SectionCard.jsx index 914d201ab8..55089158fd 100644 --- a/src/course-outline/section-card/SectionCard.jsx +++ b/src/course-outline/section-card/SectionCard.jsx @@ -13,8 +13,8 @@ import classNames from 'classnames'; import { setCurrentItem, setCurrentSection } from '../data/slice'; import { RequestStatus } from '../../data/constants'; import CardHeader from '../card-header/CardHeader'; -import SortableItem from '../drag-helper/SortableItem'; -import { DragContext } from '../drag-helper/DragContextProvider'; +import SortableItem from '../../generic/drag-helper/SortableItem'; +import { DragContext } from '../../generic/drag-helper/DragContextProvider'; import TitleButton from '../card-header/TitleButton'; import XBlockStatus from '../xblock-status/XBlockStatus'; import { getItemStatus, getItemStatusBorder, scrollToElement } from '../utils'; diff --git a/src/course-outline/subsection-card/SubsectionCard.jsx b/src/course-outline/subsection-card/SubsectionCard.jsx index 7f31b4b1fe..12bee0aec3 100644 --- a/src/course-outline/subsection-card/SubsectionCard.jsx +++ b/src/course-outline/subsection-card/SubsectionCard.jsx @@ -14,8 +14,8 @@ import { isEmpty } from 'lodash'; import { setCurrentItem, setCurrentSection, setCurrentSubsection } from '../data/slice'; import { RequestStatus } from '../../data/constants'; import CardHeader from '../card-header/CardHeader'; -import SortableItem from '../drag-helper/SortableItem'; -import { DragContext } from '../drag-helper/DragContextProvider'; +import SortableItem from '../../generic/drag-helper/SortableItem'; +import { DragContext } from '../../generic/drag-helper/DragContextProvider'; import { useCopyToClipboard, PasteComponent } from '../../generic/clipboard'; import TitleButton from '../card-header/TitleButton'; import XBlockStatus from '../xblock-status/XBlockStatus'; diff --git a/src/course-outline/unit-card/UnitCard.jsx b/src/course-outline/unit-card/UnitCard.jsx index 79193056c0..469f28e791 100644 --- a/src/course-outline/unit-card/UnitCard.jsx +++ b/src/course-outline/unit-card/UnitCard.jsx @@ -9,7 +9,7 @@ import { useSearchParams } from 'react-router-dom'; import { setCurrentItem, setCurrentSection, setCurrentSubsection } from '../data/slice'; import { RequestStatus } from '../../data/constants'; import CardHeader from '../card-header/CardHeader'; -import SortableItem from '../drag-helper/SortableItem'; +import SortableItem from '../../generic/drag-helper/SortableItem'; import TitleLink from '../card-header/TitleLink'; import XBlockStatus from '../xblock-status/XBlockStatus'; import { getItemStatus, getItemStatusBorder, scrollToElement } from '../utils'; diff --git a/src/course-unit/CourseUnit.test.jsx b/src/course-unit/CourseUnit.test.jsx index cec2b09768..062b611d5b 100644 --- a/src/course-unit/CourseUnit.test.jsx +++ b/src/course-unit/CourseUnit.test.jsx @@ -1,6 +1,6 @@ import MockAdapter from 'axios-mock-adapter'; import { - act, render, waitFor, fireEvent, within, + act, render, waitFor, fireEvent, within, screen, } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { IntlProvider } from '@edx/frontend-platform/i18n'; @@ -597,6 +597,14 @@ describe('', () => { name: 'New Cloned XBlock', block_id: '1234567890', block_type: 'drag-and-drop-v2', + actions: { + canCopy: true, + canDuplicate: true, + canMove: true, + canManageAccess: true, + canManageTags: true, + canDelete: true, + }, user_partition_info: {}, }, ], diff --git a/src/course-unit/course-xblock/CourseXBlock.jsx b/src/course-unit/course-xblock/CourseXBlock.jsx index f5edfed310..27f071684b 100644 --- a/src/course-unit/course-xblock/CourseXBlock.jsx +++ b/src/course-unit/course-xblock/CourseXBlock.jsx @@ -80,6 +80,8 @@ const CourseXBlock = memo(({ canCopy, canDelete, canDuplicate, canManageAccess, canManageTags, canMove, } = actions; + console.log('actions ===>>>>', actions); + useOverflowControl(`.${XBLOCK_EDIT_MODAL_CLASS_NAME}`); useEffect(() => { diff --git a/src/course-unit/course-xblock/CourseXBlock.scss b/src/course-unit/course-xblock/CourseXBlock.scss index cebdd0667a..6e5c4b516b 100644 --- a/src/course-unit/course-xblock/CourseXBlock.scss +++ b/src/course-unit/course-xblock/CourseXBlock.scss @@ -22,11 +22,6 @@ font-size: $font-size-sm; } - .pgn__card-header-subtitle-md { - margin-top: 0; - font-size: 1rem; - } - .pgn__card-header-title-md { font: 700 1.375rem/1.75rem $font-family-sans-serif; color: $black; diff --git a/src/course-unit/course-xblock/messages.js b/src/course-unit/course-xblock/messages.js index a67aeff2c0..1343b0783c 100644 --- a/src/course-unit/course-xblock/messages.js +++ b/src/course-unit/course-xblock/messages.js @@ -54,14 +54,6 @@ const messages = defineMessages({ id: 'course-authoring.course-unit.xblock.button.manageTags.label', defaultMessage: 'Manage tags', }, - visibilityMessage: { - id: 'course-authoring.course-unit.xblock.visibility.message', - defaultMessage: 'Access restricted to: {selectedGroupsLabel}', - }, - validationSummary: { - id: 'course-authoring.course-unit.xblock.validation.summary', - defaultMessage: 'This component has validation issues.', - }, expandTooltip: { id: 'course-authoring.course-unit.xblock.expandTooltip', defaultMessage: 'Collapse/Expand this block', diff --git a/src/course-unit/header-title/HeaderTitle.jsx b/src/course-unit/header-title/HeaderTitle.jsx index 734df5b449..0d29404ba6 100644 --- a/src/course-unit/header-title/HeaderTitle.jsx +++ b/src/course-unit/header-title/HeaderTitle.jsx @@ -50,7 +50,7 @@ const HeaderTitle = ({ return ( <> -
+
{isTitleEditFormOpen ? ( ', () => { const { getByText, getByRole } = render(); const dropzoneInput = getByRole('presentation', { hidden: true }); - const file = new File( + const imageFile = new File( [new ArrayBuffer(maxSizeInBytes + 1)], 'test-file.png', { type: 'image/png' }, ); - userEvent.upload(dropzoneInput.firstChild, file); + userEvent.upload(dropzoneInput.firstChild, imageFile); await waitFor(() => { // Assert that the error message is displayed @@ -164,13 +164,13 @@ describe('', () => { ); const dropzoneInput = getByRole('presentation', { hidden: true }); - const file = new File( + const imageFile = new File( [new ArrayBuffer(maxSizeInBytes + 1)], 'test-file.png', { type: 'image/png' }, ); - userEvent.upload(dropzoneInput.firstChild, file); + userEvent.upload(dropzoneInput.firstChild, imageFile); await waitFor(() => { expect(getByText(expectedErrorMessage)).toBeInTheDocument();