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
2efd8f47
Unverified
Commit
2efd8f47
authored
1 year ago
by
john-metabase
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix serdes v2 collection load (#29572)
Fixes import of dashboards in the root/default collection
parent
0387f115
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
enterprise/backend/test/metabase_enterprise/serialization/v2/e2e_test.clj
+5
-3
5 additions, 3 deletions
...nd/test/metabase_enterprise/serialization/v2/e2e_test.clj
src/metabase/models/dashboard.clj
+1
-1
1 addition, 1 deletion
src/metabase/models/dashboard.clj
with
6 additions
and
4 deletions
enterprise/backend/test/metabase_enterprise/serialization/v2/e2e_test.clj
+
5
−
3
View file @
2efd8f47
...
@@ -170,8 +170,10 @@
...
@@ -170,8 +170,10 @@
{
:table_id
[
:t
10
]
{
:table_id
[
:t
10
]
:collection_id
[
:coll
10
]
:collection_id
[
:coll
10
]
:creator_id
[
:u
10
]}))
:creator_id
[
:u
10
]}))
:dashboard
(
many-random-fks
100
{}
{
:collection_id
[
:coll
100
]
:dashboard
(
concat
(
many-random-fks
100
{}
{
:collection_id
[
:coll
100
]
:creator_id
[
:u
10
]})
:creator_id
[
:u
10
]})
;; create some root collection dashboards
(
many-random-fks
50
{}
{
:creator_id
[
:u
10
]}))
:dashboard-card
(
many-random-fks
300
{}
{
:card_id
[
:c
100
]
:dashboard-card
(
many-random-fks
300
{}
{
:card_id
[
:c
100
]
:dashboard_id
[
:d
100
]})
:dashboard_id
[
:d
100
]})
:dimension
(
vec
(
concat
:dimension
(
vec
(
concat
...
@@ -270,7 +272,7 @@
...
@@ -270,7 +272,7 @@
(
reduce
+
)))))
(
reduce
+
)))))
(
testing
"for dashboards"
(
testing
"for dashboards"
(
is
(
=
1
0
0
(
->>
(
io/file
dump-dir
"collections"
)
(
is
(
=
1
5
0
(
->>
(
io/file
dump-dir
"collections"
)
collections
collections
(
map
(
comp
count
dir->file-set
#
(
io/file
%
"dashboards"
)))
(
map
(
comp
count
dir->file-set
#
(
io/file
%
"dashboards"
)))
(
reduce
+
)))))
(
reduce
+
)))))
...
...
This diff is collapsed.
Click to expand it.
src/metabase/models/dashboard.clj
+
1
−
1
View file @
2efd8f47
...
@@ -495,7 +495,7 @@
...
@@ -495,7 +495,7 @@
[{
:keys
[
collection_id
ordered_cards
parameters
]}]
[{
:keys
[
collection_id
ordered_cards
parameters
]}]
(
->>
(
map
serdes-deps-dashcard
ordered_cards
)
(
->>
(
map
serdes-deps-dashcard
ordered_cards
)
(
reduce
set/union
)
(
reduce
set/union
)
(
set/union
#
{[{
:model
"Collection"
:id
collection_id
}]})
(
set/union
(
when
collection_id
#
{[{
:model
"Collection"
:id
collection_id
}]})
)
(
set/union
(
serdes/parameters-deps
parameters
))))
(
set/union
(
serdes/parameters-deps
parameters
))))
(
defmethod
serdes/descendants
"Dashboard"
[
_model-name
id
]
(
defmethod
serdes/descendants
"Dashboard"
[
_model-name
id
]
...
...
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