Skip to content
Snippets Groups Projects
Unverified Commit c1de8e13 authored by dpsutton's avatar dpsutton Committed by GitHub
Browse files

Ignore hidden tables in search (#17804)

parent 6aae2823
No related branches found
No related tags found
No related merge requests found
......@@ -171,7 +171,9 @@
[model archived?]
(if archived?
[:= 1 0] ; No tables should appear in archive searches
[:= (hsql/qualify (model->alias model) :active) true]))
[:and
[:= (hsql/qualify (model->alias model) :active) true]
[:= (hsql/qualify (model->alias model) :visibility_type) nil]]))
(defn- wildcard-match
[s]
......
......@@ -481,6 +481,12 @@
(do-test-users [user [:crowberto :rasta]]
(is (= [(default-table-search-row "Round Table")]
(search-request-data user :q "Round Table"))))))
(testing "You should not see hidden tables"
(mt/with-temp* [Table [normal {:name "Foo Visible"}]
Table [hidden {:name "Foo Hidden", :visibility_type "hidden"}]]
(do-test-users [user [:crowberto :rasta]]
(is (= [(default-table-search-row "Foo Visible")]
(search-request-data user :q "Foo"))))))
(testing "You should be able to search by their display name"
(let [lancelot "Lancelot's Favorite Furniture"]
(mt/with-temp Table [table {:name "Round Table" :display_name lancelot}]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment