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/regionalization behaviour #96

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

cesarocampov
Copy link

What problem is this solving?
The current implementation of the storefront permissions apply both regionv2 and private-seller regionalization types at the same time.
These two regionalisation are not supported at the same time by IS team. thus breaking the search.

the PR is adding a new default prop to the sessionWatcher which is regionalizationType, to control the regionalization behaviour that will happen on the site.
the Prop is set as DEFAULTV2 as default to allow backwards compatibility.

Also adds the regionv1 option for stores that require it.

How should this be manually tested?
on account: https://indolaiberia.myvtex.com/admin/b2b-organizations/organizations#/organizations add a user under the second organization in the list, this has a seller assigned and a cost center which will apply regionId and private-seller filters at the same time as seen on the segmentToken:
{
"campaigns": null,
"channel": "1",
"priceTables": null,
"regionId": "v2.E95EF045DF737D9448B8590373D19E5E",
"utm_campaign": null,
"utm_source": null,
"utmi_campaign": null,
"currencyCode": "EUR",
"currencySymbol": "€",
"countryCode": "ESP",
"cultureInfo": "es-ES",
"admin_cultureInfo": "en-US",
"channelPrivacy": "public",
"facets": "sellername=H'almagro;private-seller=indolaiberiaswl5;"
}

See that the front end is broken:

Screenshot 2023-03-14 at 19 34 33

Do the ssame thing on this workspace https://cesar--indolaiberia.myvtex.com/color/coloracion-permanente
there are no current settings so it is applying the DEFAULTV2 as shown on the segment token:
{
"campaigns": null,
"channel": "1",
"priceTables": null,
"regionId": "v2.E95EF045DF737D9448B8590373D19E5E",
"utm_campaign": null,
"utm_source": null,
"utmi_campaign": null,
"currencyCode": "EUR",
"currencySymbol": "€",
"countryCode": "ESP",
"cultureInfo": "es-ES",
"admin_cultureInfo": "en-US",
"channelPrivacy": "public"
}

on the workspace admin grapqhl-ide, you can use the mutation to change the settings:
mutation{
sessionWatcher(active:true, regionalizationType:DEFAULTV1)
}
Screenshot 2023-03-14 at 19 37 09

On the workspace admin grapqhl-ide, you can use the query to get the settings:
query {
getSessionWatcher {
active
regionalizationType
}
}

Screenshot 2023-03-14 at 19 48 54

@vtex-io-ci-cd
Copy link

vtex-io-ci-cd bot commented Mar 14, 2023

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 😞

@github-actions
Copy link

github-actions bot commented Mar 14, 2023

Messages
📖 ❤️ Thanks!
📖

🎉 PR additions = 180, PR deletions = 128

Generated by 🚫 dangerJS against 91515e0

graphql/schema.graphql Outdated Show resolved Hide resolved
node/resolvers/Routes/index.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@arturmagalhaesjr arturmagalhaesjr left a comment

Choose a reason for hiding this comment

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

I've tested this feature on this customer:
https://sfp--qalojacolgate.myvtex.com/

It's not working, the seller / private-seller is empty:
CleanShot 2023-03-15 at 14 29 13@2x

node/resolvers/Routes/index.ts Outdated Show resolved Hide resolved
node/resolvers/Routes/index.ts Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Apr 7, 2023

Cy-Runner

 [✓] Execution time
  -  initWorkspace................. 00:00:03
  -  installApps................... 00:00:25
  -  uninstallApps................. 00:00:03
  -  linkApp....................... 00:00:20
  -  strategy...................... 00:21:55
  -  teardown...................... 00:00:31
  -  total......................... 00:23:23

Cypress Dashboard

 [✓] https://cloud.cypress.io/projects/ujsuhs/runs/354

Success

 [✓] The test ran successfully, well done!

@sonarcloud
Copy link

sonarcloud bot commented Apr 24, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@thyarles
Copy link
Contributor

thyarles commented Jun 1, 2023

Hi @cesarocampov.

Could you please help fix those conflicts? After that I think we can ask @arturmagalhaesjr and @wender a final review.
image

Thanks!

@wender
Copy link
Collaborator

wender commented Jul 18, 2023

@cesarocampov Hi, can you please resolve the conflicts?

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.

5 participants