Skip to content

Commit 1ff5e5b

Browse files
authored
fix: markdown editor issues in modal (#2076)
This PR resolves rendering issues with the Markdown editor inside the modal. The problem began after a PR [1] introduced the use of modals for the editor. The EditorPage [2] component expects a `isMarkdownEditorEnabledForCourse` prop, which was missing in that implementation. [1] #1838 [2] https://github.com/openedx/frontend-app-authoring/pull/1838/files#diff-147218ef88726880178ea895988a5d3feaf2c0c4459086a8de7a4080cbe37de7R226 Backports #2074
1 parent 19ef805 commit 1ff5e5b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/course-unit/add-component/AddComponent.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const AddComponent = ({
4444
const [selectedComponents, setSelectedComponents] = useState([]);
4545
const [usageId, setUsageId] = useState(null);
4646
const { sendMessageToIframe } = useIframe();
47-
const { useVideoGalleryFlow } = useSelector(getWaffleFlags);
47+
const { useVideoGalleryFlow, useReactMarkdownEditor } = useSelector(getWaffleFlags);
4848

4949
const receiveMessage = useCallback(({ data: { type, payload } }) => {
5050
if (type === messageTypes.showMultipleComponentPicker) {
@@ -264,6 +264,7 @@ const AddComponent = ({
264264
courseId={courseId}
265265
blockType={blockType}
266266
blockId={newBlockId}
267+
isMarkdownEditorEnabledForCourse={useReactMarkdownEditor}
267268
studioEndpointUrl={getConfig().STUDIO_BASE_URL}
268269
lmsEndpointUrl={getConfig().LMS_BASE_URL}
269270
onClose={closeXBlockEditorModal}

src/course-unit/xblock-container-iframe/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const XBlockContainerIframe: FC<XBlockContainerIframeProps> = ({
4949
const [isVideoSelectorModalOpen, showVideoSelectorModal, closeVideoSelectorModal] = useToggle();
5050
const [isXBlockEditorModalOpen, showXBlockEditorModal, closeXBlockEditorModal] = useToggle();
5151
const [blockType, setBlockType] = useState<string>('');
52-
const { useVideoGalleryFlow } = useSelector(getWaffleFlags);
52+
const { useVideoGalleryFlow, useReactMarkdownEditor } = useSelector(getWaffleFlags);
5353
const [newBlockId, setNewBlockId] = useState<string>('');
5454
const [accessManagedXBlockData, setAccessManagedXBlockData] = useState<AccessManagedXBlockDataTypes | {}>({});
5555
const [iframeOffset, setIframeOffset] = useState(0);
@@ -230,6 +230,7 @@ const XBlockContainerIframe: FC<XBlockContainerIframeProps> = ({
230230
courseId={courseId}
231231
blockType={blockType}
232232
blockId={newBlockId}
233+
isMarkdownEditorEnabledForCourse={useReactMarkdownEditor}
233234
studioEndpointUrl={getConfig().STUDIO_BASE_URL}
234235
lmsEndpointUrl={getConfig().LMS_BASE_URL}
235236
onClose={closeXBlockEditorModal}

0 commit comments

Comments
 (0)