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
c431875f
Commit
c431875f
authored
Apr 13, 2018
by
Patrick O'Carroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
permissions sorting fixed + icon same size as avatrs
parent
77b8ccd7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
public/app/core/components/Permissions/DisabledPermissionsListItem.tsx
+1
-1
public/app/core/components/Permissions/PermissionsListItem.tsx
+2
-2
public/app/stores/PermissionsStore/PermissionsStore.ts
+7
-3
No files found.
public/app/core/components/Permissions/DisabledPermissionsListItem.tsx
View file @
c431875f
...
@@ -13,7 +13,7 @@ export default class DisabledPermissionListItem extends Component<IProps, any> {
...
@@ -13,7 +13,7 @@ export default class DisabledPermissionListItem extends Component<IProps, any> {
return
(
return
(
<
tr
className=
"gf-form-disabled"
>
<
tr
className=
"gf-form-disabled"
>
<
td
style=
{
{
width
:
'1%'
}
}
>
<
td
style=
{
{
width
:
'1%'
}
}
>
<
i
style=
{
{
width
:
'25px'
,
fontSize
:
'1.5rem
'
}
}
className=
"gicon gicon-shield"
/>
<
i
style=
{
{
width
:
'25px'
,
height
:
'25px
'
}
}
className=
"gicon gicon-shield"
/>
</
td
>
</
td
>
<
td
style=
{
{
width
:
'90%'
}
}
>
<
td
style=
{
{
width
:
'90%'
}
}
>
{
item
.
name
}
{
item
.
name
}
...
...
public/app/core/components/Permissions/PermissionsListItem.tsx
View file @
c431875f
...
@@ -15,10 +15,10 @@ function ItemAvatar({ item }) {
...
@@ -15,10 +15,10 @@ function ItemAvatar({ item }) {
return
<
img
className=
"filter-table__avatar"
src=
{
item
.
teamAvatarUrl
}
/>;
return
<
img
className=
"filter-table__avatar"
src=
{
item
.
teamAvatarUrl
}
/>;
}
}
if
(
item
.
role
===
'Editor'
)
{
if
(
item
.
role
===
'Editor'
)
{
return
<
i
style=
{
{
width
:
'25px'
,
fontSize
:
'1.5rem
'
}
}
className=
"gicon gicon-editor"
/>;
return
<
i
style=
{
{
width
:
'25px'
,
height
:
'25px
'
}
}
className=
"gicon gicon-editor"
/>;
}
}
return
<
i
style=
{
{
width
:
'25px'
,
fontSize
:
'1.5rem
'
}
}
className=
"gicon gicon-viewer"
/>;
return
<
i
style=
{
{
width
:
'25px'
,
height
:
'25px
'
}
}
className=
"gicon gicon-viewer"
/>;
}
}
function
ItemDescription
({
item
})
{
function
ItemDescription
({
item
})
{
...
...
public/app/stores/PermissionsStore/PermissionsStore.ts
View file @
c431875f
...
@@ -155,6 +155,8 @@ export const PermissionsStore = types
...
@@ -155,6 +155,8 @@ export const PermissionsStore = types
try
{
try
{
yield
updateItems
(
self
,
updatedItems
);
yield
updateItems
(
self
,
updatedItems
);
self
.
items
.
push
(
newItem
);
self
.
items
.
push
(
newItem
);
let
sortedItems
=
self
.
items
.
sort
((
a
,
b
)
=>
b
.
sortRank
-
a
.
sortRank
||
a
.
name
.
localeCompare
(
b
.
name
));
self
.
items
=
sortedItems
;
resetNewTypeInternal
();
resetNewTypeInternal
();
}
catch
{}
}
catch
{}
yield
Promise
.
resolve
();
yield
Promise
.
resolve
();
...
@@ -214,9 +216,11 @@ const updateItems = (self, items) => {
...
@@ -214,9 +216,11 @@ const updateItems = (self, items) => {
};
};
const
prepareServerResponse
=
(
response
,
dashboardId
:
number
,
isFolder
:
boolean
,
isInRoot
:
boolean
)
=>
{
const
prepareServerResponse
=
(
response
,
dashboardId
:
number
,
isFolder
:
boolean
,
isInRoot
:
boolean
)
=>
{
return
response
.
map
(
item
=>
{
return
response
.
map
(
item
=>
{
return
prepareItem
(
item
,
dashboardId
,
isFolder
,
isInRoot
);
return
prepareItem
(
item
,
dashboardId
,
isFolder
,
isInRoot
);
});
})
.
sort
((
a
,
b
)
=>
b
.
sortRank
-
a
.
sortRank
||
a
.
name
.
localeCompare
(
b
.
name
));
};
};
const
prepareItem
=
(
item
,
dashboardId
:
number
,
isFolder
:
boolean
,
isInRoot
:
boolean
)
=>
{
const
prepareItem
=
(
item
,
dashboardId
:
number
,
isFolder
:
boolean
,
isInRoot
:
boolean
)
=>
{
...
@@ -233,7 +237,7 @@ const prepareItem = (item, dashboardId: number, isFolder: boolean, isInRoot: boo
...
@@ -233,7 +237,7 @@ const prepareItem = (item, dashboardId: number, isFolder: boolean, isInRoot: boo
item
.
icon
=
'fa fa-fw fa-street-view'
;
item
.
icon
=
'fa fa-fw fa-street-view'
;
item
.
name
=
item
.
role
;
item
.
name
=
item
.
role
;
item
.
sortRank
=
30
;
item
.
sortRank
=
30
;
if
(
item
.
role
===
'
Viewe
r'
)
{
if
(
item
.
role
===
'
Edito
r'
)
{
item
.
sortRank
+=
1
;
item
.
sortRank
+=
1
;
}
}
}
}
...
...
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