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

Adding the BO's procurator info to ProfileBox to cover B2B scenario #266

Open
wants to merge 5 commits into
base: 1.x
Choose a base branch
from

Conversation

juliapdo
Copy link

@juliapdo juliapdo commented May 25, 2022

What did you change? *

  1. Implemented the getProcuratorData query to decode the VTEX cookie containing the procurator's info.
  2. Added the "jwt-decode" lib.
  3. Profile.tsx: replaced the GET_PROFILE query with the new one that also gets the procurator's data.
    A null procurator means that we are not in a B2B scenario, so everything remains unchanged.
  4. ProfileBox.tsx: if a procurator exists, we use its data to display the correct firstName, lastName, and email.
    In that scenario, we also omit document, birthDate, and gender.

Why? *

As agreed during a meeting with both B2B and My Account teams,
this PR is to add the necessary customization to the Profile section so it can display the procurator's info.
Before the change, some B2B customers were forking the app to add their customization, which is not a good practice.

Please let me know if anything needs clarification, and let me know if you have any suggestions!

How to test it? *

You can use the Workspace to log in and test the Profile page in both B2B and B2C scenarios.

B2B User:
[email protected]
Vtex1234

B2C User:
[email protected]
Vtex1234

Here are some screenshots:

Before the change, note that the Buyer Organization's name and email were displayed as if they were the user's info:

image

Now, we show the procurator's info:

image

But everything remains the same in a B2C scenario:

image

Types of changes *

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical improvements

@vtex-io-ci-cd
Copy link
Contributor

vtex-io-ci-cd bot commented May 25, 2022

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 😞

@vtex-io-docs-bot
Copy link

Beep boop 🤖

Thank you so much for keeping our documentation up-to-date ❤️

@juliapdo juliapdo self-assigned this May 25, 2022
@juliapdo juliapdo requested a review from vbustamante May 25, 2022 14:22
@juliapdo juliapdo changed the base branch from master to 1.x May 25, 2022 14:23
@juliapdo juliapdo added the enhancement New feature or request label May 25, 2022
@juliapdo juliapdo requested a review from arthurepc May 25, 2022 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant