diff options
author | Tim-Hinnerk Heuer <tim@innocraft.com> | 2021-09-04 10:20:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-04 10:20:24 +0300 |
commit | 5d5e630e06b7941d22fc338ee964e30f06ad74af (patch) | |
tree | b18d74e10e3467c7604e64b62b81ba471e55e6ce /plugins/CoreHome/angularjs | |
parent | 7e0b0e602068a558a84f1e16fde5e7e6cb0b7fa4 (diff) |
show users more informative information on error (#17900)
* show users more informative information on error
fixes #15135
* add rel="noreferrer noopener" #15135
* show faq section only outside of cloud #15036
* privatise variables
contributing to View::showMoreFaqInfo #15135
Co-authored-by: Stefan Giehl <stefan@matomo.org>
Diffstat (limited to 'plugins/CoreHome/angularjs')
-rw-r--r-- | plugins/CoreHome/angularjs/widget-loader/widgetloader.directive.html | 1 | ||||
-rw-r--r-- | plugins/CoreHome/angularjs/widget-loader/widgetloader.directive.js | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/plugins/CoreHome/angularjs/widget-loader/widgetloader.directive.html b/plugins/CoreHome/angularjs/widget-loader/widgetloader.directive.html index 0146d0fb56..c29f0bbbd1 100644 --- a/plugins/CoreHome/angularjs/widget-loader/widgetloader.directive.html +++ b/plugins/CoreHome/angularjs/widget-loader/widgetloader.directive.html @@ -6,6 +6,7 @@ <div class="notification system notification-error"> {{ 'General_ErrorRequest'|translate:(''):('') }} + <ng-bind-html ng-bind-html="errorFaqLink"></ng-bind-html> </div> </div> diff --git a/plugins/CoreHome/angularjs/widget-loader/widgetloader.directive.js b/plugins/CoreHome/angularjs/widget-loader/widgetloader.directive.js index 4614f01bbf..a9812701bc 100644 --- a/plugins/CoreHome/angularjs/widget-loader/widgetloader.directive.js +++ b/plugins/CoreHome/angularjs/widget-loader/widgetloader.directive.js @@ -22,6 +22,8 @@ piwikWidgetLoader.$inject = ['piwik', 'piwikUrl', '$http', '$compile', '$q', '$location', 'notifications', '$rootScope', '$timeout', 'piwikComparisonsService']; function piwikWidgetLoader(piwik, piwikUrl, $http, $compile, $q, $location, notifications, $rootScope, $timeout, piwikComparisonsService){ + var isGeneralSettingsAdminEnabled = piwik.config['enable_general_settings_admin']; + var isPluginsAdminEnabled = piwik.config['enable_plugins_admin']; return { restrict: 'A', transclude: true, @@ -35,6 +37,12 @@ return function (scope, element, attrs, ngModel) { scope.widgetName = attrs.widgetName; + if (piwik.hasSuperUserAccess && (isGeneralSettingsAdminEnabled || isPluginsAdminEnabled)) { + scope.errorFaqLink = '<a rel="noreferrer noopener" target="_blank" href="https://matomo.org/faq/troubleshooting/faq_19489/">' + + _pk_translate('General_ErrorRequestFaqLink') + '</a>'; + } else { + scope.errorFaqLink = ''; + } if (!attrs.widgetName) { scope.loadingMessage = _pk_translate('General_LoadingData'); |