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:
Chris Chávez
2025-12-05 19:14:32 -05:00
committed by GitHub
parent 50f4f70671
commit dad736f9d1
77 changed files with 1396 additions and 1601 deletions

View File

@@ -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, '');