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
72f3b9a8
Unverified
Commit
72f3b9a8
authored
5 years ago
by
Cam Saul
Browse files
Options
Downloads
Patches
Plain Diff
Code deduplication & indentation fixes
parent
2daa4b56
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/metabase/api/dashboard.clj
+9
-15
9 additions, 15 deletions
src/metabase/api/dashboard.clj
with
9 additions
and
15 deletions
src/metabase/api/dashboard.clj
+
9
−
15
View file @
72f3b9a8
...
...
@@ -217,14 +217,14 @@
:collection_id
collection_id
:collection_position
collection_position
}
dashboard
(
db/transaction
;; Adding a new dashboard at `collection_position` could cause other dashboards in this
collection to change
;;
position, check that and fix up if needed
(
api/maybe-reconcile-collection-position!
dashboard-data
)
;; Ok, now save the Dashboard
(
u/prog1
(
db/insert!
Dashboard
dashboard-data
)
;; Get cards from existing dashboard and associate to copied dashboard
(
doseq
[
card
(
:ordered_cards
existing-dashboard
)]
(
api/check-500
(
dashboard/add-dashcard!
<>
(
:card_id
card
)
card
)))))]
;; Adding a new dashboard at `collection_position` could cause other dashboards in this
;; collection to change
position, check that and fix up if needed
(
api/maybe-reconcile-collection-position!
dashboard-data
)
;; Ok, now save the Dashboard
(
u/prog1
(
db/insert!
Dashboard
dashboard-data
)
;; Get cards from existing dashboard and associate to copied dashboard
(
doseq
[
card
(
:ordered_cards
existing-dashboard
)]
(
api/check-500
(
dashboard/add-dashcard!
<>
(
:card_id
card
)
card
)))))]
(
events/publish-event!
:dashboard-create
dashboard
)))
...
...
@@ -233,13 +233,7 @@
(
api/defendpoint
GET
"/:id"
"Get `Dashboard` with ID."
[
id
]
(
u/prog1
(
->
(
Dashboard
id
)
api/check-404
(
hydrate
[
:ordered_cards
:card
:series
]
:can_write
)
api/read-check
api/check-not-archived
hide-unreadable-cards
add-query-average-durations
)
(
u/prog1
(
get-dashboard
id
)
(
events/publish-event!
:dashboard-read
(
assoc
<>
:actor_id
api/*current-user-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