Skip to content

Commit

Permalink
chore: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
LatentDream committed Apr 21, 2024
1 parent c776372 commit 407976f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
6 changes: 5 additions & 1 deletion src/renderer/hooks/useTestImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ function parseDiscoverContainer(
settings: ImportTestSettings,
) {
return map(data.response, (container) => {
const new_elem = createNewTest({ name: container.testName, path: container.path, type: settings.importType });
const new_elem = createNewTest({
name: container.testName,
path: container.path,
type: settings.importType,
});
return new_elem;
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
import { Button } from "@/renderer/components/ui/button";
import { Dialog, DialogContent } from "@/renderer/components/ui/dialog";
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/renderer/components/ui/form";
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from "@/renderer/components/ui/form";
import { Input } from "@/renderer/components/ui/input";
import {
createNewTest,
useDisplayedSequenceState,
} from "@/renderer/hooks/useTestSequencerState";
import { zodResolver } from "@hookform/resolvers/zod";
import { useForm } from "react-hook-form";
import { z } from "zod"
import { z } from "zod";

const formSchema = z.object({
name: z.string().min(1).regex(/\S/),
min: z.coerce.number().optional(),
max: z.coerce.number().optional(),
unit: z.string().optional(),
})
});

export const CreatePlaceholderTestModal = ({
isModalOpen,
Expand All @@ -34,7 +41,7 @@ export const CreatePlaceholderTestModal = ({
min: undefined,
max: undefined,
},
})
});

async function onSubmit(values: z.infer<typeof formSchema>) {
const res = await addNewElems([
Expand Down Expand Up @@ -75,18 +82,17 @@ export const CreatePlaceholderTestModal = ({
<FormItem>
<FormLabel>Test Name</FormLabel>
<FormControl>
<Input
placeholder="Power Supply Voltage Test"
{...field}
/>
<Input placeholder="Power Supply Voltage Test" {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>

<div className="grow pb-1 text-xs">
<p className="mb-2 font-bold text-muted-foreground">Expected Value</p>
<p className="mb-2 font-bold text-muted-foreground">
Expected Value
</p>
<div className="flex gap-2">
<div className="grow pb-1 text-xs">
<FormField
Expand All @@ -96,10 +102,7 @@ export const CreatePlaceholderTestModal = ({
<FormItem>
<FormLabel>Minimum</FormLabel>
<FormControl>
<Input
{...field}
type="number"
/>
<Input {...field} type="number" />
</FormControl>
<FormMessage />
</FormItem>
Expand All @@ -115,10 +118,7 @@ export const CreatePlaceholderTestModal = ({
<FormItem>
<FormLabel>Maximun</FormLabel>
<FormControl>
<Input
{...field}
type="number"
/>
<Input {...field} type="number" />
</FormControl>
<FormMessage />
</FormItem>
Expand All @@ -134,9 +134,7 @@ export const CreatePlaceholderTestModal = ({
<FormItem>
<FormLabel>Displayed Unit</FormLabel>
<FormControl>
<Input
{...field}
/>
<Input {...field} />
</FormControl>
<FormMessage />
</FormItem>
Expand All @@ -145,7 +143,9 @@ export const CreatePlaceholderTestModal = ({
</div>
</div>
</div>
<Button type="submit" className="w-full">Submit</Button>
<Button type="submit" className="w-full">
Submit
</Button>
</form>
</Form>
</DialogContent>
Expand Down

0 comments on commit 407976f

Please sign in to comment.