Sort boards, views, and templates by title
This commit is contained in:
parent
a463f6e1be
commit
dec0d0ae29
2 changed files with 8 additions and 4 deletions
|
@ -73,9 +73,11 @@ class MutableBoardTree implements BoardTree {
|
|||
|
||||
private rebuild(blocks: IMutableBlock[]) {
|
||||
this.board = blocks.find((block) => block.type === 'board') as MutableBoard
|
||||
this.views = blocks.filter((block) => block.type === 'view') as MutableBoardView[]
|
||||
this.views = blocks.filter((block) => block.type === 'view')
|
||||
.sort((a, b) => a.title.localeCompare(b.title)) as MutableBoardView[]
|
||||
this.allCards = blocks.filter((block) => block.type === 'card' && !(block as Card).isTemplate) as MutableCard[]
|
||||
this.cardTemplates = blocks.filter((block) => block.type === 'card' && (block as Card).isTemplate) as MutableCard[]
|
||||
this.cardTemplates = blocks.filter((block) => block.type === 'card' && (block as Card).isTemplate)
|
||||
.sort((a, b) => a.title.localeCompare(b.title)) as MutableCard[]
|
||||
this.cards = []
|
||||
|
||||
this.ensureMinimumSchema()
|
||||
|
|
|
@ -37,8 +37,10 @@ class MutableWorkspaceTree {
|
|||
}
|
||||
|
||||
private rebuild(blocks: IBlock[]) {
|
||||
this.boards = blocks.filter((block) => block.type === 'board') as Board[]
|
||||
this.views = blocks.filter((block) => block.type === 'view') as BoardView[]
|
||||
this.boards = blocks.filter((block) => block.type === 'board')
|
||||
.sort((a, b) => a.title.localeCompare(b.title)) as Board[]
|
||||
this.views = blocks.filter((block) => block.type === 'view')
|
||||
.sort((a, b) => a.title.localeCompare(b.title)) as BoardView[]
|
||||
}
|
||||
|
||||
mutableCopy(): MutableWorkspaceTree {
|
||||
|
|
Loading…
Reference in a new issue