Persian language (#246)
* fix: corrected typos explaination -> explanation Critera -> Criteria addtional -> additional arbitary -> arbitrary penging -> pending downladFiles -> downloadFiles isLoadeed -> isLoaded selectror -> selector commnents -> comments stirng -> string isGragrding -> isGrading queu -> queue seleted -> selected feecback -> feedback * feat: Persian language (fa_IR) added * chore: Persian translations added * chore: sort language codes alphabetically * chore: camelCase variable used for translated messages * chore: deprecated styling updated --------- Co-authored-by: Leangseu Kim <lkim@edx.org>
This commit is contained in:
2
Makefile
2
Makefile
@@ -3,7 +3,7 @@ npm-install-%: ## install specified % npm package
|
|||||||
git add package.json
|
git add package.json
|
||||||
|
|
||||||
transifex_resource = frontend-app-ora-grading
|
transifex_resource = frontend-app-ora-grading
|
||||||
transifex_langs = "ar,fr,es_419,zh_CN,fr_CA,it_IT,pt_PT,de_DE,uk,ru,hi"
|
transifex_langs = "ar,de_DE,es_419,fa_IR,fr,fr_CA,hi,it_IT,pt_PT,uk,ru,zh_CN"
|
||||||
|
|
||||||
intl_imports = ./node_modules/.bin/intl-imports.js
|
intl_imports = ./node_modules/.bin/intl-imports.js
|
||||||
transifex_utils = ./node_modules/.bin/transifex-utils.js
|
transifex_utils = ./node_modules/.bin/transifex-utils.js
|
||||||
|
|||||||
@@ -26,4 +26,3 @@ There are only two requirements for a good `make target` name
|
|||||||
What `make validate-no-uncommitted-package-lock-changes` does is `git diff`s for any `package-lock.json` file changes in your project.
|
What `make validate-no-uncommitted-package-lock-changes` does is `git diff`s for any `package-lock.json` file changes in your project.
|
||||||
|
|
||||||
This is important because `npm` uses the pinned dependencies in your `package-lock.json` file to build the `node_modules` directory. However, the dependencies defined within the `package.json` file can be modified manually, for example, to become misaligned with the dependencies defined within the `package-lock.json`. So when `npm install` executes, the `package-lock.json` file will be updated to mirror the modified `package.json` changes.
|
This is important because `npm` uses the pinned dependencies in your `package-lock.json` file to build the `node_modules` directory. However, the dependencies defined within the `package.json` file can be modified manually, for example, to become misaligned with the dependencies defined within the `package-lock.json`. So when `npm install` executes, the `package-lock.json` file will be updated to mirror the modified `package.json` changes.
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,6 @@
|
|||||||
|
|
||||||
@include media-breakpoint-down(sm) {
|
@include media-breakpoint-down(sm) {
|
||||||
.file-card-title {
|
.file-card-title {
|
||||||
width: map-get($container-max-widths, "sm")/2;
|
width: calc(map-get($container-max-widths, "sm")/2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -163,7 +163,7 @@ describe('Criterion Feedback', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('mapStateToProps', () => {
|
describe('mapStateToProps', () => {
|
||||||
const testState = { abitaryState: 'some data' };
|
const testState = { arbitraryState: 'some data' };
|
||||||
const ownProps = { orderNum: props.orderNum };
|
const ownProps = { orderNum: props.orderNum };
|
||||||
let mapped;
|
let mapped;
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -40,14 +40,14 @@ describe('Radio Criterion Container', () => {
|
|||||||
feedback: 'feedback mock',
|
feedback: 'feedback mock',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
explanation: 'explaination',
|
explanation: 'explanation',
|
||||||
feedback: 'option feedback',
|
feedback: 'option feedback',
|
||||||
label: 'this label',
|
label: 'this label',
|
||||||
name: 'option name',
|
name: 'option name',
|
||||||
points: 1,
|
points: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
explanation: 'explaination 2',
|
explanation: 'explanation 2',
|
||||||
feedback: 'option feedback 2',
|
feedback: 'option feedback 2',
|
||||||
label: 'this label 2',
|
label: 'this label 2',
|
||||||
name: 'option name 2',
|
name: 'option name 2',
|
||||||
@@ -129,7 +129,7 @@ describe('Radio Criterion Container', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('mapStateToProps', () => {
|
describe('mapStateToProps', () => {
|
||||||
const testState = { arbitary: 'some data' };
|
const testState = { arbitrary: 'some data' };
|
||||||
const ownProps = { orderNum: props.orderNum };
|
const ownProps = { orderNum: props.orderNum };
|
||||||
let mapped;
|
let mapped;
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -29,14 +29,14 @@ describe('Review Crition Container', () => {
|
|||||||
feedback: 'feedback mock',
|
feedback: 'feedback mock',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
explanation: 'explaination',
|
explanation: 'explanation',
|
||||||
feedback: 'option feedback',
|
feedback: 'option feedback',
|
||||||
label: 'this label',
|
label: 'this label',
|
||||||
name: 'option name',
|
name: 'option name',
|
||||||
points: 1,
|
points: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
explanation: 'explaination 2',
|
explanation: 'explanation 2',
|
||||||
feedback: 'option feedback 2',
|
feedback: 'option feedback 2',
|
||||||
label: 'this label 2',
|
label: 'this label 2',
|
||||||
name: 'option name 2',
|
name: 'option name 2',
|
||||||
@@ -78,7 +78,7 @@ describe('Review Crition Container', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('mapStateToProps', () => {
|
describe('mapStateToProps', () => {
|
||||||
const testState = { arbitary: 'some data' };
|
const testState = { arbitrary: 'some data' };
|
||||||
const ownProps = { orderNum: props.orderNum };
|
const ownProps = { orderNum: props.orderNum };
|
||||||
let mapped;
|
let mapped;
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ exports[`Criterion Container snapshot is graded and is not grading 1`] = `
|
|||||||
this label
|
this label
|
||||||
</strong>
|
</strong>
|
||||||
<br />
|
<br />
|
||||||
explaination
|
explanation
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="help-popover-option"
|
className="help-popover-option"
|
||||||
@@ -29,7 +29,7 @@ exports[`Criterion Container snapshot is graded and is not grading 1`] = `
|
|||||||
this label 2
|
this label 2
|
||||||
</strong>
|
</strong>
|
||||||
<br />
|
<br />
|
||||||
explaination 2
|
explanation 2
|
||||||
</div>
|
</div>
|
||||||
</InfoPopover>
|
</InfoPopover>
|
||||||
</Form.Label>
|
</Form.Label>
|
||||||
@@ -67,7 +67,7 @@ exports[`Criterion Container snapshot is ungraded and is grading 1`] = `
|
|||||||
this label
|
this label
|
||||||
</strong>
|
</strong>
|
||||||
<br />
|
<br />
|
||||||
explaination
|
explanation
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="help-popover-option"
|
className="help-popover-option"
|
||||||
@@ -77,7 +77,7 @@ exports[`Criterion Container snapshot is ungraded and is grading 1`] = `
|
|||||||
this label 2
|
this label 2
|
||||||
</strong>
|
</strong>
|
||||||
<br />
|
<br />
|
||||||
explaination 2
|
explanation 2
|
||||||
</div>
|
</div>
|
||||||
</InfoPopover>
|
</InfoPopover>
|
||||||
</Form.Label>
|
</Form.Label>
|
||||||
@@ -115,7 +115,7 @@ exports[`Criterion Container snapshot is ungraded and is not grading 1`] = `
|
|||||||
this label
|
this label
|
||||||
</strong>
|
</strong>
|
||||||
<br />
|
<br />
|
||||||
explaination
|
explanation
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="help-popover-option"
|
className="help-popover-option"
|
||||||
@@ -125,7 +125,7 @@ exports[`Criterion Container snapshot is ungraded and is not grading 1`] = `
|
|||||||
this label 2
|
this label 2
|
||||||
</strong>
|
</strong>
|
||||||
<br />
|
<br />
|
||||||
explaination 2
|
explanation 2
|
||||||
</div>
|
</div>
|
||||||
</InfoPopover>
|
</InfoPopover>
|
||||||
</Form.Label>
|
</Form.Label>
|
||||||
|
|||||||
@@ -34,14 +34,14 @@ describe('Criterion Container', () => {
|
|||||||
feedback: 'feedback mock',
|
feedback: 'feedback mock',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
explanation: 'explaination',
|
explanation: 'explanation',
|
||||||
feedback: 'option feedback',
|
feedback: 'option feedback',
|
||||||
label: 'this label',
|
label: 'this label',
|
||||||
name: 'option name',
|
name: 'option name',
|
||||||
points: 2,
|
points: 2,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
explanation: 'explaination 2',
|
explanation: 'explanation 2',
|
||||||
feedback: 'option feedback 2',
|
feedback: 'option feedback 2',
|
||||||
label: 'this label 2',
|
label: 'this label 2',
|
||||||
name: 'option name 2',
|
name: 'option name 2',
|
||||||
@@ -89,16 +89,16 @@ describe('Criterion Container', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('is ungraded and is grading (Radio criterion get render)', () => {
|
test('is ungraded and is grading (Radio criterion get render)', () => {
|
||||||
const rubricCritera = el.find('.rubric-criteria');
|
const rubricCriteria = el.find('.rubric-criteria');
|
||||||
expect(rubricCritera.children(0).name()).toEqual('RadioCriterion');
|
expect(rubricCriteria.children(0).name()).toEqual('RadioCriterion');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('is ungraded and is not grading (Review criterion get render)', () => {
|
test('is ungraded and is not grading (Review criterion get render)', () => {
|
||||||
el.setProps({
|
el.setProps({
|
||||||
isGrading: false,
|
isGrading: false,
|
||||||
});
|
});
|
||||||
const rubricCritera = el.find('.rubric-criteria');
|
const rubricCriteria = el.find('.rubric-criteria');
|
||||||
expect(rubricCritera.children(0).name()).toEqual('ReviewCriterion');
|
expect(rubricCriteria.children(0).name()).toEqual('ReviewCriterion');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('is graded and is not grading (Radio criterion get render)', () => {
|
test('is graded and is not grading (Radio criterion get render)', () => {
|
||||||
@@ -106,13 +106,13 @@ describe('Criterion Container', () => {
|
|||||||
isGrading: false,
|
isGrading: false,
|
||||||
gradeStatus: gradeStatuses.graded,
|
gradeStatus: gradeStatuses.graded,
|
||||||
});
|
});
|
||||||
const rubricCritera = el.find('.rubric-criteria');
|
const rubricCriteria = el.find('.rubric-criteria');
|
||||||
expect(rubricCritera.children(0).name()).toEqual('RadioCriterion');
|
expect(rubricCriteria.children(0).name()).toEqual('RadioCriterion');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('mapStateToProps', () => {
|
describe('mapStateToProps', () => {
|
||||||
const testState = { abitaryState: 'some data' };
|
const testState = { arbitraryState: 'some data' };
|
||||||
const ownProps = { orderNum: props.orderNum };
|
const ownProps = { orderNum: props.orderNum };
|
||||||
let mapped;
|
let mapped;
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ const messages = defineMessages({
|
|||||||
optional: {
|
optional: {
|
||||||
id: 'ora-grading.CriterionFeedback.optional',
|
id: 'ora-grading.CriterionFeedback.optional',
|
||||||
defaultMessage: '(Optional)',
|
defaultMessage: '(Optional)',
|
||||||
description: 'addtional label for optional feedback field',
|
description: 'additional label for optional feedback field',
|
||||||
},
|
},
|
||||||
optionPoints: {
|
optionPoints: {
|
||||||
id: 'ora-grading.RadioCriterion.optionPoints',
|
id: 'ora-grading.RadioCriterion.optionPoints',
|
||||||
|
|||||||
@@ -63,8 +63,8 @@ export class SubmissionsTable extends React.Component {
|
|||||||
translate = (...args) => this.props.intl.formatMessage(...args);
|
translate = (...args) => this.props.intl.formatMessage(...args);
|
||||||
|
|
||||||
handleViewAllResponsesClick = (data) => () => {
|
handleViewAllResponsesClick = (data) => () => {
|
||||||
const getsubmissionUUID = (row) => row.original.submissionUUID;
|
const getSubmissionUUID = (row) => row.original.submissionUUID;
|
||||||
this.props.loadSelectionForReview(data.map(getsubmissionUUID));
|
this.props.loadSelectionForReview(data.map(getSubmissionUUID));
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ exports[`FileDownload component snapshot download is completed 1`] = `
|
|||||||
/>,
|
/>,
|
||||||
"pending": <FormattedMessage
|
"pending": <FormattedMessage
|
||||||
defaultMessage="Downloading"
|
defaultMessage="Downloading"
|
||||||
description="Download files penging state label"
|
description="Download files pending state label"
|
||||||
id="ora-grading.ResponseDisplay.SubmissionFiles.downloading"
|
id="ora-grading.ResponseDisplay.SubmissionFiles.downloading"
|
||||||
/>,
|
/>,
|
||||||
}
|
}
|
||||||
@@ -96,7 +96,7 @@ exports[`FileDownload component snapshot download is failed 1`] = `
|
|||||||
/>,
|
/>,
|
||||||
"pending": <FormattedMessage
|
"pending": <FormattedMessage
|
||||||
defaultMessage="Downloading"
|
defaultMessage="Downloading"
|
||||||
description="Download files penging state label"
|
description="Download files pending state label"
|
||||||
id="ora-grading.ResponseDisplay.SubmissionFiles.downloading"
|
id="ora-grading.ResponseDisplay.SubmissionFiles.downloading"
|
||||||
/>,
|
/>,
|
||||||
}
|
}
|
||||||
@@ -149,7 +149,7 @@ exports[`FileDownload component snapshot download is inactive 1`] = `
|
|||||||
/>,
|
/>,
|
||||||
"pending": <FormattedMessage
|
"pending": <FormattedMessage
|
||||||
defaultMessage="Downloading"
|
defaultMessage="Downloading"
|
||||||
description="Download files penging state label"
|
description="Download files pending state label"
|
||||||
id="ora-grading.ResponseDisplay.SubmissionFiles.downloading"
|
id="ora-grading.ResponseDisplay.SubmissionFiles.downloading"
|
||||||
/>,
|
/>,
|
||||||
}
|
}
|
||||||
@@ -202,7 +202,7 @@ exports[`FileDownload component snapshot download is pending 1`] = `
|
|||||||
/>,
|
/>,
|
||||||
"pending": <FormattedMessage
|
"pending": <FormattedMessage
|
||||||
defaultMessage="Downloading"
|
defaultMessage="Downloading"
|
||||||
description="Download files penging state label"
|
description="Download files pending state label"
|
||||||
id="ora-grading.ResponseDisplay.SubmissionFiles.downloading"
|
id="ora-grading.ResponseDisplay.SubmissionFiles.downloading"
|
||||||
/>,
|
/>,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ const messages = defineMessages({
|
|||||||
downloading: {
|
downloading: {
|
||||||
id: 'ora-grading.ResponseDisplay.SubmissionFiles.downloading',
|
id: 'ora-grading.ResponseDisplay.SubmissionFiles.downloading',
|
||||||
defaultMessage: 'Downloading',
|
defaultMessage: 'Downloading',
|
||||||
description: 'Download files penging state label',
|
description: 'Download files pending state label',
|
||||||
},
|
},
|
||||||
downloaded: {
|
downloaded: {
|
||||||
id: 'ora-grading.ResponseDisplay.SubmissionFiles.downloaded',
|
id: 'ora-grading.ResponseDisplay.SubmissionFiles.downloaded',
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ jest.mock('data/redux/grading/selectors', () => ({
|
|||||||
doesExist: (state) => ({ nextDoesExist: state }),
|
doesExist: (state) => ({ nextDoesExist: state }),
|
||||||
},
|
},
|
||||||
activeIndex: (state) => ({ activeIndex: state }),
|
activeIndex: (state) => ({ activeIndex: state }),
|
||||||
selectionLength: (state) => ({ selectionlength: state }),
|
selectionLength: (state) => ({ selectionLength: state }),
|
||||||
}));
|
}));
|
||||||
jest.mock('data/redux/requests/selectors', () => ({
|
jest.mock('data/redux/requests/selectors', () => ({
|
||||||
allowNavigation: (state) => ({ allowNavigation: state }),
|
allowNavigation: (state) => ({ allowNavigation: state }),
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ describe('ReviewContent component', () => {
|
|||||||
test('isFailed loads from requests.isFailed(fetchSubmission)', () => {
|
test('isFailed loads from requests.isFailed(fetchSubmission)', () => {
|
||||||
expect(mapped.isFailed).toEqual(selectors.requests.isFailed(testState, { requestKey }));
|
expect(mapped.isFailed).toEqual(selectors.requests.isFailed(testState, { requestKey }));
|
||||||
});
|
});
|
||||||
test('isLoadeed loads from requests.isCompleted(fetchSubmission)', () => {
|
test('isLoaded loads from requests.isCompleted(fetchSubmission)', () => {
|
||||||
expect(mapped.isLoaded).toEqual(selectors.requests.isCompleted(testState, { requestKey }));
|
expect(mapped.isLoaded).toEqual(selectors.requests.isCompleted(testState, { requestKey }));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ describe('DownloadErrors component', () => {
|
|||||||
});
|
});
|
||||||
describe('behavior', () => {
|
describe('behavior', () => {
|
||||||
describe('clearState', () => {
|
describe('clearState', () => {
|
||||||
it('calls props.clearState with requestKey: downladFiles', () => {
|
it('calls props.clearState with requestKey: downloadFiles', () => {
|
||||||
el.instance().cancelAction();
|
el.instance().cancelAction();
|
||||||
expect(props.clearState).toHaveBeenCalledWith({ requestKey: RequestKeys.downloadFiles });
|
expect(props.clearState).toHaveBeenCalledWith({ requestKey: RequestKeys.downloadFiles });
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ describe('Review Modal Submit Error hooks', () => {
|
|||||||
errorStatus = 'test-status';
|
errorStatus = 'test-status';
|
||||||
const mockErrorProps = (args) => ({
|
const mockErrorProps = (args) => ({
|
||||||
confirm: { confirm: args },
|
confirm: { confirm: args },
|
||||||
headingMessag: { headingMessage: args },
|
headingMessage: { headingMessage: args },
|
||||||
contentMessage: { contentMessage: args },
|
contentMessage: { contentMessage: args },
|
||||||
});
|
});
|
||||||
const mockProps = mockErrorProps({ dispatch, errorStatus });
|
const mockProps = mockErrorProps({ dispatch, errorStatus });
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ jest.mock('data/redux/grading/selectors', () => ({
|
|||||||
overallFeedback: jest.fn((...args) => ({
|
overallFeedback: jest.fn((...args) => ({
|
||||||
selectedOverallFeedback: args,
|
selectedOverallFeedback: args,
|
||||||
})),
|
})),
|
||||||
isGrading: jest.fn((...args) => ({ isGragrding: args })),
|
isGrading: jest.fn((...args) => ({ isGrading: args })),
|
||||||
},
|
},
|
||||||
validation: {
|
validation: {
|
||||||
overallFeedbackIsInvalid: jest.fn((...args) => ({
|
overallFeedbackIsInvalid: jest.fn((...args) => ({
|
||||||
@@ -44,7 +44,7 @@ jest.mock('data/redux/grading/selectors', () => ({
|
|||||||
describe('Rubric Feedback component', () => {
|
describe('Rubric Feedback component', () => {
|
||||||
const props = {
|
const props = {
|
||||||
intl: { formatMessage },
|
intl: { formatMessage },
|
||||||
config: 'config stirng',
|
config: 'config string',
|
||||||
isGrading: true,
|
isGrading: true,
|
||||||
value: 'some value',
|
value: 'some value',
|
||||||
isInvalid: false,
|
isInvalid: false,
|
||||||
@@ -135,7 +135,7 @@ describe('Rubric Feedback component', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('mapStateToProps', () => {
|
describe('mapStateToProps', () => {
|
||||||
const testState = { abitaryState: 'some data' };
|
const testState = { arbitraryState: 'some data' };
|
||||||
let mapped;
|
let mapped;
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
mapped = mapStateToProps(testState);
|
mapped = mapStateToProps(testState);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ exports[`Rubric Feedback component snapshot feedback value is invalid 1`] = `
|
|||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
defaultMessage="Overall comments"
|
defaultMessage="Overall comments"
|
||||||
description="Rubric overall commnents label"
|
description="Rubric overall comments label"
|
||||||
id="ora-grading.Rubric.overallComments"
|
id="ora-grading.Rubric.overallComments"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
@@ -53,7 +53,7 @@ exports[`Rubric Feedback component snapshot is graded 1`] = `
|
|||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
defaultMessage="Overall comments"
|
defaultMessage="Overall comments"
|
||||||
description="Rubric overall commnents label"
|
description="Rubric overall comments label"
|
||||||
id="ora-grading.Rubric.overallComments"
|
id="ora-grading.Rubric.overallComments"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
@@ -84,7 +84,7 @@ exports[`Rubric Feedback component snapshot is grading 1`] = `
|
|||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
defaultMessage="Overall comments"
|
defaultMessage="Overall comments"
|
||||||
description="Rubric overall commnents label"
|
description="Rubric overall comments label"
|
||||||
id="ora-grading.Rubric.overallComments"
|
id="ora-grading.Rubric.overallComments"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ describe('Rubric hooks', () => {
|
|||||||
afterEach(state.restore);
|
afterEach(state.restore);
|
||||||
describe('redux values', () => {
|
describe('redux values', () => {
|
||||||
beforeEach(() => { hook = hooks.reduxValues(); });
|
beforeEach(() => { hook = hooks.reduxValues(); });
|
||||||
test('loads gradeIsPending from isPending requests selectror on submitGrade request', () => {
|
test('loads gradeIsPending from isPending requests selector on submitGrade request', () => {
|
||||||
expect(hook.gradeIsPending.useSelector(testState)).toEqual(
|
expect(hook.gradeIsPending.useSelector(testState)).toEqual(
|
||||||
selectors.requests.isPending(testState, { requestKey: RequestKeys.submitGrade }),
|
selectors.requests.isPending(testState, { requestKey: RequestKeys.submitGrade }),
|
||||||
);
|
);
|
||||||
@@ -51,7 +51,7 @@ describe('Rubric hooks', () => {
|
|||||||
test('loads criteriaIndices from rubric selector', () => {
|
test('loads criteriaIndices from rubric selector', () => {
|
||||||
expect(hook.criteriaIndices).toEqual(useSelector(selectors.app.rubric.criteriaIndices));
|
expect(hook.criteriaIndices).toEqual(useSelector(selectors.app.rubric.criteriaIndices));
|
||||||
});
|
});
|
||||||
test('loads isCompleted from requests selectror on submitGrade request', () => {
|
test('loads isCompleted from requests selector on submitGrade request', () => {
|
||||||
expect(hook.isCompleted.useSelector(testState)).toEqual(
|
expect(hook.isCompleted.useSelector(testState)).toEqual(
|
||||||
selectors.requests.isCompleted(testState, { requestKey: RequestKeys.submitGrade }),
|
selectors.requests.isCompleted(testState, { requestKey: RequestKeys.submitGrade }),
|
||||||
);
|
);
|
||||||
@@ -62,7 +62,7 @@ describe('Rubric hooks', () => {
|
|||||||
test('loads isGrading from grading selector for selected submission', () => {
|
test('loads isGrading from grading selector for selected submission', () => {
|
||||||
expect(hook.isGrading).toEqual(useSelector(selectors.grading.selected.isGrading));
|
expect(hook.isGrading).toEqual(useSelector(selectors.grading.selected.isGrading));
|
||||||
});
|
});
|
||||||
test('loads lockIsPending from isPending requests selectror on setLock request', () => {
|
test('loads lockIsPending from isPending requests selector on setLock request', () => {
|
||||||
expect(hook.lockIsPending.useSelector(testState)).toEqual(
|
expect(hook.lockIsPending.useSelector(testState)).toEqual(
|
||||||
selectors.requests.isPending(testState, { requestKey: RequestKeys.setLock }),
|
selectors.requests.isPending(testState, { requestKey: RequestKeys.setLock }),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ const messages = defineMessages({
|
|||||||
overallComments: {
|
overallComments: {
|
||||||
id: 'ora-grading.Rubric.overallComments',
|
id: 'ora-grading.Rubric.overallComments',
|
||||||
defaultMessage: 'Overall comments',
|
defaultMessage: 'Overall comments',
|
||||||
description: 'Rubric overall commnents label',
|
description: 'Rubric overall comments label',
|
||||||
},
|
},
|
||||||
addComments: {
|
addComments: {
|
||||||
id: 'ora-grading.Rubric.addComments',
|
id: 'ora-grading.Rubric.addComments',
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ describe('app selectors unit tests', () => {
|
|||||||
test('rubricConfig selector returns rubricConfig from oraMetadata', () => {
|
test('rubricConfig selector returns rubricConfig from oraMetadata', () => {
|
||||||
testOraSelector(selectors.rubric.config, oraMetadata.rubricConfig);
|
testOraSelector(selectors.rubric.config, oraMetadata.rubricConfig);
|
||||||
});
|
});
|
||||||
test('fileUploadResponseConfig returns fileUploadResponseconfig from oraMetadata', () => {
|
test('fileUploadResponseConfig returns fileUploadResponseConfig from oraMetadata', () => {
|
||||||
testOraSelector(
|
testOraSelector(
|
||||||
selectors.ora.fileUploadResponseConfig,
|
selectors.ora.fileUploadResponseConfig,
|
||||||
oraMetadata.fileUploadResponseConfig,
|
oraMetadata.fileUploadResponseConfig,
|
||||||
@@ -184,11 +184,11 @@ describe('app selectors unit tests', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('shouldIncludeFeedback', () => {
|
describe('shouldIncludeFeedback', () => {
|
||||||
it('returns true iff the passed feedback is optional or required', () => {
|
it('returns true if the passed feedback is optional or required', () => {
|
||||||
expect(selectors.shouldIncludeFeedback(feedbackRequirement.optional)).toEqual(true);
|
expect(selectors.shouldIncludeFeedback(feedbackRequirement.optional)).toEqual(true);
|
||||||
expect(selectors.shouldIncludeFeedback(feedbackRequirement.required)).toEqual(true);
|
expect(selectors.shouldIncludeFeedback(feedbackRequirement.required)).toEqual(true);
|
||||||
expect(selectors.shouldIncludeFeedback(feedbackRequirement.disabled)).toEqual(false);
|
expect(selectors.shouldIncludeFeedback(feedbackRequirement.disabled)).toEqual(false);
|
||||||
expect(selectors.shouldIncludeFeedback('aribitrary')).toEqual(false);
|
expect(selectors.shouldIncludeFeedback('arbitrary')).toEqual(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('fillGradeData selector', () => {
|
describe('fillGradeData selector', () => {
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ const initialState = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the state's gradingData entry for the seleted submission,
|
* Updates the state's gradingData entry for the selected submission,
|
||||||
* overlaying the passed data on top of the existing data for the that
|
* overlaying the passed data on top of the existing data for the that
|
||||||
* submission.
|
* submission.
|
||||||
* @return {object} - new state
|
* @return {object} - new state
|
||||||
@@ -82,7 +82,7 @@ export const updateGradingData = (state, data) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the given state's gradingData entry for the seleted submission,
|
* Updates the given state's gradingData entry for the selected submission,
|
||||||
* overlaying the passed data on top of the existing data for the criterion
|
* overlaying the passed data on top of the existing data for the criterion
|
||||||
* at the given index (orderNum) for the rubric.
|
* at the given index (orderNum) for the rubric.
|
||||||
* @return {object} - new state
|
* @return {object} - new state
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ describe('app reducer', () => {
|
|||||||
describe('setCriterionFeedback', () => {
|
describe('setCriterionFeedback', () => {
|
||||||
it('loads feedback by orderNum', () => {
|
it('loads feedback by orderNum', () => {
|
||||||
expect(reducer(testState, actions.setCriterionFeedback(testState, args))).toEqual(
|
expect(reducer(testState, actions.setCriterionFeedback(testState, args))).toEqual(
|
||||||
mocks.updateCriterion(testState, orderNum, { feecback: testValue }),
|
mocks.updateCriterion(testState, orderNum, { feedback: testValue }),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export const next = {
|
|||||||
module.hasNext,
|
module.hasNext,
|
||||||
),
|
),
|
||||||
/**
|
/**
|
||||||
* Returns the submissionUUID for the next submission in the selection queu
|
* Returns the submissionUUID for the next submission in the selection queue
|
||||||
* @return {string} next submission id (null if there isn't one)
|
* @return {string} next submission id (null if there isn't one)
|
||||||
*/
|
*/
|
||||||
submissionUUID: createSelector(
|
submissionUUID: createSelector(
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ describe('selected submission grading selectors unit tests', () => {
|
|||||||
const { userDisplay } = selectors.selected;
|
const { userDisplay } = selectors.selected;
|
||||||
const username = 'USERname';
|
const username = 'USERname';
|
||||||
const teamName = 'teamNAME';
|
const teamName = 'teamNAME';
|
||||||
it('is a reselect selector based on the username, teamname, and whether the ORA is individual', () => {
|
it('is a reselect selector based on the username, teamName, and whether the ORA is individual', () => {
|
||||||
expect(userDisplay.preSelectors).toEqual([
|
expect(userDisplay.preSelectors).toEqual([
|
||||||
appSelectors.ora.isIndividual,
|
appSelectors.ora.isIndividual,
|
||||||
selectors.selected.username,
|
selectors.selected.username,
|
||||||
|
|||||||
@@ -131,8 +131,8 @@ describe('validation grading selectors unit tests', () => {
|
|||||||
let show;
|
let show;
|
||||||
let criterionFeedback;
|
let criterionFeedback;
|
||||||
const selector = selectors.validation.criterionFeedbackIsInvalid;
|
const selector = selectors.validation.criterionFeedbackIsInvalid;
|
||||||
const mockMethods = (showvalue, feedback) => {
|
const mockMethods = (showValue, feedback) => {
|
||||||
selectors.validation.show = () => showvalue;
|
selectors.validation.show = () => showValue;
|
||||||
selectors.validation.criterionFeedback = () => feedback;
|
selectors.validation.criterionFeedback = () => feedback;
|
||||||
};
|
};
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
@@ -168,8 +168,8 @@ describe('validation grading selectors unit tests', () => {
|
|||||||
describe('validation.criterionSelectedOptionIsInvalid selector', () => {
|
describe('validation.criterionSelectedOptionIsInvalid selector', () => {
|
||||||
const testState = { some: 'state' };
|
const testState = { some: 'state' };
|
||||||
let show;
|
let show;
|
||||||
const mockMethods = (showvalue, selectedValue) => {
|
const mockMethods = (showValue, selectedValue) => {
|
||||||
selectors.validation.show = () => showvalue;
|
selectors.validation.show = () => showValue;
|
||||||
selectors.validation.criterionSelectedOption.mockReturnValueOnce(selectedValue);
|
selectors.validation.criterionSelectedOption.mockReturnValueOnce(selectedValue);
|
||||||
};
|
};
|
||||||
const selector = selectors.validation.criterionSelectedOptionIsInvalid;
|
const selector = selectors.validation.criterionSelectedOptionIsInvalid;
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ describe('requests selectors unit tests', () => {
|
|||||||
expect(select(selectors.errorCode, { error: { response: { data: testValue } } }))
|
expect(select(selectors.errorCode, { error: { response: { data: testValue } } }))
|
||||||
.toEqual(testValue);
|
.toEqual(testValue);
|
||||||
});
|
});
|
||||||
test('data reurns the request data', () => {
|
test('data returns the request data', () => {
|
||||||
expect(select(selectors.data, { data: testValue })).toEqual(testValue);
|
expect(select(selectors.data, { data: testValue })).toEqual(testValue);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ describe('submission selectors unit tests', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
test('returns gradingStatus as GradeStatus iff lockstatus is lock, else lockStatus', () => {
|
test('returns gradingStatus as GradeStatus iff lockStatus is lock, else lockStatus', () => {
|
||||||
expect(output[0].gradingStatus).toEqual(submissions[1].gradeStatus);
|
expect(output[0].gradingStatus).toEqual(submissions[1].gradeStatus);
|
||||||
expect(output[1].gradingStatus).toEqual(submissions[2].lockStatus);
|
expect(output[1].gradingStatus).toEqual(submissions[2].lockStatus);
|
||||||
expect(output[2].gradingStatus).toEqual(submissions[0].lockStatus);
|
expect(output[2].gradingStatus).toEqual(submissions[0].lockStatus);
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ describe('download thunkActions', () => {
|
|||||||
expect(download.zipFiles).toHaveBeenCalledWith(files, blobs, username);
|
expect(download.zipFiles).toHaveBeenCalledWith(files, blobs, username);
|
||||||
});
|
});
|
||||||
it('network request catch all of the errors', () => {
|
it('network request catch all of the errors', () => {
|
||||||
const blobsErrors = ['arbitary', 'error'];
|
const blobsErrors = ['arbitrary', 'error'];
|
||||||
download.downloadBlobs = () => Promise.reject(blobsErrors);
|
download.downloadBlobs = () => Promise.reject(blobsErrors);
|
||||||
|
|
||||||
download.downloadFiles()(dispatch, getState);
|
download.downloadFiles()(dispatch, getState);
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ export const loadSubmission = () => (dispatch, getState) => {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Start grading the current submission.
|
* Start grading the current submission.
|
||||||
* Attempts to lock the submisison, and on a success, sets the local grading state to
|
* Attempts to lock the submission, and on a success, sets the local grading state to
|
||||||
* True, and then loads initializes the grading process with GradeData associated with
|
* True, and then loads initializes the grading process with GradeData associated with
|
||||||
* the current submission. If there is no grade data, generates an empty grade entry
|
* the current submission. If there is no grade data, generates an empty grade entry
|
||||||
* based on the rubric config.
|
* based on the rubric config.
|
||||||
@@ -85,7 +85,7 @@ export const startGrading = () => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancels the grading process for the current submisison.
|
* Cancels the grading process for the current submission.
|
||||||
* Releases the lock and dispatches stopGrading on success.
|
* Releases the lock and dispatches stopGrading on success.
|
||||||
*/
|
*/
|
||||||
export const cancelGrading = () => (dispatch, getState) => {
|
export const cancelGrading = () => (dispatch, getState) => {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ jest.mock('data/redux/grading/selectors', () => ({
|
|||||||
gradeData: jest.fn((state) => ({ gradeData: state })),
|
gradeData: jest.fn((state) => ({ gradeData: state })),
|
||||||
gradingData: jest.fn((state) => ({ gradingData: state })),
|
gradingData: jest.fn((state) => ({ gradingData: state })),
|
||||||
isGrading: jest.fn((state) => ({ isGrading: state })),
|
isGrading: jest.fn((state) => ({ isGrading: state })),
|
||||||
submissionUUID: jest.fn((state) => ({ selectedsubmissionUUID: state })),
|
submissionUUID: jest.fn((state) => ({ selectedSubmissionUUID: state })),
|
||||||
lockStatus: jest.fn((state) => ({ lockStatus: state })),
|
lockStatus: jest.fn((state) => ({ lockStatus: state })),
|
||||||
},
|
},
|
||||||
validation: {
|
validation: {
|
||||||
@@ -62,7 +62,7 @@ describe('grading thunkActions', () => {
|
|||||||
expect(actionArgs).not.toEqual(undefined);
|
expect(actionArgs).not.toEqual(undefined);
|
||||||
});
|
});
|
||||||
describe('fetchSubmissionArgs', () => {
|
describe('fetchSubmissionArgs', () => {
|
||||||
test('submissionUUID: selectors.grading.selected.submisssionUUID', () => {
|
test('submissionUUID: selectors.grading.selected.submissionUUID', () => {
|
||||||
expect(actionArgs.submissionUUID).toEqual(
|
expect(actionArgs.submissionUUID).toEqual(
|
||||||
selectedUUID,
|
selectedUUID,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export const initializeApp = ({ locationId, ...rest }) => (dispatch) => {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tracked fetchSubmissionStatus api method.
|
* Tracked fetchSubmissionStatus api method.
|
||||||
* Tracked to the `fetchSubmissinStatus` request key.
|
* Tracked to the `fetchSubmissionStatus` request key.
|
||||||
* @param {string} submissionUUID - target submission id
|
* @param {string} submissionUUID - target submission id
|
||||||
* @param {[func]} onSuccess - onSuccess method ((response) => { ... })
|
* @param {[func]} onSuccess - onSuccess method ((response) => { ... })
|
||||||
* @param {[func]} onFailure - onFailure method ((error) => { ... })
|
* @param {[func]} onFailure - onFailure method ((error) => { ... })
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ describe('requests thunkActions module', () => {
|
|||||||
[actions.requests.completeRequest({ requestKey, response: testData })],
|
[actions.requests.completeRequest({ requestKey, response: testData })],
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
it('on failure disaptches completeRequest', async () => {
|
it('on failure dispatches completeRequest', async () => {
|
||||||
await requests.networkRequest({ requestKey, promise: Promise.reject(testData) })(dispatch);
|
await requests.networkRequest({ requestKey, promise: Promise.reject(testData) })(dispatch);
|
||||||
expect(dispatch.mock.calls).toEqual([
|
expect(dispatch.mock.calls).toEqual([
|
||||||
[actions.requests.startRequest(requestKey)],
|
[actions.requests.startRequest(requestKey)],
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ const initializeApp = () => get(
|
|||||||
/**
|
/**
|
||||||
* get('/api/submission', { oraLocation, submissionUUID })
|
* get('/api/submission', { oraLocation, submissionUUID })
|
||||||
* @return {
|
* @return {
|
||||||
* submision: {
|
* submission: {
|
||||||
* gradeData,
|
* gradeData,
|
||||||
* gradeStatus,
|
* gradeStatus,
|
||||||
* response: { files: [{}], text: <html> },
|
* response: { files: [{}], text: <html> },
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* Simple selector factory.
|
* Simple selector factory.
|
||||||
* Takes a list of string keys, and returns a simple slector for each.
|
* Takes a list of string keys, and returns a simple selector for each.
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @param {Object|string[]} keys - If passed as object, Object.keys(keys) is used.
|
* @param {Object|string[]} keys - If passed as object, Object.keys(keys) is used.
|
||||||
|
|||||||
@@ -1,36 +1,38 @@
|
|||||||
import { messages as footerMessages } from '@edx/frontend-component-footer';
|
import { messages as footerMessages } from '@edx/frontend-component-footer';
|
||||||
import { messages as headerMesssages } from '@edx/frontend-component-header';
|
import { messages as headerMessages } from '@edx/frontend-component-header';
|
||||||
import { messages as paragonMessages } from '@edx/paragon';
|
import { messages as paragonMessages } from '@edx/paragon';
|
||||||
|
|
||||||
import arMessages from './messages/ar.json';
|
import arMessages from './messages/ar.json';
|
||||||
// no need to import en messages-- they are in the defaultMessage field
|
import deDEMessages from './messages/de_DE.json';
|
||||||
import es419Messages from './messages/es_419.json';
|
import es419Messages from './messages/es_419.json';
|
||||||
|
import faIRMessages from './messages/fa_IR.json';
|
||||||
import frMessages from './messages/fr.json';
|
import frMessages from './messages/fr.json';
|
||||||
import zhcnMessages from './messages/zh_CN.json';
|
import frCAMessages from './messages/fr_CA.json';
|
||||||
import dedeMessages from './messages/de_DE.json';
|
|
||||||
import frcaMessages from './messages/fr_CA.json';
|
|
||||||
import hiMessages from './messages/hi.json';
|
import hiMessages from './messages/hi.json';
|
||||||
import ititMessages from './messages/it_IT.json';
|
import itITMessages from './messages/it_IT.json';
|
||||||
import ptptMessages from './messages/pt_PT.json';
|
import ptPTMessages from './messages/pt_PT.json';
|
||||||
import ruMessages from './messages/ru.json';
|
import ruMessages from './messages/ru.json';
|
||||||
import ukMessages from './messages/uk.json';
|
import ukMessages from './messages/uk.json';
|
||||||
|
import zhCNMessages from './messages/zh_CN.json';
|
||||||
|
// no need to import en messages-- they are in the defaultMessage field
|
||||||
|
|
||||||
const appMessages = {
|
const appMessages = {
|
||||||
ar: arMessages,
|
ar: arMessages,
|
||||||
|
'de-de': deDEMessages,
|
||||||
'es-419': es419Messages,
|
'es-419': es419Messages,
|
||||||
|
'fa-ir': faIRMessages,
|
||||||
fr: frMessages,
|
fr: frMessages,
|
||||||
'zh-cn': zhcnMessages,
|
'fr-ca': frCAMessages,
|
||||||
'de-de': dedeMessages,
|
|
||||||
'fr-ca': frcaMessages,
|
|
||||||
hi: hiMessages,
|
hi: hiMessages,
|
||||||
'it-it': ititMessages,
|
'it-it': itITMessages,
|
||||||
'pt-pt': ptptMessages,
|
'pt-pt': ptPTMessages,
|
||||||
ru: ruMessages,
|
ru: ruMessages,
|
||||||
uk: ukMessages,
|
uk: ukMessages,
|
||||||
|
'zh-cn': zhCNMessages,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
headerMesssages,
|
headerMessages,
|
||||||
footerMessages,
|
footerMessages,
|
||||||
paragonMessages,
|
paragonMessages,
|
||||||
appMessages,
|
appMessages,
|
||||||
|
|||||||
1
src/i18n/messages/fa_IR.json
Normal file
1
src/i18n/messages/fa_IR.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
@@ -16,10 +16,10 @@ jest.mock('react-dom', () => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
jest.mock('@edx/frontend-component-footer', () => ({
|
jest.mock('@edx/frontend-component-footer', () => ({
|
||||||
messages: 'frotnend-footer-messages',
|
messages: 'frontend-footer-messages',
|
||||||
}));
|
}));
|
||||||
jest.mock('@edx/frontend-component-header', () => ({
|
jest.mock('@edx/frontend-component-header', () => ({
|
||||||
messages: 'frotnend-header-messages',
|
messages: 'frontend-header-messages',
|
||||||
}));
|
}));
|
||||||
|
|
||||||
jest.mock('@edx/frontend-platform', () => ({
|
jest.mock('@edx/frontend-platform', () => ({
|
||||||
|
|||||||
Reference in New Issue
Block a user