Skip to content

Commit

Permalink
refactor: upgraded frontend-build version to v12
Browse files Browse the repository at this point in the history
PR #254
  • Loading branch information
BilalQamar95 authored Jan 26, 2023
1 parent 85607d7 commit 6be4aac
Show file tree
Hide file tree
Showing 12 changed files with 10,212 additions and 8,245 deletions.
12 changes: 8 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line import/no-extraneous-dependencies
const { createConfig } = require('@edx/frontend-build');

const config = createConfig('eslint', {
Expand All @@ -6,19 +7,22 @@ const config = createConfig('eslint', {
'import/no-named-as-default-member': 'off',
'import/no-self-import': 'off',
'spaced-comment': ['error', 'always', { 'block': { 'exceptions': ['*'] } }],

// TOD: Remove this rule once we have a better way to handle this.
'import/no-import-module-exports': 'off',
'no-import-assign': 'off',
'default-param-last': 'off',
},
overrides: [{
files: ['*.test.js'], rules: { 'no-import-assign': 'off' },
}],
});

config.settings = {
"import/resolver": {
'import/resolver': {
node: {
paths: ["src", "node_modules"],
extensions: [".js", ".jsx"],
paths: ['src', 'node_modules'],
extensions: ['.js', '.jsx'],
},
},
};
Expand Down
18,416 changes: 10,189 additions & 8,227 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions src/components/GradesView/FilterBadges/test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@
import React from 'react';
import { shallow } from 'enzyme';

import * as constants from 'data/constants/filters';
import FilterBadges from '.';
import FilterBadge from './FilterBadge';

jest.mock('./FilterBadge', () => 'FilterBadge');

const order = ['filter1', 'filter2', 'filter3'];
jest.mock('data/constants/filters', () => ({
...jest.requireActual('data/constants/filters'),
badgeOrder: order,
}));

describe('FilterBadges', () => {
describe('component', () => {
let el;
let handleClose;
const order = ['filter1', 'filter2', 'filter3'];
beforeEach(() => {
handleClose = jest.fn().mockName('this.props.handleClose');
constants.badgeOrder = order;
el = shallow(<FilterBadges handleClose={handleClose} />);
});
test('snapshot - has a filterbadge with handleClose for each filter in badgeOrder', () => {
Expand Down
4 changes: 1 addition & 3 deletions src/components/GradesView/GradebookTable/Fields.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ Username.propTypes = {
* Simple label field for email value.
* @param {string} email - email for display
*/
const Email = ({ email }) => (
<span className="wrap-text-in-cell">{email}</span>
);
const Email = ({ email }) => <span className="wrap-text-in-cell">{email}</span>;
Email.propTypes = {
email: PropTypes.string.isRequired,
};
Expand Down
2 changes: 1 addition & 1 deletion src/data/reducers/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const initialState = {
searchValue: '',
};

const app = (state = initialState, { type, payload }) => {
const app = (state = initialState, { type, payload } = {}) => {
switch (type) {
case actions.closeModal.toString():
return { ...state, modalState: { ...initialState.modalState } };
Expand Down
2 changes: 1 addition & 1 deletion src/data/reducers/assignmentTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const initialState = {
errorFetching: false,
};

const assignmentTypes = (state = initialState, { type, payload }) => {
const assignmentTypes = (state = initialState, { type, payload } = {}) => {
switch (type) {
case actions.fetching.started.toString():
return {
Expand Down
2 changes: 1 addition & 1 deletion src/data/reducers/cohorts.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const initialState = {
errorFetching: false,
};

const cohorts = (state = initialState, action) => {
const cohorts = (state = initialState, action = {}) => {
switch (action.type) {
case actions.fetching.started.toString():
return {
Expand Down
2 changes: 1 addition & 1 deletion src/data/reducers/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import actions from '../actions/config';

const initialState = {};

const reducer = (state = initialState, action) => {
const reducer = (state = initialState, action = {}) => {
switch (action.type) {
case actions.gotBulkManagementConfig.toString():
return {
Expand Down
2 changes: 1 addition & 1 deletion src/data/reducers/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import initialFilters from '../constants/filters';

const initialState = {};

const reducer = (state = initialState, { type: actionType, payload }) => {
const reducer = (state = initialState, { type: actionType, payload } = {}) => {
switch (actionType) {
case actions.initialize.toString():
return {
Expand Down
2 changes: 1 addition & 1 deletion src/data/reducers/grades.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const initialState = {
isDownloadGradesActive: false,
};

const grades = (state = initialState, { type, payload }) => {
const grades = (state = initialState, { type, payload } = {}) => {
switch (type) {
case actions.banner.open.toString():
return {
Expand Down
2 changes: 1 addition & 1 deletion src/data/reducers/roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const initialState = {
canUserViewGradebook: true,
};

const roles = (state = initialState, action) => {
const roles = (state = initialState, action = {}) => {
switch (action.type) {
case actions.fetching.received.toString():
return {
Expand Down
2 changes: 1 addition & 1 deletion src/data/reducers/tracks.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const initialState = {
errorFetching: false,
};

const tracks = (state = initialState, action) => {
const tracks = (state = initialState, action = {}) => {
switch (action.type) {
case actions.fetching.started.toString():
return {
Expand Down

0 comments on commit 6be4aac

Please sign in to comment.