Skip to content

Commit eaf50eb

Browse files
committed
Merge branch '2.4-develop' of https://github.com/magento-gl/magento2ce into ACP2E-30
2 parents abe6afa + 65714d4 commit eaf50eb

File tree

4 files changed

+59
-10
lines changed

4 files changed

+59
-10
lines changed

app/code/Magento/Review/Model/ResourceModel/Review/Collection.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,48 +14,41 @@
1414
class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
1515
{
1616
/**
17-
* Review table
1817
*
1918
* @var string
2019
*/
2120
protected $_reviewTable = null;
2221

2322
/**
24-
* Review detail table
2523
*
2624
* @var string
2725
*/
2826
protected $_reviewDetailTable = null;
2927

3028
/**
31-
* Review status table
3229
*
3330
* @var string
3431
*/
3532
protected $_reviewStatusTable = null;
3633

3734
/**
38-
* Review entity table
3935
*
4036
* @var string
4137
*/
4238
protected $_reviewEntityTable = null;
4339

4440
/**
45-
* Review store table
4641
*
4742
* @var string
4843
*/
4944
protected $_reviewStoreTable = null;
5045

5146
/**
52-
* Add store data flag
5347
* @var bool
5448
*/
5549
protected $_addStoreDataFlag = false;
5650

5751
/**
58-
* Review data
5952
*
6053
* @var \Magento\Review\Helper\Data
6154
*/
@@ -125,7 +118,7 @@ protected function _initSelect()
125118
$this->getSelect()->join(
126119
['detail' => $this->getReviewDetailTable()],
127120
'main_table.review_id = detail.review_id',
128-
['detail_id', 'title', 'detail', 'nickname', 'customer_id']
121+
['detail_id', 'store_id', 'title', 'detail', 'nickname', 'customer_id']
129122
);
130123
return $this;
131124
}

app/code/Magento/Review/Test/Unit/Model/ResourceModel/Review/CollectionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function testInitSelect(): void
104104
->with(
105105
['detail' => 'review_detail'],
106106
'main_table.review_id = detail.review_id',
107-
['detail_id', 'title', 'detail', 'nickname', 'customer_id']
107+
['detail_id', 'store_id', 'title', 'detail', 'nickname', 'customer_id']
108108
);
109109
$this->objectManager->getObject(
110110
Collection::class,
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminFilterOrderByPurchaseDateReset">
12+
<annotations>
13+
<title value="Create Order in Admin with simple product"/>
14+
<stories value="ACP2E-188: Date picker filters are not cleared after deleting the filter in Sales Order grid"/>
15+
<description value="Search order by purchase date and clear date filter"/>
16+
<features value="Sales"/>
17+
<testCaseId value="ACP2E-188"/>
18+
<severity value="MAJOR"/>
19+
<group value="Sales"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
23+
</before>
24+
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/>
25+
<waitForPageLoad stepKey="waitForIndexPageLoad"/>
26+
<actionGroup ref="FilterOrderGridByPurchaseDateActionGroup" stepKey="filterOrderByPurchaseDate">
27+
<argument name="from" value="01/18/2021" />
28+
<argument name="to" value="01/18/2021" />
29+
</actionGroup>
30+
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrderFilter"/>
31+
<grabValueFrom selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[from]')}}" stepKey="grabPurchasedDateFrom"/>
32+
<grabValueFrom selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[to]')}}" stepKey="grabPurchasedDateTo"/>
33+
<assertEmpty stepKey="checkPurchaseDateFromReset">
34+
<actualResult type="string">$grabPurchasedDateFrom</actualResult>
35+
</assertEmpty>
36+
<assertEmpty stepKey="checkPurchaseDateToReset">
37+
<actualResult type="string">$grabPurchasedDateTo</actualResult>
38+
</assertEmpty>
39+
<after>
40+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
41+
</after>
42+
</test>
43+
</tests>

app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/datepicker.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ define([
2828
* For more info about options take a look at "mage/calendar" and jquery.ui.datepicker widget.
2929
* @param {HTMLElement} el - Element, that binding is applied to
3030
* @param {Function} valueAccessor - Function that returns value, passed to binding
31+
* @param {object} allBindings
32+
* @param {object} viewModel
33+
* @param {object} bindingContext
3134
*/
32-
init: function (el, valueAccessor) {
35+
init: function (el, valueAccessor, allBindings, viewModel, bindingContext) {
3336
var config = valueAccessor(),
3437
observable,
3538
options = {};
@@ -50,6 +53,16 @@ define([
5053
observable(this.value);
5154
});
5255
});
56+
57+
if (bindingContext.$data) {
58+
bindingContext.$data.value.subscribe(function (newVal) {
59+
if (!newVal) {
60+
$(el).val('');
61+
}
62+
}, this);
63+
}
64+
65+
5366
},
5467

5568
/**

0 commit comments

Comments
 (0)