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
10158c90
Unverified
Commit
10158c90
authored
Jun 02, 2020
by
Alex Khomenko
Committed by
GitHub
Jun 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Search: uncheck dashboards after moved (#25256)
parent
51d1261a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
public/app/features/search/reducers/manageDashboards.ts
+9
-4
No files found.
public/app/features/search/reducers/manageDashboards.ts
View file @
10158c90
import
{
DashboardSectionItem
,
SearchAction
}
from
'../types'
;
import
{
DashboardSection
,
DashboardSection
Item
,
SearchAction
}
from
'../types'
;
import
{
TOGGLE_ALL_CHECKED
,
TOGGLE_CHECKED
,
MOVE_ITEMS
,
DELETE_ITEMS
}
from
'./actionTypes'
;
import
{
dashboardsSearchState
,
DashboardsSearchState
,
searchReducer
}
from
'./dashboardSearch'
;
import
{
mergeReducers
}
from
'../utils'
;
...
...
@@ -46,13 +46,18 @@ const reducer = (state: ManageDashboardsState, action: SearchAction) => {
}),
};
case
MOVE_ITEMS
:
{
const
{
dashboards
,
folder
}
=
action
.
payload
;
const
uids
=
dashboards
.
map
((
d
:
DashboardSectionItem
)
=>
d
.
uid
);
const
dashboards
:
DashboardSectionItem
[]
=
action
.
payload
.
dashboards
;
const
folder
:
DashboardSection
=
action
.
payload
.
folder
;
const
uids
=
dashboards
.
map
(
db
=>
db
.
uid
);
return
{
...
state
,
results
:
state
.
results
.
map
(
result
=>
{
if
(
folder
.
id
===
result
.
id
)
{
return
{
...
result
,
items
:
[...
result
.
items
,
...
dashboards
]
};
return
{
...
result
,
items
:
[...
result
.
items
,
...
dashboards
.
map
(
db
=>
({
...
db
,
checked
:
false
}))],
checked
:
false
,
};
}
else
{
return
{
...
result
,
items
:
result
.
items
.
filter
(
item
=>
!
uids
.
includes
(
item
.
uid
))
};
}
...
...
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