Skip to content

Commit 3843dea

Browse files
author
Ievgen Sentiabov
committed
Merge branch 'develop' of github.corp.magento.com:magento2/magento2ce into MAGETWO-44295
2 parents 4595616 + 0be91a5 commit 3843dea

File tree

184 files changed

+2692
-790
lines changed

Some content is hidden

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

184 files changed

+2692
-790
lines changed

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Checkbox.php

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,25 @@ public function render(\Magento\Framework\DataObject $row)
7777
{
7878
$values = $this->_getValues();
7979
$value = $row->getData($this->getColumn()->getIndex());
80+
$checked = '';
8081
if (is_array($values)) {
8182
$checked = in_array($value, $values) ? ' checked="checked"' : '';
8283
} else {
83-
$checked = $value === $this->getColumn()->getValue() ? ' checked="checked"' : '';
84+
$checkedValue = $this->getColumn()->getValue();
85+
if ($checkedValue !== null) {
86+
$checked = $value === $checkedValue ? ' checked="checked"' : '';
87+
}
8488
}
8589

90+
$disabled = '';
8691
$disabledValues = $this->getColumn()->getDisabledValues();
8792
if (is_array($disabledValues)) {
8893
$disabled = in_array($value, $disabledValues) ? ' disabled="disabled"' : '';
8994
} else {
90-
$disabled = $value === $this->getColumn()->getDisabledValue() ? ' disabled="disabled"' : '';
95+
$disabledValue = $this->getColumn()->getDisabledValue();
96+
if ($disabledValue !== null) {
97+
$disabled = $value === $disabledValue ? ' disabled="disabled"' : '';
98+
}
9199
}
92100

93101
$this->setDisabled($disabled);
@@ -108,15 +116,18 @@ public function render(\Magento\Framework\DataObject $row)
108116
*/
109117
protected function _getCheckboxHtml($value, $checked)
110118
{
111-
$html = '<input type="checkbox" ';
119+
$html = '<label class="data-grid-checkbox-cell-inner" ';
120+
$html .= ' for="id_' . $this->escapeHtml($value) . '">';
121+
$html .= '<input type="checkbox" ';
112122
$html .= 'name="' . $this->getColumn()->getFieldName() . '" ';
113123
$html .= 'value="' . $this->escapeHtml($value) . '" ';
124+
$html .= 'id="id_' . $this->escapeHtml($value) . '" ';
114125
$html .= 'class="' .
115126
($this->getColumn()->getInlineCss() ? $this->getColumn()->getInlineCss() : 'checkbox') .
116-
' admin__control-checkbox' .
117-
'"';
127+
' admin__control-checkbox' . '"';
118128
$html .= $checked . $this->getDisabled() . '/>';
119-
$html .= '<label></label>';
129+
$html .= '<label for="id_' . $this->escapeHtml($value) . '"></label>';
130+
$html .= '</label>';
120131
/* ToDo UI: add class="admin__field-label" after some refactoring _fields.less */
121132
return $html;
122133
}

app/code/Magento/Backend/Model/Session/AdminConfig.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ class AdminConfig extends Config
3030
protected $_frontNameResolver;
3131

3232
/**
33-
* @var \Magento\Store\Model\StoreManagerInterface
33+
* @var \Magento\Backend\App\BackendAppList
3434
*/
35-
protected $_storeManager;
35+
private $backendAppList;
3636

3737
/**
38-
* @var \Magento\Backend\App\BackendAppList
38+
* @var \Magento\Backend\Model\UrlFactory
3939
*/
40-
private $backendAppList;
40+
private $backendUrlFactory;
4141

4242
/**
4343
* @param \Magento\Framework\ValidatorFactory $validatorFactory
@@ -49,7 +49,7 @@ class AdminConfig extends Config
4949
* @param string $scopeType
5050
* @param \Magento\Backend\App\BackendAppList $backendAppList
5151
* @param FrontNameResolver $frontNameResolver
52-
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
52+
* @param \Magento\Backend\Model\UrlFactory $backendUrlFactory
5353
* @param string $lifetimePath
5454
* @param string $sessionName
5555
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
@@ -64,7 +64,7 @@ public function __construct(
6464
$scopeType,
6565
\Magento\Backend\App\BackendAppList $backendAppList,
6666
FrontNameResolver $frontNameResolver,
67-
\Magento\Store\Model\StoreManagerInterface $storeManager,
67+
\Magento\Backend\Model\UrlFactory $backendUrlFactory,
6868
$lifetimePath = self::XML_PATH_COOKIE_LIFETIME,
6969
$sessionName = self::SESSION_NAME_ADMIN
7070
) {
@@ -79,8 +79,8 @@ public function __construct(
7979
$lifetimePath
8080
);
8181
$this->_frontNameResolver = $frontNameResolver;
82-
$this->_storeManager = $storeManager;
8382
$this->backendAppList = $backendAppList;
83+
$this->backendUrlFactory = $backendUrlFactory;
8484
$adminPath = $this->extractAdminPath();
8585
$this->setCookiePath($adminPath);
8686
$this->setName($sessionName);
@@ -95,7 +95,7 @@ private function extractAdminPath()
9595
{
9696
$backendApp = $this->backendAppList->getCurrentApp();
9797
$cookiePath = null;
98-
$baseUrl = parse_url($this->_storeManager->getStore()->getBaseUrl(), PHP_URL_PATH);
98+
$baseUrl = parse_url($this->backendUrlFactory->create()->getBaseUrl(), PHP_URL_PATH);
9999
if (!$backendApp) {
100100
$cookiePath = $baseUrl . $this->_frontNameResolver->getFrontName();
101101
return $cookiePath;

app/code/Magento/Backend/Test/Unit/Model/Session/AdminConfigTest.php

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ class AdminConfigTest extends \PHPUnit_Framework_TestCase
2929
private $objectManager;
3030

3131
/**
32-
* @var \Magento\Store\Model\StoreManagerInterface | \PHPUnit_Framework_MockObject_MockObject
32+
* @var \Magento\Backend\Model\UrlFactory | \PHPUnit_Framework_MockObject_MockObject
3333
*/
34-
private $storeManagerMock;
34+
private $backendUrlFactory;
3535

3636
/**
3737
* @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject
@@ -56,13 +56,10 @@ protected function setUp()
5656
$this->validatorFactory = $this->getMockBuilder('Magento\Framework\ValidatorFactory')
5757
->disableOriginalConstructor()
5858
->getMock();
59-
60-
$storeMock = $this->getMockBuilder('\Magento\Store\Model\Store')
61-
->disableOriginalConstructor()
62-
->getMock();
63-
$storeMock->expects($this->once())->method('getBaseUrl')->will($this->returnValue('/'));
64-
$this->storeManagerMock = $this->getMockForAbstractClass('\Magento\Store\Model\StoreManagerInterface');
65-
$this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($storeMock));
59+
$backendUrl = $this->getMock('\Magento\Backend\Model\Url', [], [], '', false);
60+
$backendUrl->expects($this->once())->method('getBaseUrl')->will($this->returnValue('/'));
61+
$this->backendUrlFactory = $this->getMock('Magento\Backend\Model\UrlFactory', ['create'], [], '', false);
62+
$this->backendUrlFactory->expects($this->any())->method('create')->willReturn($backendUrl);
6663

6764
$this->filesystemMock = $this->getMock('\Magento\Framework\Filesystem', [], [], '', false);
6865
$dirMock = $this->getMockForAbstractClass('Magento\Framework\Filesystem\Directory\WriteInterface');
@@ -99,7 +96,7 @@ public function testSetCookiePathNonDefault()
9996
'validatorFactory' => $this->validatorFactory,
10097
'request' => $this->requestMock,
10198
'frontNameResolver' => $mockFrontNameResolver,
102-
'storeManager' => $this->storeManagerMock,
99+
'backendUrlFactory' => $this->backendUrlFactory,
103100
'filesystem' => $this->filesystemMock,
104101
]
105102
);
@@ -134,7 +131,7 @@ public function testSetSessionNameByConstructor()
134131
'validatorFactory' => $this->validatorFactory,
135132
'request' => $this->requestMock,
136133
'sessionName' => $sessionName,
137-
'storeManager' => $this->storeManagerMock,
134+
'backendUrlFactory' => $this->backendUrlFactory,
138135
'filesystem' => $this->filesystemMock,
139136
]
140137
);

app/code/Magento/Backend/view/adminhtml/templates/widget/form/renderer/fieldset.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if (!isset($advancedLabel)) {
2222
$advancedLabel = __('Additional Settings');
2323
}
2424

25-
$cssClass = ($isField) ? 'field ' . $element->getClass() : 'fieldset admin__fieldset' . $element->getClass();
25+
$cssClass = ($isField) ? 'field ' . $element->getClass() : 'fieldset admin__fieldset ' . $element->getClass();
2626

2727
if ($isField) {
2828
$count = $element->getCountBasicChildren();

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@
8080
<!-- ko if: (isCcDetectionEnabled())-->
8181
<ul class="credit-card-types">
8282
<!-- ko foreach: {data: getCcAvailableTypesValues(), as: 'item'} -->
83-
<li class="item" data-bind="css: {_active: $parent.selectedCardType() == item.value} ">
83+
<li class="item" data-bind="css: {
84+
_active: $parent.selectedCardType() == item.value,
85+
_inactive: $parent.selectedCardType() != null && $parent.selectedCardType() != item.value
86+
} ">
8487
<!--ko if: $parent.getIcons(item.value) -->
8588
<img data-bind="attr: {
8689
'src': $parent.getIcons(item.value).url,

app/code/Magento/Catalog/etc/di.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,11 @@
494494
</argument>
495495
</arguments>
496496
</type>
497+
<type name="Magento\Catalog\Console\Command\ImagesResizeCommand">
498+
<arguments>
499+
<argument name="productRepository" xsi:type="object">Magento\Catalog\Api\ProductRepositoryInterface\Proxy</argument>
500+
</arguments>
501+
</type>
497502
<type name="Magento\Framework\Config\View">
498503
<arguments>
499504
<argument name="xpath" xsi:type="array">

app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/tree.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@
466466
click: function () {
467467
(function ($) {
468468
$.ajax({
469-
url: '<?php /* @escapeNotVerified */ echo $block->getMoveUrl() ?>//',
469+
url: '<?php /* @escapeNotVerified */ echo $block->getMoveUrl() ?>',
470470
method: 'POST',
471471
data: pd.join(""),
472472
showLoader: true

app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -761,8 +761,5 @@ define([
761761
}
762762
};
763763

764-
jQuery(document).ready(function(){
765-
productConfigure = new ProductConfigure();
766-
});
767-
764+
productConfigure = new ProductConfigure();
768765
});

app/code/Magento/ConfigurableProduct/view/adminhtml/templates/product/configurable/affected-attribute-set-selector/js.phtml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
newAttributeSetContainer = $('[data-role=affected-attribute-set-new-name-container]'),
3434
existingAttributeSetContainer = $('[data-role=affected-attribute-set-existing-name-container]');
3535

36+
$form.find('input[type=text]').on('keypress',function(e){
37+
if(e.keyCode === 13){
38+
e.preventDefault();
39+
$form.closest('[data-role=modal]').find('button[data-action=confirm]').click();
40+
}
41+
});
3642

3743
$('[data-form=edit-product]').append($('<input>', {
3844
type: 'hidden',
@@ -48,6 +54,9 @@
4854
},
4955
buttons: [{
5056
text: '<?php /* @escapeNotVerified */ echo __('Confirm'); ?>',
57+
attr: {
58+
'data-action': 'confirm'
59+
},
5160
'class': 'action-secondary',
5261
click: function() {
5362
var affectedAttributeSetId = $form.find('input[name=affected-attribute-set]:checked').val();

app/code/Magento/Cookie/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-cookie",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.4.11|~5.5.0|~5.6.0",
5+
"php": "~5.5.0|~5.6.0|~7.0.0",
66
"magento/module-store": "1.0.0-beta",
77
"magento/framework": "1.0.0-beta"
88
},

0 commit comments

Comments
 (0)