Skip to content

Commit

Permalink
NEOS-206: base progress bar (#615)
Browse files Browse the repository at this point in the history
  • Loading branch information
evisdrenova authored Nov 19, 2023
1 parent ed807c2 commit 2e23a17
Show file tree
Hide file tree
Showing 14 changed files with 903 additions and 742 deletions.
5 changes: 1 addition & 4 deletions frontend/app/jobs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ function JobTable(props: JobTableProps): ReactElement {
);
}

interface NewJobButtonProps {}

function NewJobButton(props: NewJobButtonProps): ReactElement {
const {} = props;
function NewJobButton(): ReactElement {
return (
<NextLink href={'/new/job'}>
<Button>
Expand Down
59 changes: 59 additions & 0 deletions frontend/app/new/job/JobsProgressSteps.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { Step } from '@/components/progress-steps/Step';
import { useStep } from '@/components/progress-steps/useStep';
import { ReactElement, useEffect } from 'react';

interface OnboardStep {
name: string;
}

interface Props {
stepName: string;
}

export default function JobsProgressSteps(props: Props): ReactElement {
const { stepName } = props;

//maxStep must match the steps.length below
const [currentStep, { setStep }] = useStep({
maxStep: 4,
initialStep: 0,
});

const steps: OnboardStep[] = [
{
name: 'define',
},
{
name: 'connect',
},
{
name: 'schema',
},
{
name: 'subset',
},
];

useEffect(() => {
const ind = steps?.findIndex((item) => item.name == stepName);
setStep(ind);
}, [stepName]);

return (
<div>
<div className="flex flex-row items-center justify-center mt-5">
{steps.map((step, idx) => {
return (
<Step
isCompleted={currentStep > idx}
key={step.name}
isActive={currentStep === idx}
isLastStep={steps.length === idx + 1}
name={step.name}
/>
);
})}
</div>
</div>
);
}
Loading

0 comments on commit 2e23a17

Please sign in to comment.