Boy-scout: alphabetic ordering in the tags window

pull/28/head
Sander Vocke 5 years ago
parent c9336af0f3
commit 679a00b77d
  1. 40
      client/src/components/windows/manage_tags/ManageTagsWindow.tsx

@ -164,15 +164,17 @@ export function SingleTag(props: {
{props.prependElems} {props.prependElems}
<TagChip transparent={tag.proposeDelete} label={tagLabel} /> <TagChip transparent={tag.proposeDelete} label={tagLabel} />
</Box> </Box>
{hasChildren && expanded && tag.children.map((child: any) => <SingleTag {hasChildren && expanded && tag.children
tag={child} .sort((a: any, b: any) => a.name.localeCompare(b.name))
prependElems={[...props.prependElems, .map((child: any) => <SingleTag
<TagChip transparent={true} label={tagLabel} />, tag={child}
<Typography variant="h5">/</Typography>]} prependElems={[...props.prependElems,
dispatch={props.dispatch} <TagChip transparent={true} label={tagLabel} />,
state={props.state} <Typography variant="h5">/</Typography>]}
changedTags={props.changedTags} dispatch={props.dispatch}
/>)} state={props.state}
changedTags={props.changedTags}
/>)}
<ManageTagMenu <ManageTagMenu
position={menuPos} position={menuPos}
open={menuPos !== null} open={menuPos !== null}
@ -430,15 +432,17 @@ export default function ManageTagsWindow(props: {
mt={4} mt={4}
width="80%" width="80%"
> >
{tags && tags.length && tags.map((tag: any) => { {tags && tags.length && tags
return <SingleTag .sort((a: any, b: any) => a.name.localeCompare(b.name))
tag={tag} .map((tag: any) => {
prependElems={[]} return <SingleTag
dispatch={props.dispatch} tag={tag}
state={props.state} prependElems={[]}
changedTags={changedTags} dispatch={props.dispatch}
/>; state={props.state}
})} changedTags={changedTags}
/>;
})}
<Box mt={3}><CreateTagButton onClick={(e: any) => { onOpenNewTagMenu(e) }} /></Box> <Box mt={3}><CreateTagButton onClick={(e: any) => { onOpenNewTagMenu(e) }} /></Box>
</Box> </Box>
</Box> </Box>

Loading…
Cancel
Save