mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-04-25 12:19:10 +00:00
sort roles and fix empty name styling
This commit is contained in:
parent
de37215850
commit
309b02c6f6
2 changed files with 4 additions and 2 deletions
|
@ -64,6 +64,8 @@ export default class Role extends React.Component<RoleProps, RoleState> {
|
|||
base: Color(color).hsl().string()
|
||||
}
|
||||
|
||||
const name = (this.props.role.name !== '') ? this.props.role.name : <> </>
|
||||
|
||||
return <RoleStyled
|
||||
active={this.props.active}
|
||||
disabled={this.props.disabled}
|
||||
|
@ -73,7 +75,7 @@ export default class Role extends React.Component<RoleProps, RoleState> {
|
|||
colors={roleColors}
|
||||
title={(this.props.disabled) ? 'This role has unsafe permissions.' : null}
|
||||
>
|
||||
{this.props.role.name}
|
||||
{name}
|
||||
{ (this.props.disabled && this.state.hovering) && <Tooltip>This role has unsafe permissions.</Tooltip> }
|
||||
</RoleStyled>
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ const getUncategorized = (roleMap: OrderedMap<RenderedRole>, allCategories: Set)
|
|||
name: 'Uncategorized',
|
||||
position: -1,
|
||||
roles: rolesLeft,
|
||||
_roles: rolesLeft.map(v => roleMap.get(v)).filter(v => v != null),
|
||||
_roles: rolesLeft.map(v => roleMap.get(v)).filter(v => v != null).sortBy(v => -v.position),
|
||||
hidden: true,
|
||||
type: 'multi'
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue