Skip to content

Commit b645d5d

Browse files
committed
fix: message error appears if the input is greater than the adjusted grade.
1 parent cf5e1a6 commit b645d5d

File tree

24 files changed

+102
-59
lines changed

24 files changed

+102
-59
lines changed

src/components/BulkManagementHistoryView/__snapshots__/HistoryTable.test.jsx.snap

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`HistoryTable component snapshot history table data (from bulkManagementHistory.map(this.formatHistoryRow) snapshot: maps resultsSummay to ResultsSummary, wraps filename and user, forwards the rest 1`] = `
4-
[
5-
{
4+
Array [
5+
Object {
66
"filename": <span
77
className="wrap-text-in-cell"
88
>
@@ -20,7 +20,7 @@ exports[`HistoryTable component snapshot history table data (from bulkManagement
2020
Eifel
2121
</span>,
2222
},
23-
{
23+
Object {
2424
"filename": <span
2525
className="wrap-text-in-cell"
2626
>
@@ -45,26 +45,26 @@ exports[`HistoryTable component snapshot snapshot - loads formatted table 1`] =
4545
<DataTable
4646
className="table-striped"
4747
columns={
48-
[
49-
{
48+
Array [
49+
Object {
5050
"Header": "Gradebook",
5151
"accessor": "filename",
5252
"columnSortable": false,
5353
"width": "col-5",
5454
},
55-
{
55+
Object {
5656
"Header": "Download Summary",
5757
"accessor": "resultsSummary",
5858
"columnSortable": false,
5959
"width": "col",
6060
},
61-
{
61+
Object {
6262
"Header": "Who",
6363
"accessor": "user",
6464
"columnSortable": false,
6565
"width": "col-1",
6666
},
67-
{
67+
Object {
6868
"Header": "When",
6969
"accessor": "timeUploaded",
7070
"columnSortable": false,
@@ -73,8 +73,8 @@ exports[`HistoryTable component snapshot snapshot - loads formatted table 1`] =
7373
]
7474
}
7575
data={
76-
[
77-
{
76+
Array [
77+
Object {
7878
"filename": <span
7979
className="wrap-text-in-cell"
8080
>
@@ -92,7 +92,7 @@ exports[`HistoryTable component snapshot snapshot - loads formatted table 1`] =
9292
Eifel
9393
</span>,
9494
},
95-
{
95+
Object {
9696
"filename": <span
9797
className="wrap-text-in-cell"
9898
>

src/components/BulkManagementHistoryView/__snapshots__/ResultsSummary.test.jsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ exports[`ResultsSummary component snapshot - safe hyperlink with bulkGradesUrl w
44
<Hyperlink
55
destination="www.edx.org"
66
href={
7-
{
8-
"url": {
7+
Object {
8+
"url": Object {
99
"rowId": 42,
1010
},
1111
}

src/components/GradebookFilters/AssignmentFilter/__snapshots__/index.test.jsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ exports[`AssignmentFilter component render snapshot 1`] = `
1010
label="Assignment"
1111
onChange={[MockFunction]}
1212
options={
13-
[
13+
Array [
1414
<option
1515
value=""
1616
>

src/components/GradebookFilters/AssignmentTypeFilter/__snapshots__/index.test.jsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ exports[`AssignmentFilterType component render snapshot 1`] = `
1010
label="Assignment Types"
1111
onChange={[MockFunction]}
1212
options={
13-
[
13+
Array [
1414
<option
1515
value=""
1616
>

src/components/GradebookFilters/StudentGroupsFilter/__snapshots__/index.test.jsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ exports[`StudentGroupsFilter component render snapshot 1`] = `
77
label="Tracks"
88
onChange={[MockFunction]}
99
options={
10-
[
10+
Array [
1111
<option
1212
value="Track-All"
1313
>
@@ -43,7 +43,7 @@ exports[`StudentGroupsFilter component render snapshot 1`] = `
4343
label="Cohorts"
4444
onChange={[MockFunction]}
4545
options={
46-
[
46+
Array [
4747
<option
4848
value="Cohort-All"
4949
>

src/components/GradesView/BulkManagementControls/__snapshots__/index.test.jsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ exports[`BulkManagementControls render snapshot - show - network and import butt
66
>
77
<NetworkButton
88
label={
9-
{
9+
Object {
1010
"defaultMessage": "Download Grades",
1111
"description": "A labeled button that allows an admin user to download course grades all at once (in bulk).",
1212
"id": "gradebook.GradesView.BulkManagementControls.bulkManagementLabel",

src/components/GradesView/EditModal/OverrideTable/AdjustedGradeInput/__snapshots__/index.test.jsx.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ exports[`AdjustedGradeInput component render snapshot 1`] = `
55
<Form.Control
66
name="adjustedGradeValue"
77
onChange={[MockFunction hook.onChange]}
8-
type="text"
8+
size="sm"
9+
type="number"
910
value="test-value"
1011
/>
1112
some-hint-text

src/components/GradesView/EditModal/OverrideTable/AdjustedGradeInput/hooks.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const useAdjustedGradeInputData = () => {
1515
value,
1616
onChange,
1717
hintText,
18+
possibleGrade,
1819
};
1920
};
2021

src/components/GradesView/EditModal/OverrideTable/AdjustedGradeInput/index.jsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import React from 'react';
22

33
import { Form } from '@openedx/paragon';
4+
import { useIntl } from '@edx/frontend-platform/i18n';
5+
import messages from '../messages';
46

57
import useAdjustedGradeInputData from './hooks';
68

@@ -13,17 +15,22 @@ export const AdjustedGradeInput = () => {
1315
const {
1416
value,
1517
onChange,
18+
possibleGrade,
1619
hintText,
1720
} = useAdjustedGradeInputData();
21+
22+
const { formatMessage } = useIntl();
23+
1824
return (
1925
<span>
2026
<Form.Control
21-
type="text"
27+
type="number"
2228
name="adjustedGradeValue"
2329
value={value}
2430
onChange={onChange}
31+
size="sm"
2532
/>
26-
{hintText}
33+
{value > possibleGrade ? <div style={{ color: 'red' }}>{ formatMessage(messages.adjustedGradeError)}</div> : hintText}
2734
</span>
2835
);
2936
};

src/components/GradesView/EditModal/OverrideTable/__snapshots__/index.test.jsx.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ exports[`OverrideTable component render snapshot 1`] = `
44
<DataTable
55
columns="test-columns"
66
data={
7-
[
8-
{
7+
Array [
8+
Object {
99
"test": "data",
1010
},
11-
{
11+
Object {
1212
"andOther": "test-data",
1313
},
14-
{
14+
Object {
1515
"adjustedGrade": <AdjustedGradeInput />,
16-
"date": {
16+
"date": Object {
1717
"formatted": 2000-01-01T00:00:00.000Z,
1818
},
1919
"reason": <ReasonInput />,

0 commit comments

Comments
 (0)