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
base: master
Are you sure you want to change the base?
Conversation
Beep boop 🤖 I noticed you didn't make any changes at the
In order to keep track, I'll create an issue if you decide now is not a good time
|
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.
|
There was a problem hiding this 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.
Oh! One more thing, this change would introduce a new prop, so the documentation should be updated accordingly. |
There was a problem hiding this 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?
} | ||
} | ||
|
||
if(!hideImpossibleCombinations && possibleToClickOnImpossibleCombination.includes(variationName)){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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[] |
There was a problem hiding this comment.
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')){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint this file too.
}): DisplayOption | null => { | ||
const isSelected = selectedVariations[variationName] === variationValue.name | ||
const image = imagesMap?.[variationName]?.[variationValue.name] | ||
const parseOptionNameToDisplayOption = |
There was a problem hiding this comment.
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?
There was a problem hiding this 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.
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
After
It's also possible to use the option "all" if you want the same demeanor in all of the specifications.
Then, just visit your store and test the new function.