Skip to content

Commit

Permalink
fix: merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
muselesscreator committed Oct 3, 2023
1 parent 0bdcd8a commit 5f5c68b
Show file tree
Hide file tree
Showing 24 changed files with 366 additions and 556 deletions.
9 changes: 0 additions & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,7 @@ const { createConfig } = require('@edx/frontend-build');
const config = createConfig('eslint', {
rules: {
'import/no-unresolved': 'off',
'import/no-named-as-default': 'off',
},
overrides: [
{
files: ['*{h,H}ooks.js'],
rules: {
'react-hooks/rules-of-hooks': 'off',
},
},
],
});

config.rules['react/function-component-definition'][1].unnamedComponents = 'arrow-function';
Expand Down
3 changes: 0 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ const config = createConfig('jest', {
});

config.moduleDirectories = ['node_modules', 'src'];
<<<<<<< HEAD
=======

>>>>>>> 8f4b2e6 (chore: package updates)
// add axios to the list of modules to not transform
config.transformIgnorePatterns = ['/node_modules/(?!@edx|axios)'];

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"dependencies": {
"@edx/brand": "npm:@edx/[email protected]",
"@edx/frontend-component-footer": "12.2.1",
"@edx/frontend-component-header": "4.6.1",
"@edx/frontend-component-header": "4.6.0",
"@edx/frontend-platform": "5.4.0",
"@edx/paragon": "^20.20.0",
"@edx/react-unit-test-utils": "1.7.0",
Expand All @@ -51,7 +51,7 @@
"@tinymce/tinymce-react": "3.14.0",
"axios": "^1.5.1",
"classnames": "^2.3.2",
"core-js": "3.33.0",
"core-js": "3.32.2",
"filesize": "^8.0.6",
"jest-when": "^3.6.0",
"pdfjs-dist": "^3.11.174",
Expand Down
38 changes: 25 additions & 13 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,54 @@ import SelfAssessmentView from 'views/SelfAssessmentView';
import StudentTrainingView from 'views/StudentTrainingView';
import SubmissionView from 'views/SubmissionView';
import XBlockView from 'views/XBlockView';
import FilePreviewView from 'views/FilePreviewView';
import PageDataProvider from 'components/PageDataProvider';

import messages from './messages';
import routes from './routes';

const RouterRoot = () => {
const { formatMessage } = useIntl();
const appRoute = (route, Component) => (
<Route path={route} element={<AppContainer Component={Component} />} />
<Route
path={route}
element={(
<PageDataProvider>
<AppContainer Component={Component} />
</PageDataProvider>
)}
/>
);
const modalRoute = (route, Component, title) => (
<Route path={route} element={<ModalContainer {...{ title, Component }} />} />
<Route
path={route}
element={(
<PageDataProvider>
<ModalContainer {...{ title, Component }} />
</PageDataProvider>
)}
/>
);

const embeddedRoutes = [
<Route path={routes.embedded.xblock} element={<XBlockView />} />,
modalRoute(routes.embedded.peerAssessment, PeerAssessmentView, 'ORA Peer Assessment'),
modalRoute(routes.embedded.selfAssessment, SelfAssessmentView, 'ORA Self Assessment'),
modalRoute(routes.embedded.studentTraining, StudentTrainingView, 'ORA Student Training'),
modalRoute(routes.embedded.submission, SubmissionView, 'ORA Submission'),
modalRoute(routes.preview, FilePreviewView, 'File Preview'),
<Route path={routes.embedded.root} element={<ErrorPage message={formatMessage(messages.error404Message)} />} />,
<Route path={routes.xblockEmbed} element={<XBlockView />} />,
modalRoute(routes.peerAssessmentEmbed, PeerAssessmentView, 'ORA Peer Assessment'),
modalRoute(routes.selfAssessmentEmbed, SelfAssessmentView, 'ORA Self Assessment'),
modalRoute(routes.studentTrainingEmbed, StudentTrainingView, 'ORA Student Training'),
modalRoute(routes.submissionEmbed, SubmissionView, 'ORA Submission'),
<Route path={routes.rootEmbed} element={<ErrorPage message={formatMessage(messages.error404Message)} />} />,
];
const baseRoutes = [
appRoute(routes.xblock, PeerAssessmentView),
appRoute(routes.peerAssessment, PeerAssessmentView),
appRoute(routes.selfAssessment, SelfAssessmentView),
appRoute(routes.studentTraining, StudentTrainingView),
appRoute(routes.submission, SubmissionView),
appRoute(routes.preview, FilePreviewView),
<Route path={routes.root} element={<ErrorPage message={formatMessage(messages.error404Message)} />} />,
];

const isConfigLoaded = useIsORAConfigLoaded();
const isPageLoaded = useIsPageDataLoaded();

if (!isConfigLoaded || !isPageLoaded) {
if (!isConfigLoaded) {
return (
<div className="h-screen d-flex justify-content-center align-items-center">
<Spinner
Expand Down
182 changes: 21 additions & 161 deletions src/components/FileUpload/__snapshots__/index.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ exports[`<FileUpload /> render default 1`] = `
"accessor": "fileSize",
},
Object {
"Cell": "ActionCell",
"Cell": [Function],
"Header": "Actions",
"accessor": "actions",
},
Expand All @@ -50,177 +50,42 @@ exports[`<FileUpload /> render default 1`] = `
itemCount={2}
/>
</Fragment>
<Dropzone
multiple={true}
onProcessUpload={[MockFunction onProcessUpload]}
progressVariant="bar"
/>
<UploadConfirmModal
closeHandler={[MockFunction closeUploadModal]}
open={false}
uploadHandler={[MockFunction confirmUpload]}
/>
</div>
`;

exports[`<FileUpload /> render no uploaded files 1`] = `
<div>
<h3>
File Upload
</h3>
<Dropzone
multiple={true}
onProcessUpload={[MockFunction onProcessUpload]}
progressVariant="bar"
/>
<UploadConfirmModal
closeHandler={[MockFunction closeUploadModal]}
open={false}
uploadHandler={[MockFunction confirmUpload]}
/>
</div>
`;

exports[`<FileUpload /> render read only 1`] = `
<div>
<h3>
File Upload
</h3>
<Fragment>
<b>
Uploaded Files
</b>
<DataTable
columns={
Array [
Object {
"Header": "File Name",
"accessor": "fileName",
},
Object {
"Header": "File Description",
"accessor": "fileDescription",
},
Object {
"Header": "File Size",
"accessor": "fileSize",
},
Object {
"Cell": "ActionCell",
"Header": "Actions",
"accessor": "actions",
},
]
}
data={
Array [
Object {
"fileDescription": "file1 desc",
"fileName": "file1",
"fileSize": 100,
"size": "Unknown",
},
Object {
"fileDescription": "file2 desc",
"fileName": "file2",
"fileSize": 200,
"size": "Unknown",
},
]
}
itemCount={2}
<Dropzone
multiple={true}
onProcessUpload={[MockFunction onProcessUpload]}
progressVariant="bar"
/>
<UploadConfirmModal
closeHandler={[MockFunction closeUploadModal]}
open={false}
uploadHandler={[MockFunction confirmUpload]}
/>
</Fragment>
<UploadConfirmModal
closeHandler={[MockFunction closeUploadModal]}
open={false}
uploadHandler={[MockFunction confirmUpload]}
/>
</div>
`;

exports[`<FileUpload /> renders default 1`] = `
exports[`<FileUpload /> render no uploaded files 1`] = `
<div>
<h3>
File Upload
</h3>
<Fragment>
<b>
Uploaded Files
</b>
<DataTable
columns={
Array [
Object {
"Header": "File Name",
"accessor": "fileName",
},
Object {
"Header": "File Description",
"accessor": "fileDescription",
},
Object {
"Header": "File Size",
"accessor": "fileSize",
},
Object {
"Cell": [Function],
"Header": "Actions",
"accessor": "actions",
},
]
}
data={
Array [
Object {
"fileDescription": "file1 desc",
"fileName": "file1",
"fileSize": 100,
"size": "Unknown",
},
Object {
"fileDescription": "file2 desc",
"fileName": "file2",
"fileSize": 200,
"size": "Unknown",
},
]
}
itemCount={2}
<Dropzone
multiple={true}
onProcessUpload={[MockFunction onProcessUpload]}
progressVariant="bar"
/>
<UploadConfirmModal
closeHandler={[MockFunction closeUploadModal]}
open={false}
uploadHandler={[MockFunction confirmUpload]}
/>
</Fragment>
<Dropzone
multiple={true}
onProcessUpload={[MockFunction onProcessUpload]}
progressVariant="bar"
/>
<UploadConfirmModal
closeHandler={[MockFunction closeUploadModal]}
open={false}
uploadHandler={[MockFunction confirmUpload]}
/>
</div>
`;

exports[`<FileUpload /> renders no uploaded files 1`] = `
<div>
<h3>
File Upload
</h3>
<Dropzone
multiple={true}
onProcessUpload={[MockFunction onProcessUpload]}
progressVariant="bar"
/>
<UploadConfirmModal
closeHandler={[MockFunction closeUploadModal]}
open={false}
uploadHandler={[MockFunction confirmUpload]}
/>
</div>
`;

exports[`<FileUpload /> renders read only 1`] = `
exports[`<FileUpload /> render read only 1`] = `
<div>
<h3>
File Upload
Expand Down Expand Up @@ -270,10 +135,5 @@ exports[`<FileUpload /> renders read only 1`] = `
itemCount={2}
/>
</Fragment>
<UploadConfirmModal
closeHandler={[MockFunction closeUploadModal]}
open={false}
uploadHandler={[MockFunction confirmUpload]}
/>
</div>
`;
Loading

0 comments on commit 5f5c68b

Please sign in to comment.