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
7fa0d182
Unverified
Commit
7fa0d182
authored
2 years ago
by
metamben
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Report the ID of the app (not the coll) under [:collection :app_id] (#25237)
Fixes #25213.
parent
9c3b6b9b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/metabase/search/config.clj
+3
-3
3 additions, 3 deletions
src/metabase/search/config.clj
test/metabase/api/search_test.clj
+25
-0
25 additions, 0 deletions
test/metabase/api/search_test.clj
with
28 additions
and
3 deletions
src/metabase/search/config.clj
+
3
−
3
View file @
7fa0d182
...
...
@@ -132,7 +132,7 @@
(
defmethod
columns-for-model
"card"
[
_
]
(
conj
default-columns
:collection_id
:collection_position
:dataset_query
[
:collection_app.
collection_
id
:collection_app_id
]
[
:collection_app.id
:collection_app_id
]
[
:collection.name
:collection_name
]
[
:collection.authority_level
:collection_authority_level
]
[{
:select
[
:status
]
...
...
@@ -151,7 +151,7 @@
(
defmethod
columns-for-model
"dashboard"
[
_
]
(
conj
default-columns
:collection_id
:collection_position
bookmark-col
[
:collection_app.
collection_
id
:collection_app_id
]
[
:collection_app.id
:collection_app_id
]
[
:collection.name
:collection_name
]
[
:collection.authority_level
:collection_authority_level
]))
...
...
@@ -162,7 +162,7 @@
(
defmethod
columns-for-model
"pulse"
[
_
]
[
:id
:name
:collection_id
[
:collection_app.
collection_
id
:collection_app_id
]
[
:collection_app.id
:collection_app_id
]
[
:collection.name
:collection_name
]])
(
defmethod
columns-for-model
"collection"
...
...
This diff is collapsed.
Click to expand it.
test/metabase/api/search_test.clj
+
25
−
0
View file @
7fa0d182
...
...
@@ -640,3 +640,28 @@
(
is
(
partial=
[(
assoc
(
select-keys
page
[
:name
:description
])
:model
"page"
)]
(
search-request-data
:rasta
:q
"important text"
:models
"page"
))))))
(
deftest
collection-app-id-test
(
testing
"app_id and id of containing collection should not be confused (#25213)"
(
mt/with-temp*
[
Collection
[{
coll-id
:id
}]
;; The ignored elements are there to make sure the IDs
;; coll-id and app-id are different.
Collection
[{
ignored-collection-id
:id
}]
App
[
_ignored-app
{
:collection_id
ignored-collection-id
}]
App
[{
app-id
:id
}
{
:collection_id
coll-id
}]
Dashboard
[
_
{
:name
"Not a page but contains important text!"
:collection_id
coll-id
}]
Dashboard
[
_
{
:name
"Page"
:description
"Contains important text!"
:collection_id
coll-id
:is_app_page
true
}]
Card
[
_
{
:name
"Query looking for important text"
:query_type
"native"
:dataset_query
(
mt/native-query
{
:query
"SELECT 0 FROM venues"
})
:collection_id
coll-id
}]
Pulse
[
_
{
:name
"Pulse about important text"
:collection_id
coll-id
}]]
(
is
(
not=
app-id
coll-id
)
"app-id and coll-id should be different. Fix the test!"
)
(
is
(
partial=
(
repeat
4
{
:collection
{
:app_id
app-id
:id
coll-id
}})
(
:data
(
make-search-request
:rasta
[
:q
"important text"
])))))))
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