-
-
Notifications
You must be signed in to change notification settings - Fork 730
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add customer code to notify producer emails when enabled #13012
Add customer code to notify producer emails when enabled #13012
Conversation
312d097
to
604a47b
Compare
line_items.map do |line_item| | ||
customer_code = line_item.order.customer&.code | ||
@display_business_name = true if customer_code.present? |
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.
We only want to show the business name column if at least one customer has the code present. ref
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.
Simple logic, well done.
I don't like the conditional display of the column. But I wasn't part of the shaping phase here. No big deal anyway. 👍
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.
Nice one 👍
Hey @chahmedejaz , I've verified that:
Perhaps the indentation could be improved, not sure - it does not compromise reading, so I'd say this is good to go! Merging. |
9bfac66
into
openfoodfoundation:master
Hi @filipefurtad0 - Just to confirm, were you able to view the business name column if any of the mentioned customers had customer code present? The column is hidden if it's not present for any of the mentioned customers. |
Many thanks for spotting that missing test case @chahmedejaz - by bad, for skipping that one. I've edited the customer code from an existing customer, and also edited the First and Last names. This was done on the Then, I've placed a new order, for that customer and triggered the order cycle producer email. I can verify that if the customer has a customer code, the column is displayed together with the corresponding customer name: I've noticed that changes made on the customer data - like, editing the customer first- and last-name - were not reflected on the email. I'd say this is expected, as the changes on the This looks good to me 🟢 |
What? Why?
What should we test?
Release notes
Changelog Category (reviewers may add a label for the release notes):
The title of the pull request will be included in the release notes.
Dependencies
To test the text version of the report, this PR needs to be merged first:
However, the respective changes are also incorporated in the text version as well.