Skip to content

Commit 6fae14c

Browse files
committed
MAGETWO-56954: Shopping cart page - Reordered items count is not getting updated at mini cart
2 parents d84cb64 + d323ecb commit 6fae14c

File tree

70 files changed

+1539
-272
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1539
-272
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\AdminNotification\Ui\Component\DataProvider;
8+
9+
use Magento\AdminNotification\Model\ResourceModel\System\Message\Collection\SynchronizedFactory;
10+
11+
/**
12+
* Class DataProvider
13+
*/
14+
class DataProvider extends \Magento\Ui\DataProvider\AbstractDataProvider
15+
{
16+
/**
17+
* DataProvider constructor.
18+
* @param string $name
19+
* @param string $primaryFieldName
20+
* @param string $requestFieldName
21+
* @param SynchronizedFactory $messageCollectionFactory
22+
* @param array $meta
23+
* @param array $data
24+
*/
25+
public function __construct(
26+
$name,
27+
$primaryFieldName,
28+
$requestFieldName,
29+
SynchronizedFactory $messageCollectionFactory,
30+
array $meta = [],
31+
array $data = []
32+
) {
33+
$this->collection = $messageCollectionFactory->create();
34+
parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data);
35+
}
36+
}

app/code/Magento/AdminNotification/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"magento/module-backend": "100.2.*",
88
"magento/module-media-storage": "100.2.*",
99
"magento/framework": "100.2.*",
10+
"magento/module-ui": "100.2.*",
1011
"lib-libxml": "*"
1112
},
1213
"type": "magento2-module",

