chore: remove deprecated coupons/codes feature and all ecommerce calls - #87
Draft
macdiesel wants to merge 5 commits into
Draft
chore: remove deprecated coupons/codes feature and all ecommerce calls#87macdiesel wants to merge 5 commits into
macdiesel wants to merge 5 commits into
Conversation
…ceApiService Remove all coupon/code management components, containers, and their associated redux slices (codeAssignment, codeRevoke, coupons). Delete EcommerceApiService.js and remove ECOMMERCE_BASE_URL from config. Remove CODE_MANAGEMENT feature flag. Deleted directories: - src/components/CodeAssignmentModal/ - src/components/CodeDeprecationAlert/ - src/components/CodeManagement/ - src/components/CodeModal/ - src/components/CodeReminderModal/ - src/components/CodeRevokeModal/ - src/components/CodeSearchResults/ - src/components/Coupon/ - src/components/CouponDetails/ - src/components/RequestCodesPage/ - src/components/SaveTemplateButton/ - src/components/NumberCard/ - src/components/RemindButton/ - src/components/RevokeButton/ - src/containers/CodeAssignmentModal/ - src/containers/CodeReminderModal/ - src/containers/CodeRevokeModal/ - src/containers/CouponDetails/ - src/containers/SaveTemplateButton/ Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…er-credit, subsidy-requests - Remove useEnterpriseOffer hook and all enterprise offer code paths - Simplify useBudgetId to only return subsidyAccessPolicyId - Remove useCoupons hook and coupons from EnterpriseSubsidiesContext - Remove EcommerceApiService.fetchCouponOrders from subsidy-requests - Remove ecommerce budget type and related UI branches - Remove coupon-related subsidy type constants and UI (banners, modals) - Remove orphaned EmailTemplateForm/TemplateSourceFields components - Remove emailTemplate actions/reducer/constants (only used by code modals) - Clean up settings, sidebar, and routes to remove code management props Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Rewrite EnterpriseSubsidiesContext hooks tests for new API surface - Update subsidy-requests hooks tests to remove coupon references - Remove orphaned test files for deleted components - Fix lint issues in modified test files - Inline email template constants in validation module Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remove ecommerce budget type test cases from BudgetCard tests - Update sidebar snapshot (Code Management entry removed) - Remove coupon code request notification tests from sidebar - Fix SubsidyRequestManagementTable hooks test - Rewrite EnterpriseSubsidiesContext index test - Fix SettingsAccessTab test references to coupons - Remove enterprise offer test cases from BudgetDetailPage - Fix portalConfiguration reducer test Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix SettingsAccessTab test syntax error from orphaned code blocks - Remove enterprise offer test cases from BudgetDetailPage spend table test - Remove unused mockEnterpriseOfferId reference Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #87 +/- ##
==========================================
+ Coverage 86.55% 87.32% +0.76%
==========================================
Files 822 759 -63
Lines 19436 17622 -1814
Branches 4029 3675 -354
==========================================
- Hits 16823 15388 -1435
+ Misses 2549 2146 -403
- Partials 64 88 +24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the deprecated "codes" / "coupon codes" / "coupons" feature from the admin portal frontend and eliminates all calls to the ecommerce backend (
EcommerceApiService).What was removed
Components/Containers (deleted entirely):
src/components/CodeAssignmentModal/src/components/CodeManagement/src/components/CodeModal/src/components/CodeReminderModal/src/components/CodeRevokeModal/src/components/CodeSearchResults/src/components/Coupon/src/components/CouponDetails/src/components/RequestCodesPage/src/components/CodeDeprecationAlert/src/components/EmailTemplateForm/src/components/TemplateSourceFields/src/containers/CodeAssignmentModal/src/containers/CodeReminderModal/src/containers/CodeRevokeModal/src/containers/CouponDetails/src/containers/SaveTemplateButton/src/containers/TemplateSourceFields/Services:
src/data/services/EcommerceApiService.js— all ecommerce API calls removedRedux slices:
src/data/actions/coupons.jssrc/data/actions/codeAssignment.jssrc/data/actions/codeReminder.jssrc/data/actions/codeRevoke.jssrc/data/actions/emailTemplate.jssrc/data/reducers/coupons.jssrc/data/reducers/emailTemplate.jssrc/data/constants/emailTemplate.jsHooks:
useEnterpriseOfferhook and its testuseCouponshook from EnterpriseSubsidiesContextuseApplicableCouponsfrom subsidy-request-modalsuseSubsidySummaryAnalyticsApino longer fetches for ecommerce budget typeOther:
NoAvailableCodesBannercomponentApproveCouponCodeRequestModalcomponentBUDGET_TYPES.ecommerceconstantROUTE_NAMES.codeManagementconstantSUBSIDY_TYPES.couponandSUPPORTED_SUBSIDY_TYPES.couponconstantsEliminates all calls to the ecommerce backend from this frontend.
Behavior Changes
/admin/coupons/*and/admin/coupons/request-codesno longer existcouponsis no longer inEnterpriseSubsidiesContextuseBudgetIdnow always treats the budgetId as asubsidyAccessPolicyId(UUID); enterprise offer integer IDs are no longer supportedenableCodeManagementScreen/enablePortalCodeManagementScreenprops removed from component treeRisks / Things Reviewers Should Verify
enterpriseOfferscontext valuesubsidyRequestsCounts.couponCodesvalue still exists in subsidy-requests hook (populated from enterprise-access API, not ecommerce) — sidebar no longer displays itNotes
@edx/frontend-enterprise-utilscontinue to use@2uinc/frontend-enterprise-utilsper edx-fork convention.