You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by be...@apache.org on 2019/12/17 19:18:25 UTC

[incubator-superset] 02/03: Improve message when unauthenticated

This is an automated email from the ASF dual-hosted git repository.

beto pushed a commit to branch VIZ-1230
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git

commit 364033ff75694215a0f149b2623231f0ec4b4c8d
Author: Beto Dealmeida <ro...@dealmeida.net>
AuthorDate: Tue Dec 17 11:14:41 2019 -0800

    Improve message when unauthenticated
---
 superset/assets/src/welcome/DashboardTable.jsx | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/superset/assets/src/welcome/DashboardTable.jsx b/superset/assets/src/welcome/DashboardTable.jsx
index a2102a0..28f670e 100644
--- a/superset/assets/src/welcome/DashboardTable.jsx
+++ b/superset/assets/src/welcome/DashboardTable.jsx
@@ -47,10 +47,16 @@ class DashboardTable extends React.PureComponent {
       .then(({ json }) => {
         this.setState({ dashboards: json.result });
       })
-      .catch(() => {
-        this.props.addDangerToast(
-          t('An error occurred while fethching Dashboards'),
-        );
+      .catch(response => {
+        if (response.status === 401) {
+          this.props.addDangerToast(
+            t("You don't have the necessary permissions to load dashboards. Please contact your administrator."),
+          );
+        } else {
+          this.props.addDangerToast(
+            t('An error occurred while fetching Dashboards'),
+          );
+        }
       });
   }