Skip to content

Commit 7a9dab9

Browse files
committed
MAGETWO-56954: CLONE - Shopping cart page - Reordered items count is not getting updated at mini cart
2 parents eaddb61 + 19c8cef commit 7a9dab9

File tree

46 files changed

+2405
-875
lines changed

Some content is hidden

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

46 files changed

+2405
-875
lines changed

Gruntfile.js.sample

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,19 @@
55

66
// For performance use one level down: 'name/{,*/}*.js'
77
// If you want to recursively match all subfolders, use: 'name/**/*.js'
8+
89
module.exports = function (grunt) {
910
'use strict';
1011

1112
var _ = require('underscore'),
1213
path = require('path'),
13-
themes = require('./dev/tools/grunt/configs/themes'),
14+
filesRouter = require('./dev/tools/grunt/tools/files-router'),
1415
configDir = './dev/tools/grunt/configs',
15-
tasks = grunt.file.expand('./dev/tools/grunt/tasks/*');
16+
tasks = grunt.file.expand('./dev/tools/grunt/tasks/*'),
17+
themes;
18+
19+
filesRouter.set('themes', 'dev/tools/grunt/configs/themes');
20+
themes = filesRouter.get('themes');
1621

1722
tasks = _.map(tasks, function(task){ return task.replace('.js', '') });
1823
tasks.push('time-grunt');

app/code/Magento/Braintree/Gateway/Config/Config.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,4 +193,14 @@ public function getDynamicDescriptors()
193193
}
194194
return $values;
195195
}
196+
197+
/**
198+
* Get Merchant account ID
199+
*
200+
* @return string
201+
*/
202+
public function getMerchantAccountId()
203+
{
204+
return $this->getValue(self::KEY_MERCHANT_ACCOUNT_ID);
205+
}
196206
}

app/code/Magento/Braintree/Gateway/Request/PaymentDataBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function build(array $buildSubject)
8787
self::ORDER_ID => $order->getOrderIncrementId()
8888
];
8989

90-
$merchantAccountId = $this->config->getValue(Config::KEY_MERCHANT_ACCOUNT_ID);
90+
$merchantAccountId = $this->config->getMerchantAccountId();
9191
if (!empty($merchantAccountId)) {
9292
$result[self::MERCHANT_ACCOUNT_ID] = $merchantAccountId;
9393
}

app/code/Magento/Braintree/Model/Ui/ConfigProvider.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Braintree\Model\Ui;
77

8+
use Magento\Braintree\Gateway\Request\PaymentDataBuilder;
89
use Magento\Checkout\Model\ConfigProviderInterface;
910
use Magento\Braintree\Gateway\Config\Config;
1011
use Magento\Braintree\Model\Adapter\BraintreeAdapter;
@@ -86,7 +87,14 @@ public function getConfig()
8687
public function getClientToken()
8788
{
8889
if (empty($this->clientToken)) {
89-
$this->clientToken = $this->adapter->generate();
90+
$params = [];
91+
92+
$merchantAccountId = $this->config->getMerchantAccountId();
93+
if (!empty($merchantAccountId)) {
94+
$params[PaymentDataBuilder::MERCHANT_ACCOUNT_ID] = $merchantAccountId;
95+
}
96+
97+
$this->clientToken = $this->adapter->generate($params);
9098
}
9199

92100
return $this->clientToken;

app/code/Magento/Braintree/Test/Unit/Gateway/Request/PaymentDataBuilderTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ public function testBuild()
133133
->willReturnMap($additionalData);
134134

135135
$this->configMock->expects(static::once())
136-
->method('getValue')
137-
->with(Config::KEY_MERCHANT_ACCOUNT_ID)
136+
->method('getMerchantAccountId')
138137
->willReturn(self::MERCHANT_ACCOUNT_ID);
139138

140139
$this->paymentDO->expects(static::once())

app/code/Magento/Braintree/Test/Unit/Model/Ui/ConfigProviderTest.php

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
class ConfigProviderTest extends \PHPUnit_Framework_TestCase
1919
{
2020
const SDK_URL = 'https://js.braintreegateway.com/v2/braintree.js';
21-
2221
const CLIENT_TOKEN = 'token';
22+
const MERCHANT_ACCOUNT_ID = '245345';
2323

2424
/**
2525
* @var Config|MockObject
@@ -76,11 +76,17 @@ public function testGetConfig($config, $expected)
7676

7777
/**
7878
* @covers \Magento\Braintree\Model\Ui\ConfigProvider::getClientToken
79+
* @dataProvider getClientTokenDataProvider
7980
*/
80-
public function testGetClientToken()
81+
public function testGetClientToken($merchantAccountId, $params)
8182
{
83+
$this->config->expects(static::once())
84+
->method('getMerchantAccountId')
85+
->willReturn($merchantAccountId);
86+
8287
$this->braintreeAdapter->expects(static::once())
8388
->method('generate')
89+
->with($params)
8490
->willReturn(self::CLIENT_TOKEN);
8591

8692
static::assertEquals(self::CLIENT_TOKEN, $this->configProvider->getClientToken());
@@ -140,4 +146,21 @@ public function getConfigDataProvider()
140146
]
141147
];
142148
}
149+
150+
/**
151+
* @return array
152+
*/
153+
public function getClientTokenDataProvider()
154+
{
155+
return [
156+
[
157+
'merchantAccountId' => '',
158+
'params' => []
159+
],
160+
[
161+
'merchantAccountId' => self::MERCHANT_ACCOUNT_ID,
162+
'params' => ['merchantAccountId' => self::MERCHANT_ACCOUNT_ID]
163+
]
164+
];
165+
}
143166
}

