Skip to content

Commit e1f961d

Browse files
committed
Merge branch 'develop' into MAGETWO-70280
2 parents f5eda85 + aa4ae30 commit e1f961d

File tree

83 files changed

+1018
-1037
lines changed

Some content is hidden

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

83 files changed

+1018
-1037
lines changed

app/code/Magento/Analytics/README.md

Lines changed: 18 additions & 773 deletions
Large diffs are not rendered by default.

app/code/Magento/Analytics/view/adminhtml/templates/dashboard/section.phtml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
<div class="dashboard-advanced-reports-content">
1515
<?= $block->escapeHtml(__('Gain new insights and take command of your business\' performance,' .
1616
' using our dynamic product, order, and customer reports tailored to your customer data.')) ?>
17-
<a href="<?= $block->escapeUrl($block->getUrl('analytics/reports/show')) ?>"
18-
target="_blank"
19-
data-index="analytics-service-info-link">
20-
<?= $block->escapeHtml(__('View details')) ?>
21-
</a>
2217
</div>
2318
</div>
2419
<div class="dashboard-advanced-reports-actions">

app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Date.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function getHtml()
131131
public function getEscapedValue($index = null)
132132
{
133133
$value = $this->getValue($index);
134-
if ($value instanceof \DateTime) {
134+
if ($value instanceof \DateTimeInterface) {
135135
return $this->dateTimeFormatter->formatObject(
136136
$value,
137137
$this->_localeDate->getDateFormat(\IntlDateFormatter::SHORT)

app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Datetime.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function getEscapedValue($index = null)
147147
{
148148
if ($this->getColumn()->getFilterTime()) {
149149
$value = $this->getValue($index);
150-
if ($value instanceof \DateTime) {
150+
if ($value instanceof \DateTimeInterface) {
151151
return $this->_localeDate->formatDateTime($value);
152152
}
153153
return $value;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,13 @@ public function isLoggedIn()
168168
*/
169169
public function prolong()
170170
{
171+
$lifetime = $this->_config->getValue(self::XML_PATH_SESSION_LIFETIME);
171172
$cookieValue = $this->cookieManager->getCookie($this->getName());
173+
172174
if ($cookieValue) {
173175
$this->setUpdatedAt(time());
174176
$cookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata()
177+
->setDuration($lifetime)
175178
->setPath($this->sessionConfig->getCookiePath())
176179
->setDomain($this->sessionConfig->getCookieDomain())
177180
->setSecure($this->sessionConfig->getCookieSecure())

app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,21 @@ public function testProlong()
158158
{
159159
$name = session_name();
160160
$cookie = 'cookie';
161+
$lifetime = 900;
161162
$path = '/';
162163
$domain = 'magento2';
163164
$secure = true;
164165
$httpOnly = true;
165166

167+
$this->config->expects($this->once())
168+
->method('getValue')
169+
->with(\Magento\Backend\Model\Auth\Session::XML_PATH_SESSION_LIFETIME)
170+
->willReturn($lifetime);
166171
$cookieMetadata = $this->getMock(\Magento\Framework\Stdlib\Cookie\PublicCookieMetadata::class);
172+
$cookieMetadata->expects($this->once())
173+
->method('setDuration')
174+
->with($lifetime)
175+
->will($this->returnSelf());
167176
$cookieMetadata->expects($this->once())
168177
->method('setPath')
169178
->with($path)

app/code/Magento/Backend/etc/adminhtml/system.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
<section id="dev" translate="label" type="text" sortOrder="920" showInDefault="1" showInWebsite="1" showInStore="1">
109109
<label>Developer</label>
110110
<tab>advanced</tab>
111-
<resource>Magento_Backend::dev</resource>
111+
<resource>Magento_Config::dev</resource>
112112
<group id="debug" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
113113
<label>Debug</label>
114114
<field id="template_hints_storefront" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
@@ -408,7 +408,7 @@
408408
<section id="web" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
409409
<label>Web</label>
410410
<tab>general</tab>
411-
<resource>Magento_Backend::web</resource>
411+
<resource>Magento_Config::web</resource>
412412
<group id="url" translate="label" type="text" sortOrder="3" showInDefault="1" showInWebsite="0" showInStore="0">
413413
<label>Url Options</label>
414414
<field id="use_store" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">

app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Filters/Type/DateRangeTest.php

Lines changed: 60 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ protected function setUp()
7070
->getMock();
7171

7272
$this->dataProviderMock = $this->getMockForAbstractClass(DataProviderInterface::class);
73+
74+
$this->contextMock->expects($this->any())
75+
->method('getNamespace')
76+
->willReturn(DateRange::NAME);
77+
$this->contextMock->expects($this->any())
78+
->method('addComponentDefinition')
79+
->with(DateRange::NAME, ['extends' => DateRange::NAME]);
80+
81+
$this->contextMock->expects($this->any())
82+
->method('getDataProvider')
83+
->willReturn($this->dataProviderMock);
7384
}
7485

7586
/**
@@ -84,29 +95,15 @@ protected function setUp()
8495
*/
8596
public function testPrepare($name, $filterData, $expectedCondition)
8697
{
87-
/** @var FormDate PHPUnit_Framework_MockObject_MockObject|$uiComponent */
88-
$uiComponent = $this->getMockBuilder(FormDate::class)
89-
->disableOriginalConstructor()
90-
->getMock();
91-
92-
$uiComponent->expects($this->any())
93-
->method('getContext')
94-
->willReturn($this->contextMock);
95-
96-
$this->contextMock->expects($this->any())
97-
->method('getNamespace')
98-
->willReturn(DateRange::NAME);
99-
$this->contextMock->expects($this->any())
100-
->method('addComponentDefinition')
101-
->with(DateRange::NAME, ['extends' => DateRange::NAME]);
102-
10398
$this->contextMock->expects($this->any())
10499
->method('getFiltersParams')
105100
->willReturn($filterData);
106101

107-
$this->contextMock->expects($this->any())
108-
->method('getDataProvider')
109-
->willReturn($this->dataProviderMock);
102+
$uiComponent = $this->getMockBuilder(FormDate::class)->disableOriginalConstructor()->getMock();
103+
104+
$uiComponent->expects($this->any())
105+
->method('getContext')
106+
->willReturn($this->contextMock);
110107

111108
if ($expectedCondition !== null) {
112109
if (is_string($filterData[$name])) {
@@ -118,11 +115,11 @@ public function testPrepare($name, $filterData, $expectedCondition)
118115
$uiComponent->method('convertDate')
119116
->willReturnMap([
120117
[
121-
$filterData[$name]['from'], 0, 0, 0,
118+
$filterData[$name]['from'],
122119
new \DateTime($filterData[$name]['from'], new \DateTimeZone('UTC'))
123120
],
124121
[
125-
$filterData[$name]['to'], 23, 59, 59,
122+
$filterData[$name]['to'],
126123
new \DateTime($filterData[$name]['to'] . ' 23:59:00', new \DateTimeZone('UTC'))
127124
],
128125
]);
@@ -161,6 +158,23 @@ public function testPrepare($name, $filterData, $expectedCondition)
161158
->with($filterMock);
162159
break;
163160
}
161+
} else {
162+
$uiComponent->method('convertDate')
163+
->willReturnMap([
164+
[
165+
$filterData[$name]['from'],
166+
new \DateTime($filterData[$name]['from'], new \DateTimeZone('UTC'))
167+
],
168+
[
169+
$filterData[$name]['to'],
170+
new \DateTime($filterData[$name]['to'] . ' 23:59:00', new \DateTimeZone('UTC'))
171+
],
172+
]);
173+
174+
$filterMock = $this->getFilterMockWithoutExpectedCondition();
175+
$this->dataProviderMock->expects(static::exactly(2))
176+
->method('addFilter')
177+
->with($filterMock);
164178
}
165179

166180
$this->uiComponentFactory->expects($this->any())
@@ -212,6 +226,31 @@ private function getFilterMock($name, $expectedType, $expectedDate, &$i)
212226
return $filterMock;
213227
}
214228

229+
/**
230+
* Gets Filter mock without expected condition
231+
*
232+
* @return Filter|\PHPUnit_Framework_MockObject_MockObject
233+
*/
234+
private function getFilterMockWithoutExpectedCondition()
235+
{
236+
$this->filterBuilderMock->expects(static::exactly(2))
237+
->method('setConditionType')
238+
->willReturnSelf();
239+
$this->filterBuilderMock->expects(static::exactly(2))
240+
->method('setField')
241+
->willReturnSelf();
242+
$this->filterBuilderMock->expects(static::exactly(2))
243+
->method('setValue')
244+
->willReturnSelf();
245+
246+
$filterMock = $this->getMock(Filter::class);
247+
$this->filterBuilderMock->expects(static::exactly(2))
248+
->method('create')
249+
->willReturn($filterMock);
250+
251+
return $filterMock;
252+
}
253+
215254
/**
216255
* @return array
217256
*/

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ protected function getOptionInfo()
518518
'dataType' => Form\Element\DataType\Text::NAME,
519519
'formElement' => Form\Element\Select::NAME,
520520
'componentType' => Form\Field::NAME,
521-
'component' => 'Magento_Bundle/js/components/bundle-input-type',
521+
'component' => 'Magento_Ui/js/form/element/select',
522522
'parentContainer' => 'product_bundle_container',
523523
'selections' => 'bundle_selections',
524524
'isDefaultIndex' => 'is_default',
@@ -594,8 +594,11 @@ protected function getBundleSelections()
594594
'config' => [
595595
'componentType' => Container::NAME,
596596
'isTemplate' => true,
597-
'component' => 'Magento_Ui/js/dynamic-rows/record',
598-
'is_collection' => true
597+
'component' => 'Magento_Bundle/js/components/bundle-record',
598+
'is_collection' => true,
599+
'imports' => [
600+
'onTypeChanged' => '${ $.provider }:${ $.bundleOptionsDataScope }.type'
601+
]
599602
],
600603
],
601604
],

app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-checkbox.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ define([
5858

5959
this.prefer = typeMap[type];
6060
this.elementTmpl(this.templates[typeMap[type]]);
61+
62+
if (this.prefer === 'radio' && this.checked()) {
63+
this.clearValues();
64+
}
6165
},
6266

6367
/**

0 commit comments

Comments
 (0)