app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<body>
1010
<referenceContainer name="notifications">
11-
<block class="Magento\AdminNotification\Block\System\Messages"
12-
name="system_messages"
13-
as="system_messages"
14-
before="-"
15-
template="Magento_AdminNotification::system/messages.phtml"/>
11+
<uiComponent name="notification_area"/>
1612
<block class="Magento\AdminNotification\Block\System\Messages\UnreadMessagePopup"
1713
name="unread_system_messages"
1814
as="unread_system_messages"
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © 2016 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
9+
<argument name="data" xsi:type="array">
10+
<item name="js_config" xsi:type="array">
11+
<item name="provider" xsi:type="string">notification_area.notification_area_data_source</item>
12+
<item name="deps" xsi:type="string">notification_area.notification_area_data_source</item>
13+
</item>
14+
<item name="spinner" xsi:type="string">columns</item>
15+
</argument>
16+
<dataSource name="notification_area_data_source">
17+
<argument name="dataProvider" xsi:type="configurableObject">
18+
<argument name="class" xsi:type="string">Magento\AdminNotification\Ui\Component\DataProvider\DataProvider</argument>
19+
<argument name="name" xsi:type="string">notification_area_data_source</argument>
20+
<argument name="primaryFieldName" xsi:type="string">identity</argument>
21+
<argument name="requestFieldName" xsi:type="string">identity</argument>
22+
<argument name="data" xsi:type="array">
23+
<item name="config" xsi:type="array">
24+
<item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
25+
<item name="update_url" xsi:type="url" path="mui/index/render"/>
26+
<item name="storageConfig" xsi:type="array">
27+
<item name="indexField" xsi:type="string">identity</item>
28+
</item>
29+
</item>
30+
</argument>
31+
</argument>
32+
</dataSource>
33+
<columns name="columns">
34+
<argument name="data" xsi:type="array">
35+
<item name="config" xsi:type="array">
36+
<item name="component" xsi:type="string">Magento_AdminNotification/js/grid/listing</item>
37+
<item name="template" xsi:type="string">Magento_AdminNotification/grid/listing</item>
38+
</item>
39+
</argument>
40+
<column name="created_at">
41+
<argument name="data" xsi:type="array">
42+
<item name="config" xsi:type="array">
43+
<item name="component" xsi:type="string">Magento_AdminNotification/js/grid/columns/message</item>
44+
<item name="label" xsi:type="string" translate="true"/>
45+
<item name="dataType" xsi:type="string">text</item>
46+
<item name="sorting" xsi:type="string">asc</item>
47+
<item name="sortOrder" xsi:type="number">30</item>
48+
</item>
49+
</argument>
50+
</column>
51+
</columns>
52+
</listing>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**
2+
* Copyright © 2016 Magento. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
define([
6+
'Magento_Ui/js/grid/columns/column',
7+
'underscore'
8+
], function (Column, _) {
9+
'use strict';
10+
11+
return Column.extend({
12+
defaults: {
13+
bodyTmpl: 'Magento_AdminNotification/grid/cells/message',
14+
messageIndex: 'text',
15+
fieldClass: {
16+
message: true,
17+
'message-warning': false,
18+
'message-progress': false,
19+
'message-success': false,
20+
'message-error': false
21+
},
22+
statusMap: {
23+
0: 'info',
24+
1: 'progress',
25+
2: 'success',
26+
3: 'error'
27+
}
28+
},
29+
30+
/** @inheritdoc */
31+
getLabel: function (record) {
32+
return record[this.messageIndex];
33+
},
34+
35+
/** @inheritdoc */
36+
getFieldClass: function ($row) {
37+
var status = this.statusMap[$row.status] || 'warning',
38+
result = {};
39+
40+
result['message-' + status] = true;
41+
result = _.extend({}, this.fieldClass, result);
42+
43+
return result;
44+
}
45+
});
46+
});
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/**
2+
* Copyright © 2016 Magento. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'Magento_Ui/js/grid/listing',
8+
'Magento_Ui/js/lib/spinner',
9+
'jquery'
10+
], function (Listing, loader, $) {
11+
'use strict';
12+
13+
return Listing.extend({
14+
defaults: {
15+
imports: {
16+
totalRecords: '${ $.provider }:data.totalRecords'
17+
},
18+
selectors: {
19+
collapsible: '.message-system-collapsible',
20+
messages: '.message-system'
21+
}
22+
},
23+
24+
/** @inheritdoc */
25+
initObservable: function () {
26+
this._super()
27+
.track({
28+
totalRecords: 0
29+
});
30+
31+
return this;
32+
},
33+
34+
/** @inheritdoc */
35+
showLoader: function () {
36+
if (!this.source.firstLoad) {
37+
this.fixLoaderHeight();
38+
this._super();
39+
}
40+
},
41+
42+
/**
43+
* Calculates loader height
44+
*
45+
* @param {Boolean} [closed]
46+
*/
47+
fixLoaderHeight: function (closed) {
48+
var $messagesBlock = $(this.selectors.messages),
49+
$collapsibleBlock = $(this.selectors.collapsible),
50+
resultHeight = 0;
51+
52+
if ($messagesBlock.length) {
53+
resultHeight += $messagesBlock.outerHeight();
54+
}
55+
56+
if ($collapsibleBlock.length && $collapsibleBlock.is(':visible') && !closed) {
57+
resultHeight += $collapsibleBlock.outerHeight();
58+
}
59+
60+
loader.get(this.name).height(resultHeight);
61+
}
62+
});
63+
});
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!--
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<div css="$col.getFieldClass($row())"
8+
html="$col.getLabel($row())"/>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!--
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<div id="system_messages" class="message-system" collapsible visible="totalRecords">
8+
<div class="message-system-inner" outerClick="fixLoaderHeight.bind($data, true)">
9+
<div class="message-system-short">
10+
<button class="message-system-action-dropdown" toggleCollapsible>
11+
<span>
12+
<translate args="'System Messages'"/>:
13+
<text args="totalRecords"/>
14+
</span>
15+
</button>
16+
<div class="message-system-short-wrapper" if="rows[0]" repeat="foreach: [rows[0]], item: '$row'" visible="!$collapsible.opened()">
17+
<fastForEach args="data: getVisible(), as: '$col'" >
18+
<render args="$col.getBody()"/>
19+
</fastForEach>
20+
</div>
21+
</div>
22+
<div class="message-system-collapsible">
23+
<ul class="message-system-list">
24+
<li repeat="foreach: rows, item: '$row'">
25+
<fastForEach args="data: getVisible(), as: '$col'" >
26+
<render args="$col.getBody()"/>
27+
</fastForEach>
28+
</li>
29+
</ul>
30+
</div>
31+
</div>
32+
</div>

