-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Store: Product Trash Pickup #21810
Store: Product Trash Pickup #21810
Conversation
Test live in Docker at: https://dserve.a8c.com/?branch=fix/store-product-trashpickup |
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.
Couple of questions but this is testing out great. Thanks so much for fixing the edit -> add bug. I feel that is a highly used flow for someone setting up a new store.
@@ -190,6 +188,10 @@ class ProductCreate extends React.Component { | |||
const isBusy = Boolean( actionList ); // If there's an action list present, we're trying to save. | |||
const saveEnabled = isValid && ! isBusy && 0 === this.state.isUploading.length; | |||
|
|||
if ( ! product || isNumber( product.id ) ) { |
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.
I'm groking the check for ! product
but the second clause has me thinking a bit - so this is to short circuit the create
view if a product
exists and is not a placeholder/un-saved product?
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.
Yeah.
I found in testing, the few actions that clear away edits in product UI state, variations, etc (which also resets currentlyEditingId
and this product
object) might not have all ran yet before the component mounts. And because of how the CompactTinyMCE component works, (it only an initial value), this is needed to prevent rendering of the form in that brief moment of time. Once the prop updates the form renders.
@@ -45,7 +45,6 @@ export default class ProductFormDetailsCard extends Component { | |||
|
|||
this.setName = this.setName.bind( this ); | |||
this.setDescription = this.setDescription.bind( this ); | |||
this.debouncedSetDescription = debounce( this.setDescription, 200 ); |
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.
When trying to track down this bug, this did jump out at me - what was the original reason for this logic?
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.
I'm not sure now, sorry. It doesn't seem necessary from the testing I did though.
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.
Looks like it was added in here #14944 though i don't see any details around that specific bit. I think this might be some carry-over from patterns in the post editor maybe. But I agree if its not needed, it is great to remove it.
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 PR does some trash pickup around products. The following issues are addressed:
To Test:
npm run test-client client/extensions/woocommerce
and make sure all tests pass.