Skip to content

Commit

Permalink
Fix routes, add git api calls, git tab in task editor
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandf committed Aug 9, 2024
1 parent 5703643 commit 992cbcb
Show file tree
Hide file tree
Showing 24 changed files with 368 additions and 1,399 deletions.
65 changes: 0 additions & 65 deletions src/app/Workflows/Pipelines/Pipeline/Pipeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,71 +105,6 @@ const Pipeline: React.FC<PipelineProps> = ({ groupId, pipelineId }) => {
{pipeline && tasks && (
<div id={`pipeline`} className={styles['grid']}>
<DagView pipeline={pipeline} groupId={groupId} />
<div>
<Table dark bordered style={{ margin: 0 }}>
<thead>
<tr>
<th className={styles['center']}>id</th>
<th>uuid</th>
<th>last run</th>
<th>previous run</th>
<th className={styles['center']}>runs</th>
</tr>
</thead>
<tbody>
<td className={styles['center']}>{pipeline.id}</td>
<td>{pipeline.uuid}</td>
<td>
{pipeline.current_run && (
<Link
to={`/workflows/pipelines/${groupId}/${pipelineId}/runs/${pipeline.current_run}`}
>
view
</Link>
)}
</td>
<td>
{pipeline.last_run && (
<Link
to={`/workflows/pipelines/${groupId}/${pipelineId}/runs/${pipeline.last_run}`}
>
view
</Link>
)}
</td>
<td className={styles['center']}>
<Link
to={`/workflows/pipelines/${groupId}/${pipelineId}/runs`}
>
view
</Link>
</td>
</tbody>
</Table>
<QueryWrapper isLoading={isLoadingTasks} error={listTasksError}>
{tasks.length ? (
<div id={'default-task-view'}>
{tasks.map((task) => {
return (
<div
id="tasks"
key={task.id}
className={`${styles['tasks']}`}
>
<Task
task={task}
groupId={groupId}
pipelineId={pipelineId}
/>
</div>
);
})}
</div>
) : (
<SectionMessage type="info">No tasks</SectionMessage>
)}
</QueryWrapper>
</div>
</div>
)}
</QueryWrapper>
Expand Down
2 changes: 1 addition & 1 deletion src/app/Workflows/Pipelines/Pipeline/_Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { Router } from '../_Router';

const Layout: React.FC = () => {
return <Router />;
return <Router />
};

export default Layout;
32 changes: 27 additions & 5 deletions src/app/Workflows/Pipelines/Pipeline/_Router/Router.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,43 @@
import React from 'react';
import { Route, RouteComponentProps, Switch } from 'react-router-dom';

import { Redirect, Route, RouteComponentProps, Switch, useLocation, useRouteMatch } from 'react-router-dom';
import { default as Pipeline } from '../Pipeline';
import { default as PipelineRunsLayout } from '../../PipelineRuns';
import { default as TaskLayout } from '../../Task';
import { Menu } from 'app/Workflows/Pipelines/Pipeline/_components';

const Router: React.FC = () => {
const location = useLocation()
const { path } = useRouteMatch()
return (
<Switch>
<Route
path={`/workflows/pipelines/:groupId/:pipelineId`}
path={`${path}`}
exact
>
<Redirect to={`${location.pathname}/tasks`}/>
</Route>
<Route path={`/workflows/pipelines/:groupId/:pipelineId/tasks/:taskId`} exact>
<TaskLayout />
</Route>
<Route path={`/workflows/pipelines/:groupId/:pipelineId/runs`}>
<PipelineRunsLayout />
</Route>
<Route
path={`/workflows/pipelines/:groupId/:pipelineId/:tab`}
render={({
match: {
params: { groupId, pipelineId },
params: { groupId, pipelineId, tab },
},
}: RouteComponentProps<{
groupId: string;
pipelineId: string;
}>) => <Pipeline groupId={groupId} pipelineId={pipelineId} />}
tab: string;
}>) => (
<>
<Menu tab={tab}/>
<Pipeline groupId={groupId} pipelineId={pipelineId}/>
</>
)}
/>
</Switch>
);
Expand Down
Loading

0 comments on commit 992cbcb

Please sign in to comment.