8000 Fixes for issue #7004 - Purchase Unit Dialog Button Behavior by savanik · Pull Request #7005 · MegaMek/mekhq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fixes for issue #7004 - Purchase Unit Dialog Button Behavior #7005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2025

Conversation

savanik
Copy link
Contributor
@savanik savanik commented May 14, 2025

Fixes issue #7004. Gives buttons in the Purchase Unit dialog more consistent behavior by disabling the Purchase and Add(GM) button until a unit is selected. (Also lots of reformatting, apparently)

@savanik savanik requested a review from a team as a code owner May 14, 2025 21:50
@HammerGS HammerGS requested a review from Copilot May 14, 2025 22:27
Copy link
Contributor
@Copilot 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 addresses issue #7004 by ensuring that the Purchase and Add(GM) buttons in the Purchase Unit dialog are disabled until a unit is selected, resulting in a more consistent user experience.

  • Sets buttons to be disabled by default until a valid selection is made.
  • Refactors several code sections for improved clarity and consistency.
  • Reformats the complex filtering condition to improve readability.
Comments suppressed due to low confidence (1)

MekHQ/src/mekhq/gui/dialog/MekHQUnitSelectorDialog.java:278

  • [nitpick] The complex filtering logic in the include method, while functionally correct, could benefit from extraction into a dedicated helper method. This refactor would improve readability and simplify future maintenance.
/* Clan/IS limits */ && (campaign.getCampaignOptions().isAllowClanPurchases() || !TechConstants.isClan(mek.getType())) && (campaign.getCampaignOptions().isAllowISPurchases() || TechConstants.isClan(mek.getType())) ...

Copy link
codecov bot commented May 14, 2025

Codecov Report

Attention: Patch coverage is 0% with 22 lines in your changes missing coverage. Please review.

Project coverage is 11.99%. Comparing base (c24b3e0) to head (867f619).
Report is 114 commits behind head on master.

Files with missing lines Patch % Lines
.../src/mekhq/gui/dialog/MekHQUnitSelectorDialog.java 0.00% 22 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #7005      +/-   ##
============================================
- Coverage     12.03%   11.99%   -0.05%     
- Complexity     6852     6862      +10     
============================================
  Files          1101     1102       +1     
  Lines        141438   142148     +710     
  Branches      21917    21980      +63     
============================================
+ Hits          17026    17047      +21     
- Misses       122597   123277     +680     
- Partials       1815     1824       +9     

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

@HammerGS HammerGS merged commit 9882373 into MegaMek:master May 16, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
2A25
0