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

Admin line item ui fixes #2413

Merged
merged 3 commits into from
Dec 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
//= require spree/backend/routes

Spree.Models.LineItem = Backbone.Model.extend({
defaults: {
quantity: 1
},

initialize: function(options) {
this.order = this.collection.parent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
</td>
<td class="cart-line-item-delete actions" data-hook="cart_line_item_delete">
{{#if editing}}
<a class="save-line-item fa fa-ok no-text with-tip" data-action="save" href="#" title="{{ t "actions.save" }}"></a>
<button class="save-line-item fa fa-ok no-text with-tip" data-action="save" title="{{ t "actions.save" }}"></button>
{{#unless noCancel}}
<a class="cancel-line-item fa fa-cancel no-text with-tip" data-action="cancel" href="#" title="{{ t "actions.cancel" }}"></a>
<button class="cancel-line-item fa fa-cancel no-text with-tip" data-action="cancel" title="{{ t "actions.cancel" }}"></button>
{{/unless}}
{{else}}
<a class="edit-line-item fa fa-edit no-text with-tip" data-action="edit" href="#" title="{{ t "actions.edit" }}"></a>
<a class="delete-line-item fa fa-trash no-text with-tip" data-action="remove" href="#" title="{{ t "actions.delete" }}"></a>
<button class="edit-line-item fa fa-edit no-text with-tip" data-action="edit" title="{{ t "actions.edit" }}"></button>
<button class="delete-line-item fa fa-trash no-text with-tip" data-action="remove" title="{{ t "actions.delete" }}"></button>
{{/if}}
</td>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.variant-autocomplete-item {
.media-left {
padding: map-get($spacers, 2) $spacer 0 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
@import 'spree/backend/sections/adjustments';
@import 'spree/backend/sections/orders';
@import 'spree/backend/sections/products';
@import 'spree/backend/sections/variants';
@import 'spree/backend/sections/promotions';
@import 'spree/backend/sections/bulk_transfer';
@import 'spree/backend/sections/return_authorizations';
Expand Down
6 changes: 6 additions & 0 deletions backend/spec/features/admin/orders/new_order_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
expect(current_path).to eql(spree.edit_admin_order_customer_path(Spree::Order.last))
end

it "default line item quantity is 1", js: true do
within ".line-items" do
expect(page).to have_field 'quantity', with: '1'
end
end

it "completes new order succesfully without using the cart", js: true do
add_line_item product.name

Expand Down