mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-16 10:19:10 +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}
|
active={this.props.active}
|
||||||
disabled={this.props.disabled}
|
disabled={this.props.disabled}
|
||||||
onClick={this.onToggle}
|
onClick={this.onToggle}
|
||||||
onMouseOver={this.onMouseOver}
|
|
||||||
onMouseOut={this.onMouseOut}
|
|
||||||
onTouchStart={this.onMouseOver}
|
onTouchStart={this.onMouseOver}
|
||||||
onTouchEnd={this.onMouseOut}
|
onTouchEnd={this.onMouseOut}
|
||||||
colors={roleColors}
|
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.role.name}
|
||||||
{ (this.props.disabled && this.state.hovering) && <Tooltip>This role has unsafe permissions.</Tooltip> }
|
{ (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',
|
name: 'Uncategorized',
|
||||||
position: -1,
|
position: -1,
|
||||||
roles: rolesLeft,
|
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,
|
hidden: true,
|
||||||
type: 'multi'
|
type: 'multi'
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ export const renderRoles = (id: string) => (dispatch: *, getState: *) => {
|
||||||
let render = OrderedSet()
|
let render = OrderedSet()
|
||||||
for (let catId in categories) {
|
for (let catId in categories) {
|
||||||
const category = categories[catId]
|
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)
|
render = render.add(category)
|
||||||
}
|
}
|
||||||
// console.log({id})
|
// console.log({id})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue