-
Notifications
You must be signed in to change notification settings - Fork 177
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
Revert change to find parts by name when selling from parts in use #4665
Conversation
This reverts commit a4cc0f9 as it introduced a bug where several types of parts couldn't be sold.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4665 +/- ##
============================================
+ Coverage 10.23% 10.67% +0.44%
- Complexity 5706 5707 +1
============================================
Files 950 950
Lines 131272 131271 -1
Branches 19135 19131 -4
============================================
+ Hits 13434 14014 +580
+ Misses 116614 116034 -580
+ Partials 1224 1223 -1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flagging for some extra testing due to backwards compatibility requirements.
@@ -35,13 +35,14 @@ public PartInUse(Part part) { | |||
appendDetails(sb, part); | |||
} | |||
part.setUnit(u); | |||
this.id = part.getId(); | |||
this.name = part.getName(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this play with loading files from the previous version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the PartInUse is not actually stored in save files, at least in this context it's just a (lossy) model constructed for this dialog. When opening this dialog it loops through the warehouse and constructs PartInUse objects from them to provide this overview. It didn't look like they were saved after the dialog is closed but I will double check that when I'm back at a computer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. If PartInUse isn't being saved, then we can consider this good to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright yeah, I just double checked and it's not saved anywhere. The only part that is persistent is the IAcquisitionWork partToBuy
field, which is pulled from the Part
this is being constructed from and saved to the shopping list when buying items, but neither PR touched that object. So we should be good.
Commit a4cc0f9 introduced a bug where several types of parts could no longer be sold. This PR simply reverts it and goes back to looking up the target part by name rather than ID.
I agree with the original comment that it's not ideal to search by strings, but it appears there isn't really a better way to do it with how this dialog is constructed. I think there are some opportunities for refactoring it but I think those should be done in the future rather than now. Let me know what you think.
Closes #4663