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
9948e929
Unverified
Commit
9948e929
authored
Jul 09, 2020
by
Peter Holmberg
Committed by
GitHub
Jul 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: Redirect to correct url after creating a folder (#26160)
parent
2ac1bfcc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
public/app/features/folders/state/actions.ts
+4
-6
No files found.
public/app/features/folders/state/actions.ts
View file @
9948e929
import
{
AppEvents
}
from
'@grafana/data'
;
import
{
AppEvents
,
locationUtil
}
from
'@grafana/data'
;
import
{
getBackendSrv
}
from
'@grafana/runtime'
;
import
{
backendSrv
}
from
'app/core/services/backend_srv'
;
import
{
backendSrv
}
from
'app/core/services/backend_srv'
;
import
{
FolderState
,
ThunkResult
}
from
'app/types'
;
import
{
FolderState
,
ThunkResult
}
from
'app/types'
;
import
{
DashboardAcl
,
DashboardAclUpdateDTO
,
NewDashboardAclItem
,
PermissionLevel
}
from
'app/types/acl'
;
import
{
DashboardAcl
,
DashboardAclUpdateDTO
,
NewDashboardAclItem
,
PermissionLevel
}
from
'app/types/acl'
;
import
{
updateLocation
,
updateNavIndex
}
from
'app/core/actions'
;
import
{
updateLocation
,
updateNavIndex
}
from
'app/core/actions'
;
import
{
buildNavModel
}
from
'./navModel'
;
import
{
buildNavModel
}
from
'./navModel'
;
import
appEvents
from
'app/core/app_events'
;
import
appEvents
from
'app/core/app_events'
;
import
{
loadFolder
,
loadFolderPermissions
}
from
'./reducers'
;
import
{
loadFolder
,
loadFolderPermissions
}
from
'./reducers'
;
import
{
getBackendSrv
}
from
'@grafana/runtime'
;
export
function
getFolderByUid
(
uid
:
string
):
ThunkResult
<
void
>
{
export
function
getFolderByUid
(
uid
:
string
):
ThunkResult
<
void
>
{
return
async
dispatch
=>
{
return
async
dispatch
=>
{
...
@@ -122,9 +121,8 @@ export function addFolderPermission(newItem: NewDashboardAclItem): ThunkResult<v
...
@@ -122,9 +121,8 @@ export function addFolderPermission(newItem: NewDashboardAclItem): ThunkResult<v
export
function
createNewFolder
(
folderName
:
string
):
ThunkResult
<
void
>
{
export
function
createNewFolder
(
folderName
:
string
):
ThunkResult
<
void
>
{
return
async
dispatch
=>
{
return
async
dispatch
=>
{
// @ts-ignore
const
newFolder
=
await
getBackendSrv
().
post
(
'/api/folders'
,
{
title
:
folderName
});
const
newFolder
=
await
getBackendSrv
().
createFolder
({
title
:
folderName
});
appEvents
.
emit
(
AppEvents
.
alertSuccess
,
[
'Folder Created'
,
'OK'
]);
appEvents
.
emit
(
AppEvents
.
alertSuccess
,
[
'Folder Created'
,
'OK'
]);
dispatch
(
updateLocation
({
path
:
newFolder
.
url
}));
dispatch
(
updateLocation
({
path
:
locationUtil
.
stripBaseFromUrl
(
newFolder
.
url
)
}));
};
};
}
}
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