TSK-363: Fixed multiple no sprint category (#2352)

Signed-off-by: Anton Brechka <anton.brechka@xored.com>
This commit is contained in:
mrsadman99 2022-11-04 13:09:59 +07:00 committed by GitHub
parent 35e4fcd8aa
commit 2841146512
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 13 deletions

View File

@ -200,10 +200,8 @@
categoryLimit: Record<any, number>
): Issue[] {
const issues = groupes[category] ?? []
if (Object.keys(groupes).length === 1) {
return issues.slice(0, singleCategoryLimit)
}
const limit = categoryLimit[toCat(category)] ?? defaultLimit
const initialLimit = Object.keys(groupes).length === 1 ? singleCategoryLimit : defaultLimit
const limit = categoryLimit[toCat(category)] ?? initialLimit
return issues.slice(0, limit)
}
const categoryLimit: Record<any, number> = {}

View File

@ -56,7 +56,7 @@
$: handleSelectedSprintIdUpdated(value, rawSprints)
$: translate(tracker.string.Sprint, {}).then((result) => (defaultSprintLabel = result))
$: translate(tracker.string.NoSprint, {}).then((result) => (defaultSprintLabel = result))
const sprintIcon = tracker.icon.Sprint
$: sprintText = shouldShowLabel ? selectedSprint?.label ?? defaultSprintLabel : undefined

View File

@ -111,7 +111,7 @@ export const getIssuesModificationDatePeriodTime = (period: IssuesDateModificati
export const groupBy = (data: any, key: any): { [key: string]: any[] } => {
return data.reduce((storage: { [key: string]: any[] }, item: any) => {
const group = item[key]
const group = item[key] ?? undefined
storage[group] = storage[group] ?? []
@ -318,13 +318,7 @@ export function getCategories (
(category) => statuses.find((status) => status.category === category)?._id
)
const existingCategories = Array.from(
new Set(
elements.map((x) => {
return (x as any)[key]
})
)
)
const existingCategories = Array.from(new Set(elements.map((x: any) => x[key] ?? undefined)))
if (shouldShowAll) {
if (key === 'status') {