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

Checkout summary: avoid carriage return on price #11105

Conversation

jibees
Copy link
Contributor

@jibees jibees commented Jun 22, 2023

Capture d’écran 2023-06-22 à 12 25 40

What? Why?

What should we test?

  • In shopfront, check that when a price with currency is displayed, it should display without carriage return

Release notes

Changelog Category: User facing changes

The title of the pull request will be included in the release notes.

Dependencies

Documentation updates

@jibees jibees self-assigned this Jun 22, 2023
@jibees jibees changed the title Checkout summary: avoid carriage return Checkout summary: avoid carriage return on price Jun 22, 2023
@jibees jibees force-pushed the 11098-summary-step-order-details-line-break-on-currency-symbol-and-lettering branch 3 times, most recently from 3173987 to 5c8e5d1 Compare June 26, 2023 11:46
@jibees jibees force-pushed the 11098-summary-step-order-details-line-break-on-currency-symbol-and-lettering branch from 5c8e5d1 to cd18e35 Compare July 4, 2023 12:59
Copy link
Member

@dacook dacook left a comment

Choose a reason for hiding this comment

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

Is this because someone accidentally entered a carriage return in the system config? Perhaps we should prevent that with validation (or simply strip it in the text input with pattern="".

This certainly solves it with the current data though 👍


Also I was curious to discover that we display prices with all the extra markup. And found that it's not on the shopfront or cart, only in the checkout summary.
Do you know why it's there and if it's necessary?

@jibees
Copy link
Contributor Author

jibees commented Jul 5, 2023

Is this because someone accidentally entered a carriage return in the system config?

Nop, it's because how the browser react to DOM.

Do you know why it's there and if it's necessary?

I noticed that also, but no... I'm not sure why it's used here and not in other places (as it should be I suppose)

@dacook
Copy link
Member

dacook commented Jul 6, 2023

Ohhh.. I see now, it's because there are spaces in the currency config, and the narrow columns caused it to wrap. Good fix 👍

Copy link
Collaborator

@rioug rioug left a comment

Choose a reason for hiding this comment

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

Nice one !

@drummer83 drummer83 self-assigned this Jul 13, 2023
@drummer83
Copy link
Contributor

Hi @jibees,
we have a failing spec here. Moving to In Dev.

@drummer83 drummer83 removed their assignment Jul 13, 2023
@filipefurtad0
Copy link
Contributor

Hey @drummer83 @jibees

The failing spec looks like:
#11010

So maybe we're good to test?

Any clue why failing looks more persistent on this branch @jibees ?

@jibees jibees force-pushed the 11098-summary-step-order-details-line-break-on-currency-symbol-and-lettering branch from cd18e35 to 1cf647e Compare July 17, 2023 12:00
@jibees
Copy link
Contributor Author

jibees commented Jul 17, 2023

Any clue why failing looks more persistent on this branch @jibees ?

Nop, locally, everything is fine

I've rebased the PR, and error is still present, and I think it's probably relevant. I should investigate, but I have no clue!

@jibees
Copy link
Contributor Author

jibees commented Jul 17, 2023

This is definitely flaky, and now it's green...

@drummer83 drummer83 self-assigned this Jul 19, 2023
@drummer83 drummer83 added the pr-staged-au staging.openfoodnetwork.org.au label Jul 19, 2023
@drummer83
Copy link
Contributor

Hi @jibees,
Thanks for this fix!

I can confirm that the /summary step of split checkout is fixed. I tested this for different screen sizes as well. 👍
image

We still see this issue for the order TOTAL on the /cart page and for payment and shipping fees (step 1 and 2 of split checkout) for some screen sizes. But this is out of scope here.
image
image

I think we are safe to merge this one. Thanks! 🙏

@drummer83 drummer83 merged commit d99ac35 into openfoodfoundation:master Jul 19, 2023
52 checks passed
@drummer83 drummer83 removed the pr-staged-au staging.openfoodnetwork.org.au label Jul 19, 2023
@jibees
Copy link
Contributor Author

jibees commented Jul 19, 2023

Yes, unfortunately, we don't use Spree::Money#to_html that much in the code, so my modification has only a little impact.

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.

[Checkout, Step 3, Order Details] Line break on currency (symbol and lettering)
5 participants