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

Send empty form when clicking "Save attribute" #37021

Closed
2 tasks
octaedro opened this issue Mar 1, 2023 · 4 comments · Fixed by #37046
Closed
2 tasks

Send empty form when clicking "Save attribute" #37021

octaedro opened this issue Mar 1, 2023 · 4 comments · Fixed by #37046
Assignees
Labels
focus: product management Related to product creation and editing. focus: product Issues related to product or product page. priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: bug The issue is a confirmed bug.

Comments

@octaedro
Copy link
Contributor

octaedro commented Mar 1, 2023

Describe the bug

When creating a product, under the Attributes tab, we don't check if the form is empty when pressing the Save attribute button. So it's possible to send empty values to the action woocommerce_save_attributes.

We should add a check like this to this method.

We should mark these fields as required, disable the Save button, and show a help message.

Steps to reproduce

  • Add a global attribute through the new dropdown
  • Don't add any terms and click Save attributes
  • The request is being sent after pressing Save attributes

Screen Capture on 2023-03-01 at 16-46-28

Acceptance criteria

  • Add a check like this to this method.
  • Mark these fields as required, disable the Save button, and show a help message.
@github-actions github-actions bot added the status: awaiting triage This is a newly created issue waiting for triage. label Mar 1, 2023
@octaedro octaedro added type: bug The issue is a confirmed bug. priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. focus: product Issues related to product or product page. focus: product management Related to product creation and editing. and removed status: awaiting triage This is a newly created issue waiting for triage. labels Mar 1, 2023
@octaedro
Copy link
Contributor Author

octaedro commented Mar 1, 2023

Hey @jarekmorawski,
I'm creating an issue that will include what we discussed in this PR. Could you share the help message we should add to the validation?

@octaedro octaedro self-assigned this Mar 2, 2023
@jarekmorawski
Copy link

Hi @octaedro. Thanks for the ping. I'm working on a larger update to these flows. I think it's safe to put this on pause now and come back to it early next week.

@octaedro
Copy link
Contributor Author

octaedro commented Mar 3, 2023

I'm working on a larger update to these flows. I think it's safe to put this on pause now and come back to it early next week.

@jarekmorawski Thank you for taking care of this flow. Right now when we press the save button and the fields are empty, we execute the saving action with empty params, and that shouldn't happen. Just to avoid that behavior I created this PR that disables the save buttons (under Attributes and Variations tabs) until the fields Name and Value(s) have any value.

Maybe we can add a title attribute to the button when it's disabled with a text explaining that it will be reenabled as soon as the form fields have values.

If you hover the save button, it would look like this:

Screenshot 2023-03-03 at 12 24 35

@jarekmorawski
Copy link

I added extra flows and designs to #37099.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: product management Related to product creation and editing. focus: product Issues related to product or product page. priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: bug The issue is a confirmed bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants