Skip to content

Commit

Permalink
Merge pull request #2413 from tvdeyen/admin-line-item-ui-fixes
Browse files Browse the repository at this point in the history
Admin line item ui fixes
  • Loading branch information
jhawthorn authored Dec 12, 2017
2 parents cad4167 + 9b8e608 commit b3a06ec
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
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

0 comments on commit b3a06ec

Please sign in to comment.