app/code/Magento/Catalog/i18n/en_US.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,7 @@ Image,Image
701701
"Allowed file types: jpeg, gif, png.","Allowed file types: jpeg, gif, png."
702702
"Image Opacity","Image Opacity"
703703
"Example format: 200x300.","Example format: 200x300."
704+
"This value does not follow the specified format (for example, 200X300).","This value does not follow the specified format (for example, 200X300)."
704705
"Image Position","Image Position"
705706
Small,Small
706707
"Attribute Label","Attribute Label"

app/code/Magento/Catalog/view/adminhtml/ui_component/design_config_form.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@
5555
<field name="watermark_image_size">
5656
<argument name="data" xsi:type="array">
5757
<item name="config" xsi:type="array">
58+
<item name="component" xsi:type="string">Magento_Catalog/component/image-size-field</item>
5859
<item name="label" xsi:type="string" translate="true">Image Size</item>
5960
<item name="dataType" xsi:type="string">text</item>
6061
<item name="formElement" xsi:type="string">input</item>
6162
<item name="dataScope" xsi:type="string">watermark_image_size</item>
6263
<item name="validation" xsi:type="array">
63-
<item name="validate-digits" xsi:type="boolean">true</item>
64+
<item name="validate-image-size-range" xsi:type="boolean">true</item>
6465
</item>
6566
<item name="notice" xsi:type="string" translate="true">Example format: 200x300.</item>
6667
</item>
@@ -118,12 +119,13 @@
118119
<field name="watermark_thumbnail_size">
119120
<argument name="data" xsi:type="array">
120121
<item name="config" xsi:type="array">
122+
<item name="component" xsi:type="string">Magento_Catalog/component/image-size-field</item>
121123
<item name="label" xsi:type="string" translate="true">Image Size</item>
122124
<item name="dataType" xsi:type="string">text</item>
123125
<item name="formElement" xsi:type="string">input</item>
124126
<item name="dataScope" xsi:type="string">watermark_thumbnail_size</item>
125127
<item name="validation" xsi:type="array">
126-
<item name="validate-digits" xsi:type="boolean">true</item>
128+
<item name="validate-image-size-range" xsi:type="boolean">true</item>
127129
</item>
128130
<item name="notice" xsi:type="string" translate="true">Example format: 200x300.</item>
129131
</item>
@@ -181,12 +183,13 @@
181183
<field name="watermark_small_image_size">
182184
<argument name="data" xsi:type="array">
183185
<item name="config" xsi:type="array">
186+
<item name="component" xsi:type="string">Magento_Catalog/component/image-size-field</item>
184187
<item name="label" xsi:type="string" translate="true">Image Size</item>
185188
<item name="dataType" xsi:type="string">text</item>
186189
<item name="formElement" xsi:type="string">input</item>
187190
<item name="dataScope" xsi:type="string">watermark_small_image_size</item>
188191
<item name="validation" xsi:type="array">
189-
<item name="validate-digits" xsi:type="boolean">true</item>
192+
<item name="validate-image-size-range" xsi:type="boolean">true</item>
190193
</item>
191194
<item name="notice" xsi:type="string" translate="true">Example format: 200x300.</item>
192195
</item>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/**
2+
* Copyright © 2016 Magento. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'jquery',
8+
'Magento_Ui/js/lib/validation/utils',
9+
'Magento_Ui/js/form/element/abstract',
10+
'Magento_Ui/js/lib/validation/validator'
11+
], function ($, utils, Abstract, validator) {
12+
'use strict';
13+
14+
validator.addRule(
15+
'validate-image-size-range',
16+
function (value) {
17+
var dataAttrRange = /^(\d+)x(\d+)$/,
18+
m;
19+
20+
if (utils.isEmptyNoTrim(value)) {
21+
return true;
22+
}
23+
24+
m = dataAttrRange.exec(value);
25+
26+
return !!(m && m[1] > 0 && m[2] > 0);
27+
},
28+
$.mage.__('This value does not follow the specified format (for example, 200X300).')
29+
);
30+
31+
return Abstract.extend({
32+
33+
/**
34+
* Checks for relevant value
35+
*
36+
* @returns {Boolean}
37+
*/
38+
isRangeCorrect: function () {
39+
return validator('validate-image-size-range', this.value()).passed;
40+
}
41+
});
42+
});

