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

adjust option value handling to work like product properties handling #3561

Closed
wants to merge 1 commit into from

Conversation

hefan
Copy link
Contributor

@hefan hefan commented Mar 19, 2020

also remove last link_to_remove_fields usage and deprecate link_to_remove_fields helper

as discussed in #3547

The handling of the option value list worked in another way like the product properties list (both are the same type of lists with dynamically added rows):

  • There was no new item by default
  • all new options also had a remove button, which is not necessary

The Option Value list now works like the product property list.

Option value remove tests are also adjusted and work more like the product property remove tests.

The Test "can remove a non-persisted option value from an option type" is no longer needed, there is no more possibilty to remove the non persisted option value.

Copy link
Member

@spaghetticode spaghetticode left a comment

Choose a reason for hiding this comment

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

@hefan thanks for working on this! I left a comment, let me know what you think.

also remove last link_to_remove_fields usage and deprecate link_to_remove_fields helper
@kennyadsl
Copy link
Member

Hey @hefan, thanks for your contribution.

It's not 100% clear to me why you do want to cut off the remove button on option values list. Clicking several times on the Add Option Value button, you can have this situation:

Screenshot 2020-03-24 at 09 37 26

And no way to come back to a "clean" state without reloading the page. I think it's not intuitive for admin users to understand that it's legit to leave some empty items and they could feel lost, and that could happen after they added some option values already, which may cause to lose unsaved data.

If this is what we have on Product Properties tab, I think we should change that instead. What do you think?

@hefan
Copy link
Contributor Author

hefan commented Mar 24, 2020

i didn't find that is a bad situation considering the circumstances.

When i compared both screens i thought the product properties screen works better.
The Option Values screen adds a hidden field to remove entries (which is done by the to be removed helper). i guess to remove the non persistent field you need such a trick like the hidden field.

So it was logical to make it work like the product properties screen, which doesn't do it that way.

What i don't like on both screens is the ordering which doesn't work. The new items should at least appear ALL below the last item. Because after save they are all nevertheless below.

So my proposal would be:

  1. Do it like in the product property screen
  2. add a remove button for non persistent fields (maybe with hidden field)
  3. Add a default empty entry at the end
  4. "Add new" produces new items below all other items
  5. do not add a sort option before save (like it is now)

Maybe we do not need a default new entry at the end (3).
This would imply changes on both screens.

What do you think? In general i have the feeling that all entries should be also sortable instantly. But this goes a little bit out of scope of that PR.

@kennyadsl
Copy link
Member

@hefan I like the plan.

for point 2. I think the hidden field is not needed for non-persisted rows. It's all done client-side, just need to remove that row from the HTML, right?

Also, please, try to split these changes into multiple PR so they will be easier (and faster ;) ) to review from the core team.

@hefan
Copy link
Contributor Author

hefan commented Apr 8, 2020

ok. i'll start with the product properties page then and reference this issue and close it now

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.

4 participants