Fix board status order (#2042)

Signed-off-by: Dvinyanin Alexandr <dvinyanin.alexandr@gmail.com>
This commit is contained in:
Alex 2022-06-09 21:51:45 +07:00 committed by GitHub
parent 1b3840537a
commit b5105383d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -291,7 +291,7 @@ export function createModel (builder: Builder): void {
icon: tracker.icon.CategoryBacklog, icon: tracker.icon.CategoryBacklog,
color: 0, color: 0,
defaultStatusName: 'Backlog', defaultStatusName: 'Backlog',
order: 2 order: 0
}, },
tracker.issueStatusCategory.Backlog tracker.issueStatusCategory.Backlog
) )
@ -317,7 +317,7 @@ export function createModel (builder: Builder): void {
icon: tracker.icon.CategoryStarted, icon: tracker.icon.CategoryStarted,
color: 2, color: 2,
defaultStatusName: 'In Progress', defaultStatusName: 'In Progress',
order: 0 order: 2
}, },
tracker.issueStatusCategory.Started tracker.issueStatusCategory.Started
) )

View File

@ -297,6 +297,14 @@ export const projectsTitleMap: Record<ProjectsViewMode, IntlString> = Object.fre
closed: tracker.string.ClosedProjects closed: tracker.string.ClosedProjects
}) })
const listIssueStatusOrder = [
tracker.issueStatusCategory.Started,
tracker.issueStatusCategory.Unstarted,
tracker.issueStatusCategory.Backlog,
tracker.issueStatusCategory.Completed,
tracker.issueStatusCategory.Canceled
] as const
export function getCategories ( export function getCategories (
key: IssuesGroupByKeys | undefined, key: IssuesGroupByKeys | undefined,
elements: Issue[], elements: Issue[],
@ -308,7 +316,9 @@ export function getCategories (
return [undefined] // No grouping return [undefined] // No grouping
} }
const defaultStatuses = Object.values(statuses).map((x) => x._id) const defaultStatuses = listIssueStatusOrder.map(
(category) => statuses.find((status) => status.category === category)?._id
)
const existingCategories = Array.from( const existingCategories = Array.from(
new Set( new Set(