Skip to content

Commit

Permalink
Improve error visuals for All Websites Dashboard (#22872)
Browse files Browse the repository at this point in the history
* Add new message for All Websites error message

* Move Error message on All Websites and suppress error notification

* Build vue files

* Fixed UI test failure caused by updating All Websites Dashboard error location

* Reset files changed by vue compilation

* remove unnecessary placeholder values

* resolve merge conflict issues and odd file generation

* Add removed UI test image

* Build vue files

* Update UI test due to moving error location on page

* reset files modified by vue compilation

---------

Co-authored-by: innocraft-automation <[email protected]>
  • Loading branch information
nathangavin and innocraft-automation authored Dec 19, 2024
1 parent c7c1027 commit ab4ca64
Show file tree
Hide file tree
Showing 8 changed files with 120 additions and 112 deletions.
1 change: 1 addition & 0 deletions plugins/MultiSites/MultiSites.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function getClientSideTranslationKeys(&$translations)
$translations[] = 'MultiSites_TotalHits';
$translations[] = 'MultiSites_TotalPageviews';
$translations[] = 'MultiSites_TotalVisits';
$translations[] = 'MultiSites_AllWebsitesDashboardErrorMessage';
}

public function getStylesheetFiles(&$stylesheets)
Expand Down
1 change: 1 addition & 0 deletions plugins/MultiSites/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"SingleWebsitesDashboardDocumentation": "This report gives you an informational overview for a specific website, containing the most general metrics about your visitors.",
"AllWebsitesDashboardDocumentation": "This report gives you an informational overview for each of your websites, containing the most general metrics about your visitors.",
"AllWebsitesDashboardTitle": "All Websites",
"AllWebsitesDashboardErrorMessage": "Data is currently unavailable. This could be due to a temporary server issue or the report containing too much data. Please try again later. If the problem continues, please contact your Matomo administrator for assistance.",
"EvolutionComparisonIncomplete": "The currently selected time period is %1$s complete.",
"EvolutionComparisonProportional": "When the previous period was also %1$s complete, there would have been an estimated %2$s %3$s\n(out of a total of %4$s %3$s in the previous period).",
"EvolutionComparisonDay": "%1$s %2$s this day compared to %3$s %2$s in the previous partial period (%4$s) Evolution: %5$s",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
158 changes: 81 additions & 77 deletions plugins/MultiSites/vue/dist/MultiSites.umd.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions plugins/MultiSites/vue/dist/MultiSites.umd.min.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,12 @@ class DashboardStore {
if (this.searchTerm) {
params.pattern = this.searchTerm;
}

return AjaxHelper.fetch<GetAllWithGroupsDataResponse>(
params,
{ abortController: this.fetchAbort },
{
abortController: this.fetchAbort,
createErrorNotification: false,
},
).then((response) => {
if (!onlySites) {
this.updateDashboardKPIs(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,31 @@
</h1>
</div>

<div v-if="errorLoading">
<div class="notification system notification-error">
{{ translate('MultiSites_AllWebsitesDashboardErrorMessage') }}
<br /><br />
{{ translate('General_NeedMoreHelp', '', '') }}
<a
rel="noreferrer noopener"
target="_blank"
:href="externalRawLink('https://matomo.org/faq/troubleshooting/faq_19489/')"
>{{ translate('General_Faq') }}</a>
&#x2013;
<a
rel="noreferrer noopener"
target="_blank"
:href="externalRawLink('https://forum.matomo.org/')"
>{{ translate('Feedback_CommunityHelp') }}</a>
&#x2013;
<a
rel="noreferrer noopener"
target="_blank"
:href="externalRawLink('https://matomo.org/support-plans/')"
>{{ translate('Feedback_ProfessionalHelp') }}</a>.
</div>
</div>

<KPICardContainer
:is-loading="isLoadingKPIs"
:model-value="kpis"
Expand Down Expand Up @@ -121,6 +146,9 @@ export default defineComponent({
isLoadingKPIs(): boolean {
return DashboardStore.state.value.isLoadingKPIs;
},
errorLoading(): boolean {
return DashboardStore.state.value.errorLoading;
},
kpis(): KPICardData[] {
const { dashboardKPIs } = DashboardStore.state.value;

Expand Down
28 changes: 0 additions & 28 deletions plugins/MultiSites/vue/src/AllWebsitesDashboard/SitesTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,34 +96,6 @@
</td>
</tr>

<tr v-else-if="errorLoading">
<td colspan="7">
<div class="notification system notification-error">
{{ translate('General_ErrorRequest', '', '') }}
<br /><br />
{{ translate('General_NeedMoreHelp') }}
<a
rel="noreferrer noopener"
target="_blank"
:href="externalRawLink('https://matomo.org/faq/troubleshooting/faq_19489/')"
>{{ translate('General_Faq') }}</a>
&#x2013;
<a
rel="noreferrer noopener"
target="_blank"
:href="externalRawLink('https://forum.matomo.org/')"
>{{ translate('Feedback_CommunityHelp') }}</a>
<span v-show="errorShowProfessionalHelp"> &#x2013; </span>
<a
rel="noreferrer noopener"
target="_blank"
:href="externalRawLink('https://matomo.org/support-plans/')"
v-show="errorShowProfessionalHelp"
>{{ translate('Feedback_ProfessionalHelp') }}</a>.
</div>
</td>
</tr>

<SitesTableSite
v-else
v-for="site in sites"
Expand Down

0 comments on commit ab4ca64

Please sign in to comment.