Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
c1de8e13
Unverified
Commit
c1de8e13
authored
3 years ago
by
dpsutton
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Ignore hidden tables in search (#17804)
parent
6aae2823
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/metabase/api/search.clj
+3
-1
3 additions, 1 deletion
src/metabase/api/search.clj
test/metabase/api/search_test.clj
+6
-0
6 additions, 0 deletions
test/metabase/api/search_test.clj
with
9 additions
and
1 deletion
src/metabase/api/search.clj
+
3
−
1
View file @
c1de8e13
...
...
@@ -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
]
...
...
This diff is collapsed.
Click to expand it.
test/metabase/api/search_test.clj
+
6
−
0
View file @
c1de8e13
...
...
@@ -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
}]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment