Skip to content

Commit 25fbbc5

Browse files
committed
Merge branch 'MAGETWO-42939' of github.corp.ebay.com:magento-troll/magento2ce into m2beta3bugfixes
2 parents 1bce1de + 917dd10 commit 25fbbc5

File tree

282 files changed

+1424
-348
lines changed

Some content is hidden

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

282 files changed

+1424
-348
lines changed

Gruntfile.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.exports = function (grunt) {
99

1010
var _ = require('underscore'),
1111
path = require('path'),
12+
themes = require('./dev/tools/grunt/configs/themes'),
1213
configDir = './dev/tools/grunt/configs',
1314
taskDir = './dev/tools/grunt/tasks';
1415

@@ -63,14 +64,18 @@ module.exports = function (grunt) {
6364
},
6465

6566
/**
66-
* Refresh magento frontend & backend.
67+
* Refresh themes.
6768
*/
68-
refresh: [
69-
'exec:all',
70-
'less:blank',
71-
'less:luma',
72-
'less:backend'
73-
],
69+
refresh: function () {
70+
var tasks = [
71+
'clean',
72+
'exec:all'
73+
];
74+
_.each(themes, function(theme, name) {
75+
tasks.push('less:' + name);
76+
});
77+
grunt.task.run(tasks);
78+
},
7479

7580
/**
7681
* Documentation

app/code/Magento/Authorizenet/view/frontend/web/js/view/payment/method-renderer/authorizenet-directpost.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ define(
4848
var self = this;
4949
if (this.validateHandler() && additionalValidators.validate()) {
5050
this.isPlaceOrderActionAllowed(false);
51-
$.when(setPaymentInformationAction()).done(function() {
51+
$.when(setPaymentInformationAction(this.messageContainer)).done(function() {
5252
self.placeOrderHandler();
5353
}).fail(function() {
5454
self.isPlaceOrderActionAllowed(true);

app/code/Magento/Authorizenet/view/frontend/web/template/payment/authorizenet-directpost.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
</label>
1616
</div>
1717
<div class="payment-method-content">
18+
<!-- ko foreach: getRegion('messages') -->
19+
<!-- ko template: getTemplate() --><!-- /ko -->
20+
<!--/ko-->
1821
<div class="payment-method-billing-address">
1922
<!-- ko foreach: $parent.getRegion(getBillingAddressFormName()) -->
2023
<!-- ko template: getTemplate() --><!-- /ko -->

app/code/Magento/Backend/view/adminhtml/templates/system/cache/additional.phtml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,31 @@
66

77
// @codingStandardsIgnoreFile
88
?>
9-
<div class="fieldset additional-cache-management">
10-
<div class="legend">
9+
<div class="additional-cache-management">
10+
<h2>
1111
<span><?php /* @escapeNotVerified */ echo __('Additional Cache Management') ?></span>
12-
</div>
13-
<div class="field">
12+
</h2>
13+
<p>
1414
<button onclick="setLocation('<?php /* @escapeNotVerified */ echo $block->getCleanImagesUrl() ?>')" type="button">
1515
<?php /* @escapeNotVerified */ echo __('Flush Catalog Images Cache') ?>
1616
</button>
17-
<label class="label"><?php /* @escapeNotVerified */ echo __('Pregenerated product images files') ?></label>
18-
</div>
19-
<div class="field">
17+
<span><?php /* @escapeNotVerified */ echo __('Pregenerated product images files') ?></span>
18+
</p>
19+
<p>
2020
<button onclick="setLocation('<?php /* @escapeNotVerified */ echo $block->getCleanMediaUrl() ?>')" type="button">
2121
<?php /* @escapeNotVerified */ echo __('Flush JavaScript/CSS Cache') ?>
2222
</button>
23-
<label class="label"><?php /* @escapeNotVerified */ echo __('Themes JavaScript and CSS files combined to one file.') ?></label>
24-
</div>
23+
<span><?php /* @escapeNotVerified */ echo __('Themes JavaScript and CSS files combined to one file.') ?></span>
24+
</p>
2525
<?php
2626
if (!$block->isInProductionMode()):
2727
?>
28-
<div class="field">
28+
<p>
2929
<button onclick="setLocation('<?php /* @escapeNotVerified */ echo $block->getCleanStaticFilesUrl() ?>')" type="button">
3030
<?php /* @escapeNotVerified */ echo __('Flush Static Files Cache') ?>
3131
</button>
32-
<label class="label"><?php /* @escapeNotVerified */ echo __('Preprocessed view files and static files') ?></label>
33-
</div>
32+
<span><?php /* @escapeNotVerified */ echo __('Preprocessed view files and static files') ?></span>
33+
</p>
3434
<?php
3535
endif;
3636
?>

app/code/Magento/Braintree/Block/Adminhtml/Form/Field/Cctypes.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Cctypes extends \Magento\Framework\View\Element\Html\Select
99
{
1010
/**
1111
* All possible credit card types
12-
*
12+
*
1313
* @var array
1414
*/
1515
protected $ccTypes = [];
@@ -49,13 +49,14 @@ public function _toHtml()
4949
}
5050
}
5151
}
52-
$this->setExtraParams('multiple="multiple" style="height:80px;"');
52+
$this->setClass('cc-type-select');
53+
$this->setExtraParams('multiple="multiple"');
5354
return parent::_toHtml();
5455
}
5556

5657
/**
5758
* All possible credit card types
58-
*
59+
*
5960
* @return array
6061
*/
6162
protected function _getCcTypes()

app/code/Magento/Braintree/Test/Unit/Block/Adminhtml/Form/Field/CctypesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function testToHtml()
2727
);
2828

2929
$result = $ccTypes->_toHtml();
30-
$expected = '<select name="" id="" class="" title="" multiple="multiple" style="height:80px;">'
30+
$expected = '<select name="" id="" class="cc-type-select" title="" multiple="multiple">'
3131
. '<option value="" ></option></select>';
3232
$this->assertSame($expected, $result);
3333
}

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/braintree-paypal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ define(
103103
}
104104
});
105105
} else {
106-
messageList.addErrorMessage({'message': 'Can not initialize PayPal (Braintree)'});
106+
this.messageContainer.addErrorMessage({'message': $t('Can not initialize PayPal (Braintree)')});
107107
}
108108
},
109109
isValid: function () {

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ define(
103103
clientToken: this.clientToken
104104
});
105105
} else {
106-
messageList.addErrorMessage({'message': 'Can not initialize PayPal (Braintree)'});
106+
this.messageContainer.addErrorMessage({'message': $t('Can not initialize PayPal (Braintree)')});
107107
}
108108

109109
return this;
@@ -116,7 +116,7 @@ define(
116116
var self = this,
117117
cardInfo = null;
118118

119-
messageList.clear();
119+
this.messageContainer.clear();
120120
this.quoteBaseGrandTotals = quote.totals().base_grand_total;
121121

122122
this.isPaymentProcessing = $.Deferred();
@@ -194,9 +194,9 @@ define(
194194
this.paymentMethodNonce('');
195195

196196
if (_.isObject(error)) {
197-
messageList.addErrorMessage(error);
197+
this.messageContainer.addErrorMessage(error);
198198
} else {
199-
messageList.addErrorMessage({
199+
this.messageContainer.addErrorMessage({
200200
message: error
201201
});
202202
}

app/code/Magento/Braintree/view/frontend/web/template/payment/braintree-paypal-form.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
</div>
1818

1919
<div class="payment-method-content">
20+
<!-- ko foreach: getRegion('messages') -->
21+
<!-- ko template: getTemplate() --><!-- /ko -->
22+
<!--/ko-->
2023
<fieldset class="fieldset" data-bind='attr: {id: "payment_form_" + getCode()}'>
2124
<div data-bind="afterRender: initPayPalContainer.bind($data)"></div>
2225
</fieldset>

app/code/Magento/Braintree/view/frontend/web/template/payment/cc-form.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
</div>
2323

2424
<div class="payment-method-content">
25+
<!-- ko foreach: getRegion('messages') -->
26+
<!-- ko template: getTemplate() --><!-- /ko -->
27+
<!--/ko-->
2528
<div class="payment-method-billing-address">
2629
<!-- ko foreach: $parent.getRegion(getBillingAddressFormName()) -->
2730
<!-- ko template: getTemplate() --><!-- /ko -->

app/code/Magento/CacheInvalidate/Model/PurgeCache.php

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
class PurgeCache
1717
{
1818
/**
19-
* @var Uri
19+
* @var UriFactory
2020
*/
21-
protected $uri;
21+
protected $uriFactory;
2222

2323
/**
24-
* @var Socket
24+
* @var SocketFactory
2525
*/
26-
protected $socketAdapter;
26+
protected $socketAdapterFactory;
2727

2828
/**
2929
* @var InvalidateLogger
@@ -45,21 +45,21 @@ class PurgeCache
4545
/**
4646
* Constructor
4747
*
48-
* @param Uri $uri
49-
* @param Socket $socketAdapter
48+
* @param UriFactory $uriFactory
49+
* @param SocketFactory $socketAdapterFactory
5050
* @param InvalidateLogger $logger
5151
* @param Reader $configReader
5252
* @param RequestInterface $request
5353
*/
5454
public function __construct(
55-
Uri $uri,
56-
Socket $socketAdapter,
55+
UriFactory $uriFactory,
56+
SocketFactory $socketAdapterFactory,
5757
InvalidateLogger $logger,
5858
DeploymentConfig $config,
5959
RequestInterface $request
6060
) {
61-
$this->uri = $uri;
62-
$this->socketAdapter = $socketAdapter;
61+
$this->uriFactory = $uriFactory;
62+
$this->socketAdapterFactory = $socketAdapterFactory;
6363
$this->logger = $logger;
6464
$this->config = $config;
6565
$this->request = $request;
@@ -74,24 +74,26 @@ public function __construct(
7474
*/
7575
public function sendPurgeRequest($tagsPattern)
7676
{
77+
$uri = $this->uriFactory->create();
78+
$socketAdapter = $this->socketAdapterFactory->create();
7779
$servers = $this->config->get(ConfigOptionsListConstants::CONFIG_PATH_CACHE_HOSTS)
7880
?: [['host' => $this->request->getHttpHost()]];
7981
$headers = ['X-Magento-Tags-Pattern' => $tagsPattern];
80-
$this->socketAdapter->setOptions(['timeout' => 10]);
82+
$socketAdapter->setOptions(['timeout' => 10]);
8183
foreach ($servers as $server) {
8284
$port = isset($server['port']) ? $server['port'] : self::DEFAULT_PORT;
83-
$this->uri->setScheme('http')
85+
$uri->setScheme('http')
8486
->setHost($server['host'])
8587
->setPort($port);
8688
try {
87-
$this->socketAdapter->connect($server['host'], $port);
88-
$this->socketAdapter->write(
89+
$socketAdapter->connect($server['host'], $port);
90+
$socketAdapter->write(
8991
'PURGE',
90-
$this->uri,
92+
$uri,
9193
'1.1',
9294
$headers
9395
);
94-
$this->socketAdapter->close();
96+
$socketAdapter->close();
9597
} catch (Exception $e) {
9698
$this->logger->critical($e->getMessage(), compact('server', 'tagsPattern'));
9799
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\CacheInvalidate\Model;
7+
8+
class SocketFactory
9+
{
10+
11+
/**
12+
* @return \Zend\Http\Client\Adapter\Socket
13+
*/
14+
public function create()
15+
{
16+
return new \Zend\Http\Client\Adapter\Socket();
17+
}
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\CacheInvalidate\Model;
7+
8+
class UriFactory
9+
{
10+
11+
/**
12+
* @return \Zend\Uri\Uri
13+
*/
14+
public function create()
15+
{
16+
return new \Zend\Uri\Uri();
17+
}
18+
}

app/code/Magento/CacheInvalidate/Test/Unit/Model/PurgeCacheTest.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
*/
66
namespace Magento\CacheInvalidate\Test\Unit\Model;
77

8-
use \Magento\Framework\Config\ConfigOptionsListConstants;
9-
108
class PurgeCacheTest extends \PHPUnit_Framework_TestCase
119
{
1210
/** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\CacheInvalidate\Model\PurgeCache */
@@ -32,17 +30,25 @@ class PurgeCacheTest extends \PHPUnit_Framework_TestCase
3230
*/
3331
public function setUp()
3432
{
33+
$this->uriFactoryMock = $this->getMock('Magento\CacheInvalidate\Model\UriFactory', [], [], '', false);
3534
$this->uriMock = $this->getMock('\Zend\Uri\Uri', [], [], '', false);
35+
$this->socketFactoryMock = $this->getMock('Magento\CacheInvalidate\Model\SocketFactory', [], [], '', false);
3636
$this->socketAdapterMock = $this->getMock('\Zend\Http\Client\Adapter\Socket', [], [], '', false);
3737
$this->configMock = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false);
3838
$this->loggerMock = $this->getMock('Magento\Framework\Cache\InvalidateLogger', [], [], '', false);
3939
$this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', [], [], '', false);
4040
$this->socketAdapterMock->expects($this->once())
4141
->method('setOptions')
4242
->with(['timeout' => 10]);
43+
$this->uriFactoryMock->expects($this->once())
44+
->method('create')
45+
->willReturn($this->uriMock);
46+
$this->socketFactoryMock->expects($this->once())
47+
->method('create')
48+
->willReturn($this->socketAdapterMock);
4349
$this->model = new \Magento\CacheInvalidate\Model\PurgeCache(
44-
$this->uriMock,
45-
$this->socketAdapterMock,
50+
$this->uriFactoryMock,
51+
$this->socketFactoryMock,
4652
$this->loggerMock,
4753
$this->configMock,
4854
$this->requestMock
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\CacheInvalidate\Test\Unit\Model;
7+
8+
class SocketFactoryTest extends \PHPUnit_Framework_TestCase
9+
{
10+
11+
public function testCreate()
12+
{
13+
$factory = new \Magento\CacheInvalidate\Model\SocketFactory();
14+
$this->assertInstanceOf('\Zend\Http\Client\Adapter\Socket', $factory->create());
15+
}
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\CacheInvalidate\Test\Unit\Model;
7+
8+
class UriFactoryTest extends \PHPUnit_Framework_TestCase
9+
{
10+
11+
public function testCreate()
12+
{
13+
$factory = new \Magento\CacheInvalidate\Model\UriFactory();
14+
$this->assertInstanceOf('\Zend\Uri\Uri', $factory->create());
15+
}
16+
}

0 commit comments

Comments
 (0)