-
-
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
Admin cart page revamp #1710
Admin cart page revamp #1710
Conversation
within(#{table_column.inspect}) do | ||
fill_in #{selector.inspect}, with: #{quantity.inspect} | ||
end | ||
WARN |
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.
Ah, you already did :)
54cbf5b
to
8287bc3
Compare
👍 Looks good to me! |
8287bc3
to
751bc58
Compare
I also like the idea of putting the icons in the table to keep relative things grouped together, but it might be better to keep it separate for consistency right now, and then globally change the location of all icons in a separate PR. I realize in suggesting that though, someone would have to volunteer to do that chunk of work. This sounds like a thing that I might be capable of, but I'm not sure when I'll have the time. I can see how on first glance a user might think that the "add item" button at the bottom of the page would save the new row. I know they're figure it out and learn pretty quickly, but in the interest of a more intuitive UI, it would be nice if we could rename the label to "Add new item" The note about the disabled button raises a bigger discussion about whether we want to put the user into a stateful interaction (which is how Solidus works now) to keep them focused on their task or make it stateless to give them more flexibility. Again, I'm inclined to say keep it consistent until we have a bigger bandwidth to think through and change things on a more global scale. |
This is the pattern used throughout the admin and is way outside the scope of this PR. If you have thoughts on how the admin UI should be please file a new issue or come discuss it in our |
I was talking generally:
I'll start the discussion in |
751bc58
to
38ce62f
Compare
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.
Great. Some thoughts about backbone model organizing as discussed in #1715
<a class="edit-line-item fa fa-edit no-text with-tip" href="#" title="{{ t "actions.edit" }}"></a> | ||
<a class="delete-line-item fa fa-trash no-text with-tip" href="#" title="{{ t "actions.delete" }}"></a> | ||
{{/if}} | ||
</td> |
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.
The indenting of this file is a little off
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.
Rebased and fixed.
.line-item:not(.editing) { | ||
.save-line-item, | ||
.cancel-line-item, | ||
.line-item-qty-edit { |
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.
Can we remove these classes from the html as well?
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.
.save-line-item
and .cancel-line-item
are still in use and also used in specs (a more dubious use).
I'm not sure they aren't appropriate classes to have.
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.
.line-item-qty-edit
and .line-item-qty-show
are JS utility classes used in the old JS only AFAIK. Maybe there are others. Not mandatory, for sure. But I like to clean up as we have the chance.
$ -> | ||
if $("table.line-items").length | ||
url = Spree.routes.orders_api + "/" + order_number | ||
lineItemModel = Backbone.Model.extend |
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.
Can we put this model into its own file and use the Spree.Model namespace discussed in #1715?
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.
Can't be done here. At this point the model needs to be defined where we have access to url
. #1715 is a follow up to this where this will be fixed.
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.
Okidoki
$('.line-items').remove() | ||
window.Spree.advanceOrder() | ||
|
||
Spree.CartLineItemView = Backbone.View.extend |
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.
Maybe we can also introduce a Spree.Views namespace for views as we discussed for models in #1715?
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.
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.
Sure.
</table> | ||
<% end %> | ||
<tbody> | ||
</tbody> |
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.
It really helped me today that in the other backbone powered templates we have a comment noting that the content is handled via JS. Maybe we could also add a comment here.
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.
👍 Excellent idea
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.
Not mine ;) d2ec380
This is an unnecessary shorthand which just obfuscates what it does. It also has nothing to do with quantities specifically.
38ce62f
to
bb6093f
Compare
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.
Thanks for all your late work on making the admin UX better 🙏🏻
Can't run test on CircleCI because of AWS issues, but this is passing locally 🔥 |
This builds on top of #1709.
New Order
Validation failed
After saving one item
Adding second item