Skip to content

Commit ff64dcc

Browse files
committed
Merge remote-tracking branch 'magento-ce/develop' into MAGETWO-54708-PR
2 parents 316311a + f7b5f3b commit ff64dcc

File tree

32 files changed

+451
-881
lines changed

32 files changed

+451
-881
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/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
*/
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
## Overview
1+
# Magento_CatalogAnalytics module
22

3-
The Magento_CatalogAnalytics module provides products data for integration with
4-
[Magento Business Intelligence](https://magento.com/products/business-intelligence).
3+
The Magento_CatalogAnalytics module configures data definitions for a data collection related to the Catalog module entities to be used in [Advanced Reporting](http://devdocs.magento.com/guides/v2.2/advanced-reporting/modules.html).

app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Magento\Backend\Block\Widget\Form;
99
use Magento\Backend\Block\Widget\Form\Generic;
1010
use Magento\Ui\Component\Layout\Tabs\TabInterface;
11+
use Magento\Rule\Model\Condition\AbstractCondition;
1112

1213
class Conditions extends Generic implements TabInterface
1314
{
@@ -146,14 +147,16 @@ protected function addTabToForm($model, $fieldsetId = 'conditions_fieldset', $fo
146147
$form = $this->_formFactory->create();
147148
$form->setHtmlIdPrefix('rule_');
148149

150+
$conditionsFieldSetId = $model->getConditionsFieldSetId($formName);
151+
149152
$newChildUrl = $this->getUrl(
150-
'catalog_rule/promo_catalog/newConditionHtml/form/' . $model->getConditionsFieldSetId($formName),
153+
'catalog_rule/promo_catalog/newConditionHtml/form/' . $conditionsFieldSetId,
151154
['form_namespace' => $formName]
152155
);
153156

154157
$renderer = $this->_rendererFieldset->setTemplate('Magento_CatalogRule::promo/fieldset.phtml')
155158
->setNewChildUrl($newChildUrl)
156-
->setFieldSetId($model->getConditionsFieldSetId($formName));
159+
->setFieldSetId($conditionsFieldSetId);
157160

158161
$fieldset = $form->addFieldset(
159162
$fieldsetId,
@@ -175,22 +178,24 @@ protected function addTabToForm($model, $fieldsetId = 'conditions_fieldset', $fo
175178
->setRenderer($this->_conditions);
176179

177180
$form->setValues($model->getData());
178-
$this->setConditionFormName($model->getConditions(), $formName);
181+
$this->setConditionFormName($model->getConditions(), $formName, $conditionsFieldSetId);
179182
return $form;
180183
}
181184

182185
/**
183-
* @param \Magento\Rule\Model\Condition\AbstractCondition $conditions
186+
* @param AbstractCondition $conditions
184187
* @param string $formName
188+
* @param string $jsFormName
185189
* @return void
186190
*/
187-
private function setConditionFormName(\Magento\Rule\Model\Condition\AbstractCondition $conditions, $formName)
191+
private function setConditionFormName(AbstractCondition $conditions, $formName, $jsFormName)
188192
{
189193
$conditions->setFormName($formName);
190-
$conditions->setJsFormObject($formName);
194+
$conditions->setJsFormObject($jsFormName);
195+
191196
if ($conditions->getConditions() && is_array($conditions->getConditions())) {
192197
foreach ($conditions->getConditions() as $condition) {
193-
$this->setConditionFormName($condition, $formName);
198+
$this->setConditionFormName($condition, $formName, $jsFormName);
194199
}
195200
}
196201
}

app/code/Magento/Checkout/Controller/Cart/CouponPost.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ public function execute()
124124
$escaper->escapeHtml($couponCode)
125125
)
126126
);
127-
$this->cart->save();
128127
}
129128
}
130129
} else {

app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@
230230
<settings>
231231
<timezone>false</timezone>
232232
<dateFormat>MMM d, y</dateFormat>
233+
<skipTime>true</skipTime>
233234
<filter>dateRange</filter>
234235
<dataType>date</dataType>
235236
<label translate="true">Date of Birth</label>
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
## Overview
1+
# Magento_CustomerAnalytics module
22

3-
The Magento_CustomerAnalytics module provides customers data for integration with
4-
[Magento Business Intelligence](https://magento.com/products/business-intelligence).
3+
The Magento_CustomerAnalytics module configures data definitions for a data collection related to the Customer module entities to be used in [Advanced Reporting](http://devdocs.magento.com/guides/v2.2/advanced-reporting/modules.html).
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
## Overview
1+
# Magento_QuoteAnalytics
22

3-
The Magento_QuoteAnalytics module provides quotes data for integration with
4-
[Magento Business Intelligence](https://magento.com/products/business-intelligence).
3+
The Magento_QuoteAnalytics module configures data definitions for a data collection related to the Quote module entities to be used in [Advanced Reporting](http://devdocs.magento.com/guides/v2.2/advanced-reporting/modules.html).
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
## Overview
1+
# Magento_ReviewAnalytics module
22

3-
The Magento_ReviewAnalytics module provides reviews data for integration with
4-
[Magento Business Intelligence](https://magento.com/products/business-intelligence).
3+
The Magento_ReviewAnalytics module configures data definitions for a data collection related to the Review module entities to be used in [Advanced Reporting](http://devdocs.magento.com/guides/v2.2/advanced-reporting/modules.html).

0 commit comments

Comments
 (0)