Skip to content

Commit ee2ce79

Browse files
committed
MAGETWO-55345: Grunt uses actual theme's list
2 parents a441f22 + 8744435 commit ee2ce79

File tree

454 files changed

+9169
-3474
lines changed

Some content is hidden

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

454 files changed

+9169
-3474
lines changed

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/Catalog/view/frontend/templates/product/view/form.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<script>
4141
require([
4242
'jquery',
43-
'Magento_Catalog/js/price-box'
43+
'priceBox'
4444
], function($){
4545
var priceBoxes = $('[data-role=priceBox]');
4646

app/code/Magento/CatalogImportExport/Model/Export/Product.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,6 +1284,14 @@ protected function getCustomOptionsData($productIds)
12841284
$row['max_characters'] = $option['max_characters'];
12851285
}
12861286

1287+
foreach (['file_extension', 'image_size_x', 'image_size_y'] as $fileOptionKey) {
1288+
if (!isset($option[$fileOptionKey])) {
1289+
continue;
1290+
}
1291+
1292+
$row[$fileOptionKey] = $option[$fileOptionKey];
1293+
}
1294+
12871295
$values = $option->getValues();
12881296

12891297
if ($values) {

0 commit comments

Comments
 (0)