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
f4937b76
Commit
f4937b76
authored
7 years ago
by
Simon Belak
Browse files
Options
Downloads
Patches
Plain Diff
Cap related
parent
df3ff3ff
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/metabase/automagic_dashboards/core.clj
+24
-19
24 additions, 19 deletions
src/metabase/automagic_dashboards/core.clj
with
24 additions
and
19 deletions
src/metabase/automagic_dashboards/core.clj
+
24
−
19
View file @
f4937b76
...
...
@@ -485,6 +485,8 @@
:table
table
})))
(
sort-by
:score
>
))))
(
def
^
:private
^
Long
max-related
6
)
(
defn
automagic-dashboard
"Create dashboards for table `root` using the best matching heuristics."
([
root
]
(
automagic-dashboard
nil
root
))
...
...
@@ -497,25 +499,28 @@
;; matching-rules returns an ArraySeq so first
;; realises one element at a time (no chunking).
first
))]
(
->
dashboard
populate/create-dashboard
(
assoc
:related
{
:tables
(
->>
root
database
candidate-tables
(
remove
(
comp
#
{
root
}
:table
)))
:indepth
(
->>
rule
:rule
rules/indepth
(
keep
(
fn
[
indepth
]
(
when-let
[[
dashboard
_
]
(
apply-rule
root
indepth
)]
{
:title
(
:title
dashboard
)
:description
(
:description
dashboard
)
:table
(
table
root
)
:url
(
format
"/%s/%s"
(
url
root
)
(
:rule
rule
)
(
:rule
indepth
))}))))}))
(
let
[
indepth
(
->>
rule
:rule
rules/indepth
(
keep
(
fn
[
indepth
]
(
when-let
[[
dashboard
_
]
(
apply-rule
root
indepth
)]
{
:title
(
:title
dashboard
)
:description
(
:description
dashboard
)
:table
(
table
root
)
:url
(
format
"/%s/%s"
(
url
root
)
(
:rule
rule
)
(
:rule
indepth
))})))
(
take
max-related
))]
(
->
dashboard
populate/create-dashboard
(
assoc
:related
{
:tables
(
->>
root
database
candidate-tables
(
remove
(
comp
#
{
root
}
:table
))
(
take
(
-
max-related
(
count
indepth
))))
:indepth
indepth
})))
(
log/info
(
format
"Skipping %s: no cards fully match the topology."
(
full-name
root
))))))
...
...
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