@@ -101,6 +96,8 @@ EditModal.propTypes = {
closeModal: PropTypes.func.isRequired,
doneViewingAssignment: PropTypes.func.isRequired,
updateGrades: PropTypes.func.isRequired,
+ // injected
+ intl: intlShape.isRequired,
};
export const mapStateToProps = (state) => ({
@@ -114,4 +111,4 @@ export const mapDispatchToProps = {
updateGrades: thunkActions.grades.updateGrades,
};
-export default connect(mapStateToProps, mapDispatchToProps)(EditModal);
+export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(EditModal));
diff --git a/src/components/GradesView/EditModal/test.jsx b/src/components/GradesView/EditModal/test.jsx
index e1578692..c0f6cbf6 100644
--- a/src/components/GradesView/EditModal/test.jsx
+++ b/src/components/GradesView/EditModal/test.jsx
@@ -49,6 +49,8 @@ describe('EditModal', () => {
closeModal: jest.fn(),
doneViewingAssignment: jest.fn(),
updateGrades: jest.fn(),
+
+ intl: { formatMessage: (msg) => msg.defaultMessage },
};
});
diff --git a/src/components/GradesView/GradebookTable/__snapshots__/test.jsx.snap b/src/components/GradesView/GradebookTable/__snapshots__/test.jsx.snap
index 34effcd0..7bd40ff9 100644
--- a/src/components/GradesView/GradebookTable/__snapshots__/test.jsx.snap
+++ b/src/components/GradesView/GradebookTable/__snapshots__/test.jsx.snap
@@ -48,13 +48,7 @@ exports[`GradebookTable component snapshot - fields1 and 2 between email and tot
- }
+ content="No results found"
/>
diff --git a/src/components/GradesView/GradebookTable/index.jsx b/src/components/GradesView/GradebookTable/index.jsx
index 3203354a..9d753a34 100644
--- a/src/components/GradesView/GradebookTable/index.jsx
+++ b/src/components/GradesView/GradebookTable/index.jsx
@@ -4,7 +4,9 @@ import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { DataTable } from '@edx/paragon';
-import { FormattedMessage, getLocale, isRtl } from '@edx/frontend-platform/i18n';
+import {
+ FormattedMessage, getLocale, isRtl, injectIntl, intlShape,
+} from '@edx/frontend-platform/i18n';
import selectors from 'data/selectors';
import { Headings } from 'data/constants/grades';
@@ -44,21 +46,17 @@ export class GradebookTable extends React.Component {
return { Header: label, accessor: heading };
}
- mapRows(entry) {
- const dataRow = {
- [Headings.username]: (
-
- ),
- [Headings.email]: (),
- [Headings.totalGrade]: `${roundGrade(entry.percent * 100)}${isRtl(getLocale()) ? '\u200f' : ''}%`,
- };
- entry.section_breakdown.forEach(subsection => {
- dataRow[subsection.label] = (
-
- );
- });
- return dataRow;
- }
+ mapRows = entry => ({
+ [Headings.username]: (
+
+ ),
+ [Headings.email]: (),
+ [Headings.totalGrade]: `${roundGrade(entry.percent * 100)}${isRtl(getLocale()) ? '\u200f' : ''}%`,
+ ...entry.section_breakdown.reduce((acc, subsection) => ({
+ ...acc,
+ [subsection.label]: ,
+ }), {}),
+ });
nullMethod() {
return null;
@@ -77,7 +75,7 @@ export class GradebookTable extends React.Component {
>
- } />
+
);
@@ -106,6 +104,8 @@ GradebookTable.propTypes = {
user_name: PropTypes.string,
})),
headings: PropTypes.arrayOf(PropTypes.string).isRequired,
+ // injected
+ intl: intlShape.isRequired,
};
export const mapStateToProps = (state) => ({
@@ -113,4 +113,4 @@ export const mapStateToProps = (state) => ({
headings: selectors.root.getHeadings(state),
});
-export default connect(mapStateToProps)(GradebookTable);
+export default injectIntl(connect(mapStateToProps)(GradebookTable));
diff --git a/src/components/GradesView/GradebookTable/test.jsx b/src/components/GradesView/GradebookTable/test.jsx
index f144913b..6970e06d 100644
--- a/src/components/GradesView/GradebookTable/test.jsx
+++ b/src/components/GradesView/GradebookTable/test.jsx
@@ -80,6 +80,8 @@ describe('GradebookTable', () => {
fields.field2,
Headings.totalGrade,
],
+
+ intl: { formatMessage: (msg) => msg.defaultMessage },
};
test('snapshot - fields1 and 2 between email and totalGrade, mocked rows', () => {
el = shallow();
diff --git a/src/postcss.config.js b/src/postcss.config.js
deleted file mode 100644
index 71d41ef9..00000000
--- a/src/postcss.config.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/* I'm here to allow autoprefixing in webpack.prod.config.js */
-module.exports = {
- plugins: [
- require('autoprefixer')({ grid: true, browsers: ['>1%'] }),
- ],
-};
-