From 3b14e25db68194a404785772b05f193049a8240b Mon Sep 17 00:00:00 2001 From: newsiberian Date: Fri, 29 Apr 2016 16:21:11 +0600 Subject: [PATCH] - added new `title` field to `CartItem` schema; - updated `cart/addToCart` to be compatible with new field; - updated styles for cartDrawer item; - updated item title spans; --- .../templates/cart/cartDrawer/cartItems/cartItems.html | 2 +- .../theme/cart/cartDrawer/cartItems/cartItems.less | 8 ++++++-- packages/reaction-core/server/methods/cart.js | 1 + .../templates/dashboard/orders/list/items/items.html | 2 +- .../orders/workflow/shippingInvoice/shippingInvoice.html | 2 +- packages/reaction-schemas/common/schemas/cart.js | 3 +++ 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/reaction-checkout/client/templates/cart/cartDrawer/cartItems/cartItems.html b/packages/reaction-checkout/client/templates/cart/cartDrawer/cartItems/cartItems.html index 578706cd851..91c117c9363 100644 --- a/packages/reaction-checkout/client/templates/cart/cartDrawer/cartItems/cartItems.html +++ b/packages/reaction-checkout/client/templates/cart/cartDrawer/cartItems/cartItems.html @@ -20,7 +20,7 @@
!
{{/if}} {{quantity}} - {{variants.title}} + {{title}} {{variants.title}} diff --git a/packages/reaction-core-theme/theme/cart/cartDrawer/cartItems/cartItems.less b/packages/reaction-core-theme/theme/cart/cartDrawer/cartItems/cartItems.less index 53fccfe190c..ced67fa8df0 100644 --- a/packages/reaction-core-theme/theme/cart/cartDrawer/cartItems/cartItems.less +++ b/packages/reaction-core-theme/theme/cart/cartDrawer/cartItems/cartItems.less @@ -4,8 +4,8 @@ border-radius: 4px; .cart-labels { - margin: -30px 0 0 0; - height: 30px; + margin: -50px 0 0 0; + height: 50px; padding: 5px; background-color: @product-overlay-bg; width: 235px; @@ -23,6 +23,10 @@ } } + .cart-item-title { + white-space: pre-wrap; + } + .remove-cart-item { position: absolute; top: 8px; diff --git a/packages/reaction-core/server/methods/cart.js b/packages/reaction-core/server/methods/cart.js index e869b61f1ea..24be4e31037 100644 --- a/packages/reaction-core/server/methods/cart.js +++ b/packages/reaction-core/server/methods/cart.js @@ -367,6 +367,7 @@ Meteor.methods({ productId: productId, quantity: quantity, variants: variant, + title: product.title, type: product.type } } diff --git a/packages/reaction-orders/client/templates/dashboard/orders/list/items/items.html b/packages/reaction-orders/client/templates/dashboard/orders/list/items/items.html index 8cfb0e74a47..d605f4e2dda 100644 --- a/packages/reaction-orders/client/templates/dashboard/orders/list/items/items.html +++ b/packages/reaction-orders/client/templates/dashboard/orders/list/items/items.html @@ -13,7 +13,7 @@
- {{variants.title}} + {{title}} {{variants.title}}
diff --git a/packages/reaction-orders/client/templates/dashboard/orders/workflow/shippingInvoice/shippingInvoice.html b/packages/reaction-orders/client/templates/dashboard/orders/workflow/shippingInvoice/shippingInvoice.html index 94d0876c831..d2554089ca4 100644 --- a/packages/reaction-orders/client/templates/dashboard/orders/workflow/shippingInvoice/shippingInvoice.html +++ b/packages/reaction-orders/client/templates/dashboard/orders/workflow/shippingInvoice/shippingInvoice.html @@ -13,7 +13,7 @@
- {{item.variants.title}} + {{item.title}} {{item.variants.title}}
diff --git a/packages/reaction-schemas/common/schemas/cart.js b/packages/reaction-schemas/common/schemas/cart.js index fdedb0ad673..53983d42827 100644 --- a/packages/reaction-schemas/common/schemas/cart.js +++ b/packages/reaction-schemas/common/schemas/cart.js @@ -25,6 +25,9 @@ ReactionCore.Schemas.CartItem = new SimpleSchema({ variants: { type: ReactionCore.Schemas.ProductVariant }, + title: { + type: String + }, type: { label: "Product Type", type: String,