Repository navigation
fix: show a toast when a grade import fails - #615
Anas12091101 wants to merge 1 commit into
Conversation
|
Thanks for the pull request, @Anas12091101! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## legacy-mfe #615 +/- ##
==============================================
+ Coverage 95.06% 95.14% +0.07%
==============================================
Files 139 139
Lines 1357 1379 +22
Branches 266 274 +8
==============================================
+ Hits 1290 1312 +22
Misses 59 59
Partials 8 8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟢 Approval recommended
The failure flow, state transitions, message formatting, navigation, and fallback behavior are coherent and adequately tested.
Pull request overview
Adds failure feedback for grade imports, complementing the companion backend behavior.
Changes:
- Adds a 15-second import-error toast with API details and history navigation.
- Coordinates success/error toast state across upload lifecycle events.
- Refactors error formatting and expands tests.
File summaries
| File | Description |
|---|---|
src/data/selectors/grades.test.js |
Tests error-message formatting. |
src/data/selectors/grades.js |
Adds reusable error-message selector. |
src/data/selectors/app.js |
Exposes error-toast state. |
src/data/redux/hooks/selectors.js |
Adds selector hooks. |
src/data/redux/hooks/actions.js |
Adds error-toast action hook. |
src/data/reducers/app.test.js |
Tests toast state transitions. |
src/data/reducers/app.js |
Manages mutually exclusive toast state. |
src/data/actions/app.js |
Adds error-toast action. |
src/components/GradesView/index.jsx |
Mounts the error toast. |
src/components/GradesView/ImportErrorToast/messages.js |
Defines localized messages. |
src/components/GradesView/ImportErrorToast/index.test.jsx |
Tests toast rendering. |
src/components/GradesView/ImportErrorToast/index.jsx |
Implements the toast component. |
src/components/GradesView/ImportErrorToast/hooks.test.js |
Tests toast behavior and content. |
src/components/GradesView/ImportErrorToast/hooks.js |
Provides toast data and handlers. |
Review details
- Files reviewed: 14/14 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
340dc3d to
eb74ea3
Compare
eb74ea3 to
8922a37
Compare
|
With #621, |
8922a37 to
abf66bb
Compare
|
@arbrandes sorry for the delay, I was on leave. I have now retargeted this PR at Could you review this with openedx/edx-bulk-grades#178 when you get a chance? |
|
@Anas12091101, the bug also exists in |
TL;DR - A successful grade import shows a toast at the bottom of the Gradebook, but a failed one shows nothing there — the error only appears if you click through to the Bulk Management History screen. This adds an error toast so both outcomes are reported where the operator actually pressed Import.
JIRA: n/a
What changed?
ImportErrorToast, shown oncsvUpload.error, displaying whatever message the API returned rather than wording of its own — so it covers future error types without further frontend work.csvUpload.started, so one upload is never described by the previous one's result.Toasthas novariantprop, so it is styled the same as the success toast and distinguished by its wording.bulkImportErrornow composes the newbulkImportErrorMessagesselector instead of duplicating its join logic.grade-import-final-narrated.webm
Developer Checklist
Testing Instructions
Needs the companion backend PR — openedx/edx-bulk-grades#178 — because on current
mastera file with nothing to apply is reported as a success, so there is no error for the toast to show.new_overridecolumn.new_overridecolumn and upload again. You should get the usual success toast, and no error toast.Reviewer Checklist
Collectively, these should be completed by reviewers of this PR:
FYI: @openedx/content-aurora