diff --git a/app/code/Magento/Review/Model/ResourceModel/Review/Collection.php b/app/code/Magento/Review/Model/ResourceModel/Review/Collection.php index 3c5b0c291a422..eebe6964576c8 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Review/Collection.php +++ b/app/code/Magento/Review/Model/ResourceModel/Review/Collection.php @@ -14,48 +14,41 @@ class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection { /** - * Review table * * @var string */ protected $_reviewTable = null; /** - * Review detail table * * @var string */ protected $_reviewDetailTable = null; /** - * Review status table * * @var string */ protected $_reviewStatusTable = null; /** - * Review entity table * * @var string */ protected $_reviewEntityTable = null; /** - * Review store table * * @var string */ protected $_reviewStoreTable = null; /** - * Add store data flag * @var bool */ protected $_addStoreDataFlag = false; /** - * Review data * * @var \Magento\Review\Helper\Data */ @@ -125,7 +118,7 @@ protected function _initSelect() $this->getSelect()->join( ['detail' => $this->getReviewDetailTable()], 'main_table.review_id = detail.review_id', - ['detail_id', 'title', 'detail', 'nickname', 'customer_id'] + ['detail_id', 'store_id', 'title', 'detail', 'nickname', 'customer_id'] ); return $this; } diff --git a/app/code/Magento/Review/Test/Unit/Model/ResourceModel/Review/CollectionTest.php b/app/code/Magento/Review/Test/Unit/Model/ResourceModel/Review/CollectionTest.php index fa20186053e3c..49dce6b65577b 100644 --- a/app/code/Magento/Review/Test/Unit/Model/ResourceModel/Review/CollectionTest.php +++ b/app/code/Magento/Review/Test/Unit/Model/ResourceModel/Review/CollectionTest.php @@ -104,7 +104,7 @@ public function testInitSelect(): void ->with( ['detail' => 'review_detail'], 'main_table.review_id = detail.review_id', - ['detail_id', 'title', 'detail', 'nickname', 'customer_id'] + ['detail_id', 'store_id', 'title', 'detail', 'nickname', 'customer_id'] ); $this->objectManager->getObject( Collection::class, diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminFilterOrderByPurchaseDateReset.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminFilterOrderByPurchaseDateReset.xml new file mode 100644 index 0000000000000..70a292f4ee269 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminFilterOrderByPurchaseDateReset.xml @@ -0,0 +1,43 @@ + + + + + + + + <stories value="ACP2E-188: Date picker filters are not cleared after deleting the filter in Sales Order grid"/> + <description value="Search order by purchase date and clear date filter"/> + <features value="Sales"/> + <testCaseId value="ACP2E-188"/> + <severity value="MAJOR"/> + <group value="Sales"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> + <waitForPageLoad stepKey="waitForIndexPageLoad"/> + <actionGroup ref="FilterOrderGridByPurchaseDateActionGroup" stepKey="filterOrderByPurchaseDate"> + <argument name="from" value="01/18/2021" /> + <argument name="to" value="01/18/2021" /> + </actionGroup> + <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrderFilter"/> + <grabValueFrom selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[from]')}}" stepKey="grabPurchasedDateFrom"/> + <grabValueFrom selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[to]')}}" stepKey="grabPurchasedDateTo"/> + <assertEmpty stepKey="checkPurchaseDateFromReset"> + <actualResult type="string">$grabPurchasedDateFrom</actualResult> + </assertEmpty> + <assertEmpty stepKey="checkPurchaseDateToReset"> + <actualResult type="string">$grabPurchasedDateTo</actualResult> + </assertEmpty> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + </test> +</tests> diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/datepicker.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/datepicker.js index 9085076960005..f243322c8521f 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/datepicker.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/datepicker.js @@ -28,8 +28,11 @@ define([ * For more info about options take a look at "mage/calendar" and jquery.ui.datepicker widget. * @param {HTMLElement} el - Element, that binding is applied to * @param {Function} valueAccessor - Function that returns value, passed to binding + * @param {object} allBindings + * @param {object} viewModel + * @param {object} bindingContext */ - init: function (el, valueAccessor) { + init: function (el, valueAccessor, allBindings, viewModel, bindingContext) { var config = valueAccessor(), observable, options = {}; @@ -50,6 +53,16 @@ define([ observable(this.value); }); }); + + if (bindingContext.$data) { + bindingContext.$data.value.subscribe(function (newVal) { + if (!newVal) { + $(el).val(''); + } + }, this); + } + + }, /**