Skip to content

Commit

Permalink
fix for showing empty groups when grouping by status
Browse files Browse the repository at this point in the history
  • Loading branch information
gsdstr committed Mar 4, 2024
1 parent 164a258 commit 05da49b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions models/tracker/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ function defineSortAndGrouping (builder: Builder): void {
createAggregationManager: tracker.aggregation.CreateComponentAggregationManager
})

builder.mixin(tracker.class.IssueStatus, core.class.Class, view.mixin.AllValuesFunc, {
func: tracker.function.GetAllIssueStatus
})

builder.mixin(tracker.class.TypeIssuePriority, core.class.Class, view.mixin.AllValuesFunc, {
func: tracker.function.GetAllPriority
})
Expand Down Expand Up @@ -190,6 +194,9 @@ function defineFilters (builder: Builder): void {
presenter: tracker.component.StatusFilterValuePresenter
})


console.log('presenter: tracker.component.StatusFilterValuePresenter')

//
// Issue Template
//
Expand Down
2 changes: 2 additions & 0 deletions plugins/tracker-resources/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ import {
activeProjects,
getAllComponents,
getAllMilestones,
getAllIssueStatus,
getAllPriority,
getComponentTitle,
getIssueChatTitle,
Expand Down Expand Up @@ -527,6 +528,7 @@ export default async (): Promise<Resources> => ({
IssuePrioritySort: issuePrioritySort,
MilestoneSort: milestoneSort,
SubIssueQuery: subIssueQuery,
GetAllIssueStatus: getAllIssueStatus,
GetAllPriority: getAllPriority,
GetAllComponents: getAllComponents,
GetAllMilestones: getAllMilestones,
Expand Down
1 change: 1 addition & 0 deletions plugins/tracker-resources/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ export default mergeIds(trackerId, tracker, {
IssuePrioritySort: '' as SortFunc,
MilestoneSort: '' as SortFunc,
SubIssueQuery: '' as ViewQueryAction,
GetAllIssueStatus: '' as GetAllValuesFunc,
GetAllPriority: '' as GetAllValuesFunc,
GetAllComponents: '' as GetAllValuesFunc,
GetAllMilestones: '' as GetAllValuesFunc,
Expand Down
10 changes: 10 additions & 0 deletions plugins/tracker-resources/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,16 @@ async function getAllSomething (
return await promise
}

export async function getAllIssueStatus (
query: DocumentQuery<Doc> | undefined,
onUpdate: () => void,
queryId: Ref<Doc>
): Promise<any[] | undefined> {
return await getAllSomething(core.class.Status, {
ofAttribute: tracker.attribute.IssueStatus
}, onUpdate, queryId)
}

export async function getAllPriority (
query: DocumentQuery<Doc> | undefined,
onUpdate: () => void,
Expand Down

0 comments on commit 05da49b

Please sign in to comment.