Decathlon / vitamin-web

Decathlon Design System UI components for web applications
https://decathlon.github.io/vitamin-web
Apache License 2.0
279 stars 77 forks source link

fix(@vtmn/svelte, @vtmn/react, @vtmn/vue): fix rounded value on `VtmnRating` #1378

Closed Tlahey closed 1 year ago

Tlahey commented 1 year ago

Changes description

After checking the Decathlon website, I saw many products that the stars are stuck at 4.5.

image

But some of them are a rating > 4.7.

Context

The rule on the current component is :

But here with a value > 4.5 we don't round.

The question here is, what we defined when a number is > 4.5. I've discuss with @lauthieb, we need to speak about it, maybe take the example of Google that round the value with the nearest one.

And write this rule on the Design System website so that there are no more questions about it.

Checklist

Does this introduce a breaking change?

No breaking changes

Other information

This PR aims to enhancer the storybook

Readonly = false Readonly = true
image image

Improve tests

lauthieb commented 1 year ago

Hi @Tlahey, Thanks for your PR, I just proposed you a meeting when you will be back to work next Monday to discuss about this. See you soon. Laurent

lauthieb commented 1 year ago

Thanks @Tlahey, that's ok for me! I also added it this fix for React & Vue implementation of the VtmnRating component.