Skip to content

Commit

Permalink
feat:add filter for in-progress runs
Browse files Browse the repository at this point in the history
  • Loading branch information
cunla committed Nov 12, 2023
1 parent a9e2313 commit 3d4f0fe
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<WorkflowRunListQuickFilter> = listOf(
WorkflowRunListQuickFilter.All(),
WorkflowRunListQuickFilter.InProgres(),
)

val branchFilterState = searchState.partialState(WfRunsListSearchValue::branch) { copy(branch = it) }
Expand All @@ -39,7 +41,12 @@ internal class WfRunsSearchPanelViewModel(

sealed class WorkflowRunListQuickFilter(val title: String) : ReviewListQuickFilter<WfRunsListSearchValue> {


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)
}
}

0 comments on commit 3d4f0fe

Please sign in to comment.