Skip to content

Commit

Permalink
feat: refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ihor-romaniuk authored and PKulkoRaccoonGang committed Oct 25, 2024
1 parent 470beb9 commit e9e8ec4
Show file tree
Hide file tree
Showing 24 changed files with 3,669 additions and 475 deletions.
4 changes: 2 additions & 2 deletions src/CourseAuthoringRoutes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import ScheduleAndDetails from './schedule-and-details';
import { GradingSettings } from './grading-settings';
import CourseTeam from './course-team/CourseTeam';
import { CourseUpdates } from './course-updates';
import { CourseUnit } from './course-unit';
import { CourseUnit, IframeProvider } from './course-unit';
import { Certificates } from './certificates';
import CourseExportPage from './export-page/CourseExportPage';
import CourseImportPage from './import-page/CourseImportPage';
Expand Down Expand Up @@ -79,7 +79,7 @@ const CourseAuthoringRoutes = () => {
<Route
key={path}
path={path}
element={<PageWrap><CourseUnit courseId={courseId} /></PageWrap>}
element={<PageWrap><IframeProvider><CourseUnit courseId={courseId} /></IframeProvider></PageWrap>}
/>
))}
<Route
Expand Down
28 changes: 14 additions & 14 deletions src/course-unit/CourseUnit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,16 @@ const CourseUnit = ({ courseId }) => {
aria-hidden={movedXBlockParams.isSuccess}
dismissible
actions={movedXBlockParams.isUndo ? null : [
<Button onClick={handleRollbackMovedXBlock}>
<Button
onClick={handleRollbackMovedXBlock}
key="xblock-moved-alert-undo-move-button"
>
{intl.formatMessage(messages.undoMoveButton)}
</Button>,
<Button onClick={handleNavigateToTargetUnit}>
<Button
onClick={handleNavigateToTargetUnit}
key="xblock-moved-alert-new-location-button"
>
{intl.formatMessage(messages.newLocationButton)}
</Button>,
]}
Expand Down Expand Up @@ -141,18 +147,6 @@ const CourseUnit = ({ courseId }) => {
/>
)}
/>

<hr />
<hr />
<Button onClick={openMoveModal}>MOVE MODAL TRIGGER</Button>
<MoveModal
isOpen={isMoveModalOpen}
close={closeMoveModal}
displayName="Choosing a Compute Option"
/>
<hr />
<hr />

<Sequence
courseId={courseId}
sequenceId={sequenceId}
Expand Down Expand Up @@ -194,6 +188,12 @@ const CourseUnit = ({ courseId }) => {
text={intl.formatMessage(messages.pasteButtonText)}
/>
)}
<MoveModal
isOpenModal={isMoveModalOpen}
openModal={openMoveModal}
closeModal={closeMoveModal}
courseId={courseId}
/>
</Layout.Element>
<Layout.Element>
<Stack gap={3}>
Expand Down
5 changes: 4 additions & 1 deletion src/course-unit/CourseUnit.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import addComponentMessages from './add-component/messages';
import { PUBLISH_TYPES, UNIT_VISIBILITY_STATES } from './constants';
import messages from './messages';
import { getContentTaxonomyTagsApiUrl, getContentTaxonomyTagsCountApiUrl } from '../content-tags-drawer/data/api';
import { IframeProvider } from './context/iFrameContext';

let axiosMock;
let store;
Expand Down Expand Up @@ -108,7 +109,9 @@ global.BroadcastChannel = jest.fn(() => clipboardBroadcastChannelMock);
const RootWrapper = () => (
<AppProvider store={store}>
<IntlProvider locale="en">
<CourseUnit courseId={courseId} />
<IframeProvider>
<CourseUnit courseId={courseId} />
</IframeProvider>
</IntlProvider>
</AppProvider>
);
Expand Down
Loading

0 comments on commit e9e8ec4

Please sign in to comment.