From 3d4f0fe0d77ef28321f90ebe442ec69cfd218dd2 Mon Sep 17 00:00:00 2001 From: Daniel M Date: Sat, 11 Nov 2023 16:07:45 -0800 Subject: [PATCH] feat:add filter for in-progress runs --- .../ui/panels/filters/WfRunsSearchPanelViewModel.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/kotlin/com/dsoftware/ghmanager/ui/panels/filters/WfRunsSearchPanelViewModel.kt b/src/main/kotlin/com/dsoftware/ghmanager/ui/panels/filters/WfRunsSearchPanelViewModel.kt index ccf3d04e..33bce1d9 100644 --- a/src/main/kotlin/com/dsoftware/ghmanager/ui/panels/filters/WfRunsSearchPanelViewModel.kt +++ b/src/main/kotlin/com/dsoftware/ghmanager/ui/panels/filters/WfRunsSearchPanelViewModel.kt @@ -24,10 +24,12 @@ internal class WfRunsSearchPanelViewModel( get() = context.runsListLoader.repoCollaborators val workflowTypes get() = context.runsListLoader.workflowTypes + override fun WfRunsListSearchValue.withQuery(query: String?) = copy(searchQuery = query) override val quickFilters: List = listOf( WorkflowRunListQuickFilter.All(), + WorkflowRunListQuickFilter.InProgres(), ) val branchFilterState = searchState.partialState(WfRunsListSearchValue::branch) { copy(branch = it) } @@ -39,7 +41,12 @@ internal class WfRunsSearchPanelViewModel( sealed class WorkflowRunListQuickFilter(val title: String) : ReviewListQuickFilter { + class All : WorkflowRunListQuickFilter("All workflow runs") { override val filter = WfRunsListSearchValue() } + + class InProgres : WorkflowRunListQuickFilter("Runs in progress") { + override val filter = WfRunsListSearchValue(status = WfRunsListSearchValue.Status.IN_PROGRESS) + } } \ No newline at end of file