vtex-apps / product-summary

VTEX Product Summary app
11 stars 51 forks source link

`customPath` prop in `ProductSummaryCustom` #257

Closed gustavopvasconcellos closed 4 years ago

gustavopvasconcellos commented 4 years ago

What is the purpose of this pull request?

Adding a customPath prop in ProductSummaryCustom allow to custom apps to use the product-summary and its Contexts, avoiding custom Apps creating new components.

There are two cases, in our case we want to redirect the use to another store in some shelfs, with this prop we can use set a correct link to the store that have the product. In other case, on the TokStok Weeding List, the product-summary do not have a link because the product-summary is just to show the product and use the custom "Add to List Button".

This is a Chaordic API context in the first, and the second is a private TokStok API.

  1. https://custompath--carrefourbr.myvtex.com/vinho?_q=vinho&map=ft
  2. https://tokstoklista.myvtex.com/casamento/guyas

What problem is this solving?

This will help to use the product-summary behaviors on custom apps easely.

How should this be manually tested?

On these to sites:

  1. https://custompath--carrefourbr.myvtex.com/vinho?_q=vinho&map=ft
  2. https://tokstoklista.myvtex.com/casamento/guyas

Screenshots or example usage

An example on our custom App: image

Types of changes

vtex-io-ci-cd[bot] commented 4 years ago

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:

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

vtex-io-docs-bot[bot] commented 4 years ago

Beep boop :robot:

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

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

gustavopvasconcellos commented 4 years ago

Thanks for the PR, it looks great.

Do you mind adding the proptype for this new prop?

Suggestion:

  /** Should be only used by custom components, never by blocks */
  customPath: PropTypes.string,

@klzns Done bro! Thanks!

gustavopvasconcellos commented 4 years ago

@klzns Done man, ok I will pay attention on this!

vtex-io-ci-cd[bot] commented 4 years ago

Your PR has been merged! App is being published. :rocket: Version 2.53.3 → 2.54.0

After the publishing process has been completed (check #vtex-io-releases) and doing A/B tests with the new version, you can deploy your release by running:

vtex deploy vtex.product-summary@2.54.0

After that your app will be updated on all accounts.

For more information on the deployment process check the docs. :book:

Klynger commented 4 years ago

@all-contributors add @gustavopvasconcellos for code

allcontributors[bot] commented 4 years ago

@Klynger

I've put up a pull request to add @gustavopvasconcellos! :tada: