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

possibleToClickOnImpossibleCombination #986

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

Conversation

anamaiabap
Copy link

@anamaiabap anamaiabap commented Oct 21, 2021

What problem is this solving?
This PR allows the possibility to click in the option "impossibles" on store if you want to.

How to test it?
Before:
https://skubefore--anamb.myvtex.com/camisa/p?skuId=7
After:
https://sku--anamb.myvtex.com/camisa/p?skuId=7

Screenshots or example usage:
Before
Captura de Tela 2021-10-22 às 17 10 57

After
Captura de Tela 2021-10-21 às 16 56 50

It's also possible to use the option "all" if you want the same demeanor in all of the specifications.
Captura de Tela 2021-10-21 às 16 56 21

Then, just visit your store and test the new function.

Gravação-de-Tela-2021-10-21-às-17 02 55

@vtex-io-docs-bot
Copy link

vtex-io-docs-bot bot commented Oct 21, 2021

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 🎉🎉

@vtex-io-ci-cd
Copy link
Contributor

vtex-io-ci-cd bot commented Oct 21, 2021

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 😞

Copy link
Contributor

@victorhmp victorhmp left a comment

Choose a reason for hiding this comment

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

Hi, @anamaiabap! Thanks for the contribution :)
But could you please read our contributing guide and adjust the PR accordingly? Here it is: https://github.com/vtex-apps/store-discussion/blob/master/CONTRIBUTING.md.

Also, please give us more detail in the PR description, following the template, including a functioning workspace with this change implemented.

@victorhmp
Copy link
Contributor

Oh! One more thing, this change would introduce a new prop, so the documentation should be updated accordingly.

Copy link
Contributor

@igorbrasileiro igorbrasileiro left a comment

Choose a reason for hiding this comment

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

Great job, @anamaiabap 👏 ! Left some comments.

We created this CONTRIBUTING.md to help new maintainers. Can you take a look there?

react/components/SKUSelector/components/SKUSelector.tsx Outdated Show resolved Hide resolved
react/components/SKUSelector/components/SKUSelector.tsx Outdated Show resolved Hide resolved
}
}

if(!hideImpossibleCombinations && possibleToClickOnImpossibleCombination.includes(variationName)){
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if(!hideImpossibleCombinations && possibleToClickOnImpossibleCombination.includes(variationName)){
if(!hideImpossibleCombinations
&& possibleToClickOnImpossibleCombination.includes(variationName)) {

@@ -55,6 +55,7 @@ interface Props {
imagesMap: ImageMap
selectedVariations: Record<string, string | null>
hideImpossibleCombinations: boolean
possibleToClickOnImpossibleCombination: string[]
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you fix lint errors on this file? Go to the root folder, install packages (yarn), then run yarn lint.

disableUnavailableSelectOptions: boolean
}) => (variationName: string): DisplayVariation => {
if(possibleToClickOnImpossibleCombination.includes('all')){
Copy link
Contributor

Choose a reason for hiding this comment

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

Lint this file too.

react/components/SKUSelector/components/SKUSelector.tsx Outdated Show resolved Hide resolved
react/components/SKUSelector/components/SKUSelector.tsx Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
react/components/SKUSelector/index.tsx Outdated Show resolved Hide resolved
react/components/SKUSelector/components/Variation.tsx Outdated Show resolved Hide resolved
react/components/SKUSelector/components/SKUSelector.tsx Outdated Show resolved Hide resolved
react/components/SKUSelector/components/SKUSelector.tsx Outdated Show resolved Hide resolved
}): DisplayOption | null => {
const isSelected = selectedVariations[variationName] === variationValue.name
const image = imagesMap?.[variationName]?.[variationValue.name]
const parseOptionNameToDisplayOption =
Copy link
Contributor

Choose a reason for hiding this comment

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

This method seems to be too huge. Can we split it into some meaningful functions?

Copy link
Contributor

@icazevedo icazevedo left a comment

Choose a reason for hiding this comment

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

Functionality wise, LGTM, but the code needs adjustments. Also, undo all changes to the changelog and just add your entry. You shouldn't edit/reformat past changelogs.

react/components/SKUSelector/components/SKUSelector.tsx Outdated Show resolved Hide resolved
react/components/SKUSelector/components/SKUSelector.tsx Outdated Show resolved Hide resolved
react/components/SKUSelector/components/SKUSelector.tsx Outdated Show resolved Hide resolved
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.

None yet

4 participants