Wgu jesse stewart/instructor dashboard certificates bulk#190
Wgu jesse stewart/instructor dashboard certificates bulk#190wgu-jesse-stewart wants to merge 24 commits intoopenedx:mainfrom
Conversation
|
Thanks for the pull request, @wgu-jesse-stewart! 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❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #190 +/- ##
==========================================
+ Coverage 89.89% 90.15% +0.25%
==========================================
Files 139 139
Lines 2277 2376 +99
Branches 459 478 +19
==========================================
+ Hits 2047 2142 +95
- Misses 224 228 +4
Partials 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
307a2eb to
a685422
Compare
| }, | ||
| onError: (error) => { | ||
| showModal({ | ||
| title: MODAL_TITLES.ERROR, |
There was a problem hiding this comment.
maybe im catching this late, but i think this one should be an intl message, if not in other languages you would see Error without translation in the title
feat: bulk certificate exceptions CSV upload + certificates modal redesign
Description
Frontend counterpart to the new
BulkCertificateExceptionsViewendpoint. Adds CSV upload to the Grant Exceptions flow and redesigns the three certificate-management modals to match the latest design.What changes for users (course staff / instructors)
Grant Exceptions modal is now a tabbed dialog:
.csvonly, 5 MB max). The selected filename is shown with a confirmation banner. A "CSV Instructions" tooltip near the bottom of the panel explains the expected format (username/email in column 1, optional note in column 2).Partial-failure handling: when the CSV endpoint returns a mix of successes and errors, the modal closes, a toast reports the success count, and a warning modal lists each failed row as
learner: message. A pure error response shows a danger modal with the API's error message.Invalidate Certificate modal is now single-learner only. The label changes from "Learners" to "Username or Email", and the input from a comma-separated list to a single field. Title copy is singularized ("Invalidate Certificate"). Submit is Save and is disabled until a learner is entered.
Student Generated Certificates modal (formerly "Disable Certificates"):
smtomdand now has the standard header close (X). Footer buttons are Save / Close (replacing Confirm / Cancel).The invalidate button on the page header switched its
iconBeforefromClosetoCancelto match the new icon set.What changes for developers
uploadBulkExceptionsCsv(courseId, file)indata/api.ts— posts amultipart/form-datarequest with afilefield to/api/instructor/v2/courses/{courseId}/certificates/exceptions/bulk.useUploadBulkExceptionsCsv(courseId)indata/apiHook.ts— invalidates the per-course query key on success so the certificate tables refresh.CertificatesPageHeader'sonDisableCertificatesprop is renamed and made optional:onStudentGeneratedCertificates?: () => void. The dropdown item is conditionally rendered when the handler is provided.GrantExceptionsModalandInvalidateCertificateModalno longer wrapLearnerActionModal; they each own theirModalDialogmarkup.LearnerActionModalno longer has any consumers in this PR — leaving it in place to bound the diff, but it can be deleted in a follow-up if there are no other planned uses.getByRole('dialog')rather than matching the title string, and to use the new "Save" button label.User roles impacted
Supporting information
BulkCertificateExceptionsViewatPOST /api/instructor/v2/courses/{course_id}/certificates/exceptions/bulk. This frontend PR depends on that endpoint being available.Testing instructions
Backend dependency: bring up an LMS that includes the
BulkCertificateExceptionsViewendpoint. Without it the Bulk tab will surface a 404 from the API.Bulk CSV upload (happy path)
username,notesrows, e.g.:Bulk CSV upload (partial failure)
learner: message.Bulk CSV upload (full failure)
.csv-extension file with malformed content.Individual exception (regression)
user1).Invalidate Certificate
Student Generated Certificates
mdsize with a header close (X) and a checkbox reflecting the current enabled state.Run unit tests
Other information
BulkCertificateExceptionsViewPR.destination="#"and aTODOcomment — the documentation URL has not been finalized. The tooltip carries the actual format guidance for now, so the link is informational only.messages.tsincludes acsvUploadPendingkey that is no longer referenced after the real backend endpoint landed; can be removed in a follow-up i18n cleanup.LearnerActionModalis now unused by either consumer — kept in place to bound the diff; safe to delete in a follow-up.DropzoneonProcessUploadcallback walksfileData.values()because Paragon's typings here are loose; this matches the pattern used elsewhere in the codebase but is worth a second look from a reviewer familiar with that component.dialogrole (the tests assert this), and the form controls are labeled. The "More actions" dropdown toggle uses an explicit alt label.Best Practices Checklist
.ts,.tsx).propTypes,defaultProps, andinjectIntlpatterns are not used in any new or modified code.src/testUtils.tsx(specificallyinitializeMocks) — existing tests in this file use a localrenderWithAlertAndIntl/renderWithIntlhelper; new tests follow the existing pattern. Migrating toinitializeMockscan be a separate cleanup.useUploadBulkExceptionsCsvis a newuseMutation.)messages.tsfiles have adescriptionfor translators.../(uses@src/...).