From 8998ae37375d9dcec802abb06e3fd009f93496b3 Mon Sep 17 00:00:00 2001 From: Peter Zhang Date: Tue, 5 Oct 2021 22:08:11 +1300 Subject: 'Users' or 'UserId' tab no data: explain how to populate Users report data (#18077) * update the userId report guide when there is no data --- plugins/UserId/Categories/VisitorsUserSubcategory.php | 5 ++++- plugins/UserId/Reports/GetUsers.php | 13 ++++++++----- plugins/UserId/lang/en.json | 7 ++++--- 3 files changed, 16 insertions(+), 9 deletions(-) (limited to 'plugins/UserId') diff --git a/plugins/UserId/Categories/VisitorsUserSubcategory.php b/plugins/UserId/Categories/VisitorsUserSubcategory.php index cf524ed728..628a9b941f 100644 --- a/plugins/UserId/Categories/VisitorsUserSubcategory.php +++ b/plugins/UserId/Categories/VisitorsUserSubcategory.php @@ -17,8 +17,11 @@ class VisitorsUserSubcategory extends Subcategory protected $id = 'UserId_UserReportTitle'; protected $order = 40; + public function getHelp() { - return '

' . Piwik::translate('UserId_VisitorsUserSubcategoryHelp') . '

'; + return '

' . Piwik::translate('UserId_VisitorsUserSubcategoryHelp') . '

'. + '

' . Piwik::translate('CoreAdminHome_LearnMore') . '

'; + ; } } diff --git a/plugins/UserId/Reports/GetUsers.php b/plugins/UserId/Reports/GetUsers.php index 406eb7a9d2..04899ade9b 100644 --- a/plugins/UserId/Reports/GetUsers.php +++ b/plugins/UserId/Reports/GetUsers.php @@ -25,11 +25,11 @@ class GetUsers extends Base { parent::init(); - $this->name = Piwik::translate('UserId_UserReportTitle'); - $this->subcategoryId = 'UserId_UserReportTitle'; - $this->documentation = Piwik::translate('UserId_UserReportDocumentation'); - $this->dimension = new UserId(); - $this->metrics = array('label', 'nb_visits', 'nb_actions', 'nb_visits_converted'); + $this->name = Piwik::translate('UserId_UserReportTitle'); + $this->subcategoryId = 'UserId_UserReportTitle'; + $this->documentation = Piwik::translate('UserId_UserReportDocumentation'); + $this->dimension = new UserId(); + $this->metrics = array('label', 'nb_visits', 'nb_actions', 'nb_visits_converted'); $this->supportsFlatten = false; // This defines in which order your report appears in the mobile app, in the menu and in the list of widgets @@ -61,6 +61,9 @@ class GetUsers extends Base $view->config->show_related_reports = false; $view->config->show_insights = false; $view->config->show_pivot_by_subtable = false; + $view->config->no_data_message = Piwik::translate('UserId_ThereIsNoDataForThisReport') . '

' + . sprintf(Piwik::translate('UserId_ThereIsNoDataForThisReportHelp'), + "", ""); if ($view->isViewDataTableId(HtmlTable::ID)) { $view->config->disable_row_evolution = false; diff --git a/plugins/UserId/lang/en.json b/plugins/UserId/lang/en.json index 0603567b0f..f53f89ee91 100644 --- a/plugins/UserId/lang/en.json +++ b/plugins/UserId/lang/en.json @@ -4,6 +4,7 @@ "UserReportTitle": "User IDs", "UserReportDocumentation": "This report shows visits and other general metrics for every individual User ID.", "PluginDescription": "Shows user reports", - "VisitorsUserSubcategoryHelp": "The User IDs report shows visits associated with all of your registered and logged in users. You can use this section to understand website usage by specific users and identify who your most and least active users are." - } -} \ No newline at end of file + "VisitorsUserSubcategoryHelp": "The User IDs report shows visits associated with all of your registered and logged in users. You can use this section to understand website usage by specific users and identify who your most and least active users are.", + "ThereIsNoDataForThisReport": "There is no data for this report.", + "ThereIsNoDataForThisReportHelp" : "%1$sLearn more about how to generate data for this report in our user guide.%2$s" } +} -- cgit v1.2.3