Skip to content

Commit

Permalink
tl-its-umich-edu#1497 fix error message when all assignments are grad…
Browse files Browse the repository at this point in the history
  • Loading branch information
pushyamig authored Sep 13, 2023
1 parent c156cf8 commit 8204866
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
18 changes: 8 additions & 10 deletions assets/src/components/AssignmentGoalInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,14 @@ function AssignmentGoalInput (props) {
variant='outlined'
style={{ marginRight: '10px', width: '25ch' }}
/>
{
<Button
variant='contained'
className={classes.clearButton}
onClick={handleClearGoalGrades}
aria-label='clear'
>
Clear
</Button>
}
<Button
variant='contained'
className={classes.clearButton}
onClick={handleClearGoalGrades}
aria-label='clear'
>
Clear
</Button>
</Grid>
)
}
Expand Down
3 changes: 1 addition & 2 deletions assets/src/containers/AssignmentPlanningV2.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,7 @@ function AssignmentPlanningV2 (props) {
handleInputFocus={handleInputFocus}
handleInputBlur={handleInputBlur}
/>
</div>
)
</div>)
}
<UserSettingSnackbar
saved={!mutationError && !mutationLoading && settingChanged}
Expand Down
6 changes: 3 additions & 3 deletions assets/src/hooks/useMathWarning.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { useEffect, useState } from 'react'

const allAssignmentsAreGradedOrHasGoalGrade = assignments =>
assignments.filter(a => !(a.graded || a.goalGradeSetByUser)).length === 0
const allAssignmentsHasGoalGrade = assignments =>
assignments.filter(a => !(a.goalGradeSetByUser)).length === 0

const useMathWarning = assignments => {
const [showMathWarning, setShowMathWarning] = useState(false)

useEffect(() => {
if (allAssignmentsAreGradedOrHasGoalGrade(assignments)) {
if (allAssignmentsHasGoalGrade(assignments)) {
setShowMathWarning(true)
} else {
setShowMathWarning(false)
Expand Down

0 comments on commit 8204866

Please sign in to comment.