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
55100d5f
Unverified
Commit
55100d5f
authored
Feb 05, 2018
by
Marcus Efraimsson
Committed by
GitHub
Feb 05, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10760 from grafana/10749_link_to_folder
Fix link to folder from permissions list
parents
6def21e8
7d3b990e
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
28 additions
and
20 deletions
+28
-20
pkg/api/dashboard.go
+1
-1
pkg/api/dtos/dashboard.go
+1
-1
public/app/containers/ManageDashboards/FolderPermissions.tsx
+5
-0
public/app/core/angular_wrappers.ts
+1
-7
public/app/core/components/Permissions/DashboardPermissions.tsx
+8
-5
public/app/core/components/Permissions/FolderInfo.ts
+2
-2
public/app/core/components/Permissions/PermissionsListItem.tsx
+1
-1
public/app/features/dashboard/settings/settings.html
+1
-3
public/app/features/dashboard/settings/settings.ts
+8
-0
No files found.
pkg/api/dashboard.go
View file @
55100d5f
...
...
@@ -99,7 +99,7 @@ func GetDashboard(c *middleware.Context) Response {
return
ApiError
(
500
,
"Dashboard folder could not be read"
,
err
)
}
meta
.
FolderTitle
=
query
.
Result
.
Title
meta
.
Folder
Slug
=
query
.
Result
.
Slug
meta
.
Folder
Url
=
query
.
Result
.
GetUrl
()
}
// make sure db version is in sync with json model version
...
...
pkg/api/dtos/dashboard.go
View file @
55100d5f
...
...
@@ -27,7 +27,7 @@ type DashboardMeta struct {
IsFolder
bool
`json:"isFolder"`
FolderId
int64
`json:"folderId"`
FolderTitle
string
`json:"folderTitle"`
Folder
Slug
string
`json:"folderSlug
"`
Folder
Url
string
`json:"folderUrl
"`
}
type
DashboardFullWithMeta
struct
{
...
...
public/app/containers/ManageDashboards/FolderPermissions.tsx
View file @
55100d5f
...
...
@@ -17,6 +17,11 @@ export class FolderPermissions extends Component<IContainerProps, any> {
this
.
loadStore
();
}
componentWillUnmount
()
{
const
{
permissions
}
=
this
.
props
;
permissions
.
hideAddPermissions
();
}
loadStore
()
{
const
{
nav
,
folder
,
view
}
=
this
.
props
;
return
folder
.
load
(
view
.
routeParams
.
get
(
'uid'
)
as
string
).
then
(
res
=>
{
...
...
public/app/core/angular_wrappers.ts
View file @
55100d5f
...
...
@@ -20,11 +20,5 @@ export function registerAngularDirectives() {
[
'tagOptions'
,
{
watchDepth
:
'reference'
}],
]);
react2AngularDirective
(
'selectUserPicker'
,
UserPicker
,
[
'backendSrv'
,
'handlePicked'
]);
react2AngularDirective
(
'dashboardPermissions'
,
DashboardPermissions
,
[
'backendSrv'
,
'dashboardId'
,
'folderTitle'
,
'folderSlug'
,
'folderId'
,
]);
react2AngularDirective
(
'dashboardPermissions'
,
DashboardPermissions
,
[
'backendSrv'
,
'dashboardId'
,
'folder'
]);
}
public/app/core/components/Permissions/DashboardPermissions.tsx
View file @
55100d5f
...
...
@@ -6,12 +6,11 @@ import Tooltip from 'app/core/components/Tooltip/Tooltip';
import
PermissionsInfo
from
'app/core/components/Permissions/PermissionsInfo'
;
import
AddPermissions
from
'app/core/components/Permissions/AddPermissions'
;
import
SlideDown
from
'app/core/components/Animations/SlideDown'
;
import
{
FolderInfo
}
from
'./FolderInfo'
;
export
interface
IProps
{
dashboardId
:
number
;
folderId
:
number
;
folderTitle
:
string
;
folderSlug
:
string
;
folder
?:
FolderInfo
;
backendSrv
:
any
;
}
@
observer
...
...
@@ -28,8 +27,12 @@ class DashboardPermissions extends Component<IProps, any> {
this
.
permissions
.
toggleAddPermissions
();
}
componentWillUnmount
()
{
this
.
permissions
.
hideAddPermissions
();
}
render
()
{
const
{
dashboardId
,
folder
Title
,
folderSlug
,
folderId
,
backendSrv
}
=
this
.
props
;
const
{
dashboardId
,
folder
,
backendSrv
}
=
this
.
props
;
return
(
<
div
>
...
...
@@ -56,7 +59,7 @@ class DashboardPermissions extends Component<IProps, any> {
permissions=
{
this
.
permissions
}
isFolder=
{
false
}
dashboardId=
{
dashboardId
}
folderInfo=
{
{
title
:
folderTitle
,
slug
:
folderSlug
,
id
:
folderId
}
}
folderInfo=
{
folder
}
backendSrv=
{
backendSrv
}
/>
</
div
>
...
...
public/app/core/components/Permissions/FolderInfo.ts
View file @
55100d5f
export
interface
FolderInfo
{
title
:
string
;
id
:
number
;
slug
:
string
;
title
:
string
;
url
:
string
;
}
public/app/core/components/Permissions/PermissionsListItem.tsx
View file @
55100d5f
...
...
@@ -30,7 +30,7 @@ export default observer(({ item, removeItem, permissionChanged, itemIndex, folde
folderInfo
&&
(
<
em
className=
"muted no-wrap"
>
Inherited from folder
{
' '
}
<
a
className=
"text-link"
href=
{
`
dashboards/folder/${folderInfo.id}/${folderInfo.slug
}/permissions`
}
>
<
a
className=
"text-link"
href=
{
`
${folderInfo.url
}/permissions`
}
>
{
folderInfo
.
title
}
</
a
>
{
' '
}
</
em
>
...
...
public/app/features/dashboard/settings/settings.html
View file @
55100d5f
...
...
@@ -99,9 +99,7 @@
<dashboard-permissions
ng-if=
"ctrl.dashboard"
dashboardId=
"ctrl.dashboard.id"
backendSrv=
"ctrl.backendSrv"
folderTitle=
"ctrl.dashboard.meta.folderTitle"
folderSlug=
"ctrl.dashboard.meta.folderSlug"
folderId=
"ctrl.dashboard.meta.folderId"
folder=
"ctrl.getFolder()"
/>
</div>
...
...
public/app/features/dashboard/settings/settings.ts
View file @
55100d5f
...
...
@@ -197,6 +197,14 @@ export class SettingsCtrl {
this
.
dashboard
.
meta
.
folderTitle
=
folder
.
title
;
this
.
dashboard
.
meta
.
folderSlug
=
folder
.
slug
;
}
getFolder
()
{
return
{
id
:
this
.
dashboard
.
meta
.
folderId
,
title
:
this
.
dashboard
.
meta
.
folderTitle
,
url
:
this
.
dashboard
.
meta
.
folderUrl
,
};
}
}
export
function
dashboardSettings
()
{
...
...
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