app/code/Magento/Catalog/Api/Data/ProductAttributeInterface.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
interface ProductAttributeInterface extends \Magento\Catalog\Api\Data\EavAttributeInterface
1313
{
1414
const ENTITY_TYPE_CODE = 'catalog_product';
15-
const CODE_TIER_PRICE_FIELD_PRICE = 'price';
1615
const CODE_HAS_WEIGHT = 'product_has_weight';
1716
const CODE_SPECIAL_PRICE = 'special_price';
1817
const CODE_PRICE = 'price';
@@ -27,6 +26,9 @@ interface ProductAttributeInterface extends \Magento\Catalog\Api\Data\EavAttribu
2726
const CODE_COST = 'cost';
2827
const CODE_SEO_FIELD_URL_KEY = 'url_key';
2928
const CODE_TIER_PRICE = 'tier_price';
29+
const CODE_TIER_PRICE_FIELD_PRICE = 'price';
30+
const CODE_TIER_PRICE_FIELD_PERCENTAGE_VALUE = 'percentage_value';
31+
const CODE_TIER_PRICE_FIELD_VALUE_TYPE = 'value_type';
3032
const CODE_SEO_FIELD_META_DESCRIPTION = 'meta_description';
3133
const CODE_WEIGHT = 'weight';
3234
}

app/code/Magento/Catalog/Api/ProductTierPriceManagementInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
/**
1010
* @api
11+
* @deprecated use ScopedProductTierPriceManagementInterface instead
1112
*/
1213
interface ProductTierPriceManagementInterface
1314
{
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
/**
3+
*
4+
* Copyright © 2016 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
namespace Magento\Catalog\Api;
8+
9+
/**
10+
* @api
11+
*/
12+
interface ScopedProductTierPriceManagementInterface
13+
{
14+
/**
15+
* Create tier price for product
16+
*
17+
* @param string $sku
18+
* @param \Magento\Catalog\Api\Data\ProductTierPriceInterface $tierPrice
19+
* @return boolean
20+
* @throws \Magento\Framework\Exception\NoSuchEntityException
21+
* @throws \Magento\Framework\Exception\CouldNotSaveException
22+
*/
23+
public function add($sku, \Magento\Catalog\Api\Data\ProductTierPriceInterface $tierPrice);
24+
25+
/**
26+
* Remove tier price from product
27+
*
28+
* @param string $sku
29+
* @param \Magento\Catalog\Api\Data\ProductTierPriceInterface $tierPrice
30+
* @return boolean
31+
* @throws \Magento\Framework\Exception\NoSuchEntityException
32+
* @throws \Magento\Framework\Exception\CouldNotSaveException
33+
*/
34+
public function remove($sku, \Magento\Catalog\Api\Data\ProductTierPriceInterface $tierPrice);
35+
36+
/**
37+
* Get tier price of product
38+
*
39+
* @param string $sku
40+
* @param string $customerGroupId 'all' can be used to specify 'ALL GROUPS'
41+
* @return \Magento\Catalog\Api\Data\ProductTierPriceInterface[]
42+
* @throws \Magento\Framework\Exception\NoSuchEntityException
43+
*/
44+
public function getList($sku, $customerGroupId);
45+
}

app/code/Magento/Catalog/Model/Config/Source/Product/Options/Price.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
*/
66
namespace Magento\Catalog\Model\Config\Source\Product\Options;
77

8+
use Magento\Catalog\Model\Config\Source\ProductPriceOptionsInterface;
9+
810
/**
911
* Price types mode source
1012
*
1113
* @author Magento Core Team <[email protected]>
1214
*/
13-
class Price implements \Magento\Framework\Option\ArrayInterface
15+
class Price implements ProductPriceOptionsInterface
1416
{
1517
/**
1618
* {@inheritdoc}
@@ -20,8 +22,8 @@ class Price implements \Magento\Framework\Option\ArrayInterface
2022
public function toOptionArray()
2123
{
2224
return [
23-
['value' => 'fixed', 'label' => __('Fixed')],
24-
['value' => 'percent', 'label' => __('Percent')]
25+
['value' => self::VALUE_FIXED, 'label' => __('Fixed')],
26+
['value' => self::VALUE_PERCENT, 'label' => __('Percent')],
2527
];
2628
}
2729
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Catalog\Model\Config\Source;
7+
8+
use Magento\Framework\Data\OptionSourceInterface;
9+
10+
/**
11+
* Interface ProductPriceOptionsInterface
12+
*/
13+
interface ProductPriceOptionsInterface extends OptionSourceInterface
14+
{
15+
/**#@+
16+
* Values
17+
*/
18+
const VALUE_FIXED = 'fixed';
19+
const VALUE_PERCENT = 'percent';
20+
/**#@-*/
21+
}

0 commit comments

Comments
 (0)