Skip to content
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

Fix : wrong value in VolumeUnits steps when creating a new rule #4889

Merged
merged 3 commits into from
Feb 19, 2025

Conversation

Atala
Copy link
Member

@Atala Atala commented Feb 6, 2025

No description provided.

@vladimir-8 vladimir-8 self-requested a review February 10, 2025 16:26

const newUnit = e.target.value

if (newUnit === 'vu') {
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a bug if the switch is between units that are both multiplied (kg, km); it needs an extra check that the current unit is 1000x (kg, km) and the newUnit is not (vu), and vice versa:

Screenshot 2025-02-10 at 14 35 17

Copy link
Contributor

Choose a reason for hiding this comment

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

May be add a helper to check if a unit is multiplied or not instead of hard-coding 'vu' to allow adding more units

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it should be refactored at a "higher level" to remove all these multiplication/division from the component, and just multiply by *1000 in the change handler if it kg/km
let's do that later when we have more time, knowing that the price screen is soon to be refactored

@Atala Atala requested a review from vladimir-8 February 17, 2025 15:55
@Atala Atala merged commit 13d6530 into master Feb 19, 2025
7 of 8 checks passed
@Atala Atala deleted the fix-price-range-input branch February 19, 2025 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants