File tree Expand file tree Collapse file tree 3 files changed +37
-4
lines changed
src/app/pipelines/[namespace] Expand file tree Collapse file tree 3 files changed +37
-4
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,14 @@ import { useAllPipelineRuns } from "@/data/pipeline-runs/all-pipeline-runs-query
66import { SearchField } from "@/components/SearchField" ;
77import Pagination from "@/components/Pagination" ;
88import { getPipelineDetailColumns } from "./columns" ;
9+ import { useRunsSelectorContext } from "../RunsTab/RunsSelectorContext" ;
10+ import { RunsButtonGroup } from "../RunsTab/ButtonGroup" ;
911
1012export function PipelineRunsTable ( ) {
1113 const { namespace } = useParams ( ) as { namespace : string } ;
1214 const params = usePipelineRunParams ( ) ;
1315 const cols = getPipelineDetailColumns ( ) ;
16+ const { selectedRuns } = useRunsSelectorContext ( ) ;
1417
1518 const { data, refetch } = useAllPipelineRuns (
1619 {
@@ -26,7 +29,7 @@ export function PipelineRunsTable() {
2629 return (
2730 < div className = "flex flex-col gap-5 p-5" >
2831 < div className = "flex items-center justify-between" >
29- < SearchField searchParams = { params } />
32+ { selectedRuns . length ? < RunsButtonGroup /> : < SearchField searchParams = { params } /> }
3033 < Button intent = "primary" emphasis = "subtle" size = "md" onClick = { ( ) => refetch ( ) } >
3134 < Refresh className = "h-5 w-5 fill-theme-text-brand" />
3235 Refresh
Original file line number Diff line number Diff line change @@ -17,9 +17,23 @@ import {
1717 TooltipTrigger
1818} from "@zenml-io/react-component-library" ;
1919import { Link } from "react-router-dom" ;
20+ import { RunDropdown } from "../RunsTab/RunDropdown" ;
21+ import { RunSelector } from "../RunsTab/RunSelector" ;
2022
2123export function getPipelineDetailColumns ( ) : ColumnDef < PipelineRun > [ ] {
2224 return [
25+ {
26+ id : "check" ,
27+ header : "" ,
28+ meta : {
29+ width : "1%"
30+ } ,
31+ accessorFn : ( row ) => ( { id : row . id } ) ,
32+ cell : ( { getValue } ) => {
33+ const { id } = getValue < { id : string } > ( ) ;
34+ return < RunSelector id = { id } /> ;
35+ }
36+ } ,
2337 {
2438 id : "run" ,
2539 header : "Run" ,
@@ -129,6 +143,16 @@ export function getPipelineDetailColumns(): ColumnDef<PipelineRun>[] {
129143 const { author } = getValue < { author : User } > ( ) ;
130144 return < InlineAvatar username = { author . name } /> ;
131145 }
146+ } ,
147+ {
148+ id : "admin_actions" ,
149+ header : "" ,
150+ meta : {
151+ width : "5%"
152+ } ,
153+ cell : ( { row } ) => {
154+ return < RunDropdown id = { row . original . id } /> ;
155+ }
132156 }
133157 ] ;
134158}
Original file line number Diff line number Diff line change @@ -3,20 +3,26 @@ import { Header } from "./Header";
33import { PipelineRunsTable } from "./RunsTable" ;
44import { useEffect } from "react" ;
55import { useBreadcrumbsContext } from "@/layouts/AuthenticatedLayout/BreadcrumbsContext" ;
6+ import { RunsSelectorProvider } from "../RunsTab/RunsSelectorContext" ;
67
78export default function PipelineNamespacePage ( ) {
89 const { namespace } = useParams ( ) as { namespace : string } ;
910 const { setCurrentBreadcrumbData } = useBreadcrumbsContext ( ) ;
1011
1112 useEffect ( ( ) => {
1213 namespace &&
13- setCurrentBreadcrumbData ( { segment : "pipeline_detail" , data : { name : namespace } } ) ;
14+ setCurrentBreadcrumbData ( {
15+ segment : "pipeline_detail" ,
16+ data : { name : namespace }
17+ } ) ;
1418 } , [ namespace ] ) ;
1519
1620 return (
1721 < div >
18- < Header namespace = { namespace } />
19- < PipelineRunsTable />
22+ < RunsSelectorProvider >
23+ < Header namespace = { namespace } />
24+ < PipelineRunsTable />
25+ </ RunsSelectorProvider >
2026 </ div >
2127 ) ;
2228}
You can’t perform that action at this time.
0 commit comments