Skip to content

Remove discounts dead code (sale views)#5916

Merged
lkostrowski merged 7 commits intomainfrom
remove-dead-code-3
Oct 1, 2025
Merged

Remove discounts dead code (sale views)#5916
lkostrowski merged 7 commits intomainfrom
remove-dead-code-3

Conversation

@lkostrowski
Copy link
Member

@lkostrowski lkostrowski commented Oct 1, 2025

Summary

This PR continues the dead code removal effort by cleaning up legacy sale-related views and components that are no longer used in the dashboard.

Changes

  • Removed SaleCreatePage component (src/discounts/components/SaleCreatePage/)

    • 148 lines of legacy React form code for creating sales
    • Included channel management, metadata handling, and discount configuration UI
  • Removed SaleCreate view (src/discounts/views/SaleCreate/)

    • 126 lines of view logic with GraphQL mutations
    • Channel listing management and modal handlers
    • Form submission handlers
  • Removed SaleDetails view (src/discounts/views/SaleDetails/)

    • 551 lines of complex view logic for managing sale details
    • Category, collection, product, and variant assignment dialogs
    • Bulk actions, pagination, and channel availability management
  • Removed SaleList view (src/discounts/views/SaleList/)

    • 229 lines of list view with filtering and sorting
    • Bulk delete functionality
  • Cleaned up SaleList filters (src/discounts/views/SaleList/filters.ts)

    • Removed unused filter logic (40 lines)
  • Removed GlobalConfigPluginPopupBody component (src/plugins/components/GlobalConfigPluginPopupBody.tsx)

    • 37 lines of unused plugin configuration UI
  • Cleaned up locale messages (locale/defaultMessages.json)

    • Removed 69 translation entries related to deleted components:
      • Sale creation/deletion confirmations
      • Unassign dialogs (categories, collections, products, variants)
      • Channel availability management messages
      • Status messages and error texts

File Statistics

  • 14 files changed: 2 insertions(+), 1,407 deletions(-)
  • Net reduction: 1,405 lines of unused code removed

Related Work

This PR builds on the previous dead code removal efforts in remove-dead-code-2 branch.

🤖 Generated with Claude Code

@lkostrowski lkostrowski requested a review from a team as a code owner October 1, 2025 07:45
@lkostrowski lkostrowski requested review from kzuraw and witoszekdev and removed request for a team October 1, 2025 07:45
@vercel
Copy link

vercel bot commented Oct 1, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
saleor-dashboard-storybook Ignored Ignored Preview Oct 1, 2025 7:50am

@changeset-bot
Copy link

changeset-bot bot commented Oct 1, 2025

⚠️ No Changeset found

Latest commit: 838bc29

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@lkostrowski lkostrowski marked this pull request as draft October 1, 2025 07:45
Base automatically changed from remove-dead-code-2 to main October 1, 2025 07:46
@codecov
Copy link

codecov bot commented Oct 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.58%. Comparing base (a01d3ba) to head (838bc29).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5916      +/-   ##
==========================================
+ Coverage   39.35%   39.58%   +0.22%     
==========================================
  Files        2649     2640       -9     
  Lines       42024    41777     -247     
  Branches     9481     9427      -54     
==========================================
- Hits        16540    16538       -2     
+ Misses      24226    23992     -234     
+ Partials     1258     1247      -11     

☔ 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.

@lkostrowski lkostrowski marked this pull request as ready for review October 1, 2025 07:50
Copilot AI review requested due to automatic review settings October 1, 2025 07:50
@lkostrowski lkostrowski added the skip changeset Use if your changes doesn't need entry in changelog label Oct 1, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes legacy sale-related views, components, and associated code that are no longer used in the dashboard. It's part of an ongoing effort to clean up dead code and reduce the codebase footprint.

  • Removes complete sale creation and detail management functionality including React components, view logic, and GraphQL handlers
  • Eliminates unused plugin configuration UI component
  • Cleans up associated locale messages and filter utilities

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/plugins/components/PluginsList/PluginAvailabilityStatusPopup/GlobalConfigPluginPopupBody.tsx Removes unused plugin configuration popup component
src/discounts/views/SaleList/index.ts Removes export file for SaleList view
src/discounts/views/SaleList/filters.ts Removes unused filter options and storage utilities
src/discounts/views/SaleList/SaleList.tsx Removes complete SaleList view component with bulk operations
src/discounts/views/SaleDetails/messages.ts Removes all message definitions for SaleDetails dialogs
src/discounts/views/SaleDetails/index.ts Removes export file for SaleDetails view
src/discounts/views/SaleDetails/handlers.ts Removes SaleDetails form submission handlers
src/discounts/views/SaleDetails/SaleDetails.tsx Removes complete SaleDetails view with complex management logic
src/discounts/views/SaleCreate/handlers.ts Removes SaleCreate form submission handlers
src/discounts/views/SaleCreate/consts.ts Removes SaleCreate form constants
src/discounts/views/SaleCreate/SaleCreate.tsx Removes complete SaleCreate view component
src/discounts/components/SaleCreatePage/index.ts Removes export file for SaleCreatePage component
src/discounts/components/SaleCreatePage/SaleCreatePage.tsx Removes complete SaleCreatePage form component
locale/defaultMessages.json Removes 69 translation entries for deleted sale components
Comments suppressed due to low confidence (1)

locale/defaultMessages.json:5340

  • The message entry 'UjoSZB' for unassigning collections appears to be related to sale operations but was not removed. This should be removed as part of the cleanup if it's only used in the deleted sale components.
  "UjoSZB": {
    "context": "dialog content",
    "string": "{counter,plural,one{Are you sure you want to unassign this collection?} other{Are you sure you want to unassign {displayQuantity} collections?}}"
  },

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@lkostrowski lkostrowski merged commit 953f59b into main Oct 1, 2025
32 of 37 checks passed
@lkostrowski lkostrowski deleted the remove-dead-code-3 branch October 1, 2025 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changeset Use if your changes doesn't need entry in changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants