-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/ReCodEx/web-app into simp…
…le_exercise_form # Conflicts: # src/locales/cs.json # src/locales/en.json # src/redux/modules/exercises.js
- Loading branch information
Showing
23 changed files
with
268 additions
and
210 deletions.
There are no files selected for viewing
12 changes: 6 additions & 6 deletions
12
...lesTable/AdditionalFilesTableHeaderRow.js → ...lesTable/AttachmentFilesTableHeaderRow.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
import React from 'react'; | ||
import { FormattedMessage } from 'react-intl'; | ||
|
||
const AdditionalFilesTableHeaderRow = () => | ||
const AttachmentFilesTableHeaderRow = () => | ||
<tr> | ||
<th> | ||
<FormattedMessage | ||
id="app.additionalFilesTable.fileName" | ||
id="app.attachmentFilesTable.fileName" | ||
defaultMessage="Original filename" | ||
/> | ||
</th> | ||
<th> | ||
<FormattedMessage | ||
id="app.additionalFilesTable.url" | ||
id="app.attachmentFilesTable.url" | ||
defaultMessage="URL" | ||
/> | ||
</th> | ||
<th> | ||
<FormattedMessage | ||
id="app.additionalFilesTable.fileSize" | ||
id="app.attachmentFilesTable.fileSize" | ||
defaultMessage="Filesize" | ||
/> | ||
</th> | ||
<th> | ||
<FormattedMessage | ||
id="app.additionalFilesTable.fileUploadedAt" | ||
id="app.attachmentFilesTable.fileUploadedAt" | ||
defaultMessage="Uploaded at" | ||
/> | ||
</th> | ||
<th /> | ||
</tr>; | ||
|
||
export default AdditionalFilesTableHeaderRow; | ||
export default AttachmentFilesTableHeaderRow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
...nts/Exercises/AttachedFilesTable/index.js → src/components/Exercises/FilesTable/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
export default from './AttachedFilesTable'; | ||
export default from './FilesTable'; | ||
|
||
export { | ||
default as SupplementaryFilesTableRow | ||
} from './SupplementaryFilesTableRow'; | ||
export { | ||
default as SupplementaryFilesTableHeaderRow | ||
} from './SupplementaryFilesTableHeaderRow'; | ||
export { default as AdditionalFilesTableRow } from './AdditionalFilesTableRow'; | ||
export { default as AttachmentFilesTableRow } from './AttachmentFilesTableRow'; | ||
export { | ||
default as AdditionalFilesTableHeaderRow | ||
} from './AdditionalFilesTableHeaderRow'; | ||
default as AttachmentFilesTableHeaderRow | ||
} from './AttachmentFilesTableHeaderRow'; |
75 changes: 0 additions & 75 deletions
75
...containers/AdditionalExerciseFilesTableContainer/AdditionalExerciseFilesTableContainer.js
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
75 changes: 75 additions & 0 deletions
75
src/containers/AttachmentFilesTableContainer/AttachmentFilesTableContainer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { connect } from 'react-redux'; | ||
import ImmutablePropTypes from 'react-immutable-proptypes'; | ||
import { FormattedMessage } from 'react-intl'; | ||
|
||
import FilesTableContainer from '../FilesTableContainer'; | ||
import { | ||
AttachmentFilesTableRow, | ||
AttachmentFilesTableHeaderRow | ||
} from '../../components/Exercises/FilesTable'; | ||
|
||
import { | ||
fetchAttachmentFiles, | ||
addAttachmentFiles, | ||
removeAttachmentFile | ||
} from '../../redux/modules/attachmentFiles'; | ||
|
||
import { createGetAttachmentFiles } from '../../redux/selectors/attachmentFiles'; | ||
|
||
const AttachmentFilesTableContainer = ({ | ||
exercise, | ||
attachmentFiles, | ||
loadFiles, | ||
addFiles, | ||
removeFile | ||
}) => | ||
<FilesTableContainer | ||
uploadId={`attachment-exercise-files-${exercise.id}`} | ||
attachments={attachmentFiles} | ||
loadFiles={loadFiles} | ||
addFiles={addFiles} | ||
removeFile={removeFile} | ||
title={ | ||
<FormattedMessage | ||
id="app.attachmentFilesTable.title" | ||
defaultMessage="Attached files" | ||
/> | ||
} | ||
description={ | ||
<FormattedMessage | ||
id="app.attachmentFilesTable.description" | ||
defaultMessage="Attached files are files which can be used within exercise description using links provided below. Attached files can be viewed or downloaded by students." | ||
/> | ||
} | ||
HeaderComponent={AttachmentFilesTableHeaderRow} | ||
RowComponent={AttachmentFilesTableRow} | ||
/>; | ||
|
||
AttachmentFilesTableContainer.propTypes = { | ||
exercise: PropTypes.shape({ | ||
id: PropTypes.string.isRequired, | ||
attachmentFilesIds: PropTypes.array.isRequired | ||
}).isRequired, | ||
attachmentFiles: ImmutablePropTypes.map, | ||
loadFiles: PropTypes.func.isRequired, | ||
addFiles: PropTypes.func.isRequired, | ||
removeFile: PropTypes.func.isRequired | ||
}; | ||
|
||
export default connect( | ||
(state, { exercise }) => { | ||
const getAttachmentFiles = createGetAttachmentFiles( | ||
exercise.attachmentFilesIds | ||
); | ||
return { | ||
attachmentFiles: getAttachmentFiles(state) | ||
}; | ||
}, | ||
(dispatch, { exercise }) => ({ | ||
loadFiles: () => dispatch(fetchAttachmentFiles(exercise.id)), | ||
addFiles: files => dispatch(addAttachmentFiles(exercise.id, files)), | ||
removeFile: id => dispatch(removeAttachmentFile(exercise.id, id)) | ||
}) | ||
)(AttachmentFilesTableContainer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default from './AttachmentFilesTableContainer'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default from './FilesTableContainer'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.