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
Show 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 {
...
@@ -99,7 +99,7 @@ func GetDashboard(c *middleware.Context) Response {
return
ApiError
(
500
,
"Dashboard folder could not be read"
,
err
)
return
ApiError
(
500
,
"Dashboard folder could not be read"
,
err
)
}
}
meta
.
FolderTitle
=
query
.
Result
.
Title
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
// 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 {
...
@@ -27,7 +27,7 @@ type DashboardMeta struct {
IsFolder
bool
`json:"isFolder"`
IsFolder
bool
`json:"isFolder"`
FolderId
int64
`json:"folderId"`
FolderId
int64
`json:"folderId"`
FolderTitle
string
`json:"folderTitle"`
FolderTitle
string
`json:"folderTitle"`
Folder
Slug
string
`json:"folderSlug
"`
Folder
Url
string
`json:"folderUrl
"`
}
}
type
DashboardFullWithMeta
struct
{
type
DashboardFullWithMeta
struct
{
...
...
public/app/containers/ManageDashboards/FolderPermissions.tsx
View file @
55100d5f
...
@@ -17,6 +17,11 @@ export class FolderPermissions extends Component<IContainerProps, any> {
...
@@ -17,6 +17,11 @@ export class FolderPermissions extends Component<IContainerProps, any> {
this
.
loadStore
();
this
.
loadStore
();
}
}
componentWillUnmount
()
{
const
{
permissions
}
=
this
.
props
;
permissions
.
hideAddPermissions
();
}
loadStore
()
{
loadStore
()
{
const
{
nav
,
folder
,
view
}
=
this
.
props
;
const
{
nav
,
folder
,
view
}
=
this
.
props
;
return
folder
.
load
(
view
.
routeParams
.
get
(
'uid'
)
as
string
).
then
(
res
=>
{
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() {
...
@@ -20,11 +20,5 @@ export function registerAngularDirectives() {
[
'tagOptions'
,
{
watchDepth
:
'reference'
}],
[
'tagOptions'
,
{
watchDepth
:
'reference'
}],
]);
]);
react2AngularDirective
(
'selectUserPicker'
,
UserPicker
,
[
'backendSrv'
,
'handlePicked'
]);
react2AngularDirective
(
'selectUserPicker'
,
UserPicker
,
[
'backendSrv'
,
'handlePicked'
]);
react2AngularDirective
(
'dashboardPermissions'
,
DashboardPermissions
,
[
react2AngularDirective
(
'dashboardPermissions'
,
DashboardPermissions
,
[
'backendSrv'
,
'dashboardId'
,
'folder'
]);
'backendSrv'
,
'dashboardId'
,
'folderTitle'
,
'folderSlug'
,
'folderId'
,
]);
}
}
public/app/core/components/Permissions/DashboardPermissions.tsx
View file @
55100d5f
...
@@ -6,12 +6,11 @@ import Tooltip from 'app/core/components/Tooltip/Tooltip';
...
@@ -6,12 +6,11 @@ import Tooltip from 'app/core/components/Tooltip/Tooltip';
import
PermissionsInfo
from
'app/core/components/Permissions/PermissionsInfo'
;
import
PermissionsInfo
from
'app/core/components/Permissions/PermissionsInfo'
;
import
AddPermissions
from
'app/core/components/Permissions/AddPermissions'
;
import
AddPermissions
from
'app/core/components/Permissions/AddPermissions'
;
import
SlideDown
from
'app/core/components/Animations/SlideDown'
;
import
SlideDown
from
'app/core/components/Animations/SlideDown'
;
import
{
FolderInfo
}
from
'./FolderInfo'
;
export
interface
IProps
{
export
interface
IProps
{
dashboardId
:
number
;
dashboardId
:
number
;
folderId
:
number
;
folder
?:
FolderInfo
;
folderTitle
:
string
;
folderSlug
:
string
;
backendSrv
:
any
;
backendSrv
:
any
;
}
}
@
observer
@
observer
...
@@ -28,8 +27,12 @@ class DashboardPermissions extends Component<IProps, any> {
...
@@ -28,8 +27,12 @@ class DashboardPermissions extends Component<IProps, any> {
this
.
permissions
.
toggleAddPermissions
();
this
.
permissions
.
toggleAddPermissions
();
}
}
componentWillUnmount
()
{
this
.
permissions
.
hideAddPermissions
();
}
render
()
{
render
()
{
const
{
dashboardId
,
folder
Title
,
folderSlug
,
folderId
,
backendSrv
}
=
this
.
props
;
const
{
dashboardId
,
folder
,
backendSrv
}
=
this
.
props
;
return
(
return
(
<
div
>
<
div
>
...
@@ -56,7 +59,7 @@ class DashboardPermissions extends Component<IProps, any> {
...
@@ -56,7 +59,7 @@ class DashboardPermissions extends Component<IProps, any> {
permissions=
{
this
.
permissions
}
permissions=
{
this
.
permissions
}
isFolder=
{
false
}
isFolder=
{
false
}
dashboardId=
{
dashboardId
}
dashboardId=
{
dashboardId
}
folderInfo=
{
{
title
:
folderTitle
,
slug
:
folderSlug
,
id
:
folderId
}
}
folderInfo=
{
folder
}
backendSrv=
{
backendSrv
}
backendSrv=
{
backendSrv
}
/>
/>
</
div
>
</
div
>
...
...
public/app/core/components/Permissions/FolderInfo.ts
View file @
55100d5f
export
interface
FolderInfo
{
export
interface
FolderInfo
{
title
:
string
;
id
:
number
;
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
...
@@ -30,7 +30,7 @@ export default observer(({ item, removeItem, permissionChanged, itemIndex, folde
folderInfo
&&
(
folderInfo
&&
(
<
em
className=
"muted no-wrap"
>
<
em
className=
"muted no-wrap"
>
Inherited from folder
{
' '
}
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
}
{
folderInfo
.
title
}
</
a
>
{
' '
}
</
a
>
{
' '
}
</
em
>
</
em
>
...
...
public/app/features/dashboard/settings/settings.html
View file @
55100d5f
...
@@ -99,9 +99,7 @@
...
@@ -99,9 +99,7 @@
<dashboard-permissions
ng-if=
"ctrl.dashboard"
<dashboard-permissions
ng-if=
"ctrl.dashboard"
dashboardId=
"ctrl.dashboard.id"
dashboardId=
"ctrl.dashboard.id"
backendSrv=
"ctrl.backendSrv"
backendSrv=
"ctrl.backendSrv"
folderTitle=
"ctrl.dashboard.meta.folderTitle"
folder=
"ctrl.getFolder()"
folderSlug=
"ctrl.dashboard.meta.folderSlug"
folderId=
"ctrl.dashboard.meta.folderId"
/>
/>
</div>
</div>
...
...
public/app/features/dashboard/settings/settings.ts
View file @
55100d5f
...
@@ -197,6 +197,14 @@ export class SettingsCtrl {
...
@@ -197,6 +197,14 @@ export class SettingsCtrl {
this
.
dashboard
.
meta
.
folderTitle
=
folder
.
title
;
this
.
dashboard
.
meta
.
folderTitle
=
folder
.
title
;
this
.
dashboard
.
meta
.
folderSlug
=
folder
.
slug
;
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
()
{
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