From fef9ee69b1341d70a3a4ebdd6ad52ee3ceced4ff Mon Sep 17 00:00:00 2001
From: Alexander Lesnenko <alxnddr@users.noreply.github.com>
Date: Thu, 20 Jan 2022 20:35:50 +0000
Subject: [PATCH] hide new question menu item when there are no dbs (#19811)

---
 .../src/metabase/nav/containers/Navbar.jsx    | 22 +++++++++++--------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/frontend/src/metabase/nav/containers/Navbar.jsx b/frontend/src/metabase/nav/containers/Navbar.jsx
index 159f745ceb2..537d6ff127c 100644
--- a/frontend/src/metabase/nav/containers/Navbar.jsx
+++ b/frontend/src/metabase/nav/containers/Navbar.jsx
@@ -163,15 +163,19 @@ export default class Navbar extends Component {
               </Link>
             }
             items={[
-              {
-                title: t`Question`,
-                icon: `insight`,
-                link: Urls.newQuestion({
-                  mode: "notebook",
-                  creationType: "complex_question",
-                }),
-                event: `NavBar;New Question Click;`,
-              },
+              ...(hasDataAccess
+                ? [
+                    {
+                      title: t`Question`,
+                      icon: `insight`,
+                      link: Urls.newQuestion({
+                        mode: "notebook",
+                        creationType: "complex_question",
+                      }),
+                      event: `NavBar;New Question Click;`,
+                    },
+                  ]
+                : []),
               ...(hasNativeWrite
                 ? [
                     {
-- 
GitLab