diff --git a/webapp/src/viewModel/boardTree.ts b/webapp/src/viewModel/boardTree.ts index 6b4cd8948..e8de4741b 100644 --- a/webapp/src/viewModel/boardTree.ts +++ b/webapp/src/viewModel/boardTree.ts @@ -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() diff --git a/webapp/src/viewModel/workspaceTree.ts b/webapp/src/viewModel/workspaceTree.ts index dd590e277..778efc1d9 100644 --- a/webapp/src/viewModel/workspaceTree.ts +++ b/webapp/src/viewModel/workspaceTree.ts @@ -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 {