-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
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.
@hefan thanks for working on this! I left a comment, let me know what you think.
backend/app/views/spree/admin/option_types/_option_value_fields.html.erb
Outdated
Show resolved
Hide resolved
also remove last link_to_remove_fields usage and deprecate link_to_remove_fields helper
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 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? |
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. 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:
Maybe we do not need a default new entry at the end (3). 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. |
@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. |
ok. i'll start with the product properties page then and reference this issue and close it now |
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):
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.