Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[temp] feat: add detail taxonomy page #5

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d5cc567
fix(deps): update dependency react-transition-group to v4.4.5 (#647)
renovate[bot] Nov 6, 2023
09f908b
fix(deps): update dependency @edx/frontend-component-footer to v12.5.…
renovate[bot] Nov 6, 2023
f61f742
chore(deps): update dependency @edx/frontend-build to v13.0.4 (#641)
renovate[bot] Nov 6, 2023
02a683f
fix: end date error when certificate row not shown (#668)
KristinAoki Nov 7, 2023
05e90b5
fix: fidelity typo in preference api (#662)
KristinAoki Nov 7, 2023
2cfde7d
fix(deps): update dependency @edx/frontend-component-header to v4.9.3…
renovate[bot] Nov 7, 2023
4a3d1a1
fix(deps): update dependency @edx/frontend-lib-content-components to …
renovate[bot] Nov 7, 2023
3dac6aa
fix: modal exit redirect (#659)
KristinAoki Nov 7, 2023
78eb512
refactor: files-and-videos folder (#672)
KristinAoki Nov 8, 2023
7c7b3cd
feat: remove old/duplicate proctoring component (#671)
zacharis278 Nov 9, 2023
56dbdd2
feat: add taxonomy detail page
rpenido Nov 11, 2023
e41efba
feat: opt out is not supported by lti proctoring (#673)
zacharis278 Nov 13, 2023
2fbb490
fix: total file count update on add and delete (#681)
KristinAoki Nov 13, 2023
3378c8e
fix: combine filter and sort into one modal (#680)
KristinAoki Nov 13, 2023
7c7ea1f
fix: active transcript preference not loading (#682)
KristinAoki Nov 14, 2023
1ee80b6
feat: Taxonomy export menu [FC-0036] (#645)
ChrisChV Nov 14, 2023
ce9db57
fix: table search filter (#683)
KristinAoki Nov 14, 2023
14e3c25
fix(deps): update dependency @edx/brand to v1.2.3 (#667)
renovate[bot] Nov 15, 2023
416ac4f
chore(deps): update dependency @edx/frontend-build to v13.0.5 (#676)
renovate[bot] Nov 15, 2023
2804f38
chore(deps): update dependency axios-mock-adapter to v1.22.0 (#678)
renovate[bot] Nov 15, 2023
9c582ed
Merge branch 'master' into rpenido/fal-3529-bare-bones-taxonomy-detai…
pomegranited Nov 15, 2023
9df1699
fix: address nits in PR review
pomegranited Nov 15, 2023
0fdaa07
refactor: move data/selectors to data/apiHooks
pomegranited Nov 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ Developing

If your devstack includes the default Demo course, you can visit the following URLs to see content:

- `Proctored Exam Settings <http://localhost:2001/course/course-v1:edX+DemoX+Demo_Course/proctored-exam-settings>`_
- `Pages and Resources <http://localhost:2001/course/course-v1:edX+DemoX+Demo_Course/pages-and-resources>`_

Troubleshooting
Expand Down
21,846 changes: 10,949 additions & 10,897 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
"@edx/frontend-component-footer": "^12.3.0",
"@edx/frontend-component-header": "^4.7.0",
"@edx/frontend-enterprise-hotjar": "^2.0.0",
"@edx/frontend-lib-content-components": "1.175.0",
"@edx/frontend-lib-content-components": "1.175.1",
"@edx/frontend-platform": "5.6.1",
"@edx/paragon": "^20.45.4",
"@edx/paragon": "^21.5.6",
"@fortawesome/fontawesome-svg-core": "1.2.36",
"@fortawesome/free-brands-svg-icons": "5.15.4",
"@fortawesome/free-regular-svg-icons": "5.15.4",
Expand All @@ -67,7 +67,7 @@
"react-router": "6.16.0",
"react-router-dom": "6.16.0",
"react-textarea-autosize": "^8.4.1",
"react-transition-group": "4.4.1",
"react-transition-group": "4.4.5",
"redux": "4.0.5",
"regenerator-runtime": "0.13.7",
"universal-cookie": "^4.0.4",
Expand All @@ -76,15 +76,15 @@
},
"devDependencies": {
"@edx/browserslist-config": "1.2.0",
"@edx/frontend-build": "13.0.1",
"@edx/frontend-build": "13.0.5",
"@edx/reactifex": "^1.0.3",
"@edx/stylelint-config-edx": "^2.3.0",
"@edx/typescript-config": "^1.0.1",
"@testing-library/jest-dom": "5.17.0",
"@testing-library/react": "12.1.5",
"@testing-library/user-event": "^13.2.1",
"@wojtekmaj/enzyme-adapter-react-17": "0.8.0",
"axios-mock-adapter": "1.20.0",
"axios-mock-adapter": "1.22.0",
"enzyme": "3.11.0",
"enzyme-to-json": "^3.6.2",
"glob": "7.2.3",
Expand Down
7 changes: 4 additions & 3 deletions src/CourseAuthoringRoutes.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react';
import { Routes, Route, useParams } from 'react-router-dom';
import {
Navigate, Routes, Route, useParams,
} from 'react-router-dom';
import { PageWrap } from '@edx/frontend-platform/react';
import Placeholder from '@edx/frontend-lib-content-components';
import CourseAuthoringPage from './CourseAuthoringPage';
import { PagesAndResources } from './pages-and-resources';
import ProctoredExamSettings from './proctored-exam-settings/ProctoredExamSettings';
import EditorContainer from './editors/EditorContainer';
import VideoSelectorContainer from './selectors/VideoSelectorContainer';
import CustomPages from './custom-pages';
Expand Down Expand Up @@ -61,7 +62,7 @@ const CourseAuthoringRoutes = () => {
/>
<Route
path="proctored-exam-settings"
element={<PageWrap><ProctoredExamSettings courseId={courseId} /></PageWrap>}
element={<Navigate replace to={`/course/${courseId}/pages-and-resources`} />}
/>
<Route
path="custom-pages/*"
Expand Down
24 changes: 0 additions & 24 deletions src/CourseAuthoringRoutes.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import initializeStore from './store';

const courseId = 'course-v1:edX+TestX+Test_Course';
const pagesAndResourcesMockText = 'Pages And Resources';
const proctoredExamSeetingsMockText = 'Proctored Exam Settings';
const editorContainerMockText = 'Editor Container';
const videoSelectorContainerMockText = 'Video Selector Container';
const customPagesMockText = 'Custom Pages';
Expand Down Expand Up @@ -36,10 +35,6 @@ jest.mock('./pages-and-resources/PagesAndResources', () => (props) => {
mockComponentFn(props);
return pagesAndResourcesMockText;
});
jest.mock('./proctored-exam-settings/ProctoredExamSettings', () => (props) => {
mockComponentFn(props);
return proctoredExamSeetingsMockText;
});
jest.mock('./editors/EditorContainer', () => (props) => {
mockComponentFn(props);
return editorContainerMockText;
Expand Down Expand Up @@ -76,25 +71,6 @@ describe('<CourseAuthoringRoutes>', () => {
);

expect(screen.getByText(pagesAndResourcesMockText)).toBeVisible();
expect(screen.queryByText(proctoredExamSeetingsMockText)).not.toBeInTheDocument();
expect(mockComponentFn).toHaveBeenCalledWith(
expect.objectContaining({
courseId,
}),
);
});

it('renders the ProctoredExamSettings component when the proctored exam settings route is active', () => {
render(
<AppProvider store={store} wrapWithRouter={false}>
<MemoryRouter initialEntries={['/proctored-exam-settings']}>
<CourseAuthoringRoutes />
</MemoryRouter>
</AppProvider>,
);

expect(screen.queryByText(proctoredExamSeetingsMockText)).toBeInTheDocument();
expect(screen.queryByText(pagesAndResourcesMockText)).not.toBeInTheDocument();
expect(mockComponentFn).toHaveBeenCalledWith(
expect.objectContaining({
courseId,
Expand Down
13 changes: 3 additions & 10 deletions src/custom-pages/CustomPages.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React, { useEffect, useContext, useState } from 'react';
import PropTypes from 'prop-types';
import {
Routes, Route, useLocation, useNavigate,
} from 'react-router-dom';
import { Routes, Route, useNavigate } from 'react-router-dom';
import { useDispatch, useSelector } from 'react-redux';
import { AppContext, PageWrap } from '@edx/frontend-platform/react';
import { injectIntl, FormattedMessage, intlShape } from '@edx/frontend-platform/i18n';
Expand Down Expand Up @@ -53,13 +51,11 @@ const CustomPages = ({
const [orderedPages, setOrderedPages] = useState([]);
const [currentPage, setCurrentPage] = useState();
const [isOpen, open, close] = useToggle(false);
const [isEditModalOpen, openEditModal, closeEditModal] = useToggle(false);

const courseDetails = useModel('courseDetails', courseId);
document.title = getPageHeadTitle(courseDetails?.name, intl.formatMessage(messages.heading));

const { config } = useContext(AppContext);
const location = useLocation();
const learningCourseURL = `${config.LEARNING_BASE_URL}/course/${courseId}`;

useEffect(() => {
Expand All @@ -79,15 +75,14 @@ const CustomPages = ({
dispatch(updatePageOrder(courseId, newPageOrder));
};
const handleEditClose = () => (content) => {
navigate(location.pathname);
navigate(`/course/${courseId}/custom-pages`);
if (!content?.metadata) {
closeEditModal();
setCurrentPage(null);
return;
}
dispatch(updateSingleCustomPage({
blockId: currentPage,
metadata: { displayName: content.metadata.display_name },
onClose: closeEditModal,
setCurrentPage,
}));
};
Expand Down Expand Up @@ -192,7 +187,6 @@ const CustomPages = ({
deletePageStatus,
courseId,
setCurrentPage,
openEditModal,
}}
/>
</SortableItem>
Expand Down Expand Up @@ -262,7 +256,6 @@ const CustomPages = ({
<PageWrap>
<EditModal
courseId={courseId}
isOpen={isEditModalOpen}
pageId={currentPage}
onClose={handleEditClose}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import {
} from '@edx/paragon';
import { ContentCopy, InfoOutline } from '@edx/paragon/icons';

import { getFileSizeToClosestByte } from '../data/utils';
import { getFileSizeToClosestByte } from '../generic/utils';
import messages from './messages';

const FileInfoAssetSidebar = ({
const FileInfoModalSidebar = ({
asset,
handleLockedAsset,
// injected
Expand Down Expand Up @@ -109,7 +109,7 @@ const FileInfoAssetSidebar = ({
</Stack>
);
};
FileInfoAssetSidebar.propTypes = {
FileInfoModalSidebar.propTypes = {
asset: PropTypes.shape({
displayName: PropTypes.string.isRequired,
wrapperType: PropTypes.string.isRequired,
Expand All @@ -127,4 +127,4 @@ FileInfoAssetSidebar.propTypes = {
intl: intlShape.isRequired,
};

export default injectIntl(FileInfoAssetSidebar);
export default injectIntl(FileInfoModalSidebar);
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import {
Icon,
Image,
} from '@edx/paragon';
import { getSrc } from '../data/utils';
import { getSrc } from './data/utils';
import messages from './messages';

const AssetThumbnail = ({
const FileThumbnail = ({
thumbnail,
wrapperType,
externalUrl,
Expand Down Expand Up @@ -50,13 +50,13 @@ const AssetThumbnail = ({
</div>
);
};
AssetThumbnail.defaultProps = {
FileThumbnail.defaultProps = {
thumbnail: null,
wrapperType: null,
externalUrl: null,
displayName: null,
};
AssetThumbnail.propTypes = {
FileThumbnail.propTypes = {
thumbnail: PropTypes.string,
wrapperType: PropTypes.string,
externalUrl: PropTypes.string,
Expand All @@ -69,4 +69,4 @@ AssetThumbnail.propTypes = {
intl: intlShape.isRequired,
};

export default injectIntl(AssetThumbnail);
export default injectIntl(FileThumbnail);
Loading