From 4ec5118fd58824ca6f67b5c0a3ac5ce6ad9ed4ff Mon Sep 17 00:00:00 2001 From: "Bryson G." Date: Wed, 4 Dec 2024 11:18:56 -0800 Subject: [PATCH 1/7] refactor(dashboard): shadcn principal menu --- dashboard/package.json | 1 + .../app/[tenantId]/components/Principal.tsx | 55 ++--- dashboard/src/components/ui/dropdown-menu.tsx | 200 ++++++++++++++++++ 3 files changed, 216 insertions(+), 40 deletions(-) create mode 100644 dashboard/src/components/ui/dropdown-menu.tsx diff --git a/dashboard/package.json b/dashboard/package.json index 796161f29..738a5b06b 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -16,6 +16,7 @@ "@radix-ui/react-accordion": "^1.2.1", "@radix-ui/react-checkbox": "^1.1.1", "@radix-ui/react-dialog": "^1.1.2", + "@radix-ui/react-dropdown-menu": "^2.1.2", "@radix-ui/react-label": "^2.1.0", "@radix-ui/react-select": "^2.0.0", "@radix-ui/react-separator": "^1.1.0", diff --git a/dashboard/src/app/[tenantId]/components/Principal.tsx b/dashboard/src/app/[tenantId]/components/Principal.tsx index b47f5b20a..3813ae3d9 100644 --- a/dashboard/src/app/[tenantId]/components/Principal.tsx +++ b/dashboard/src/app/[tenantId]/components/Principal.tsx @@ -1,5 +1,5 @@ import { useWhoAmI } from '@/contexts/WhoAmIContext' -import { Menu, Transition } from '@headlessui/react' +import { DropdownMenu, DropdownMenuSeparator, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel } from '@/components/ui/dropdown-menu' import { signOut } from 'next-auth/react' import { FC, Fragment } from 'react' function classNames(...classes: Array) { @@ -9,44 +9,19 @@ function classNames(...classes: Array) { export const Principal: FC = () => { const { user } = useWhoAmI() return ( - -
- -
- {user?.name?.at(0)} -
-
-
- - - -
- - {({ active }) => ( - - )} - -
-
-
-
+ + +
+ {user?.name?.at(0)} +
+
+ + {user?.name} + + signOut()} className="block w-full px-4 py-2 text-left text-sm"> + Sign out + + +
) } diff --git a/dashboard/src/components/ui/dropdown-menu.tsx b/dashboard/src/components/ui/dropdown-menu.tsx new file mode 100644 index 000000000..cf5662390 --- /dev/null +++ b/dashboard/src/components/ui/dropdown-menu.tsx @@ -0,0 +1,200 @@ +"use client" + +import * as React from "react" +import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu" +import { Check, ChevronRight, Circle } from "lucide-react" + +import { cn } from '@/components/utils' + +const DropdownMenu = DropdownMenuPrimitive.Root + +const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger + +const DropdownMenuGroup = DropdownMenuPrimitive.Group + +const DropdownMenuPortal = DropdownMenuPrimitive.Portal + +const DropdownMenuSub = DropdownMenuPrimitive.Sub + +const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup + +const DropdownMenuSubTrigger = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef & { + inset?: boolean + } +>(({ className, inset, children, ...props }, ref) => ( + + {children} + + +)) +DropdownMenuSubTrigger.displayName = + DropdownMenuPrimitive.SubTrigger.displayName + +const DropdownMenuSubContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +DropdownMenuSubContent.displayName = + DropdownMenuPrimitive.SubContent.displayName + +const DropdownMenuContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, sideOffset = 4, ...props }, ref) => ( + + + +)) +DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName + +const DropdownMenuItem = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef & { + inset?: boolean + } +>(({ className, inset, ...props }, ref) => ( + +)) +DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName + +const DropdownMenuCheckboxItem = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, checked, ...props }, ref) => ( + + + + + + + {children} + +)) +DropdownMenuCheckboxItem.displayName = + DropdownMenuPrimitive.CheckboxItem.displayName + +const DropdownMenuRadioItem = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + + + + + + {children} + +)) +DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName + +const DropdownMenuLabel = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef & { + inset?: boolean + } +>(({ className, inset, ...props }, ref) => ( + +)) +DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName + +const DropdownMenuSeparator = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName + +const DropdownMenuShortcut = ({ + className, + ...props +}: React.HTMLAttributes) => { + return ( + + ) +} +DropdownMenuShortcut.displayName = "DropdownMenuShortcut" + +export { + DropdownMenu, + DropdownMenuTrigger, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuCheckboxItem, + DropdownMenuRadioItem, + DropdownMenuLabel, + DropdownMenuSeparator, + DropdownMenuShortcut, + DropdownMenuGroup, + DropdownMenuPortal, + DropdownMenuSub, + DropdownMenuSubContent, + DropdownMenuSubTrigger, + DropdownMenuRadioGroup, +} From 726a1f673e463f7f093619a9199a84bb9263c67f Mon Sep 17 00:00:00 2001 From: "Bryson G." Date: Wed, 4 Dec 2024 11:21:07 -0800 Subject: [PATCH 2/7] refactor(dashboard): thread accordion --- .../wfSpec/[...props]/components/Thread.tsx | 28 ++++----- dashboard/src/components/ui/accordion.tsx | 58 +++++++++++++++++++ 2 files changed, 70 insertions(+), 16 deletions(-) create mode 100644 dashboard/src/components/ui/accordion.tsx diff --git a/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/Thread.tsx b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/Thread.tsx index be951a33c..0e90d49e6 100644 --- a/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/Thread.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/Thread.tsx @@ -1,7 +1,6 @@ 'use client' -import { Disclosure } from '@headlessui/react' +import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion' import { ThreadSpec } from 'littlehorse-client/proto' -import { ChevronUpIcon } from 'lucide-react' import { FC } from 'react' import { Mutations } from './Mutations' import { Variables } from './Variables' @@ -13,20 +12,17 @@ type Props = { export const Thread: FC = ({ name, spec }) => { return (
- - {({ open }) => ( - <> - -

Thread: {name}

- -
- - - - - - )} -
+ + + +

Thread: {name}

+
+ + + + +
+
) } diff --git a/dashboard/src/components/ui/accordion.tsx b/dashboard/src/components/ui/accordion.tsx new file mode 100644 index 000000000..1baf26951 --- /dev/null +++ b/dashboard/src/components/ui/accordion.tsx @@ -0,0 +1,58 @@ +"use client" + +import * as React from "react" +import * as AccordionPrimitive from '@radix-ui/react-accordion' +import { ChevronDown } from 'lucide-react' + +import { cn } from '@/components/utils' + +const Accordion = AccordionPrimitive.Root + +const AccordionItem = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AccordionItem.displayName = "AccordionItem" + +const AccordionTrigger = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + svg]:rotate-180", + className + )} + {...props} + > + {children} + + + +)) +AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName + +const AccordionContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + +
{children}
+
+)) + +AccordionContent.displayName = AccordionPrimitive.Content.displayName + +export { Accordion, AccordionItem, AccordionTrigger, AccordionContent } From e2760ce874cc56ea84498a72a2f9dd352a9e31ec Mon Sep 17 00:00:00 2001 From: "Bryson G." Date: Wed, 4 Dec 2024 11:21:47 -0800 Subject: [PATCH 3/7] refactor(dashboard): wfRun time window select --- dashboard/package-lock.json | 116 +++++++++++++++ .../[...props]/components/WfRunsHeader.tsx | 44 +++--- dashboard/tailwind.config.ts | 134 ++++++++++-------- 3 files changed, 208 insertions(+), 86 deletions(-) diff --git a/dashboard/package-lock.json b/dashboard/package-lock.json index 60895852c..31c71a4bb 100644 --- a/dashboard/package-lock.json +++ b/dashboard/package-lock.json @@ -13,6 +13,7 @@ "@radix-ui/react-accordion": "^1.2.1", "@radix-ui/react-checkbox": "^1.1.1", "@radix-ui/react-dialog": "^1.1.2", + "@radix-ui/react-dropdown-menu": "^2.1.2", "@radix-ui/react-label": "^2.1.0", "@radix-ui/react-select": "^2.0.0", "@radix-ui/react-separator": "^1.1.0", @@ -3151,6 +3152,35 @@ } } }, + "node_modules/@radix-ui/react-dropdown-menu": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-2.1.2.tgz", + "integrity": "sha512-GVZMR+eqK8/Kes0a36Qrv+i20bAPXSn8rCBTHx30w+3ECnR5o3xixAlqcVaYvLeyKUsm0aqyhWfmUcqufM8nYA==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.0", + "@radix-ui/react-compose-refs": "1.1.0", + "@radix-ui/react-context": "1.1.1", + "@radix-ui/react-id": "1.1.0", + "@radix-ui/react-menu": "2.1.2", + "@radix-ui/react-primitive": "2.0.0", + "@radix-ui/react-use-controllable-state": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-focus-guards": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.1.1.tgz", @@ -3232,6 +3262,46 @@ } } }, + "node_modules/@radix-ui/react-menu": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-menu/-/react-menu-2.1.2.tgz", + "integrity": "sha512-lZ0R4qR2Al6fZ4yCCZzu/ReTFrylHFxIqy7OezIpWF4bL0o9biKo0pFIvkaew3TyZ9Fy5gYVrR5zCGZBVbO1zg==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.0", + "@radix-ui/react-collection": "1.1.0", + "@radix-ui/react-compose-refs": "1.1.0", + "@radix-ui/react-context": "1.1.1", + "@radix-ui/react-direction": "1.1.0", + "@radix-ui/react-dismissable-layer": "1.1.1", + "@radix-ui/react-focus-guards": "1.1.1", + "@radix-ui/react-focus-scope": "1.1.0", + "@radix-ui/react-id": "1.1.0", + "@radix-ui/react-popper": "1.2.0", + "@radix-ui/react-portal": "1.1.2", + "@radix-ui/react-presence": "1.1.1", + "@radix-ui/react-primitive": "2.0.0", + "@radix-ui/react-roving-focus": "1.1.0", + "@radix-ui/react-slot": "1.1.0", + "@radix-ui/react-use-callback-ref": "1.1.0", + "aria-hidden": "^1.1.1", + "react-remove-scroll": "2.6.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-popper": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.2.0.tgz", @@ -3350,6 +3420,52 @@ } } }, + "node_modules/@radix-ui/react-roving-focus": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-roving-focus/-/react-roving-focus-1.1.0.tgz", + "integrity": "sha512-EA6AMGeq9AEeQDeSH0aZgG198qkfHSbvWTf1HvoDmOB5bBG/qTxjYMWUKMnYiV6J/iP/J8MEFSuB2zRU2n7ODA==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.0", + "@radix-ui/react-collection": "1.1.0", + "@radix-ui/react-compose-refs": "1.1.0", + "@radix-ui/react-context": "1.1.0", + "@radix-ui/react-direction": "1.1.0", + "@radix-ui/react-id": "1.1.0", + "@radix-ui/react-primitive": "2.0.0", + "@radix-ui/react-use-callback-ref": "1.1.0", + "@radix-ui/react-use-controllable-state": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-roving-focus/node_modules/@radix-ui/react-context": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.1.0.tgz", + "integrity": "sha512-OKrckBy+sMEgYM/sMmqmErVn0kZqrHPJze+Ql3DzYsDDp0hl0L62nx/2122/Bvps1qz645jlcu2tD9lrRSdf8A==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-select": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/@radix-ui/react-select/-/react-select-2.1.2.tgz", diff --git a/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/WfRunsHeader.tsx b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/WfRunsHeader.tsx index dba18d8eb..8fc92e44a 100644 --- a/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/WfRunsHeader.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/WfRunsHeader.tsx @@ -1,5 +1,11 @@ import { TIME_RANGES, TIME_RANGES_NAMES, TimeRange, WF_RUN_STATUSES } from '@/app/constants' -import { Listbox, ListboxButton, ListboxOptions } from '@headlessui/react' +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from '@/components/ui/select' import { LHStatus, WfSpec } from 'littlehorse-client/proto' import { ClockIcon } from 'lucide-react' import LinkWithTenant from '@/app/[tenantId]/components/LinkWithTenant' @@ -23,29 +29,21 @@ export const WfRunsHeader: FC = ({ spec, currentStatus, currentWindow, se

WfRun Search

- -
- +
{['ALL', ...WF_RUN_STATUSES].map(status => ( Date: Wed, 4 Dec 2024 12:17:59 -0800 Subject: [PATCH 4/7] refactor(dashboard): more headlessui -> shadcn --- .../[tenantId]/components/TenantSelector.tsx | 80 +++++++------------ .../[tenantId]/components/VersionSelector.tsx | 57 ++++++------- .../taskDef/[name]/components/TaskDef.tsx | 19 ++--- .../[...props]/components/UserTaskDef.tsx | 39 ++++----- 4 files changed, 91 insertions(+), 104 deletions(-) diff --git a/dashboard/src/app/[tenantId]/components/TenantSelector.tsx b/dashboard/src/app/[tenantId]/components/TenantSelector.tsx index 1a18dcae0..657159b8a 100644 --- a/dashboard/src/app/[tenantId]/components/TenantSelector.tsx +++ b/dashboard/src/app/[tenantId]/components/TenantSelector.tsx @@ -1,8 +1,8 @@ 'use client' import { useWhoAmI } from '@/contexts/WhoAmIContext' -import { Menu, Transition } from '@headlessui/react' +import { DropdownMenu, DropdownMenuSeparator, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from '@/components/ui/dropdown-menu' import { useParams, useRouter } from 'next/navigation' -import { FC, Fragment } from 'react' +import { FC } from 'react' export const TenantSelector: FC = () => { const { tenants } = useWhoAmI() @@ -10,53 +10,33 @@ export const TenantSelector: FC = () => { const router = useRouter() return ( - -
- - - - - {tenantId} - -
- - -
Tenants
- {tenants.map(tenant => ( -
- - - -
- ))} -
-
-
+ + + + + + {tenantId} + + +
Tenants
+ + {tenants.map(tenant => ( + router.push(`/${tenant}`)}> + {tenant} + + ))} +
+
) } diff --git a/dashboard/src/app/[tenantId]/components/VersionSelector.tsx b/dashboard/src/app/[tenantId]/components/VersionSelector.tsx index e58b0d8b0..c93d3f902 100644 --- a/dashboard/src/app/[tenantId]/components/VersionSelector.tsx +++ b/dashboard/src/app/[tenantId]/components/VersionSelector.tsx @@ -1,7 +1,12 @@ -import { Listbox } from '@headlessui/react' import { TagIcon } from 'lucide-react' import { FC } from 'react' import LinkWithTenant from './LinkWithTenant' +import { + Select, + SelectContent, + SelectTrigger, + SelectValue, +} from '@/components/ui/select' type Props = { path: string @@ -12,31 +17,29 @@ type Props = { export const VersionSelector: FC = ({ path, currentVersion, versions, loadVersions }) => { return ( - -
- Version: -
- - - {currentVersion} - - - {[...versions].reverse().map(version => { - return ( - - {version} - - ) - })} - -
-
-
+
+ Version: + +
) } diff --git a/dashboard/src/app/[tenantId]/taskDef/[name]/components/TaskDef.tsx b/dashboard/src/app/[tenantId]/taskDef/[name]/components/TaskDef.tsx index bfbb4df0e..68c8101ed 100644 --- a/dashboard/src/app/[tenantId]/taskDef/[name]/components/TaskDef.tsx +++ b/dashboard/src/app/[tenantId]/taskDef/[name]/components/TaskDef.tsx @@ -5,7 +5,8 @@ import { SearchFooter } from '@/app/[tenantId]/components/SearchFooter' import { SEARCH_DEFAULT_LIMIT } from '@/app/constants' import { concatWfRunIds, localDateTimeToUTCIsoString, utcToLocalDateTime } from '@/app/utils' import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table' -import { Field, Input, Label } from '@headlessui/react' +import { Input } from '@/components/ui/input' +import { Label } from '@/components/ui/label' import { useInfiniteQuery } from '@tanstack/react-query' import { TaskDef as TaskDefProto, TaskStatus } from 'littlehorse-client/proto' import { RefreshCwIcon } from 'lucide-react' @@ -64,25 +65,25 @@ export const TaskDef: FC = ({ spec }) => {
- - +
+ ) => setCreatedAfter(e.target.value)} - className="focus:shadow-outline ml-3 w-full appearance-none rounded border px-3 py-2 leading-tight shadow focus:outline-none" + className="w-full" /> - +
- - +
+ ) => setCreatedBefore(e.target.value)} - className="focus:shadow-outline ml-4 w-full appearance-none rounded border px-3 py-2 leading-tight shadow focus:outline-none" + className="w-full" /> - +
{isPending ? ( diff --git a/dashboard/src/app/[tenantId]/userTaskDef/[...props]/components/UserTaskDef.tsx b/dashboard/src/app/[tenantId]/userTaskDef/[...props]/components/UserTaskDef.tsx index 4491acbfd..899c807c7 100644 --- a/dashboard/src/app/[tenantId]/userTaskDef/[...props]/components/UserTaskDef.tsx +++ b/dashboard/src/app/[tenantId]/userTaskDef/[...props]/components/UserTaskDef.tsx @@ -11,7 +11,9 @@ import LinkWithTenant from '@/app/[tenantId]/components/LinkWithTenant' import { SEARCH_DEFAULT_LIMIT } from '@/app/constants' import { concatWfRunIds, localDateTimeToUTCIsoString, utcToLocalDateTime } from '@/app/utils' import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table' -import { Button, Field, Input, Label } from '@headlessui/react' +import { Button } from "@/components/ui/button" +import { Input } from "@/components/ui/input" +import { Label } from "@/components/ui/label" import { useInfiniteQuery } from '@tanstack/react-query' import { UserTaskDef as UserTaskDefProto, UserTaskRunStatus } from 'littlehorse-client/proto' import { RefreshCwIcon } from 'lucide-react' @@ -85,7 +87,8 @@ export const UserTaskDef: FC = ({ spec }) => { @@ -93,46 +96,46 @@ export const UserTaskDef: FC = ({ spec }) => {
- - +
+ ) => setUserId(e.target.value)} - className="focus:shadow-outline ml-6 w-full appearance-none rounded border px-3 py-2 leading-tight shadow focus:outline-none" + className="w-full" /> - +
- - +
+ ) => setUserGroup(e.target.value)} - className="focus:shadow-outline ml-4 w-full appearance-none rounded border px-3 py-2 leading-tight shadow focus:outline-none" + className="w-full" /> - +
- - +
+ ) => setCreatedAfter(e.target.value)} - className="focus:shadow-outline ml-3 w-full appearance-none rounded border px-3 py-2 leading-tight shadow focus:outline-none" + className="w-full" /> - +
- - +
+ ) => setCreatedBefore(e.target.value)} - className="focus:shadow-outline ml-4 w-full appearance-none rounded border px-3 py-2 leading-tight shadow focus:outline-none" + className="w-full" /> - +
{isPending ? ( From 7c89fe3201dce41d1c7451b86818fef96f982a9a Mon Sep 17 00:00:00 2001 From: "Bryson G." Date: Wed, 4 Dec 2024 12:18:33 -0800 Subject: [PATCH 5/7] refactor(dashboard): lint --- .../[...props]/components/WfRunsHeader.tsx | 8 +- .../app/[tenantId]/components/Principal.tsx | 9 +- .../[tenantId]/components/TenantSelector.tsx | 14 +- .../[tenantId]/components/VersionSelector.tsx | 7 +- .../[...props]/components/UserTaskDef.tsx | 8 +- dashboard/src/components/ui/accordion.tsx | 16 +- dashboard/src/components/ui/dropdown-menu.tsx | 59 +++----- dashboard/tailwind.config.ts | 142 +++++++++--------- 8 files changed, 123 insertions(+), 140 deletions(-) diff --git a/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/WfRunsHeader.tsx b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/WfRunsHeader.tsx index 8fc92e44a..b670bd8c2 100644 --- a/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/WfRunsHeader.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/WfRunsHeader.tsx @@ -1,11 +1,5 @@ import { TIME_RANGES, TIME_RANGES_NAMES, TimeRange, WF_RUN_STATUSES } from '@/app/constants' -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from '@/components/ui/select' +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' import { LHStatus, WfSpec } from 'littlehorse-client/proto' import { ClockIcon } from 'lucide-react' import LinkWithTenant from '@/app/[tenantId]/components/LinkWithTenant' diff --git a/dashboard/src/app/[tenantId]/components/Principal.tsx b/dashboard/src/app/[tenantId]/components/Principal.tsx index 3813ae3d9..434bd47c7 100644 --- a/dashboard/src/app/[tenantId]/components/Principal.tsx +++ b/dashboard/src/app/[tenantId]/components/Principal.tsx @@ -1,5 +1,12 @@ import { useWhoAmI } from '@/contexts/WhoAmIContext' -import { DropdownMenu, DropdownMenuSeparator, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel } from '@/components/ui/dropdown-menu' +import { + DropdownMenu, + DropdownMenuSeparator, + DropdownMenuTrigger, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuLabel, +} from '@/components/ui/dropdown-menu' import { signOut } from 'next-auth/react' import { FC, Fragment } from 'react' function classNames(...classes: Array) { diff --git a/dashboard/src/app/[tenantId]/components/TenantSelector.tsx b/dashboard/src/app/[tenantId]/components/TenantSelector.tsx index 657159b8a..196f13a81 100644 --- a/dashboard/src/app/[tenantId]/components/TenantSelector.tsx +++ b/dashboard/src/app/[tenantId]/components/TenantSelector.tsx @@ -1,6 +1,12 @@ 'use client' import { useWhoAmI } from '@/contexts/WhoAmIContext' -import { DropdownMenu, DropdownMenuSeparator, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from '@/components/ui/dropdown-menu' +import { + DropdownMenu, + DropdownMenuSeparator, + DropdownMenuTrigger, + DropdownMenuContent, + DropdownMenuItem, +} from '@/components/ui/dropdown-menu' import { useParams, useRouter } from 'next/navigation' import { FC } from 'react' @@ -32,7 +38,11 @@ export const TenantSelector: FC = () => {
Tenants
{tenants.map(tenant => ( - router.push(`/${tenant}`)}> + router.push(`/${tenant}`)} + > {tenant} ))} diff --git a/dashboard/src/app/[tenantId]/components/VersionSelector.tsx b/dashboard/src/app/[tenantId]/components/VersionSelector.tsx index c93d3f902..1e8aad9ea 100644 --- a/dashboard/src/app/[tenantId]/components/VersionSelector.tsx +++ b/dashboard/src/app/[tenantId]/components/VersionSelector.tsx @@ -1,12 +1,7 @@ import { TagIcon } from 'lucide-react' import { FC } from 'react' import LinkWithTenant from './LinkWithTenant' -import { - Select, - SelectContent, - SelectTrigger, - SelectValue, -} from '@/components/ui/select' +import { Select, SelectContent, SelectTrigger, SelectValue } from '@/components/ui/select' type Props = { path: string diff --git a/dashboard/src/app/[tenantId]/userTaskDef/[...props]/components/UserTaskDef.tsx b/dashboard/src/app/[tenantId]/userTaskDef/[...props]/components/UserTaskDef.tsx index 899c807c7..ade44c9e7 100644 --- a/dashboard/src/app/[tenantId]/userTaskDef/[...props]/components/UserTaskDef.tsx +++ b/dashboard/src/app/[tenantId]/userTaskDef/[...props]/components/UserTaskDef.tsx @@ -11,9 +11,9 @@ import LinkWithTenant from '@/app/[tenantId]/components/LinkWithTenant' import { SEARCH_DEFAULT_LIMIT } from '@/app/constants' import { concatWfRunIds, localDateTimeToUTCIsoString, utcToLocalDateTime } from '@/app/utils' import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table' -import { Button } from "@/components/ui/button" -import { Input } from "@/components/ui/input" -import { Label } from "@/components/ui/label" +import { Button } from '@/components/ui/button' +import { Input } from '@/components/ui/input' +import { Label } from '@/components/ui/label' import { useInfiniteQuery } from '@tanstack/react-query' import { UserTaskDef as UserTaskDefProto, UserTaskRunStatus } from 'littlehorse-client/proto' import { RefreshCwIcon } from 'lucide-react' @@ -87,7 +87,7 @@ export const UserTaskDef: FC = ({ spec }) => {