Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandf committed Aug 9, 2024
1 parent 992cbcb commit 2a18905
Show file tree
Hide file tree
Showing 15 changed files with 270 additions and 217 deletions.
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;
25 changes: 16 additions & 9 deletions src/app/Workflows/Pipelines/Pipeline/_Router/Router.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
import React from 'react';
import { Redirect, Route, RouteComponentProps, Switch, useLocation, useRouteMatch } 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()
const location = useLocation();
const { path } = useRouteMatch();
return (
<Switch>
<Route path={`${path}`} exact>
<Redirect to={`${location.pathname}/tasks`} />
</Route>
<Route
path={`${path}`}
path={`/workflows/pipelines/:groupId/:pipelineId/tasks/:taskId`}
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`}>
Expand All @@ -34,8 +41,8 @@ const Router: React.FC = () => {
tab: string;
}>) => (
<>
<Menu tab={tab}/>
<Pipeline groupId={groupId} pipelineId={pipelineId}/>
<Menu tab={tab} />
<Pipeline groupId={groupId} pipelineId={pipelineId} />
</>
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const DagViewDrawer: React.FC<DagViewDrawerProps> = ({
<ListItem key={`dag-task-${i}`} disablePadding>
<ListItemButton
onClick={() => {
console.log({task})
console.log({ task });
handleCreateDagTask(task as Workflows.Task);
}}
>
Expand Down
14 changes: 7 additions & 7 deletions src/app/Workflows/Pipelines/Pipeline/_components/Menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { useHistory, useRouteMatch } from 'react-router-dom';
import { Box, Tab } from '@mui/material';
import { TabList, TabContext } from '@mui/lab';

const Menu: React.FC<{tab: string}> = ({tab}) => {
const { url } = useRouteMatch()
const history = useHistory()
const Menu: React.FC<{ tab: string }> = ({ tab }) => {
const { url } = useRouteMatch();
const history = useHistory();
const handleChangeTab = (_: React.SyntheticEvent, value: string) => {
const parts = url.split("/")
parts.pop()
history.push(`${parts.join("/")}/${value}`)
}
const parts = url.split('/');
parts.pop();
history.push(`${parts.join('/')}/${value}`);
};
return (
<Box sx={{ width: '100%', typography: 'body1' }}>
<TabContext value={tab}>
Expand Down
2 changes: 1 addition & 1 deletion src/app/Workflows/Pipelines/_Router/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const Router: React.FC = () => {
<Route path={`${path}/:groupId`} exact>
<PipelinesLayout />
</Route>

<Route path={`${path}/:groupId/:pipelineId`}>
<PipelineLayout />
</Route>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.form {
width: 100%;
padding: 16px;
display: grid;
gap: 16px;
}

width: 100%;
padding: 16px;
display: grid;
gap: 16px;
}
Loading

0 comments on commit 2a18905

Please sign in to comment.