Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandf committed Aug 2, 2024
1 parent 69c3cb1 commit a3f61b8
Show file tree
Hide file tree
Showing 11 changed files with 242 additions and 125 deletions.
2 changes: 1 addition & 1 deletion src/app/Workflows/Pipelines/Task/Task.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.back {
padding-left: 16px;
padding-top: 16px;
}
}
34 changes: 20 additions & 14 deletions src/app/Workflows/Pipelines/Task/Task.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,42 @@
import React from 'react';
import { TaskEditor } from '../_components';
import { Workflows as Hooks } from "@tapis/tapisui-hooks"
import { Workflows as Hooks } from '@tapis/tapisui-hooks';
import { QueryWrapper } from '@tapis/tapisui-common';
import { Link } from 'react-router-dom';
import { ArrowBack } from '@mui/icons-material';
import styles from "./Task.module.scss"
import styles from './Task.module.scss';

type TaskProps = {
groupId: string;
pipelineId: string;
taskId: string;
};

const Task: React.FC<TaskProps> = ({
groupId,
pipelineId,
taskId,
}) => {
const { data, isLoading, error } = Hooks.Tasks.useList({groupId, pipelineId})
const tasks = data?.result || []
const task = tasks.filter((task) => task.id === taskId)
const Task: React.FC<TaskProps> = ({ groupId, pipelineId, taskId }) => {
const { data, isLoading, error } = Hooks.Tasks.useList({
groupId,
pipelineId,
});
const tasks = data?.result || [];
const task = tasks.filter((task) => task.id === taskId);

return (
<div>
<div className={styles["back"]}>
<Link to={`/workflows/pipelines/${groupId}/${pipelineId}`}><ArrowBack /> Pipeline: {pipelineId}</Link>
<div className={styles['back']}>
<Link to={`/workflows/pipelines/${groupId}/${pipelineId}`}>
<ArrowBack /> Pipeline: {pipelineId}
</Link>
</div>
<QueryWrapper isLoading={isLoading} error={error}>
{task !== undefined ? (
<TaskEditor groupId={groupId} pipelineId={pipelineId} tasks={tasks} task={task[0]}/>
<TaskEditor
groupId={groupId}
pipelineId={pipelineId}
tasks={tasks}
task={task[0]}
/>
) : (
<p style={{color: "red"}}>Task with id '{taskId}' does not exist</p>
<p style={{ color: 'red' }}>Task with id '{taskId}' does not exist</p>
)}
</QueryWrapper>
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/app/Workflows/Pipelines/Task/_Router/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ const Router: React.FC = () => {
groupId: string;
pipelineId: string;
taskId: string;
}>) => <Task groupId={groupId} pipelineId={pipelineId} taskId={taskId} />}
}>) => (
<Task groupId={groupId} pipelineId={pipelineId} taskId={taskId} />
)}
/>
</Switch>
);
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 @@ -4,7 +4,7 @@ import { Route, useRouteMatch, Switch } from 'react-router-dom';
import { default as Pipelines } from '../Pipelines';
import { default as Pipeline } from '../Pipeline';
import { default as PipelineRuns } from '../PipelineRuns';
import { default as Task } from "../Task";
import { default as Task } from '../Task';

const Router: React.FC = () => {
const { path } = useRouteMatch();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
.sidebar {
width: 30%;
border: 1px solid #cccccc;
background-color: #FFFFFF;
background-color: #ffffff;
}

.menu {
Expand Down
Loading

0 comments on commit a3f61b8

Please sign in to comment.