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

Add full GQL support to product editor #188

Merged
merged 222 commits into from
Mar 4, 2020

Conversation

mikemurray
Copy link
Member

@mikemurray mikemurray commented Jan 23, 2020

Resolves #168 #184 #212 #216 #220 #223
Impact: major
Type: feature|refactor

Issue

There are many issues with the current meteor specific implementation of the product admin.

Solution

  • Fix all of those problems and convert it to GraphQL
  • Removed the template field (it's not available in the API in 3.0)
  • Removed the google plus message field from the social for.

Breaking changes

none.

Testing

  1. Use api with this PR: feat: Fixes for product editor reaction#6141
  2. Use the admin and make sure everything works in the product editor

(non-critical issues can go into a list and I can address them in another PR.)

@mikemurray mikemurray force-pushed the feat-184-mikemurray-gql-product-edit branch 2 times, most recently from 671dbf5 to f7fa37f Compare February 19, 2020 18:36
Signed-off-by: Mike Murray <[email protected]>
Signed-off-by: Mike Murray <[email protected]>
Signed-off-by: Mike Murray <[email protected]>
Signed-off-by: Mike Murray <[email protected]>
Signed-off-by: Mike Murray <[email protected]>
Signed-off-by: Mike Murray <[email protected]>
Signed-off-by: Mike Murray <[email protected]>
Signed-off-by: Mike Murray <[email protected]>
@mikemurray mikemurray changed the title [WIP] Add full GQL support to product editor Add full GQL support to product editor Mar 4, 2020
@mikemurray mikemurray marked this pull request as ready for review March 4, 2020 02:17
@mikemurray
Copy link
Member Author

@willopez Ok... This is enough for this PR. The editor still needs some work, especially to the media gallery block, but for the most part, everything is in place and seems to work. I'd like to push any non-critical feedback into a fresh PR.

One issue, in particular, would be with the Media Gallery editor. I've put those issues into this ticket: #236

@mikemurray mikemurray requested a review from willopez March 4, 2020 02:24
@janus-reith
Copy link
Contributor

janus-reith commented Mar 4, 2020

@mikemurray When changes are saved and the updated Product is returned, publishedProductHash and currentProductHash are the same, so the Publish button won't become active.

After a page reload the changes are visible, ot by doing a second change in order to get a new refetch. That state would be old again:
I could take a published Product with Title "ABC 123", change it to "ABC 1234", Publish button greyed out. Then change it back to "ABC 123", and the Publish button becomes active.

Might need api changes to correctly deliver a new hash directly upon change, or else, an artifical delay like for images.
Update: I just figured out that simply adding another refetchProduct inside onUpdateProduct does the trick for now without another artifical delay here.
However, that still is not a clean solution, as the Payload of updateProduct is expected to have all the fresh Product data, therefore not requiering a manual refetch.

@janus-reith
Copy link
Contributor

janus-reith commented Mar 4, 2020

The TagSelector Component needs overflow-y: visible in order to display a List of Tags properly, else it would be cut of at the Dialog height.
The issue is noticable when having 3 or more Tags to choose from.

As this is broken in the catalyst library, one option is to define a custom theme override in the admin's theme:
MuiDialog: { paper: { overflowY: "visible" } }

Certainly better to fix this in catalyst.

@mikemurray
Copy link
Member Author

@janus-reith
Product hash: Yea, I've seen that happen sometimes. We probably need to look at the API to see why the hash isn't delivered with the result on time. It might be doing the has async with an app event or something.

MUI Dialog: I agree, probably best to fix the default in Catalyst.

@mikemurray
Copy link
Member Author

@janus-reith Just checked, and yes, the hasProduct function runs on an the app events afterProductUpdate and afterVariantUpdate. So just like the media, we're going to have to figure out a solution to this async stuff.

@willopez willopez mentioned this pull request Mar 4, 2020
9 tasks
@willopez
Copy link
Member

willopez commented Mar 4, 2020

I am adding non-critical issues to another issue here: #237. Other than those issues noted in #237 this is a good foundation to build on.

Copy link
Member

@willopez willopez left a comment

Choose a reason for hiding this comment

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

Approving so that we can merge this and start fixing issues on new PRs. The issues found are in issue #237.

@mikemurray mikemurray merged commit 864b459 into trunk Mar 4, 2020
@mikemurray mikemurray deleted the feat-184-mikemurray-gql-product-edit branch March 4, 2020 21:16
@kieckhafer kieckhafer mentioned this pull request Apr 2, 2020
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.

[v3.0.0] Cannot upload images to product
6 participants