app/code/Magento/CatalogInventory/Setup/InstallSchema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
249249
\Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
250250
5,
251251
['unsigned' => true, 'nullable' => false, 'default' => 0],
252-
'Is Divided into Multiple Boxes for Shipping'
252+
'Website ID'
253253
)
254254
->addIndex(
255255
$installer->getIdxName(

app/code/Magento/CatalogInventory/etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9-
<module name="Magento_CatalogInventory" setup_version="2.0.0">
9+
<module name="Magento_CatalogInventory" setup_version="2.0.1">
1010
<sequence>
1111
<module name="Magento_Catalog"/>
1212
</sequence>

app/code/Magento/Checkout/view/frontend/web/js/region-updater.js

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ define([
2525
isMultipleCountriesAllowed: true
2626
},
2727

28+
/**
29+
*
30+
* @private
31+
*/
2832
_create: function () {
2933
this._initCountryElement();
3034

@@ -43,12 +47,18 @@ define([
4347
}, this));
4448
},
4549

46-
_initCountryElement: function() {
50+
/**
51+
*
52+
* @private
53+
*/
54+
_initCountryElement: function () {
55+
4756
if (this.options.isMultipleCountriesAllowed) {
4857
this.element.parents('div.field').show();
4958
this.element.on('change', $.proxy(function (e) {
5059
this._updateRegion($(e.target).val());
5160
}, this));
61+
5262
if (this.options.isCountryRequired) {
5363
this.element.addClass('required-entry');
5464
this.element.parents('div.field').addClass('required');
@@ -60,6 +70,7 @@ define([
6070

6171
/**
6272
* Remove options from dropdown list
73+
*
6374
* @param {Object} selectElement - jQuery object for dropdown list
6475
* @private
6576
*/
@@ -113,7 +124,7 @@ define([
113124
* @private
114125
*/
115126
_clearError: function () {
116-
if (this.options.clearError && typeof (this.options.clearError) === 'function') {
127+
if (this.options.clearError && typeof this.options.clearError === 'function') {
117128
this.options.clearError.call(this);
118129
} else {
119130
if (!this.options.form) {
@@ -122,12 +133,19 @@ define([
122133

123134
this.options.form = $(this.options.form);
124135

125-
this.options.form && this.options.form.data('validation') && this.options.form.validation('clearError',
136+
this.options.form && this.options.form.data('validator') && this.options.form.validation('clearError',
126137
this.options.regionListId, this.options.regionInputId, this.options.postcodeId);
138+
139+
// Clean up errors on region & zip fix
140+
$(this.options.regionInputId).removeClass('mage-error').parent().find('[generated]').remove();
141+
$(this.options.regionListId).removeClass('mage-error').parent().find('[generated]').remove();
142+
$(this.options.postcodeId).removeClass('mage-error').parent().find('[generated]').remove();
127143
}
128144
},
145+
129146
/**
130147
* Update dropdown list based on the country selected
148+
*
131149
* @param {String} country - 2 uppercase letter for country code
132150
* @private
133151
*/
@@ -182,11 +200,12 @@ define([
182200
if (!this.options.optionalRegionAllowed) {
183201
regionInput.attr('disabled', 'disabled');
184202
}
203+
requiredLabel.removeClass('required');
204+
regionInput.removeClass('required-entry');
185205
}
186206

187207
regionList.removeClass('required-entry').hide();
188208
regionInput.show();
189-
requiredLabel.removeClass('required');
190209
label.attr('for', regionInput.attr('id'));
191210
}
192211

@@ -208,10 +227,11 @@ define([
208227
* @private
209228
*/
210229
_checkRegionRequired: function (country) {
211-
this.options.isRegionRequired = false;
212230
var self = this;
231+
232+
this.options.isRegionRequired = false;
213233
$.each(this.options.regionJson.config.regions_required, function (index, elem) {
214-
if (elem == country) {
234+
if (elem === country) {
215235
self.options.isRegionRequired = true;
216236
}
217237
});

app/code/Magento/Dhl/Model/Plugin/Rma/Block/Adminhtml/Rma/Edit/Tab/General/Shippingmethod.php

Lines changed: 0 additions & 39 deletions
This file was deleted.

app/code/Magento/Dhl/composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
"lib-libxml": "*"
1717
},
1818
"suggest": {
19-
"magento/module-checkout": "100.2.*",
20-
"magento/module-rma": "100.2.*"
19+
"magento/module-checkout": "100.2.*"
2120
},
2221
"type": "magento2-module",
2322
"version": "100.2.0-dev",

0 commit comments

Comments
 (0)