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

[feature]: Utilize graphql returned color for swatches #1633

Closed
1 of 7 tasks
sirugh opened this issue Sep 5, 2019 · 3 comments · Fixed by #2151
Closed
1 of 7 tasks

[feature]: Utilize graphql returned color for swatches #1633

sirugh opened this issue Sep 5, 2019 · 3 comments · Fixed by #2151
Assignees
Labels
enhancement New feature or request help wanted Eligible for community contribution.

Comments

@sirugh
Copy link
Contributor

sirugh commented Sep 5, 2019

Is your feature request related to a problem? Please describe.
Currently we randomize the colors in the product component because GQL does not return the hex code or any way for the UI to determine what color to display. There is an open issue for this in GQL: magento/graphql-ce#196.

Describe the solution you'd like
When the GQL issue is resolved/merged/released I would like to update our product query and swatch code to use the hex value returned.

Describe alternatives you've considered
If there was a mapping of colors returnable by the gql endpoint and hex colors we could maintain it on the UI and render a map. I don't think this is scaleable or a good idea, but it is an alternative :P

Another more realistic alternative would be to get the data from the rest endpoint instead of graphql. I'm not sure how to obtain that information or whether it even exists, but it should be a fallback incase we need to be "production ready" and don't have this data available in gql yet.

Additional context
magento/graphql-ce#196
https://github.com/magento/pwa-studio/blob/develop/packages/venia-ui/lib/components/ProductOptions/swatch.js#L58-L59

Please let us know what packages this feature is in regards to:

  • venia-concept
  • venia-ui
  • pwa-buildpack
  • peregrine
  • pwa-devdocs
  • upward-js
  • upward-spec
@sirugh sirugh added the enhancement New feature or request label Sep 5, 2019
@awilcoxa awilcoxa added the help wanted Eligible for community contribution. label Feb 3, 2020
@deiserh
Copy link
Contributor

deiserh commented Feb 8, 2020

assigned

deiserh added a commit to deiserh/pwa-studio that referenced this issue Feb 8, 2020
deiserh added a commit to deiserh/pwa-studio that referenced this issue Feb 8, 2020
@awilcoxa
Copy link

awilcoxa commented Mar 2, 2020

can go into next release but need to evaluate to ensure backwards compatibility, keeping in backlog

@tjwiebell tjwiebell added the hold On hold until another condition is fulfilled. label Mar 10, 2020
larsroettig pushed a commit to deiserh/pwa-studio that referenced this issue Mar 31, 2020
@awilcoxa awilcoxa removed the hold On hold until another condition is fulfilled. label Apr 28, 2020
@awilcoxa
Copy link

2.3.5 released today, needs review

larsroettig pushed a commit to deiserh/pwa-studio that referenced this issue Apr 30, 2020
sirugh added a commit to deiserh/pwa-studio that referenced this issue May 4, 2020
dpatil-magento added a commit to deiserh/pwa-studio that referenced this issue May 7, 2020
dpatil-magento added a commit that referenced this issue May 7, 2020
* Added swatch color resolves #1633

* Added the fix to show images and added a empty fallback value to avoid not shown swatches on the category page

* Uses background css property to set either color or image

Signed-off-by: sirugh <[email protected]>

* Use thumbnail as image if provided, else use color or fallback to default background color.

* Removes fashion color swatch from filter drawer as possible aggregations from graphql do not include swatch values

Signed-off-by: sirugh <[email protected]>

* Fixes selected image overlay and other feedback

Signed-off-by: sirugh <[email protected]>

Co-authored-by: Lars Roettig <[email protected]>
Co-authored-by: Stephen <[email protected]>
Co-authored-by: sirugh <[email protected]>
Co-authored-by: Devagouda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Eligible for community contribution.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants