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
71c97417
Commit
71c97417
authored
Feb 21, 2018
by
Marcus Efraimsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
permissions: use updated api endpoint for dashboard permissions
parent
9889c920
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
public/app/core/components/Permissions/AddPermissions.jest.tsx
+2
-2
public/app/stores/PermissionsStore/PermissionsStore.jest.ts
+2
-2
public/app/stores/PermissionsStore/PermissionsStore.ts
+2
-2
No files found.
public/app/core/components/Permissions/AddPermissions.jest.tsx
View file @
71c97417
...
...
@@ -53,7 +53,7 @@ describe('AddPermissions', () => {
wrapper
.
find
(
'form'
).
simulate
(
'submit'
,
{
preventDefault
()
{}
});
expect
(
backendSrv
.
post
.
mock
.
calls
.
length
).
toBe
(
1
);
expect
(
backendSrv
.
post
.
mock
.
calls
[
0
][
0
]).
toBe
(
'/api/dashboards/id/1/
acl
'
);
expect
(
backendSrv
.
post
.
mock
.
calls
[
0
][
0
]).
toBe
(
'/api/dashboards/id/1/
permissions
'
);
});
});
...
...
@@ -80,7 +80,7 @@ describe('AddPermissions', () => {
wrapper
.
find
(
'form'
).
simulate
(
'submit'
,
{
preventDefault
()
{}
});
expect
(
backendSrv
.
post
.
mock
.
calls
.
length
).
toBe
(
1
);
expect
(
backendSrv
.
post
.
mock
.
calls
[
0
][
0
]).
toBe
(
'/api/dashboards/id/1/
acl
'
);
expect
(
backendSrv
.
post
.
mock
.
calls
[
0
][
0
]).
toBe
(
'/api/dashboards/id/1/
permissions
'
);
});
});
...
...
public/app/stores/PermissionsStore/PermissionsStore.jest.ts
View file @
71c97417
...
...
@@ -44,7 +44,7 @@ describe('PermissionsStore', () => {
expect
(
store
.
items
[
0
].
permission
).
toBe
(
2
);
expect
(
store
.
items
[
0
].
permissionName
).
toBe
(
'Edit'
);
expect
(
backendSrv
.
post
.
mock
.
calls
.
length
).
toBe
(
1
);
expect
(
backendSrv
.
post
.
mock
.
calls
[
0
][
0
]).
toBe
(
'/api/dashboards/id/1/
acl
'
);
expect
(
backendSrv
.
post
.
mock
.
calls
[
0
][
0
]).
toBe
(
'/api/dashboards/id/1/
permissions
'
);
});
it
(
'should save removed permissions automatically'
,
()
=>
{
...
...
@@ -54,7 +54,7 @@ describe('PermissionsStore', () => {
expect
(
store
.
items
.
length
).
toBe
(
2
);
expect
(
backendSrv
.
post
.
mock
.
calls
.
length
).
toBe
(
1
);
expect
(
backendSrv
.
post
.
mock
.
calls
[
0
][
0
]).
toBe
(
'/api/dashboards/id/1/
acl
'
);
expect
(
backendSrv
.
post
.
mock
.
calls
[
0
][
0
]).
toBe
(
'/api/dashboards/id/1/
permissions
'
);
});
describe
(
'when duplicate team permissions are added'
,
()
=>
{
...
...
public/app/stores/PermissionsStore/PermissionsStore.ts
View file @
71c97417
...
...
@@ -110,7 +110,7 @@ export const PermissionsStore = types
self
.
dashboardId
=
dashboardId
;
self
.
items
.
clear
();
const
res
=
yield
backendSrv
.
get
(
`/api/dashboards/id/
${
dashboardId
}
/
acl
`
);
const
res
=
yield
backendSrv
.
get
(
`/api/dashboards/id/
${
dashboardId
}
/
permissions
`
);
const
items
=
prepareServerResponse
(
res
,
dashboardId
,
isFolder
,
isInRoot
);
self
.
items
=
items
;
self
.
originalItems
=
items
;
...
...
@@ -210,7 +210,7 @@ const updateItems = self => {
let
res
;
try
{
res
=
backendSrv
.
post
(
`/api/dashboards/id/
${
self
.
dashboardId
}
/
acl
`
,
{
res
=
backendSrv
.
post
(
`/api/dashboards/id/
${
self
.
dashboardId
}
/
permissions
`
,
{
items
:
updated
,
});
}
catch
(
error
)
{
...
...
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