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 [customData] Extra validation #59

Merged
merged 3 commits into from
Jun 20, 2024

Conversation

ivanlopezluna
Copy link
Contributor

@ivanlopezluna ivanlopezluna commented May 22, 2024

What problem is this solving?

If there is another customApp in the customData, the "B2BQuotesLockingModal.tsx"component breaks on its own.

Step by step to replicate the issue

  1. Go to B2B and sign in as a member of an organization (if you need credentials to take the test, share your email to invite you as a member).
  2. Add a SKU to the cart, go to Checkout and complete the necessary information until the Shipping step.
  3. After going to Payment step, go back to Home and check how the Header will disappear.
Screenshot 2024-06-14 at 13 26 32 Screenshot 2024-06-14 at 13 26 39

How to test it?

Workspace

@vtex-io-docs-bot
Copy link

vtex-io-docs-bot bot commented May 22, 2024

Beep boop 🤖

I noticed you didn't make any changes at the docs/ folder

  • There's nothing new to document 🤔
  • I'll do it later 😞

In order to keep track, I'll create an issue if you decide now is not a good time

  • I just updated 🎉🎉

Copy link

vtex-io-ci-cd bot commented May 22, 2024

Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖

Please select which version do you want to release:

  • Patch (backwards-compatible bug fixes)

  • Minor (backwards-compatible functionality)

  • Major (incompatible API changes)

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

  • No thanks, I would rather do it manually 😞

@jorgeAcostaVTEX
Copy link

Hi @ivanlopezluna thank you for your contribution. Can you please include a changelog Keep a Changelog under the Unreleased section:
image

It would be:
Fixed
Explanation of the issue

Copy link

github-actions bot commented Jun 4, 2024

Messages
📖 ❤️ Thanks!
📖

🎉 PR additions = 10, PR deletions = 1

Generated by 🚫 dangerJS against 47411a0

wender
wender previously approved these changes Jun 13, 2024
@ataideverton
Copy link
Collaborator

Do you have a step by step test guide?

It's possible to test it in an account that is not that of a production client? If not, are there any specific credentials we should use?

@wender
Copy link
Contributor

wender commented Jun 14, 2024

Do you have a step by step test guide?

It's possible to test it in an account that is not that of a production client? If not, are there any specific credentials we should use?

Hi @ataideverton here's a video explaining how to replicate the issue https://drive.google.com/file/d/1W46MsUSW-icx1VIORKbKGDOUI_mxIyQD/view?usp=sharing

@ivanlopezluna
Copy link
Contributor Author

Hi @ataideverton
Please share your mail and we can invite you as a organization member.

@alfonsovtex
Copy link

What problem is this solving?

If there is another customApp in the customData, the "B2BQuotesLockingModal.tsx"component breaks on its own.

Step by step to replicate the issue

  1. Go to B2B and sign in as a member of an organization (if you need credentials to take the test, share your email to invite you as a member).
  2. Add a SKU to the cart, go to Checkout and complete the necessary information until the Shipping step.
  3. After going to Payment step, go back to Home and check how the Header will disappear.

Screenshot 2024-06-14 at 13 26 32 Screenshot 2024-06-14 at 13 26 39

How to test it?

Workspace

Ivan,
It is important to note that the "Delivery Date" field is a custom field that fetches available delivery routes for specific customers. The delivery routes data comes from master data. The checkout customization hides the VTEX-default shipping block and preselects a "dummy" shipping sla in the background.

The delivery date data is being stored in the orderForm under customData. The breakage of the header occurs when a Delivery Date is selected and the user returns to the IO for whatever reason.

@ataideverton
Copy link
Collaborator

Hi @ataideverton Please share your mail and we can invite you as a organization member.

[email protected]

@ivanlopezluna
Copy link
Contributor Author

ivanlopezluna commented Jun 18, 2024

What problem is this solving?

If there is another customApp in the customData, the "B2BQuotesLockingModal.tsx"component breaks on its own.

Step by step to replicate the issue

  1. Go to B2B and sign in as a member of an organization (if you need credentials to take the test, share your email to invite you as a member).
  2. Add a SKU to the cart, go to Checkout and complete the necessary information until the Shipping step.
  3. After going to Payment step, go back to Home and check how the Header will disappear.

Screenshot 2024-06-14 at 13 26 32 Screenshot 2024-06-14 at 13 26 39

How to test it?

Workspace

Ivan, It is important to note that the "Delivery Date" field is a custom field that fetches available delivery routes for specific customers. The delivery routes data comes from master data. The checkout customization hides the VTEX-default shipping block and preselects a "dummy" shipping sla in the background.

The delivery date data is being stored in the orderForm under customData. The breakage of the header occurs when a Delivery Date is selected and the user returns to the IO for whatever reason.

@ataideverton ,
What you mention about storing the date in the customData of the orderForm is correct; however, the main problem is that the validation of the vtex.b2b-quotes app only checks if the customData property contains the customApps property. Therefore, adding any information at the customData level will present this scenario.

The intention of this PR is to add a validation that ensures the customApp to be used is named b2b-quotes-graphql, and only in that case continue with the rest of the app’s functionality.

On the other hand, I confirm that you have already been added as a member of an organization.

ataideverton
ataideverton previously approved these changes Jun 19, 2024
react/components/B2BQuotesLockingModal.tsx Outdated Show resolved Hide resolved
@ivanlopezluna ivanlopezluna dismissed stale reviews from ataideverton and wender via 9d29312 June 19, 2024 16:42
@ivanlopezluna
Copy link
Contributor Author

@ataideverton
Thanks for the suggestion. It's done.

@ataideverton
Copy link
Collaborator

@ivanlopezluna Please run a yarn lint --fix and commit the result, the check is breaking

It should change just your file, applying the linter rules to it

@ivanlopezluna
Copy link
Contributor Author

@ivanlopezluna Please run a yarn lint --fix and commit the result, the check is breaking

It should change just your file, applying the linter rules to it

@ataideverton
It's done.

@pabloppupulin pabloppupulin merged commit 354d7ec into vtex-apps:master Jun 20, 2024
26 of 29 checks passed
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.

7 participants