Skip to content

feat: add certificate management v2 API endpoints#181

Merged
wgu-jesse-stewart merged 15 commits into
openedx:mainfrom
WGU-Open-edX:wgu-jesse-stewart/instructor_dashboard_certificates_v2
Apr 27, 2026
Merged

feat: add certificate management v2 API endpoints#181
wgu-jesse-stewart merged 15 commits into
openedx:mainfrom
WGU-Open-edX:wgu-jesse-stewart/instructor_dashboard_certificates_v2

Conversation

@wgu-jesse-stewart

@wgu-jesse-stewart wgu-jesse-stewart commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Description

This PR migrates the Certificates page from using dummy data to consuming real backend APIs, making certificate management fully functional. The changes enable Course Authors and Operators to manage learner certificates through the instructor dashboard.

image image image image

Key changes:

  • Replaced dummy data with React Query hooks that fetch real certificate data from backend APIs
  • Implemented API integration for all certificate operations (grant exceptions, invalidate, remove exceptions/invalidations, regenerate)
  • Updated API endpoints to use the new instructor v2 API format
  • Added missing RemoveExceptionModal component for confirming exception removals
  • Improved error handling with partial success/failure support for bulk operations
  • Fixed UI components (dropdowns, popovers) to properly display action menus
  • Enhanced the regenerate button to show which filter is being applied
  • Added feature flag check to hide certificate management when disabled for a course

User roles impacted:

  • Course Authors: Can now manage certificate exceptions and invalidations
  • Operators: Can enable/disable certificate generation and regenerate certificates

Supporting information

This work connects the frontend to the backend certificate management APIs as part of the broader instructor dashboard modernization effort.

Testing instructions

  1. View issued certificates:

    • Navigate to a course's Certificates page
    • Verify the table loads with real certificate data
    • Test pagination, search, and filtering
  2. Grant exceptions:

    • Click "Grant exceptions" button
    • Enter learner usernames/emails (comma-separated)
    • Add notes and submit
    • Verify success toast and table updates with new exceptions
  3. Invalidate certificates:

    • Click "Invalidate certificates" button
    • Enter learner identifiers and notes
    • Submit and verify certificates are marked as invalidated
  4. Remove exceptions:

    • Filter by "Granted exceptions"
    • Click the three-dot menu on a row
    • Select "Remove exception"
    • Confirm in the modal
    • Verify the exception is removed
  5. Remove invalidations:

    • Filter by "Invalidated"
    • Use the action menu to remove an invalidation
    • Verify the certificate status is restored
  6. Regenerate certificates:

    • Select a filter (or use "All learners")
    • Click "Regenerate certificates for [filter]"
    • Verify task is triggered
  7. Disable certificates:

    • Click the three-dot menu in the header
    • Select "Disable certificates"
    • Confirm and verify certificate generation is disabled
  8. View generation history:

    • Switch to "Generation History" tab
    • Verify task history loads with dates and details

Other information

API changes:

  • All endpoints now use /api/instructor/v2/courses/{course_id}/certificates/* format
  • Bulk operations (grant exceptions, invalidate) now return partial success/error arrays
  • Remove operations accept username or email as identifier

Known limitations:

  • Certificate regeneration runs as a background task; status updates require page refresh

Best Practices Checklist

  • Any new files are using TypeScript (.ts, .tsx).
  • Deprecated propTypes, defaultProps, and injectIntl patterns are not used in any new or modified code.
  • Tests should use the helpers in src/testUtils.tsx (specifically initializeMocks)
  • Use React Query to load data from REST APIs. See any apiHooks.ts in this repo for examples.
  • All new i18n messages in messages.ts files have a description for translators to use.
  • Imports avoid using ../. To import from parent folders, use @src, e.g. import { initializeMocks } from '@src/testUtils'; instead of from '../../../../testUtils'

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Apr 24, 2026
@openedx-webhooks

openedx-webhooks commented Apr 24, 2026

Copy link
Copy Markdown

Thanks for the pull request, @wgu-jesse-stewart!

This repository is currently maintained by @openedx/committers-frontend-app-instructor-dashboard.

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 approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To 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:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where 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:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Apr 24, 2026
@wgu-jesse-stewart wgu-jesse-stewart changed the title Wgu jesse stewart/instructor dashboard certificates v2 feat: add certificate management v2 API endpoints Apr 24, 2026
@codecov

codecov Bot commented Apr 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.98496% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.84%. Comparing base (f1e6fec) to head (0659a5e).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/certificates/CertificatesPage.tsx 85.18% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #181      +/-   ##
==========================================
+ Coverage   88.78%   89.84%   +1.05%     
==========================================
  Files         133      138       +5     
  Lines        2006     2264     +258     
  Branches      411      480      +69     
==========================================
+ Hits         1781     2034     +253     
- Misses        219      222       +3     
- Partials        6        8       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wgu-jesse-stewart wgu-jesse-stewart marked this pull request as ready for review April 24, 2026 21:27
Comment thread src/certificates/CertificatesPage.tsx Outdated
Comment thread src/certificates/CertificatesPage.test.tsx Outdated
Comment thread src/certificates/data/apiHook.ts
Comment thread src/certificates/components/CertificateTable.tsx Outdated
Comment thread src/certificates/components/CertificatesToolbar.tsx Outdated
Comment thread src/certificates/data/api.ts Outdated
@wgu-jesse-stewart wgu-jesse-stewart merged commit 82fbea4 into openedx:main Apr 27, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Needs Triage to Done in Contributions Apr 27, 2026
@diana-villalvazo-wgu diana-villalvazo-wgu deleted the wgu-jesse-stewart/instructor_dashboard_certificates_v2 branch April 27, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants