Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

style: hyperlinks in tables with enumerables and badges

Brad Barbin0a4f397c996b
diff --git a/apps/erp/app/components/Hyperlink.tsx b/apps/erp/app/components/Hyperlink.tsx
index 5aae94fd86..f0873024f8 100644
--- a/apps/erp/app/components/Hyperlink.tsx
+++ b/apps/erp/app/components/Hyperlink.tsx
@@ -15,16 +15,16 @@ const Hyperlink = ({
<Link
prefetch="intent"
className={cn(
- "group/hyperlink text-foreground font-medium cursor-pointer flex flex-row items-center justify-between gap-2",
+ "group/hyperlink text-foreground font-medium cursor-pointer flex flex-row items-center justify-start gap-3",
className
)}
{...props}
>
- <span className="flex-1">{children}</span>
+ <span>{children}</span>
<Button
leftIcon={<LuSquareArrowOutUpRight />}
variant="secondary"
- className="opacity-0 transition-opacity duration-200 group-hover/hyperlink:opacity-100 no-underline"
+ className="flex-shrink-0 opacity-0 transition-opacity duration-200 group-hover/hyperlink:opacity-100 no-underline"
size="sm"
>
Open
diff --git a/apps/erp/app/components/Layout/Navigation/CollapsibleSidebar.tsx b/apps/erp/app/components/Layout/Navigation/CollapsibleSidebar.tsx
index 2e0fe81aa4..44993d3432 100644
--- a/apps/erp/app/components/Layout/Navigation/CollapsibleSidebar.tsx
+++ b/apps/erp/app/components/Layout/Navigation/CollapsibleSidebar.tsx
@@ -86,7 +86,7 @@ export const CollapsibleSidebar = ({
variants={variants}
className="relative flex h-[calc(100dvh-49px)]"
>
- <div className="h-full w-full overflow-y-scroll scrollbar-thin bg-background border-r border-border">
+ <div className="h-full w-full overflow-y-scroll scrollbar-thin bg-card border-r border-border">
{isOpen ? children : null}
</div>
</motion.div>
diff --git a/apps/erp/app/components/Layout/Navigation/PrimaryNavigation.tsx b/apps/erp/app/components/Layout/Navigation/PrimaryNavigation.tsx
index d1b0fb9643..a048f7c3a4 100644
--- a/apps/erp/app/components/Layout/Navigation/PrimaryNavigation.tsx
+++ b/apps/erp/app/components/Layout/Navigation/PrimaryNavigation.tsx
@@ -30,7 +30,7 @@ const PrimaryNavigation = () => {
<nav
data-state={navigationPanel.isOpen ? "expanded" : "collapsed"}
className={cn(
- "bg-background py-2 group z-10 h-full w-14 data-[state=expanded]:w-[13rem]",
+ "bg-card py-2 group z-10 h-full w-14 data-[state=expanded]:w-[13rem]",
"border-r border-border data-[state=expanded]:shadow-xl",
"transition-width duration-200",
"hide-scrollbar flex flex-col justify-between overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent"
diff --git a/apps/erp/app/components/Layout/Topbar/Topbar.tsx b/apps/erp/app/components/Layout/Topbar/Topbar.tsx
index 66111abef0..a979baac03 100644
--- a/apps/erp/app/components/Layout/Topbar/Topbar.tsx
+++ b/apps/erp/app/components/Layout/Topbar/Topbar.tsx
@@ -13,11 +13,11 @@ const Topbar = () => {
const notificationsKey = `${user.id}:${user.company.id}`;
return (
- <div className="flex bg-background text-foreground border-b border-border px-4 top-0 sticky z-10 items-center">
+ <div className="grid grid-cols-[1fr_200px_1fr] bg-card text-foreground border-b border-border px-4 top-0 sticky z-10 items-center">
<div className="flex-1">
<Breadcrumbs />
</div>
- <div className="flex-1 flex justify-center">
+ <div className="flex justify-center">
{permissions.is("employee") ? <Search /> : <div />}
</div>
<HStack spacing={2} className="flex-1 justify-end py-2">
diff --git a/apps/erp/app/modules/items/ui/UnitOfMeasure/UnitOfMeasuresTable.tsx b/apps/erp/app/modules/items/ui/UnitOfMeasure/UnitOfMeasuresTable.tsx
index 7a5d8643d7..02cb6518e8 100644
--- a/apps/erp/app/modules/items/ui/UnitOfMeasure/UnitOfMeasuresTable.tsx
+++ b/apps/erp/app/modules/items/ui/UnitOfMeasure/UnitOfMeasuresTable.tsx
@@ -3,7 +3,7 @@ import { useNavigate } from "@remix-run/react";
import type { ColumnDef } from "@tanstack/react-table";
import { memo, useCallback, useMemo } from "react";
import { LuBookMarked, LuCode, LuPencil, LuTrash } from "react-icons/lu";
-import { New, Table } from "~/components";
+import { Hyperlink, New, Table } from "~/components";
import { Enumerable } from "~/components/Enumerable";
import { usePermissions, useUrlParams } from "~/hooks";
import { useCustomColumns } from "~/hooks/useCustomColumns";
@@ -28,11 +28,9 @@ const UnitOfMeasuresTable = memo(
accessorKey: "name",
header: "Name",
cell: ({ row }) => (
- <Enumerable
- onClick={() => navigate(row.original.id)}
- value={row.original.name}
- className="cursor-pointer"
- />
+ <Hyperlink to={row.original.id}>
+ <Enumerable value={row.original.name} />
+ </Hyperlink>
),
meta: {
icon: <LuBookMarked />,
@@ -48,7 +46,7 @@ const UnitOfMeasuresTable = memo(
},
];
return [...defaultColumns, ...customColumns];
- }, [navigate, customColumns]);
+ }, [customColumns]);
const renderContextMenu = useCallback(
(row: (typeof data)[number]) => {
diff --git a/apps/erp/app/modules/people/ui/Departments/DepartmentsTable.tsx b/apps/erp/app/modules/people/ui/Departments/DepartmentsTable.tsx
index b798b177e7..47f6eb6194 100644
--- a/apps/erp/app/modules/people/ui/Departments/DepartmentsTable.tsx
+++ b/apps/erp/app/modules/people/ui/Departments/DepartmentsTable.tsx
@@ -3,7 +3,7 @@ import { useNavigate } from "@remix-run/react";
import type { ColumnDef } from "@tanstack/react-table";
import { memo, useCallback, useMemo } from "react";
import { LuBuilding, LuPencil, LuTrash } from "react-icons/lu";
-import { New, Table } from "~/components";
+import { Hyperlink, New, Table } from "~/components";
import { Enumerable } from "~/components/Enumerable";
import { usePermissions, useUrlParams } from "~/hooks";
import { useCustomColumns } from "~/hooks/useCustomColumns";
@@ -35,11 +35,9 @@ const DepartmentsTable = memo(({ data, count }: DepartmentsTableProps) => {
accessorKey: "name",
header: "Department",
cell: ({ row }) => (
- <Enumerable
- value={row.original.name}
- onClick={() => navigate(row.original.id)}
- className="cursor-pointer"
- />
+ <Hyperlink to={row.original.id}>
+ <Enumerable value={row.original.name} />
+ </Hyperlink>
),
meta: {
icon: <LuBuilding />,
@@ -60,7 +58,7 @@ const DepartmentsTable = memo(({ data, count }: DepartmentsTableProps) => {
},
];
return [...defaultColumns, ...customColumns];
- }, [navigate, customColumns]);
+ }, [customColumns]);
const renderContextMenu = useCallback(
(row: (typeof data)[number]) => {
diff --git a/apps/erp/app/modules/people/ui/Holidays/HolidaysTable.tsx b/apps/erp/app/modules/people/ui/Holidays/HolidaysTable.tsx
index 3f5b518d4b..56d29472fe 100644
--- a/apps/erp/app/modules/people/ui/Holidays/HolidaysTable.tsx
+++ b/apps/erp/app/modules/people/ui/Holidays/HolidaysTable.tsx
@@ -1,4 +1,5 @@
import { MenuIcon, MenuItem } from "@carbon/react";
+import { formatDate } from "@carbon/utils";
import { useNavigate } from "@remix-run/react";
import type { ColumnDef } from "@tanstack/react-table";
import { memo, useCallback, useMemo } from "react";
@@ -57,7 +58,7 @@ const HolidaysTable = memo(({ data, count, years }: HolidaysTableProps) => {
{
accessorKey: "date",
header: "Date",
- cell: (item) => item.getValue<string>(),
+ cell: (item) => formatDate(item.getValue<string>()),
meta: {
icon: <LuCalendarDays />,
},
diff --git a/apps/erp/app/modules/production/ui/ScrapReasons/ScrapReasonsTable.tsx b/apps/erp/app/modules/production/ui/ScrapReasons/ScrapReasonsTable.tsx
index b2665c84a1..0c5e5e4588 100644
--- a/apps/erp/app/modules/production/ui/ScrapReasons/ScrapReasonsTable.tsx
+++ b/apps/erp/app/modules/production/ui/ScrapReasons/ScrapReasonsTable.tsx
@@ -3,7 +3,7 @@ import { useNavigate } from "@remix-run/react";
import type { ColumnDef } from "@tanstack/react-table";
import { memo, useCallback, useMemo } from "react";
import { LuPencil, LuTrash } from "react-icons/lu";
-import { New, Table } from "~/components";
+import { Hyperlink, New, Table } from "~/components";
import { Enumerable } from "~/components/Enumerable";
import { usePermissions, useUrlParams } from "~/hooks";
import { useCustomColumns } from "~/hooks/useCustomColumns";
@@ -27,11 +27,9 @@ const ScrapReasonsTable = memo(({ data, count }: ScrapReasonsTableProps) => {
accessorKey: "name",
header: "Scrap Reason",
cell: ({ row }) => (
- <Enumerable
- value={row.original.name}
- onClick={() => navigate(row.original.id)}
- className="cursor-pointer"
- />
+ <Hyperlink to={row.original.id}>
+ <Enumerable value={row.original.name} />
+ </Hyperlink>
),
meta: {
icon: <LuTrash />,
@@ -39,7 +37,7 @@ const ScrapReasonsTable = memo(({ data, count }: ScrapReasonsTableProps) => {
},
];
return [...defaultColumns, ...customColumns];
- }, [navigate, customColumns]);
+ }, [customColumns]);
const renderContextMenu = useCallback(
(row: ScrapReason) => {
diff --git a/apps/erp/app/modules/purchasing/ui/SupplierStatuses/SupplierStatusesTable.tsx b/apps/erp/app/modules/purchasing/ui/SupplierStatuses/SupplierStatusesTable.tsx
index 166f944a80..c6fdf0b317 100644
--- a/apps/erp/app/modules/purchasing/ui/SupplierStatuses/SupplierStatusesTable.tsx
+++ b/apps/erp/app/modules/purchasing/ui/SupplierStatuses/SupplierStatusesTable.tsx
@@ -4,7 +4,7 @@ import type { ColumnDef } from "@tanstack/react-table";
import { memo, useCallback, useMemo } from "react";
import { BsPeopleFill } from "react-icons/bs";
import { LuPencil, LuStar, LuTrash } from "react-icons/lu";
-import { New, Table } from "~/components";
+import { Hyperlink, New, Table } from "~/components";
import { Enumerable } from "~/components/Enumerable";
import { usePermissions, useUrlParams } from "~/hooks";
import { useCustomColumns } from "~/hooks/useCustomColumns";
@@ -29,13 +29,9 @@ const SupplierStatusesTable = memo(
accessorKey: "name",
header: "Supplier Status",
cell: ({ row }) => (
- <Enumerable
- value={row.original.name}
- onClick={() =>
- navigate(`${row.original.id}?${params.toString()}`)
- }
- className="cursor-pointer"
- />
+ <Hyperlink to={`${row.original.id}?${params.toString()}`}>
+ <Enumerable value={row.original.name} />
+ </Hyperlink>
),
meta: {
icon: <LuStar />,
@@ -43,7 +39,7 @@ const SupplierStatusesTable = memo(
},
];
return [...defaultColumns, ...customColumns];
- }, [navigate, params, customColumns]);
+ }, [params, customColumns]);
const renderContextMenu = useCallback(
(row: SupplierStatus) => {
diff --git a/apps/erp/app/modules/resources/ui/Abilities/AbilitiesTable.tsx b/apps/erp/app/modules/resources/ui/Abilities/AbilitiesTable.tsx
index f5a29196c9..33147e1915 100644
--- a/apps/erp/app/modules/resources/ui/Abilities/AbilitiesTable.tsx
+++ b/apps/erp/app/modules/resources/ui/Abilities/AbilitiesTable.tsx
@@ -3,7 +3,7 @@ import { useNavigate } from "@remix-run/react";
import type { ColumnDef } from "@tanstack/react-table";
import { memo, useCallback, useMemo } from "react";
import { LuBrain, LuClock, LuPencil, LuTrash, LuUsers } from "react-icons/lu";
-import { EmployeeAvatarGroup, New, Table } from "~/components";
+import { EmployeeAvatarGroup, Hyperlink, New, Table } from "~/components";
import { usePermissions, useUrlParams } from "~/hooks";
import { path } from "~/utils/path";
import type { Abilities, AbilityDatum } from "../../types";
@@ -36,13 +36,11 @@ const AbilitiesTable = memo(({ data, count }: AbilitiesTableProps) => {
accessorKey: "name",
header: "Ability",
cell: ({ row }) => (
- <Badge
- variant="secondary"
- onClick={() => navigate(path.to.ability(row.original.id))}
- className="cursor-pointer"
- >
- {row.original.name}
- </Badge>
+ <Hyperlink to={path.to.ability(row.original.id)}>
+ <Badge variant="secondary" className="cursor-pointer">
+ {row.original.name}
+ </Badge>
+ </Hyperlink>
),
meta: {
icon: <LuBrain />,
@@ -70,7 +68,7 @@ const AbilitiesTable = memo(({ data, count }: AbilitiesTableProps) => {
},
},
];
- }, [navigate]);
+ }, []);
const renderContextMenu = useCallback(
(row: (typeof rows)[number]) => {
diff --git a/apps/erp/app/modules/resources/ui/Locations/LocationsTable.tsx b/apps/erp/app/modules/resources/ui/Locations/LocationsTable.tsx
index 964e6587e8..ecd28bcef7 100644
--- a/apps/erp/app/modules/resources/ui/Locations/LocationsTable.tsx
+++ b/apps/erp/app/modules/resources/ui/Locations/LocationsTable.tsx
@@ -13,7 +13,7 @@ import {
LuTrash,
LuUser,
} from "react-icons/lu";
-import { EmployeeAvatar, New, Table } from "~/components";
+import { EmployeeAvatar, Hyperlink, New, Table } from "~/components";
import { Enumerable } from "~/components/Enumerable";
import { usePermissions, useUrlParams } from "~/hooks";
import { useCustomColumns } from "~/hooks/useCustomColumns";
@@ -43,11 +43,9 @@ const LocationsTable = memo(({ data, count }: LocationsTableProps) => {
accessorKey: "name",
header: "Location",
cell: ({ row }) => (
- <Enumerable
- value={row.original.name}
- onClick={() => navigate(row.original.id)}
- className="cursor-pointer"
- />
+ <Hyperlink to={row.original.id}>
+ <Enumerable value={row.original.name} className="cursor-pointer" />
+ </Hyperlink>
),
meta: {
icon: <LuMapPin />,
@@ -126,7 +124,7 @@ const LocationsTable = memo(({ data, count }: LocationsTableProps) => {
},
];
return [...defaultColumns, ...customColumns];
- }, [people, customColumns, navigate]);
+ }, [people, customColumns]);
const renderContextMenu = useCallback(
(row: (typeof data)[number]) => {
diff --git a/apps/erp/app/modules/resources/ui/Processes/ProcessesTable.tsx b/apps/erp/app/modules/resources/ui/Processes/ProcessesTable.tsx
index 8c6141d1be..f24b18216f 100644
--- a/apps/erp/app/modules/resources/ui/Processes/ProcessesTable.tsx
+++ b/apps/erp/app/modules/resources/ui/Processes/ProcessesTable.tsx
@@ -22,7 +22,7 @@ import {
LuUser,
LuUsers,
} from "react-icons/lu";
-import { EmployeeAvatar, New, Table } from "~/components";
+import { EmployeeAvatar, Hyperlink, New, Table } from "~/components";
import { Enumerable } from "~/components/Enumerable";
import { usePermissions, useUrlParams } from "~/hooks";
import { useCustomColumns } from "~/hooks/useCustomColumns";
@@ -59,16 +59,19 @@ const ProcessesTable = memo(({ data, count }: ProcessesTableProps) => {
cell: ({ row }) =>
row.original.processType === "Outside" ||
((row.original.workCenters as any[]) ?? []).length > 0 ? (
- <Enumerable
- value={row.original.name}
- onClick={() => navigate(row.original.id!)}
- className="cursor-pointer"
- />
+ <Hyperlink to={row.original.id!}>
+ <Enumerable
+ value={row.original.name}
+ className="cursor-pointer"
+ />
+ </Hyperlink>
) : (
- <HStack onClick={() => navigate(row.original.id!)} spacing={2}>
- <LuTriangleAlert />
- <span>{row.original.name}</span>
- </HStack>
+ <Hyperlink to={row.original.id!}>
+ <HStack spacing={2}>
+ <LuTriangleAlert />
+ <span>{row.original.name}</span>
+ </HStack>
+ </Hyperlink>
),
meta: {
icon: <LuCog />,
diff --git a/apps/erp/app/modules/resources/ui/WorkCenters/WorkCentersTable.tsx b/apps/erp/app/modules/resources/ui/WorkCenters/WorkCentersTable.tsx
index 4d5f376f01..0025039e23 100644
--- a/apps/erp/app/modules/resources/ui/WorkCenters/WorkCentersTable.tsx
+++ b/apps/erp/app/modules/resources/ui/WorkCenters/WorkCentersTable.tsx
@@ -14,7 +14,7 @@ import {
LuUser,
LuWrench,
} from "react-icons/lu";
-import { EmployeeAvatar, New, Table } from "~/components";
+import { EmployeeAvatar, Hyperlink, New, Table } from "~/components";
import { Enumerable } from "~/components/Enumerable";
import { ConfirmDelete } from "~/components/Modals";
import { useCurrencyFormatter, usePermissions, useUrlParams } from "~/hooks";
@@ -70,16 +70,19 @@ const WorkCentersTable = memo(
cell: ({ row }) => (
<HStack>
{((row.original.processes as any[]) ?? []).length > 0 ? (
- <Enumerable
- value={row.original.name}
- onClick={() => navigate(row.original.id!)}
- className="cursor-pointer"
- />
+ <Hyperlink to={row.original.id!}>
+ <Enumerable
+ value={row.original.name}
+ className="cursor-pointer"
+ />
+ </Hyperlink>
) : (
- <HStack onClick={() => navigate(row.original.id!)} spacing={2}>
- <LuTriangleAlert />
- <span>{row.original.name}</span>
- </HStack>
+ <Hyperlink to={row.original.id!}>
+ <HStack spacing={2}>
+ <LuTriangleAlert />
+ <span>{row.original.name}</span>
+ </HStack>
+ </Hyperlink>
)}
{row.original.requiredAbilityId && (
diff --git a/apps/erp/app/modules/sales/sales.models.ts b/apps/erp/app/modules/sales/sales.models.ts
index 9705d5cf46..226f832409 100644
--- a/apps/erp/app/modules/sales/sales.models.ts
+++ b/apps/erp/app/modules/sales/sales.models.ts
@@ -25,7 +25,7 @@ export const KPIs = [
},
{
key: "salesOrderRevenue",
- label: "Sales Order Revenue",
+ label: "Sales",
},
// {
// key: "turnaroundTime",
diff --git a/apps/erp/app/modules/sales/ui/CustomerStatuses/CustomerStatusesTable.tsx b/apps/erp/app/modules/sales/ui/CustomerStatuses/CustomerStatusesTable.tsx
index 19b59d88c7..fbe75b5710 100644
--- a/apps/erp/app/modules/sales/ui/CustomerStatuses/CustomerStatusesTable.tsx
+++ b/apps/erp/app/modules/sales/ui/CustomerStatuses/CustomerStatusesTable.tsx
@@ -4,7 +4,7 @@ import type { ColumnDef } from "@tanstack/react-table";
import { memo, useCallback, useMemo } from "react";
import { BsPeopleFill } from "react-icons/bs";
import { LuPencil, LuStar, LuTrash } from "react-icons/lu";
-import { New, Table } from "~/components";
+import { Hyperlink, New, Table } from "~/components";
import { Enumerable } from "~/components/Enumerable";
import { usePermissions, useUrlParams } from "~/hooks";
import { useCustomColumns } from "~/hooks/useCustomColumns";
@@ -29,11 +29,9 @@ const CustomerStatusesTable = memo(
accessorKey: "name",
header: "Customer Status",
cell: ({ row }) => (
- <Enumerable
- value={row.original.name}
- onClick={() => navigate(row.original.id)}
- className="cursor-pointer"
- />
+ <Hyperlink to={row.original.id}>
+ <Enumerable value={row.original.name} />
+ </Hyperlink>
),
meta: {
icon: <LuStar />,
@@ -41,7 +39,7 @@ const CustomerStatusesTable = memo(
},
];
return [...defaultColumns, ...customColumns];
- }, [navigate, customColumns]);
+ }, [customColumns]);
const renderContextMenu = useCallback(
(row: CustomerStatus) => {
diff --git a/apps/erp/app/modules/sales/ui/NoQuoteReasons/NoQuoteReasonsTable.tsx b/apps/erp/app/modules/sales/ui/NoQuoteReasons/NoQuoteReasonsTable.tsx
index 2be82ae88d..c258dd1068 100644
--- a/apps/erp/app/modules/sales/ui/NoQuoteReasons/NoQuoteReasonsTable.tsx
+++ b/apps/erp/app/modules/sales/ui/NoQuoteReasons/NoQuoteReasonsTable.tsx
@@ -3,7 +3,7 @@ import { useNavigate } from "@remix-run/react";
import type { ColumnDef } from "@tanstack/react-table";
import { memo, useCallback, useMemo } from "react";
import { LuBookMarked, LuPencil, LuTrash } from "react-icons/lu";
-import { New, Table } from "~/components";
+import { Hyperlink, New, Table } from "~/components";
import { Enumerable } from "~/components/Enumerable";
import { usePermissions, useUrlParams } from "~/hooks";
import { useCustomColumns } from "~/hooks/useCustomColumns";
@@ -28,11 +28,9 @@ const NoQuoteReasonsTable = memo(
accessorKey: "name",
header: "Reason",
cell: ({ row }) => (
- <Enumerable
- value={row.original.name}
- onClick={() => navigate(row.original.id)}
- className="cursor-pointer"
- />
+ <Hyperlink to={row.original.id}>
+ <Enumerable value={row.original.name} />
+ </Hyperlink>
),
meta: {
icon: <LuBookMarked />,
@@ -40,7 +38,7 @@ const NoQuoteReasonsTable = memo(
},
];
return [...defaultColumns, ...customColumns];
- }, [navigate, customColumns]);
+ }, [customColumns]);
const renderContextMenu = useCallback(
(row: NoQuoteReason) => {
diff --git a/apps/erp/app/modules/users/ui/EmployeeTypes/EmployeeTypesTable.tsx b/apps/erp/app/modules/users/ui/EmployeeTypes/EmployeeTypesTable.tsx
index 64aee7cb0a..1ac6a8f00b 100644
--- a/apps/erp/app/modules/users/ui/EmployeeTypes/EmployeeTypesTable.tsx
+++ b/apps/erp/app/modules/users/ui/EmployeeTypes/EmployeeTypesTable.tsx
@@ -4,7 +4,7 @@ import type { ColumnDef } from "@tanstack/react-table";
import { memo, useCallback, useMemo } from "react";
import { BsPeopleFill } from "react-icons/bs";
import { LuPencil, LuTrash, LuUsers } from "react-icons/lu";
-import { New, Table } from "~/components";
+import { Hyperlink, New, Table } from "~/components";
import { Enumerable } from "~/components/Enumerable";
import { usePermissions, useUrlParams } from "~/hooks";
import type { EmployeeType } from "~/modules/users";
@@ -32,18 +32,19 @@ const EmployeeTypesTable = memo(({ data, count }: EmployeeTypesTableProps) => {
className="cursor-not-allowed"
/>
) : (
- <Enumerable
- value={row.original.name}
- onClick={() => navigate(row.original.id)}
- className="cursor-pointer"
- />
+ <Hyperlink to={row.original.id}>
+ <Enumerable
+ value={row.original.name}
+ className="cursor-pointer"
+ />
+ </Hyperlink>
),
meta: {
icon: <LuUsers />,
},
},
];
- }, [navigate]);
+ }, []);
const renderContextMenu = useCallback(
(row: (typeof data)[number]) => {
diff --git a/apps/erp/app/modules/users/ui/Groups/GroupsTable.tsx b/apps/erp/app/modules/users/ui/Groups/GroupsTable.tsx
index 285aace1c4..3786b3f470 100644
--- a/apps/erp/app/modules/users/ui/Groups/GroupsTable.tsx
+++ b/apps/erp/app/modules/users/ui/Groups/GroupsTable.tsx
@@ -9,7 +9,7 @@ import { useNavigate } from "@remix-run/react";
import type { ColumnDef } from "@tanstack/react-table";
import { memo, useCallback, useMemo } from "react";
import { LuBookMarked, LuPencil, LuTrash, LuUsers } from "react-icons/lu";
-import { Avatar, New, Table } from "~/components";
+import { Avatar, Hyperlink, New, Table } from "~/components";
import { usePermissions, useUrlParams } from "~/hooks";
import type { Group } from "~/modules/users";
import { path } from "~/utils/path";
@@ -45,7 +45,16 @@ const GroupsTable = memo(({ data, count }: GroupsTableProps) => {
{
accessorKey: "name",
header: "Group Name",
- cell: (item) => item.getValue(),
+ cell: ({ row }) =>
+ row.original.isEmployeeTypeGroup ||
+ row.original.isCustomerTypeGroup ||
+ row.original.isSupplierTypeGroup ? (
+ <span>{row.original.name}</span>
+ ) : (
+ <Hyperlink to={path.to.group(row.original.id)}>
+ {row.original.name}
+ </Hyperlink>
+ ),
meta: {
icon: <LuBookMarked />,
},
diff --git a/apps/erp/app/routes/x+/account+/_layout.tsx b/apps/erp/app/routes/x+/account+/_layout.tsx
index 3b570b2d55..5907df75fe 100644
--- a/apps/erp/app/routes/x+/account+/_layout.tsx
+++ b/apps/erp/app/routes/x+/account+/_layout.tsx
@@ -25,10 +25,10 @@ export default function AccountRoute() {
return (
<VStack
- className="flex w-full h-full items-center justify-start bg-background"
+ className="flex w-full h-full items-center justify-start bg-card"
spacing={4}
>
- <div className="flex bg-background border-b border-border py-8 px-2 w-full justify-center">
+ <div className="flex bg-card border-b border-border py-8 px-2 w-full justify-center">
<div className="w-full max-w-[60rem]">
<Heading size="h3">Account Settings</Heading>
</div>
diff --git a/apps/erp/app/routes/x+/customer+/$customerId.tsx b/apps/erp/app/routes/x+/customer+/$customerId.tsx
index 6f11f8eb55..4e2b837298 100644
--- a/apps/erp/app/routes/x+/customer+/$customerId.tsx
+++ b/apps/erp/app/routes/x+/customer+/$customerId.tsx
@@ -4,6 +4,7 @@ import { flash } from "@carbon/auth/session.server";
import { Outlet } from "@remix-run/react";
import type { LoaderFunctionArgs } from "@vercel/remix";
import { json, redirect } from "@vercel/remix";
+import { usePermissions } from "~/hooks";
import {
getCustomer,
getCustomerContacts,
@@ -13,6 +14,7 @@ import { CustomerHeader, CustomerSidebar } from "~/modules/sales/ui/Customer";
import { getTagsList } from "~/modules/shared";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
+import { cn } from "../../../../../../packages/react/src/utils/cn";
export const handle: Handle = {
breadcrumb: "Customers",
@@ -53,11 +55,17 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
}
export default function CustomerRoute() {
+ const permissions = usePermissions();
+ const isEmployee = permissions.is("employee");
return (
<>
<CustomerHeader />
- <div className="grid grid-cols-1 md:grid-cols-[1fr_4fr] h-full w-full gap-4">
- <CustomerSidebar />
+ <div
+ className={cn("grid grid-cols-1 h-full w-full gap-4", {
+ "md:grid-cols-[1fr_4fr]": isEmployee,
+ })}
+ >
+ {isEmployee && <CustomerSidebar />}
<Outlet />
</div>
</>
diff --git a/apps/erp/app/routes/x+/resources+/ability.$abilityId.tsx b/apps/erp/app/routes/x+/resources+/ability.$abilityId.tsx
index f669da7860..f0b13e8462 100644
--- a/apps/erp/app/routes/x+/resources+/ability.$abilityId.tsx
+++ b/apps/erp/app/routes/x+/resources+/ability.$abilityId.tsx
@@ -176,7 +176,7 @@ export default function AbilitiesRoute() {
return (
<>
- <div className="bg-background w-full relative">
+ <div className="bg-card w-full relative border-b">
<HStack className="w-full justify-between p-4">
{editingTitle.isOpen ? (
<ValidatedForm
diff --git a/packages/react/src/Button.tsx b/packages/react/src/Button.tsx
index e9282436cc..636ce34282 100644
--- a/packages/react/src/Button.tsx
+++ b/packages/react/src/Button.tsx
@@ -19,7 +19,7 @@ export const buttonVariants = cva(
primary:
"bg-gradient-to-br from-primary/90 to-primary text-primary-foreground hover:bg-primary/90 saturate-[105%] shadow-[inset_0px_0.5px_0px_rgb(255_255_255_/_0.32)]",
active:
- "bg-active text-active-foreground hover:bg-active/90 hover:text-active-foreground shadow-button-base hover:before:opacity-100 dark:hover:before:opacity-50",
+ "bg-active text-active-foreground hover:bg-active/90 hover:text-active-foreground shadow-button-base",
secondary:
"bg-white dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 shadow-button-base hover:before:opacity-100 dark:hover:before:opacity-50",
solid:
diff --git a/packages/utils/src/themes.ts b/packages/utils/src/themes.ts
index bd138a3b21..1702594ee6 100644
--- a/packages/utils/src/themes.ts
+++ b/packages/utils/src/themes.ts
@@ -439,9 +439,9 @@ export const themes = [
"active-foreground": "263 41 98%",
secondary: "215 27.9% 16.9%",
"secondary-foreground": "210 20% 98%",
- muted: "263 27.9% 16.9%",
+ muted: "263 27.9% 12.9%",
"muted-foreground": "217.9 10.6% 64.9%",
- accent: "263 27.9% 16.9%",
+ accent: "263 27.9% 12.9%",
"accent-foreground": "210 20% 98%",
destructive: "0 62.8% 30.6%",
"destructive-foreground": "210 20% 98%",