From b92aef02958c7820d2d4e9456eb22f3cebba107d Mon Sep 17 00:00:00 2001 From: Eden Date: Fri, 6 Dec 2019 16:56:06 +0700 Subject: [PATCH 1/3] Resolve Refresh Statistics: Updated At = Null should be display as "Never" instead of "undefined". issue25931 --- .../Reports/Controller/Adminhtml/Report/AbstractReport.php | 2 +- app/code/Magento/Reports/i18n/en_US.csv | 2 ++ .../view/adminhtml/layout/reports_report_statistics_index.xml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/AbstractReport.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/AbstractReport.php index 2fbff13a5b644..c6d79459a2b52 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/AbstractReport.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/AbstractReport.php @@ -140,7 +140,7 @@ protected function _showLastExecutionTime($flagCode, $refreshCode) $flag = $this->_objectManager->create(\Magento\Reports\Model\Flag::class) ->setReportFlagCode($flagCode) ->loadSelf(); - $updatedAt = 'undefined'; + $updatedAt = __('Never'); if ($flag->hasData()) { $updatedAt = $this->timezone->formatDate( $flag->getLastUpdate(), diff --git a/app/code/Magento/Reports/i18n/en_US.csv b/app/code/Magento/Reports/i18n/en_US.csv index 3225f2fc41409..169d3cc2b74b4 100644 --- a/app/code/Magento/Reports/i18n/en_US.csv +++ b/app/code/Magento/Reports/i18n/en_US.csv @@ -224,3 +224,5 @@ Action,Action Report,Report Description,Description undefined,undefined +Never,Never + diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_statistics_index.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_statistics_index.xml index 649dc7ceeb065..5b841e3523649 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_statistics_index.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_statistics_index.xml @@ -71,7 +71,7 @@ 0 updated_at updated_at - undefined + Never col-period col-period From f33199f77fe16beb22478dd9773035185b576a0d Mon Sep 17 00:00:00 2001 From: Eden Date: Fri, 6 Dec 2019 22:03:30 +0700 Subject: [PATCH 2/3] Fix static test --- .../Reports/Controller/Adminhtml/Report/AbstractReport.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/AbstractReport.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/AbstractReport.php index c6d79459a2b52..d5d8d32744e49 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/AbstractReport.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/AbstractReport.php @@ -18,6 +18,7 @@ /** * Reports api controller * + * phpcs:disable Magento2.Classes.AbstractApi * @api * @since 100.0.2 * @SuppressWarnings(PHPMD.AllPurposeAction) From 2d0c917f48e5aa0d4b9e461834f9d4d147e53000 Mon Sep 17 00:00:00 2001 From: Eden Date: Mon, 9 Dec 2019 15:46:34 +0700 Subject: [PATCH 3/3] Integration Test for issue 25931 --- .../Adminhtml/Report/Statistics/IndexTest.php | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Reports/Controller/Adminhtml/Report/Statistics/IndexTest.php diff --git a/dev/tests/integration/testsuite/Magento/Reports/Controller/Adminhtml/Report/Statistics/IndexTest.php b/dev/tests/integration/testsuite/Magento/Reports/Controller/Adminhtml/Report/Statistics/IndexTest.php new file mode 100644 index 0000000000000..e7d74159e48fc --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Reports/Controller/Adminhtml/Report/Statistics/IndexTest.php @@ -0,0 +1,25 @@ +dispatch('backend/reports/report_statistics'); + $actual = $this->getResponse()->getBody(); + $this->assertContains('Never', $actual); + } +}