-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor generate type to boolean * Add ManualSystemFlow * Add ConfigureSteps * Make button bigger * Update changelog * Remove UI features for WIP elements
- Loading branch information
1 parent
f87b8a4
commit 11908bb
Showing
4 changed files
with
100 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
clients/ctl/admin-ui/src/features/system/ManualSystemFlow.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { Box, Button, Grid, Stack, Text } from "@fidesui/react"; | ||
import { useState } from "react"; | ||
|
||
const STEPS = ["Describe", "Declare", "Review"]; | ||
|
||
interface ConfigureStepsProps { | ||
steps: string[]; | ||
currentStepIndex: number; | ||
onChange: (index: number) => void; | ||
} | ||
const ConfigureSteps = ({ | ||
steps, | ||
currentStepIndex, | ||
onChange, | ||
}: ConfigureStepsProps) => ( | ||
<Stack pl={5}> | ||
{steps.map((step, idx) => { | ||
const isActive = idx === currentStepIndex; | ||
return ( | ||
<Button | ||
key={step} | ||
variant="ghost" | ||
colorScheme={isActive ? "complimentary" : "ghost"} | ||
width="fit-content" | ||
disabled={idx > currentStepIndex} | ||
onClick={() => onChange(idx)} | ||
> | ||
{step} | ||
</Button> | ||
); | ||
})} | ||
</Stack> | ||
); | ||
|
||
const ManualSystemFlow = () => { | ||
const [currentStepIndex, setCurrentStepIndex] = useState(0); | ||
|
||
return ( | ||
<Grid templateColumns="2fr 8fr"> | ||
<Stack spacing={3} fontWeight="semibold" data-testid="settings"> | ||
<Text>Configuration Settings</Text> | ||
<ConfigureSteps | ||
steps={STEPS} | ||
currentStepIndex={currentStepIndex} | ||
onChange={setCurrentStepIndex} | ||
/> | ||
</Stack> | ||
<Box>{STEPS[currentStepIndex]}</Box> | ||
</Grid> | ||
); | ||
}; | ||
|
||
export default ManualSystemFlow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Box, Breadcrumb, BreadcrumbItem, Heading } from "@fidesui/react"; | ||
import type { NextPage } from "next"; | ||
import NextLink from "next/link"; | ||
|
||
import Layout from "~/features/common/Layout"; | ||
import ManualSystemFlow from "~/features/system/ManualSystemFlow"; | ||
|
||
const ConfigureSystem: NextPage = () => ( | ||
<Layout title="Systems"> | ||
<Heading mb={2} fontSize="2xl" fontWeight="semibold"> | ||
Configure your system | ||
</Heading> | ||
<Box mb={8}> | ||
<Breadcrumb fontWeight="medium" fontSize="sm" color="gray.600"> | ||
<BreadcrumbItem> | ||
<NextLink href="/system">System Connections</NextLink> | ||
</BreadcrumbItem> | ||
<BreadcrumbItem> | ||
<NextLink href="/system/new">Create a new system</NextLink> | ||
</BreadcrumbItem> | ||
<BreadcrumbItem> | ||
<NextLink href="#">Configure your connection</NextLink> | ||
</BreadcrumbItem> | ||
</Breadcrumb> | ||
</Box> | ||
<ManualSystemFlow /> | ||
</Layout> | ||
); | ||
|
||
export default ConfigureSystem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters