Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TSK-363: Fixed multiple no sprint category #2352

Merged
merged 2 commits into from
Nov 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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> = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 2 additions & 8 deletions plugins/tracker-resources/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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] ?? []

Expand Down Expand Up @@ -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') {
Expand Down