refactor: Migration of course details to React query (#2724)
- Migrates the `courseDetails` part from the Redux Store to React Query. - Creates a new `CourseAuthoringContext` - Update the pages in `<CourseAuthoringRoutes>` to use the newly created context. - Migrates some files to Typescript - Migrates some tests to use `src/testUtils.tsx`
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { useCourseAuthoringContext } from '@src/CourseAuthoringContext';
|
||||
import TinyMceWidget, { prepareEditorRef } from '../editors/sharedComponents/TinyMceWidget';
|
||||
|
||||
import { DEFAULT_EMPTY_WYSIWYG_VALUE } from '../constants';
|
||||
@@ -14,7 +13,7 @@ export const WysiwygEditor = ({
|
||||
initialValue, editorType, onChange, minHeight,
|
||||
}) => {
|
||||
const { editorRef, refReady, setEditorRef } = prepareEditorRef();
|
||||
const { courseId } = useSelector((state) => state.courseDetail);
|
||||
const { courseId } = useCourseAuthoringContext();
|
||||
const isEquivalentCodeExtraSpaces = (first, second) => {
|
||||
// Utils allows to compare code extra spaces
|
||||
const removeWhitespace = (str) => str.replace(/\s/g, '');
|
||||
|
||||
Reference in New Issue
Block a user