Skip to content

Commit

Permalink
Merge pull request #602 from magento-folks/checkout_notifications
Browse files Browse the repository at this point in the history
[Folks] Sprint 75
  • Loading branch information
Akimov, Alexander(aakimov) committed Sep 16, 2015
2 parents 0a87feb + 4d40328 commit 4cc81e9
Show file tree
Hide file tree
Showing 234 changed files with 904 additions and 224 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ define(
var self = this;
if (this.validateHandler() && additionalValidators.validate()) {
this.isPlaceOrderActionAllowed(false);
$.when(setPaymentInformationAction()).done(function() {
$.when(setPaymentInformationAction(this.messageContainer)).done(function() {
self.placeOrderHandler();
}).fail(function() {
self.isPlaceOrderActionAllowed(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
</label>
</div>
<div class="payment-method-content">
<!-- ko foreach: getRegion('messages') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<div class="payment-method-billing-address">
<!-- ko foreach: $parent.getRegion(getBillingAddressFormName()) -->
<!-- ko template: getTemplate() --><!-- /ko -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ define(
}
});
} else {
messageList.addErrorMessage({'message': 'Can not initialize PayPal (Braintree)'});
this.messageContainer.addErrorMessage({'message': $t('Can not initialize PayPal (Braintree)')});
}
},
isValid: function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ define(
clientToken: this.clientToken
});
} else {
messageList.addErrorMessage({'message': 'Can not initialize PayPal (Braintree)'});
this.messageContainer.addErrorMessage({'message': $t('Can not initialize PayPal (Braintree)')});
}

return this;
Expand All @@ -116,7 +116,7 @@ define(
var self = this,
cardInfo = null;

messageList.clear();
this.messageContainer.clear();
this.quoteBaseGrandTotals = quote.totals().base_grand_total;

this.isPaymentProcessing = $.Deferred();
Expand Down Expand Up @@ -194,9 +194,9 @@ define(
this.paymentMethodNonce('');

if (_.isObject(error)) {
messageList.addErrorMessage(error);
this.messageContainer.addErrorMessage(error);
} else {
messageList.addErrorMessage({
this.messageContainer.addErrorMessage({
message: error
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
</div>

<div class="payment-method-content">
<!-- ko foreach: getRegion('messages') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<fieldset class="fieldset" data-bind='attr: {id: "payment_form_" + getCode()}'>
<div data-bind="afterRender: initPayPalContainer.bind($data)"></div>
</fieldset>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
</div>

<div class="payment-method-content">
<!-- ko foreach: getRegion('messages') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<div class="payment-method-billing-address">
<!-- ko foreach: $parent.getRegion(getBillingAddressFormName()) -->
<!-- ko template: getTemplate() --><!-- /ko -->
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/Checkout/Block/Adminhtml/CartTab.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* Class CartTab
*
* @package Magento\Checkout\Block\Adminhtml
* @codeCoverageIgnore
*/
class CartTab extends TabWrapper
{
Expand Down
8 changes: 8 additions & 0 deletions app/code/Magento/Checkout/Block/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class Cart extends \Magento\Checkout\Block\Cart\AbstractCart
* @param \Magento\Checkout\Helper\Cart $cartHelper
* @param \Magento\Framework\App\Http\Context $httpContext
* @param array $data
* @codeCoverageIgnore
*/
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
Expand All @@ -55,6 +56,7 @@ public function __construct(
/**
* Prepare Quote Item Product URLs
*
* @codeCoverageIgnore
* @return void
*/
protected function _construct()
Expand Down Expand Up @@ -106,6 +108,7 @@ public function prepareItemUrls()
}

/**
* @codeCoverageIgnore
* @return bool
*/
public function hasError()
Expand All @@ -114,6 +117,7 @@ public function hasError()
}

/**
* @codeCoverageIgnore
* @return int
*/
public function getItemsSummaryQty()
Expand All @@ -122,6 +126,7 @@ public function getItemsSummaryQty()
}

/**
* @codeCoverageIgnore
* @return bool
*/
public function isWishlistActive()
Expand All @@ -140,6 +145,7 @@ public function isWishlistActive()
}

/**
* @codeCoverageIgnore
* @return string
*/
public function getCheckoutUrl()
Expand All @@ -165,6 +171,7 @@ public function getContinueShoppingUrl()

/**
* @return bool
* @codeCoverageIgnore
* @SuppressWarnings(PHPMD.BooleanGetMethodName)
*/
public function getIsVirtual()
Expand Down Expand Up @@ -218,6 +225,7 @@ public function getItems()
}

/**
* @codeCoverageIgnore
* @return int
*/
public function getItemsCount()
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Checkout/Block/Cart/AbstractCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class AbstractCart extends \Magento\Framework\View\Element\Template
* @param \Magento\Customer\Model\Session $customerSession
* @param \Magento\Checkout\Model\Session $checkoutSession
* @param array $data
* @codeCoverageIgnore
*/
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
Expand Down Expand Up @@ -114,6 +115,7 @@ public function getQuote()
* Get all cart items
*
* @return array
* @codeCoverageIgnore
*/
public function getItems()
{
Expand All @@ -134,6 +136,7 @@ public function getItemHtml(\Magento\Quote\Model\Quote\Item $item)

/**
* @return array
* @codeCoverageIgnore
*/
public function getTotals()
{
Expand Down
2 changes: 2 additions & 0 deletions app/code/Magento/Checkout/Block/Cart/Additional/Info.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Info extends \Magento\Framework\View\Element\Template
/**
* @param \Magento\Quote\Model\Quote\Item\AbstractItem $item
* @return $this
* @codeCoverageIgnore
*/
public function setItem(\Magento\Quote\Model\Quote\Item\AbstractItem $item)
{
Expand All @@ -25,6 +26,7 @@ public function setItem(\Magento\Quote\Model\Quote\Item\AbstractItem $item)

/**
* @return \Magento\Quote\Model\Quote\Item\AbstractItem
* @codeCoverageIgnore
*/
public function getItem()
{
Expand Down
2 changes: 2 additions & 0 deletions app/code/Magento/Checkout/Block/Cart/Coupon.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Coupon extends \Magento\Checkout\Block\Cart\AbstractCart
* @param \Magento\Customer\Model\Session $customerSession
* @param \Magento\Checkout\Model\Session $checkoutSession
* @param array $data
* @codeCoverageIgnore
*/
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
Expand All @@ -25,6 +26,7 @@ public function __construct(

/**
* @return string
* @codeCoverageIgnore
*/
public function getCouponCode()
{
Expand Down
4 changes: 4 additions & 0 deletions app/code/Magento/Checkout/Block/Cart/Crosssell.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class Crosssell extends \Magento\Catalog\Block\Product\AbstractProduct
* @param StockHelper $stockHelper
* @param array $data
*
* @codeCoverageIgnore
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
Expand Down Expand Up @@ -131,6 +132,7 @@ public function getItems()
* Count items
*
* @return int
* @codeCoverageIgnore
*/
public function getItemCount()
{
Expand Down Expand Up @@ -162,6 +164,7 @@ protected function _getCartProductIds()
* Get last product ID that was added to cart and remove this information from session
*
* @return int
* @codeCoverageIgnore
*/
protected function _getLastAddedProductId()
{
Expand All @@ -172,6 +175,7 @@ protected function _getLastAddedProductId()
* Get quote instance
*
* @return \Magento\Quote\Model\Quote
* @codeCoverageIgnore
*/
public function getQuote()
{
Expand Down
13 changes: 13 additions & 0 deletions app/code/Magento/Checkout/Block/Cart/Item/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class Renderer extends \Magento\Framework\View\Element\Template implements
* @param InterpretationStrategyInterface $messageInterpretationStrategy
* @param array $data
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
* @codeCoverageIgnore
*/
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
Expand Down Expand Up @@ -132,6 +133,7 @@ public function __construct(
*
* @param AbstractItem $item
* @return $this
* @codeCoverageIgnore
*/
public function setItem(AbstractItem $item)
{
Expand All @@ -143,6 +145,7 @@ public function setItem(AbstractItem $item)
* Get quote item
*
* @return AbstractItem
* @codeCoverageIgnore
*/
public function getItem()
{
Expand All @@ -153,6 +156,7 @@ public function getItem()
* Get item product
*
* @return \Magento\Catalog\Model\Product
* @codeCoverageIgnore
*/
public function getProduct()
{
Expand All @@ -163,6 +167,7 @@ public function getProduct()
* Identify the product from which thumbnail should be taken.
*
* @return \Magento\Catalog\Model\Product
* @codeCoverageIgnore
*/
public function getProductForThumbnail()
{
Expand All @@ -172,6 +177,7 @@ public function getProductForThumbnail()
/**
* @param string $productUrl
* @return $this
* @codeCoverageIgnore
*/
public function overrideProductUrl($productUrl)
{
Expand Down Expand Up @@ -265,6 +271,7 @@ public function getProductOptions()
* Get list of all otions for product
*
* @return array
* @codeCoverageIgnore
*/
public function getOptionList()
{
Expand All @@ -288,6 +295,7 @@ public function getQty()
* Get checkout session
*
* @return \Magento\Checkout\Model\Session
* @codeCoverageIgnore
*/
public function getCheckoutSession()
{
Expand Down Expand Up @@ -368,6 +376,7 @@ public function getFormatedOptionValue($optionValue)
* Check whether Product is visible in site
*
* @return bool
* @codeCoverageIgnore
*/
public function isProductVisible()
{
Expand All @@ -378,6 +387,7 @@ public function isProductVisible()
* Return product additional information block
*
* @return AbstractBlock
* @codeCoverageIgnore
*/
public function getProductAdditionalInformationBlock()
{
Expand All @@ -389,6 +399,7 @@ public function getProductAdditionalInformationBlock()
*
* @param bool $strict
* @return $this
* @codeCoverageIgnore
*/
public function setQtyMode($strict)
{
Expand All @@ -401,6 +412,7 @@ public function setQtyMode($strict)
*
* @param bool $ignore
* @return $this
* @codeCoverageIgnore
*/
public function setIgnoreProductUrl($ignore = true)
{
Expand Down Expand Up @@ -451,6 +463,7 @@ public function getProductPriceHtml(\Magento\Catalog\Model\Product $product)

/**
* @return \Magento\Framework\Pricing\Render
* @codeCoverageIgnore
*/
protected function getPriceRender()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Actions extends Text
* Returns current quote item
*
* @return AbstractItem
* @codeCoverageIgnore
*/
public function getItem()
{
Expand All @@ -31,6 +32,7 @@ public function getItem()
*
* @param AbstractItem $item
* @return $this
* @codeCoverageIgnore
*/
public function setItem(AbstractItem $item)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Generic extends Template
* Returns current quote item
*
* @return AbstractItem
* @codeCoverageIgnore
*/
public function getItem()
{
Expand All @@ -30,6 +31,7 @@ public function getItem()
*
* @param AbstractItem $item
* @return $this
* @codeCoverageIgnore
*/
public function setItem(AbstractItem $item)
{
Expand All @@ -41,6 +43,7 @@ public function setItem(AbstractItem $item)
* Check if product is visible in site visibility
*
* @return bool
* @codeCoverageIgnore
*/
public function isProductVisibleInSiteVisibility()
{
Expand All @@ -51,6 +54,7 @@ public function isProductVisibleInSiteVisibility()
* Check if cart item is virtual
*
* @return bool
* @codeCoverageIgnore
*/
public function isVirtual()
{
Expand Down
Loading

0 comments on commit 4cc81e9

Please sign in to comment.