diff --git a/apps/console/src/App.tsx b/apps/console/src/App.tsx index ab9418bbb..a79f7b3c9 100644 --- a/apps/console/src/App.tsx +++ b/apps/console/src/App.tsx @@ -26,7 +26,9 @@ const NotFoundPage = lazy(() => import("./pages/NotFoundPage")); const PeopleListPage = lazy(() => import("./pages/PeopleListPage")); const VendorListPage = lazy(() => import("./pages/VendorListPage")); const FrameworkListPage = lazy(() => import("./pages/FrameworkListPage")); -const FrameworkOverviewPage = lazy(() => import("./pages/FrameworkOverviewPage")); +const FrameworkOverviewPage = lazy( + () => import("./pages/FrameworkOverviewPage"), +); const VendorOverviewPage = lazy(() => import("./pages/VendorOverviewPage")); const SettingsPage = lazy(() => import("./pages/SettingsPage")); const CreatePeoplePage = lazy(() => import("./pages/CreatePeoplePage")); @@ -147,7 +149,11 @@ function App() { ); } -function ErrorBoundaryWithLocation({ children }: { children: React.ReactNode }) { +function ErrorBoundaryWithLocation({ + children, +}: { + children: React.ReactNode; +}) { const location = useLocation(); return {children}; } diff --git a/apps/console/src/components/ui/badge.tsx b/apps/console/src/components/ui/badge.tsx index e87d62bf1..f79598057 100644 --- a/apps/console/src/components/ui/badge.tsx +++ b/apps/console/src/components/ui/badge.tsx @@ -1,7 +1,7 @@ -import * as React from "react" -import { cva, type VariantProps } from "class-variance-authority" +import * as React from "react"; +import { cva, type VariantProps } from "class-variance-authority"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const badgeVariants = cva( "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", @@ -20,8 +20,8 @@ const badgeVariants = cva( defaultVariants: { variant: "default", }, - } -) + }, +); export interface BadgeProps extends React.HTMLAttributes, @@ -30,7 +30,7 @@ export interface BadgeProps function Badge({ className, variant, ...props }: BadgeProps) { return (
- ) + ); } -export { Badge, badgeVariants } +export { Badge, badgeVariants }; diff --git a/apps/console/src/components/ui/card.tsx b/apps/console/src/components/ui/card.tsx index cabfbfc59..1cc0c1253 100644 --- a/apps/console/src/components/ui/card.tsx +++ b/apps/console/src/components/ui/card.tsx @@ -1,6 +1,6 @@ -import * as React from "react" +import * as React from "react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const Card = React.forwardRef< HTMLDivElement, @@ -10,12 +10,12 @@ const Card = React.forwardRef< ref={ref} className={cn( "rounded-xl border bg-card text-card-foreground shadow", - className + className, )} {...props} /> -)) -Card.displayName = "Card" +)); +Card.displayName = "Card"; const CardHeader = React.forwardRef< HTMLDivElement, @@ -26,8 +26,8 @@ const CardHeader = React.forwardRef< className={cn("flex flex-col space-y-1.5 p-6", className)} {...props} /> -)) -CardHeader.displayName = "CardHeader" +)); +CardHeader.displayName = "CardHeader"; const CardTitle = React.forwardRef< HTMLDivElement, @@ -38,8 +38,8 @@ const CardTitle = React.forwardRef< className={cn("font-semibold leading-none tracking-tight", className)} {...props} /> -)) -CardTitle.displayName = "CardTitle" +)); +CardTitle.displayName = "CardTitle"; const CardDescription = React.forwardRef< HTMLDivElement, @@ -50,16 +50,16 @@ const CardDescription = React.forwardRef< className={cn("text-sm text-muted-foreground", className)} {...props} /> -)) -CardDescription.displayName = "CardDescription" +)); +CardDescription.displayName = "CardDescription"; const CardContent = React.forwardRef< HTMLDivElement, React.HTMLAttributes >(({ className, ...props }, ref) => (
-)) -CardContent.displayName = "CardContent" +)); +CardContent.displayName = "CardContent"; const CardFooter = React.forwardRef< HTMLDivElement, @@ -70,7 +70,14 @@ const CardFooter = React.forwardRef< className={cn("flex items-center p-6 pt-0", className)} {...props} /> -)) -CardFooter.displayName = "CardFooter" +)); +CardFooter.displayName = "CardFooter"; -export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } +export { + Card, + CardHeader, + CardFooter, + CardTitle, + CardDescription, + CardContent, +}; diff --git a/apps/console/src/components/ui/checkbox.tsx b/apps/console/src/components/ui/checkbox.tsx index f0712d709..58d176812 100644 --- a/apps/console/src/components/ui/checkbox.tsx +++ b/apps/console/src/components/ui/checkbox.tsx @@ -1,8 +1,8 @@ -import * as React from "react" -import * as CheckboxPrimitive from "@radix-ui/react-checkbox" -import { Check } from "lucide-react" +import * as React from "react"; +import * as CheckboxPrimitive from "@radix-ui/react-checkbox"; +import { Check } from "lucide-react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const Checkbox = React.forwardRef< React.ElementRef, @@ -12,7 +12,7 @@ const Checkbox = React.forwardRef< ref={ref} className={cn( "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground", - className + className, )} {...props} > @@ -22,7 +22,7 @@ const Checkbox = React.forwardRef< -)) -Checkbox.displayName = CheckboxPrimitive.Root.displayName +)); +Checkbox.displayName = CheckboxPrimitive.Root.displayName; -export { Checkbox } \ No newline at end of file +export { Checkbox }; diff --git a/apps/console/src/components/ui/label.tsx b/apps/console/src/components/ui/label.tsx index a9eec775f..44912aff5 100644 --- a/apps/console/src/components/ui/label.tsx +++ b/apps/console/src/components/ui/label.tsx @@ -1,12 +1,12 @@ -import * as React from "react" -import * as LabelPrimitive from "@radix-ui/react-label" -import { cva, type VariantProps } from "class-variance-authority" +import * as React from "react"; +import * as LabelPrimitive from "@radix-ui/react-label"; +import { cva, type VariantProps } from "class-variance-authority"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const labelVariants = cva( - "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" -) + "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", +); const Label = React.forwardRef< React.ElementRef, @@ -18,7 +18,7 @@ const Label = React.forwardRef< className={cn(labelVariants(), className)} {...props} /> -)) -Label.displayName = LabelPrimitive.Root.displayName +)); +Label.displayName = LabelPrimitive.Root.displayName; -export { Label } \ No newline at end of file +export { Label }; diff --git a/apps/console/src/components/ui/progress.tsx b/apps/console/src/components/ui/progress.tsx index 3fd47adad..882affb83 100644 --- a/apps/console/src/components/ui/progress.tsx +++ b/apps/console/src/components/ui/progress.tsx @@ -1,7 +1,7 @@ -import * as React from "react" -import * as ProgressPrimitive from "@radix-ui/react-progress" +import * as React from "react"; +import * as ProgressPrimitive from "@radix-ui/react-progress"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const Progress = React.forwardRef< React.ElementRef, @@ -11,7 +11,7 @@ const Progress = React.forwardRef< ref={ref} className={cn( "relative h-2 w-full overflow-hidden rounded-full bg-primary/20", - className + className, )} {...props} > @@ -20,7 +20,7 @@ const Progress = React.forwardRef< style={{ transform: `translateX(-${100 - (value || 0)}%)` }} /> -)) -Progress.displayName = ProgressPrimitive.Root.displayName +)); +Progress.displayName = ProgressPrimitive.Root.displayName; -export { Progress } +export { Progress }; diff --git a/apps/console/src/components/ui/radio-group.tsx b/apps/console/src/components/ui/radio-group.tsx index a9f443f56..e41130505 100644 --- a/apps/console/src/components/ui/radio-group.tsx +++ b/apps/console/src/components/ui/radio-group.tsx @@ -1,8 +1,8 @@ -import * as React from "react" -import * as RadioGroupPrimitive from "@radix-ui/react-radio-group" -import { Circle } from "lucide-react" +import * as React from "react"; +import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"; +import { Circle } from "lucide-react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const RadioGroup = React.forwardRef< React.ElementRef, @@ -14,9 +14,9 @@ const RadioGroup = React.forwardRef< {...props} ref={ref} /> - ) -}) -RadioGroup.displayName = RadioGroupPrimitive.Root.displayName + ); +}); +RadioGroup.displayName = RadioGroupPrimitive.Root.displayName; const RadioGroupItem = React.forwardRef< React.ElementRef, @@ -27,7 +27,7 @@ const RadioGroupItem = React.forwardRef< ref={ref} className={cn( "aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", - className + className, )} {...props} > @@ -35,8 +35,8 @@ const RadioGroupItem = React.forwardRef< - ) -}) -RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName + ); +}); +RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName; -export { RadioGroup, RadioGroupItem } \ No newline at end of file +export { RadioGroup, RadioGroupItem }; diff --git a/apps/console/src/components/ui/select.tsx b/apps/console/src/components/ui/select.tsx index f28525e93..ea79c5648 100644 --- a/apps/console/src/components/ui/select.tsx +++ b/apps/console/src/components/ui/select.tsx @@ -1,14 +1,14 @@ -import * as React from "react" -import * as SelectPrimitive from "@radix-ui/react-select" -import { Check, ChevronDown } from "lucide-react" +import * as React from "react"; +import * as SelectPrimitive from "@radix-ui/react-select"; +import { Check, ChevronDown } from "lucide-react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; -const Select = SelectPrimitive.Root +const Select = SelectPrimitive.Root; -const SelectGroup = SelectPrimitive.Group +const SelectGroup = SelectPrimitive.Group; -const SelectValue = SelectPrimitive.Value +const SelectValue = SelectPrimitive.Value; const SelectTrigger = React.forwardRef< React.ElementRef, @@ -18,15 +18,15 @@ const SelectTrigger = React.forwardRef< ref={ref} className={cn( "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", - className + className, )} {...props} > {children} -)) -SelectTrigger.displayName = SelectPrimitive.Trigger.displayName +)); +SelectTrigger.displayName = SelectPrimitive.Trigger.displayName; const SelectContent = React.forwardRef< React.ElementRef, @@ -39,7 +39,7 @@ const SelectContent = React.forwardRef< "relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", - className + className, )} position={position} {...props} @@ -48,15 +48,15 @@ const SelectContent = React.forwardRef< className={cn( "p-1", position === "popper" && - "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]" + "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]", )} > {children} -)) -SelectContent.displayName = SelectPrimitive.Content.displayName +)); +SelectContent.displayName = SelectPrimitive.Content.displayName; const SelectItem = React.forwardRef< React.ElementRef, @@ -66,7 +66,7 @@ const SelectItem = React.forwardRef< ref={ref} className={cn( "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", - className + className, )} {...props} > @@ -78,8 +78,8 @@ const SelectItem = React.forwardRef< {children} -)) -SelectItem.displayName = SelectPrimitive.Item.displayName +)); +SelectItem.displayName = SelectPrimitive.Item.displayName; export { Select, @@ -88,4 +88,4 @@ export { SelectTrigger, SelectContent, SelectItem, -} \ No newline at end of file +}; diff --git a/apps/console/src/layouts/ConsoleLayout.tsx b/apps/console/src/layouts/ConsoleLayout.tsx index 5e116520c..45796b358 100644 --- a/apps/console/src/layouts/ConsoleLayout.tsx +++ b/apps/console/src/layouts/ConsoleLayout.tsx @@ -18,7 +18,7 @@ import { export default function ConsoleLayout() { const location = useLocation(); - const pathSegments = location.pathname.split('/').filter(Boolean); + const pathSegments = location.pathname.split("/").filter(Boolean); return ( @@ -32,15 +32,13 @@ export default function ConsoleLayout() { - - Home - + Home {pathSegments.map((segment, index) => { - const path = `/${pathSegments.slice(0, index + 1).join('/')}`; + const path = `/${pathSegments.slice(0, index + 1).join("/")}`; const isLast = index === pathSegments.length - 1; - + return ( @@ -52,7 +50,8 @@ export default function ConsoleLayout() { ) : ( - {segment.charAt(0).toUpperCase() + segment.slice(1)} + {segment.charAt(0).toUpperCase() + + segment.slice(1)} )} diff --git a/apps/console/src/pages/CreatePeoplePage.tsx b/apps/console/src/pages/CreatePeoplePage.tsx index 7818e609c..d2cc8908b 100644 --- a/apps/console/src/pages/CreatePeoplePage.tsx +++ b/apps/console/src/pages/CreatePeoplePage.tsx @@ -54,7 +54,9 @@ function CreatePeoplePageContent({ const environment = useRelayEnvironment(); const data = usePreloadedQuery(createPeoplePageQuery, queryRef); const [createPeople, isCreatingPeople] = useMutation(createPeopleMutation); - const [kind, setKind] = useState<'EMPLOYEE' | 'CONTRACTOR' | 'VENDOR'>('EMPLOYEE'); + const [kind, setKind] = useState<"EMPLOYEE" | "CONTRACTOR" | "VENDOR">( + "EMPLOYEE", + ); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); @@ -64,8 +66,8 @@ function CreatePeoplePageContent({ variables: { input: { organizationId: data.node.id, - fullName: formData.get('fullName') as string, - primaryEmailAddress: formData.get('primaryEmailAddress') as string, + fullName: formData.get("fullName") as string, + primaryEmailAddress: formData.get("primaryEmailAddress") as string, kind, }, }, @@ -77,8 +79,8 @@ function CreatePeoplePageContent({ organization.invalidateRecord(); } }); - - navigate('/peoples'); + + navigate("/peoples"); }, }); }; @@ -91,7 +93,9 @@ function CreatePeoplePageContent({
-

Create People

+

+ Create People +

Add a new person to your organization.

@@ -145,7 +149,7 @@ function CreatePeoplePageContent({ @@ -162,7 +166,9 @@ function CreatePeoplePageContent({ } export default function CreatePeoplePage() { - const [queryRef, loadQuery] = useQueryLoader(createPeoplePageQuery); + const [queryRef, loadQuery] = useQueryLoader( + createPeoplePageQuery, + ); useEffect(() => { loadQuery({}); @@ -177,4 +183,4 @@ export default function CreatePeoplePage() { ); -} \ No newline at end of file +} diff --git a/apps/console/src/pages/ErrorPage.tsx b/apps/console/src/pages/ErrorPage.tsx index ef735a410..d365002aa 100644 --- a/apps/console/src/pages/ErrorPage.tsx +++ b/apps/console/src/pages/ErrorPage.tsx @@ -32,4 +32,4 @@ export function ErrorPage({
); -} \ No newline at end of file +} diff --git a/apps/console/src/pages/FrameworkListPage.tsx b/apps/console/src/pages/FrameworkListPage.tsx index 64d90d20c..fbc4576f0 100644 --- a/apps/console/src/pages/FrameworkListPage.tsx +++ b/apps/console/src/pages/FrameworkListPage.tsx @@ -46,16 +46,19 @@ function FrameworkListPageContent({ queryRef: PreloadedQuery; }) { const data = usePreloadedQuery(FrameworkListPageQuery, queryRef); - const frameworks = data.node.frameworks?.edges.map(edge => edge?.node) ?? []; + const frameworks = + data.node.frameworks?.edges.map((edge) => edge?.node) ?? []; return (

Framework

- Compliance frameworks like SOC 2 and ISO 27001 provide guidelines to secure sensitive data, manage risks, and - build trust. SOC 2 focuses on customer data protection via five Trust Principles, while ISO 27001 establishes - a comprehensive Information Security Management System for global standards. + Compliance frameworks like SOC 2 and ISO 27001 provide guidelines to + secure sensitive data, manage risks, and build trust. SOC 2 focuses on + customer data protection via five Trust Principles, while ISO 27001 + establishes a comprehensive Information Security Management System for + global standards.

@@ -70,9 +73,13 @@ function FrameworkListPageContent({
-
{framework?.name}
+
+ {framework?.name} +
-

{framework?.name}

+

+ {framework?.name} +

{framework?.description}

@@ -118,7 +125,9 @@ function FrameworkListPageFallback() { } export default function FrameworkListPage() { - const [queryRef, loadQuery] = useQueryLoader(FrameworkListPageQuery); + const [queryRef, loadQuery] = useQueryLoader( + FrameworkListPageQuery, + ); useEffect(() => { loadQuery({}); diff --git a/apps/console/src/pages/FrameworkOverviewPage.tsx b/apps/console/src/pages/FrameworkOverviewPage.tsx index ceacf00ba..752aa1d07 100644 --- a/apps/console/src/pages/FrameworkOverviewPage.tsx +++ b/apps/console/src/pages/FrameworkOverviewPage.tsx @@ -24,6 +24,7 @@ import { Progress } from "@/components/ui/progress"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import type { FrameworkOverviewPageQuery as FrameworkOverviewPageQueryType } from "./__generated__/FrameworkOverviewPageQuery.graphql"; import { Helmet } from "react-helmet-async"; + const FrameworkOverviewPageQuery = graphql` query FrameworkOverviewPageQuery($frameworkId: ID!) { node(id: $frameworkId) { @@ -53,21 +54,29 @@ function FrameworkOverviewPageContent({ }) { const data = usePreloadedQuery(FrameworkOverviewPageQuery, queryRef); const framework = data.node; - const controls = framework.controls?.edges.map(edge => edge?.node) ?? []; + const controls = framework.controls?.edges.map((edge) => edge?.node) ?? []; const controlsByCategory = { - office: controls.filter(c => c?.name.toLowerCase().includes('office')), - computer: controls.filter(c => c?.name.toLowerCase().includes('computer')), - employees: controls.filter(c => c?.name.toLowerCase().includes('employee')), - email: controls.filter(c => c?.name.toLowerCase().includes('email')), - code: controls.filter(c => c?.name.toLowerCase().includes('code')), - infrastructure: controls.filter(c => c?.name.toLowerCase().includes('infrastructure')), - network: controls.filter(c => c?.name.toLowerCase().includes('network')), - data: controls.filter(c => c?.name.toLowerCase().includes('data')), - logging: controls.filter(c => c?.name.toLowerCase().includes('log')), - incidents: controls.filter(c => c?.name.toLowerCase().includes('incident')), - vendors: controls.filter(c => c?.name.toLowerCase().includes('vendor')), - sharing: controls.filter(c => c?.name.toLowerCase().includes('share')) + office: controls.filter((c) => c?.name.toLowerCase().includes("office")), + computer: controls.filter((c) => + c?.name.toLowerCase().includes("computer"), + ), + employees: controls.filter((c) => + c?.name.toLowerCase().includes("employee"), + ), + email: controls.filter((c) => c?.name.toLowerCase().includes("email")), + code: controls.filter((c) => c?.name.toLowerCase().includes("code")), + infrastructure: controls.filter((c) => + c?.name.toLowerCase().includes("infrastructure"), + ), + network: controls.filter((c) => c?.name.toLowerCase().includes("network")), + data: controls.filter((c) => c?.name.toLowerCase().includes("data")), + logging: controls.filter((c) => c?.name.toLowerCase().includes("log")), + incidents: controls.filter((c) => + c?.name.toLowerCase().includes("incident"), + ), + vendors: controls.filter((c) => c?.name.toLowerCase().includes("vendor")), + sharing: controls.filter((c) => c?.name.toLowerCase().includes("share")), }; const controlCards = [ @@ -75,19 +84,25 @@ function FrameworkOverviewPageContent({ icon: , title: "Secure your offices and internet access", controls: controlsByCategory.office, - completed: controlsByCategory.office.filter(c => c?.state === 'IMPLEMENTED').length, + completed: controlsByCategory.office.filter( + (c) => c?.state === "IMPLEMENTED", + ).length, total: controlsByCategory.office.length, }, { icon: , title: "Manage your computers", controls: controlsByCategory.computer, - completed: controlsByCategory.computer.filter(c => c?.state === 'IMPLEMENTED').length, + completed: controlsByCategory.computer.filter( + (c) => c?.state === "IMPLEMENTED", + ).length, total: controlsByCategory.computer.length, }, ]; - const totalImplemented = controls.filter(c => c?.state === 'IMPLEMENTED').length; + const totalImplemented = controls.filter( + (c) => c?.state === "IMPLEMENTED", + ).length; return (
@@ -125,7 +140,9 @@ function FrameworkOverviewPageContent({

Controls

-
{totalImplemented} out of {controls.length} validated
+
+ {totalImplemented} out of {controls.length} validated +
@@ -191,7 +208,9 @@ function FrameworkOverviewPageFallback() { export default function FrameworkOverviewPage() { const { frameworkId } = useParams(); - const [queryRef, loadQuery] = useQueryLoader(FrameworkOverviewPageQuery); + const [queryRef, loadQuery] = useQueryLoader( + FrameworkOverviewPageQuery, + ); useEffect(() => { loadQuery({ frameworkId: frameworkId! }); @@ -208,4 +227,3 @@ export default function FrameworkOverviewPage() { ); } - diff --git a/apps/console/src/pages/PeopleListPage.tsx b/apps/console/src/pages/PeopleListPage.tsx index 4c55a007a..28ccf0c20 100644 --- a/apps/console/src/pages/PeopleListPage.tsx +++ b/apps/console/src/pages/PeopleListPage.tsx @@ -18,7 +18,12 @@ import type { PeopleListPageQuery as PeopleListPageQueryType } from "./__generat const ITEMS_PER_PAGE = 20; const PeopleListPageQuery = graphql` - query PeopleListPageQuery($first: Int, $after: CursorKey, $last: Int, $before: CursorKey) { + query PeopleListPageQuery( + $first: Int + $after: CursorKey + $last: Int + $before: CursorKey + ) { node(id: "AZSfP_xAcAC5IAAAAAAltA") { id ... on Organization { @@ -57,21 +62,26 @@ const deletePeopleMutation = graphql` function PeopleListPageContent({ queryRef, onPageChange, - loadQuery + loadQuery, }: { queryRef: PreloadedQuery; - onPageChange: (params: { first?: number; after?: string; last?: number; before?: string }) => void; + onPageChange: (params: { + first?: number; + after?: string; + last?: number; + before?: string; + }) => void; loadQuery: LoadQueryType; }) { const data = usePreloadedQuery(PeopleListPageQuery, queryRef); - const peoples = data.node.peoples?.edges.map(edge => edge?.node) ?? []; + const peoples = data.node.peoples?.edges.map((edge) => edge?.node) ?? []; const pageInfo = data.node.peoples?.pageInfo; const [isPending, startTransition] = useTransition(); const [deletePeople] = useMutation(deletePeopleMutation); - const handlePageChange = (direction: 'prev' | 'next') => { + const handlePageChange = (direction: "prev" | "next") => { startTransition(() => { - if (direction === 'prev') { + if (direction === "prev") { onPageChange({ last: ITEMS_PER_PAGE, before: pageInfo?.startCursor, @@ -96,9 +106,7 @@ function PeopleListPageContent({

@@ -113,14 +121,21 @@ function PeopleListPageContent({ {person?.fullName?.[0]}
-

{person?.fullName}

-

{person?.primaryEmailAddress}

+

+ {person?.fullName} +

+

+ {person?.primaryEmailAddress} +

- {person?.kind === 'EMPLOYEE' ? 'Employee' : - person?.kind === 'CONTRACTOR' ? 'Contractor' : 'Vendor'} + {person?.kind === "EMPLOYEE" + ? "Employee" + : person?.kind === "CONTRACTOR" + ? "Contractor" + : "Vendor"}
@@ -136,20 +151,27 @@ function PeopleListPageContent({ className="text-destructive hover:text-destructive hover:bg-destructive/10" onClick={(e) => { e.preventDefault(); - if (window.confirm('Are you sure you want to delete this person?')) { + if ( + window.confirm( + "Are you sure you want to delete this person?", + ) + ) { deletePeople({ variables: { input: { - peopleId: person.id - } + peopleId: person.id, + }, }, onCompleted() { - loadQuery({ - first: ITEMS_PER_PAGE, - after: undefined, - last: undefined, - before: undefined, - }, { fetchPolicy: 'network-only' }); + loadQuery( + { + first: ITEMS_PER_PAGE, + after: undefined, + last: undefined, + before: undefined, + }, + { fetchPolicy: "network-only" }, + ); }, }); } @@ -164,14 +186,14 @@ function PeopleListPageContent({
@@ -76,7 +95,11 @@ function SettingsPageContent({
{organization.logoUrl ? ( - Logo + Logo ) : (
@@ -95,7 +118,9 @@ function SettingsPageContent({
- Set the name of the organization + + Set the name of the organization +
{organization.name} @@ -115,23 +140,37 @@ function SettingsPageContent({ Workspace members - Manage who has privileged access to your workspace and their permissions. + + Manage who has privileged access to your workspace and their + permissions. +
{members.map((member) => ( -
+
- {member.fullName.charAt(0)} + + {member.fullName.charAt(0)} +
- {member.fullName} - {member.primaryEmailAddress} + + {member.fullName} + + + {member.primaryEmailAddress} +
- {member.role} + + {member.role} +
@@ -152,7 +193,7 @@ function SettingsPageContent({
- ) + ); } function SettingsPageFallback() { @@ -172,7 +213,8 @@ function SettingsPageFallback() { } export default function SettingsPage() { - const [queryRef, loadQuery] = useQueryLoader(settingsPageQuery); + const [queryRef, loadQuery] = + useQueryLoader(settingsPageQuery); useEffect(() => { loadQuery({}); @@ -192,4 +234,4 @@ export default function SettingsPage() { ); -} \ No newline at end of file +} diff --git a/apps/console/src/pages/VendorListPage.tsx b/apps/console/src/pages/VendorListPage.tsx index c42333690..61b6bf1da 100644 --- a/apps/console/src/pages/VendorListPage.tsx +++ b/apps/console/src/pages/VendorListPage.tsx @@ -19,7 +19,12 @@ import { Helmet } from "react-helmet-async"; const ITEMS_PER_PAGE = 20; const vendorListPageQuery = graphql` - query VendorListPageQuery($first: Int, $after: CursorKey, $last: Int, $before: CursorKey) { + query VendorListPageQuery( + $first: Int + $after: CursorKey + $last: Int + $before: CursorKey + ) { node(id: "AZSfP_xAcAC5IAAAAAAltA") { id ... on Organization { @@ -64,34 +69,45 @@ const deleteVendorMutation = graphql` // TODO: Remove this once we have a real list of vendors const vendorsList = [ - { id: '1', name: 'Amazon Web Services', createdAt: new Date().toISOString() }, - { id: '2', name: 'Google Cloud Platform', createdAt: new Date().toISOString() }, - { id: '3', name: 'Microsoft Azure', createdAt: new Date().toISOString() }, - { id: '4', name: 'Salesforce', createdAt: new Date().toISOString() }, - { id: '5', name: 'Slack', createdAt: new Date().toISOString() }, - { id: '6', name: 'Zoom', createdAt: new Date().toISOString() }, - { id: '7', name: 'Dropbox', createdAt: new Date().toISOString() }, - { id: '8', name: 'Trello', createdAt: new Date().toISOString() }, - { id: '9', name: 'Asana', createdAt: new Date().toISOString() }, - { id: '10', name: 'Notion', createdAt: new Date().toISOString() }, - { id: '11', name: 'GitHub', createdAt: new Date().toISOString() }, - { id: '12', name: 'GitLab', createdAt: new Date().toISOString() }, - { id: '13', name: 'Bitbucket', createdAt: new Date().toISOString() }, - { id: '14', name: 'Docker', createdAt: new Date().toISOString() }, - { id: '15', name: 'Kubernetes', createdAt: new Date().toISOString() }, - { id: '16', name: 'Jenkins', createdAt: new Date().toISOString() }, - { id: '17', name: 'CircleCI', createdAt: new Date().toISOString() }, + { id: "1", name: "Amazon Web Services", createdAt: new Date().toISOString() }, + { + id: "2", + name: "Google Cloud Platform", + createdAt: new Date().toISOString(), + }, + { id: "3", name: "Microsoft Azure", createdAt: new Date().toISOString() }, + { id: "4", name: "Salesforce", createdAt: new Date().toISOString() }, + { id: "5", name: "Slack", createdAt: new Date().toISOString() }, + { id: "6", name: "Zoom", createdAt: new Date().toISOString() }, + { id: "7", name: "Dropbox", createdAt: new Date().toISOString() }, + { id: "8", name: "Trello", createdAt: new Date().toISOString() }, + { id: "9", name: "Asana", createdAt: new Date().toISOString() }, + { id: "10", name: "Notion", createdAt: new Date().toISOString() }, + { id: "11", name: "GitHub", createdAt: new Date().toISOString() }, + { id: "12", name: "GitLab", createdAt: new Date().toISOString() }, + { id: "13", name: "Bitbucket", createdAt: new Date().toISOString() }, + { id: "14", name: "Docker", createdAt: new Date().toISOString() }, + { id: "15", name: "Kubernetes", createdAt: new Date().toISOString() }, + { id: "16", name: "Jenkins", createdAt: new Date().toISOString() }, + { id: "17", name: "CircleCI", createdAt: new Date().toISOString() }, ]; -type LoadQueryType = ReturnType>[1]; +type LoadQueryType = ReturnType< + typeof useQueryLoader +>[1]; function VendorListContent({ queryRef, onPageChange, - loadQuery + loadQuery, }: { queryRef: PreloadedQuery; - onPageChange: (params: { first?: number; after?: string; last?: number; before?: string }) => void; + onPageChange: (params: { + first?: number; + after?: string; + last?: number; + before?: string; + }) => void; loadQuery: LoadQueryType; }) { const data = usePreloadedQuery(vendorListPageQuery, queryRef); @@ -102,32 +118,33 @@ function VendorListContent({ const [createVendor] = useMutation(createVendorMutation); const [deleteVendor] = useMutation(deleteVendorMutation); - const vendors = data.node?.vendors?.edges?.map(edge => edge?.node) ?? []; + const vendors = data.node?.vendors?.edges?.map((edge) => edge?.node) ?? []; const pageInfo = data.node?.vendors?.pageInfo; const fuse = new Fuse(vendorsList, { - keys: ['name'], + keys: ["name"], threshold: 0.3, }); - const handlePageChange = (direction: 'next' | 'prev') => { + const handlePageChange = (direction: "next" | "prev") => { if (!pageInfo) return; - - if (direction === 'next' && !pageInfo.hasNextPage) return; - if (direction === 'prev' && !pageInfo.hasPreviousPage) return; - - startTransition(() => { - const params = direction === 'next' - ? { first: ITEMS_PER_PAGE, after: pageInfo.endCursor } - : { last: ITEMS_PER_PAGE, before: pageInfo.startCursor }; - setSearchParams(prev => { - if (direction === 'next') { - prev.set('after', pageInfo.endCursor!); - prev.delete('before'); + if (direction === "next" && !pageInfo.hasNextPage) return; + if (direction === "prev" && !pageInfo.hasPreviousPage) return; + + startTransition(() => { + const params = + direction === "next" + ? { first: ITEMS_PER_PAGE, after: pageInfo.endCursor } + : { last: ITEMS_PER_PAGE, before: pageInfo.startCursor }; + + setSearchParams((prev) => { + if (direction === "next") { + prev.set("after", pageInfo.endCursor!); + prev.delete("before"); } else { - prev.set('before', pageInfo.startCursor!); - prev.delete('after'); + prev.set("before", pageInfo.startCursor!); + prev.delete("after"); } return prev; }); @@ -153,7 +170,9 @@ function VendorListContent({

Add a vendor

-

Search and add new vendors

+

+ Search and add new vendors +

@@ -169,7 +188,9 @@ function VendorListContent({ if (value.trim() === "") { setFilteredVendors([]); } else { - const results = fuse.search(value).map(result => result.item); + const results = fuse + .search(value) + .map((result) => result.item); setFilteredVendors(results); } }} @@ -185,18 +206,21 @@ function VendorListContent({ variables: { input: { organizationId: data.node.id, - name: vendor.name - } + name: vendor.name, + }, }, onCompleted(response: any) { setSearchTerm(""); setFilteredVendors([]); - loadQuery({ - first: ITEMS_PER_PAGE, - after: undefined, - last: undefined, - before: undefined, - }, { fetchPolicy: 'network-only' }); + loadQuery( + { + first: ITEMS_PER_PAGE, + after: undefined, + last: undefined, + before: undefined, + }, + { fetchPolicy: "network-only" }, + ); }, }); }} @@ -219,9 +243,12 @@ function VendorListContent({
{vendors.map((vendor) => ( -
+
- @@ -230,8 +257,13 @@ function VendorListContent({ {vendor?.name?.[0]}
-

{vendor?.name}

-

Vendor since {new Date(vendor?.createdAt).toLocaleDateString()}

+

+ {vendor?.name} +

+

+ Vendor since{" "} + {new Date(vendor?.createdAt).toLocaleDateString()} +

@@ -247,26 +279,33 @@ function VendorListContent({ Not assessed -

Asset Storage Type

-

Questions related to the type of assets stored by the vendor.

+

+ Questions related to the type of assets stored by the vendor. +

- +
- - + +
@@ -72,7 +90,8 @@ function VendorOverviewPageContent({

Data Storage and Handling

- Questions related to the vendor's data storage and handling practices. + Questions related to the vendor's data storage and handling + practices.

@@ -80,29 +99,43 @@ function VendorOverviewPageContent({
- +
- - + +
- +
- - + +
- +
@@ -141,9 +174,12 @@ function VendorOverviewPageContent({
-

Vendor Reliability and Continuity

+

+ Vendor Reliability and Continuity +

- Evaluating the vendor's reliability and plans for business continuity. + Evaluating the vendor's reliability and plans for business + continuity.

@@ -151,7 +187,9 @@ function VendorOverviewPageContent({
- +
@@ -160,7 +198,9 @@ function VendorOverviewPageContent({
- +
@@ -176,23 +216,37 @@ function VendorOverviewPageContent({
- +
- - + +
- +
- - - + + +
@@ -203,18 +257,26 @@ function VendorOverviewPageContent({

Risk level

-

Based on the responses, the suggested risk level is medium.

+

+ Based on the responses, the suggested risk level is medium. +

- - - + + +
- ) + ); } function VendorOverviewPageFallback() { @@ -235,7 +297,9 @@ function VendorOverviewPageFallback() { export default function VendorOverviewPage() { const { vendorId } = useParams(); - const [queryRef, loadQuery] = useQueryLoader(VendorOverviewPageQuery); + const [queryRef, loadQuery] = useQueryLoader( + VendorOverviewPageQuery, + ); useEffect(() => { loadQuery({ vendorId: vendorId! }); @@ -255,4 +319,4 @@ export default function VendorOverviewPage() { ); -} \ No newline at end of file +}