Skip to content

Commit ee1daef

Browse files
author
Oleksandr Iegorov
committed
Merge branch 'develop' of https://github.com/magento/magento2ce into MAGETWO-55757
2 parents ddb1eea + 1630c06 commit ee1daef

File tree

341 files changed

+3362
-1658
lines changed

Some content is hidden

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

341 files changed

+3362
-1658
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/Catalog/view/frontend/layout/catalog_product_view.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,33 @@
101101
</block>
102102
</container>
103103
<container name="product.info.media" htmlTag="div" htmlClass="product media" after="product.info.main">
104+
<block class="Magento\Framework\View\Element\Template" name="skip_gallery_after.target" before="skip_gallery_before.wrapper" template="Magento_Theme::html/skiptarget.phtml">
105+
<arguments>
106+
<argument name="target_id" xsi:type="string">gallery-prev-area</argument>
107+
</arguments>
108+
</block>
109+
<container name="skip_gallery_before.wrapper" htmlTag="div" htmlClass="action-skip-wrapper">
110+
<block class="Magento\Framework\View\Element\Template" before="product.info.media.image" name="skip_gallery_before" template="Magento_Theme::html/skip.phtml">
111+
<arguments>
112+
<argument name="target" xsi:type="string">gallery-next-area</argument>
113+
<argument name="label" translate="true" xsi:type="string">Skip to the end of the images gallery</argument>
114+
</arguments>
115+
</block>
116+
</container>
104117
<block class="Magento\Catalog\Block\Product\View\Gallery" name="product.info.media.image" template="product/view/gallery.phtml"/>
118+
<container name="skip_gallery_after.wrapper" htmlTag="div" htmlClass="action-skip-wrapper">
119+
<block class="Magento\Framework\View\Element\Template" after="product.info.media.image" name="skip_gallery_after" template="Magento_Theme::html/skip.phtml">
120+
<arguments>
121+
<argument name="target" xsi:type="string">gallery-prev-area</argument>
122+
<argument name="label" translate="true" xsi:type="string">Skip to the beginning of the images gallery</argument>
123+
</arguments>
124+
</block>
125+
</container>
126+
<block class="Magento\Framework\View\Element\Template" name="skip_gallery_before.target" after="skip_gallery_after.wrapper" template="Magento_Theme::html/skiptarget.phtml">
127+
<arguments>
128+
<argument name="target_id" xsi:type="string">gallery-next-area</argument>
129+
</arguments>
130+
</block>
105131
</container>
106132
<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.details" template="product/view/details.phtml" after="product.info.media">
107133
<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.description" template="product/view/attribute.phtml" group="detailed_info">

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) {

app/code/Magento/CatalogImportExport/Model/Import/Product/Option.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ class Option extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
105105
'radio' => true,
106106
'checkbox' => true,
107107
'multiple' => true,
108+
'file' => ['sku', 'file_extension', 'image_size_x', 'image_size_y'],
108109
];
109110

110111
/**
@@ -1136,6 +1137,28 @@ private function processOptionRow($name, $optionRow)
11361137
$result[$this->columnMaxCharacters] = $optionRow['max_characters'];
11371138
}
11381139

1140+
$result = $this->addFileOptions($result, $optionRow);
1141+
1142+
return $result;
1143+
}
1144+
1145+
/**
1146+
* Add file options
1147+
*
1148+
* @param array $result
1149+
* @param array $optionRow
1150+
* @return array
1151+
*/
1152+
private function addFileOptions($result, $optionRow)
1153+
{
1154+
foreach (['file_extension', 'image_size_x', 'image_size_y'] as $fileOptionKey) {
1155+
if (!isset($optionRow[$fileOptionKey])) {
1156+
continue;
1157+
}
1158+
1159+
$result[self::COLUMN_PREFIX . $fileOptionKey] = $optionRow[$fileOptionKey];
1160+
}
1161+
11391162
return $result;
11401163
}
11411164

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/CatalogSearch/view/frontend/templates/advanced/result.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<?php endif; ?>
2222
</div>
2323
<?php else: ?>
24-
<div class="message error">
24+
<div role="alert" class="message error">
2525
<div>
2626
<?php /* @escapeNotVerified */ echo __('We can\'t find any items matching these search criteria.');?> <a href="<?php /* @escapeNotVerified */ echo $block->getFormUrl(); ?>"><?php /* @escapeNotVerified */ echo __('Modify your search.'); ?></a>
2727
</div>

0 commit comments

Comments
 (0)