Financial-Times / x-dash

:x::heavy_minus_sign::newspaper: shared front-end components for FT.com and the FT Apps
https://financial-times.github.io/x-dash
38 stars 6 forks source link

Bugfix: Gift Article Radio Buttons #693

Closed willhoward closed 1 year ago

willhoward commented 1 year ago

This PR fixes a bug whereby B2C users were erroneously seeing the 'Enterprise Sharing' option in the Gift Article radio buttons. This was happening because the specific logic controlling which radio buttons to display was quite confusing.

I've now separated out that logic. There's some minor repetition of code which I think is justified by making the logic clearer and easier to understand. I've also added a few code comment to explain it.

willhoward commented 1 year ago

Sure! At the moment if you're a B2C customer and you're viewing a paid article you'll see this:

Screenshot 2023-01-26 at 12 16 37

This isn't right because B2C customers shouldn't be seeing the 'Multiple recipients' Enterprise Sharing option. Enterprise Sharing is only available to users who are B2B or FT Staff. After the change if you're a B2C customer and you're viewing a paid article you'll see this:

Screenshot 2023-01-26 at 12 19 16