mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-15 09:59:09 +00:00
fix regression in sorting
This commit is contained in:
parent
1c784d0605
commit
7e79d65390
2 changed files with 3 additions and 5 deletions
|
@ -68,12 +68,10 @@ export default class Role extends React.Component<RoleProps, RoleState> {
|
|||
active={this.props.active}
|
||||
disabled={this.props.disabled}
|
||||
onClick={this.onToggle}
|
||||
onMouseOver={this.onMouseOver}
|
||||
onMouseOut={this.onMouseOut}
|
||||
onTouchStart={this.onMouseOver}
|
||||
onTouchEnd={this.onMouseOut}
|
||||
colors={roleColors}
|
||||
// title={(this.props.disabled) ? 'This role is disabled for safety.' : null}
|
||||
title={(this.props.disabled) ? 'This role has unsafe permissions.' : null}
|
||||
>
|
||||
{this.props.role.name}
|
||||
{ (this.props.disabled && this.state.hovering) && <Tooltip>This role has unsafe permissions.</Tooltip> }
|
||||
|
|
|
@ -65,7 +65,7 @@ const getUncategorized = (roleMap: OrderedMap<RenderedRole>, allCategories): Ren
|
|||
name: 'Uncategorized',
|
||||
position: -1,
|
||||
roles: rolesLeft,
|
||||
_roles: OrderedSet(rolesLeft.map(r => roleMap.get(r))).sortBy(v => -v.position),
|
||||
_roles: OrderedSet(rolesLeft.map(r => roleMap.get(r))).sortBy(v => -(v.position || 0)),
|
||||
hidden: true,
|
||||
type: 'multi'
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ export const renderRoles = (id: string) => (dispatch: *, getState: *) => {
|
|||
let render = OrderedSet()
|
||||
for (let catId in categories) {
|
||||
const category = categories[catId]
|
||||
category._roles = OrderedSet(category.roles.map(r => roleMap.get(r))).sortBy(v => -v.position)
|
||||
category._roles = OrderedSet(category.roles.map(r => roleMap.get(r))).sortBy(v => -(v.position || 0))
|
||||
render = render.add(category)
|
||||
}
|
||||
// console.log({id})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue