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
Hydrate initial product for add/edit product pages #37003
Comments
Estimate: 2 I noticed some oddities around saving the product as an "auto-draft" status, but this may be related to the v2 endpoint which should be resolved when this issue is ready to tackle. |
Note that this will depend on #36991 being finished. One follow up question and something to think about while working on this, is how do we clean up |
Is the intention to have this create entities with the post status of @joshuatf @louwie17 If you have any thoughts on the above ^. |
@joelclimbsthings I would have a look at what Core is doing with posts and pages and follow their approach ( I am not to familiar with that, so can't say without diving in). |
Actually looping back on this as I am looking at the code @joshuatf linked above, I think we want to use It also looks like it schedules an auto draft clean up event if one is not scheduled, it be interesting to know if this is also done with our current product API, or if this is auto triggered when creating a new Product. It looks like the auto delete specifically looks for post statuses of |
The product editor will need to be hydrated with a product prior to initializing the editor. The editor requires a product and the entity configuration to be loaded prior to being able to load edits (dirty state) into its state.
While core hydrates this server-side, we are a bit more restricted since we are using React router and may not initally load the add product page, meaning we need to dynamically create the product when visiting this path.
This might look something like this for the add product page, while the edit product page should fetch the product by the provided product ID.
Depends on #36991 being finished.
Acceptance criteria
The text was updated successfully, but these errors were encountered: