Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
84ff62d7
Commit
84ff62d7
authored
Jun 16, 2017
by
Daniel Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: remove dashboard children on delete
parent
d9dca72e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
pkg/services/sqlstore/dashboard.go
+1
-0
pkg/services/sqlstore/dashboard_test.go
+16
-0
No files found.
pkg/services/sqlstore/dashboard.go
View file @
84ff62d7
...
@@ -371,6 +371,7 @@ func DeleteDashboard(cmd *m.DeleteDashboardCommand) error {
...
@@ -371,6 +371,7 @@ func DeleteDashboard(cmd *m.DeleteDashboardCommand) error {
"DELETE FROM dashboard WHERE id = ?"
,
"DELETE FROM dashboard WHERE id = ?"
,
"DELETE FROM playlist_item WHERE type = 'dashboard_by_id' AND value = ?"
,
"DELETE FROM playlist_item WHERE type = 'dashboard_by_id' AND value = ?"
,
"DELETE FROM dashboard_version WHERE dashboard_id = ?"
,
"DELETE FROM dashboard_version WHERE dashboard_id = ?"
,
"DELETE FROM dashboard WHERE parent_id = ?"
,
}
}
for
_
,
sql
:=
range
deletes
{
for
_
,
sql
:=
range
deletes
{
...
...
pkg/services/sqlstore/dashboard_test.go
View file @
84ff62d7
...
@@ -247,6 +247,22 @@ func TestDashboardDataAccess(t *testing.T) {
...
@@ -247,6 +247,22 @@ func TestDashboardDataAccess(t *testing.T) {
So
(
query
.
Result
.
ParentId
,
ShouldEqual
,
0
)
So
(
query
.
Result
.
ParentId
,
ShouldEqual
,
0
)
})
})
Convey
(
"Should be able to delete a dashboard folder and its children"
,
func
()
{
deleteCmd
:=
&
m
.
DeleteDashboardCommand
{
Slug
:
savedFolder
.
Slug
}
err
:=
DeleteDashboard
(
deleteCmd
)
So
(
err
,
ShouldBeNil
)
query
:=
search
.
FindPersistedDashboardsQuery
{
OrgId
:
1
,
ParentId
:
savedFolder
.
Id
,
}
err
=
SearchDashboards
(
&
query
)
So
(
err
,
ShouldBeNil
)
So
(
len
(
query
.
Result
),
ShouldEqual
,
0
)
})
Convey
(
"Should be able to get dashboard tags"
,
func
()
{
Convey
(
"Should be able to get dashboard tags"
,
func
()
{
query
:=
m
.
GetDashboardTagsQuery
{
OrgId
:
1
}
query
:=
m
.
GetDashboardTagsQuery
{
OrgId
:
1
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment