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: update tracking type icon

Brad Barbina3db47ea5a4f
diff --git a/apps/carbon/app/modules/items/ui/Consumables/ConsumableProperties.tsx b/apps/carbon/app/modules/items/ui/Consumables/ConsumableProperties.tsx
index 9ebeced09e..217be93145 100644
--- a/apps/carbon/app/modules/items/ui/Consumables/ConsumableProperties.tsx
+++ b/apps/carbon/app/modules/items/ui/Consumables/ConsumableProperties.tsx
@@ -1,4 +1,5 @@
import {
+ Badge,
Button,
Enumerable,
HStack,
@@ -16,6 +17,7 @@ import { useRouteData } from "~/hooks";
import type { ListItem } from "~/types";
import { path } from "~/utils/path";
import type { BuyMethod, Consumable, PickMethod } from "../../types";
+import { MethodIcon, TrackingTypeIcon } from "../Item";
import { MethodBadge } from "../Item/MethodBadge";
const ConsumableProperties = () => {
@@ -104,12 +106,30 @@ const ConsumableProperties = () => {
<VStack spacing={2}>
<h3 className="text-xs text-muted-foreground">Tracking Type</h3>
- <Enumerable
- className={cn(
- routeData?.consumableSummary?.active === false && "opacity-50"
- )}
- value={routeData?.consumableSummary?.itemTrackingType ?? null}
- />
+ <Badge variant="secondary">
+ <TrackingTypeIcon
+ type={routeData?.consumableSummary?.itemTrackingType!}
+ className={cn(
+ "mr-2",
+ routeData?.consumableSummary?.active === false && "opacity-50"
+ )}
+ />
+ <span>{routeData?.consumableSummary?.itemTrackingType!}</span>
+ </Badge>
+ </VStack>
+
+ <VStack spacing={2}>
+ <h3 className="text-xs text-muted-foreground">Default Method Type</h3>
+ <Badge variant="secondary">
+ <MethodIcon
+ type={routeData?.consumableSummary?.defaultMethodType!}
+ className={cn(
+ "mr-2",
+ routeData?.consumableSummary?.active === false && "opacity-50"
+ )}
+ />
+ <span>{routeData?.consumableSummary?.defaultMethodType!}</span>
+ </Badge>
</VStack>
<VStack spacing={2}>
diff --git a/apps/carbon/app/modules/items/ui/Consumables/ConsumablesTable.tsx b/apps/carbon/app/modules/items/ui/Consumables/ConsumablesTable.tsx
index 878f9d9f55..201fe466a2 100644
--- a/apps/carbon/app/modules/items/ui/Consumables/ConsumablesTable.tsx
+++ b/apps/carbon/app/modules/items/ui/Consumables/ConsumablesTable.tsx
@@ -1,4 +1,4 @@
-import { Checkbox, Enumerable, MenuIcon, MenuItem } from "@carbon/react";
+import { Badge, Checkbox, MenuIcon, MenuItem } from "@carbon/react";
import { formatDate } from "@carbon/utils";
import { useNavigate } from "@remix-run/react";
import type { ColumnDef } from "@tanstack/react-table";
@@ -8,7 +8,12 @@ import { EmployeeAvatar, Hyperlink, New, Table } from "~/components";
import { usePermissions, useUrlParams } from "~/hooks";
import { useCustomColumns } from "~/hooks/useCustomColumns";
import type { Consumable } from "~/modules/items";
-import { itemTrackingTypes, methodType } from "~/modules/items";
+import {
+ MethodIcon,
+ TrackingTypeIcon,
+ itemTrackingTypes,
+ methodType,
+} from "~/modules/items";
import { usePeople } from "~/stores";
import type { ListItem } from "~/types";
import { path } from "~/utils/path";
@@ -51,13 +56,26 @@ const ConsumablesTable = memo(
{
accessorKey: "itemTrackingType",
header: "Tracking",
- cell: (item) => <Enumerable value={item.getValue<string>()} />,
+ cell: (item) => (
+ <Badge variant="secondary">
+ <TrackingTypeIcon
+ type={item.getValue<string>()}
+ className="mr-2"
+ />
+ <span>{item.getValue<string>()}</span>
+ </Badge>
+ ),
meta: {
filter: {
type: "static",
options: itemTrackingTypes.map((type) => ({
value: type,
- label: <Enumerable value={type} />,
+ label: (
+ <Badge variant="secondary">
+ <TrackingTypeIcon type={type} className="mr-2" />
+ <span>{type}</span>
+ </Badge>
+ ),
})),
},
},
@@ -65,13 +83,23 @@ const ConsumablesTable = memo(
{
accessorKey: "defaultMethodType",
header: "Default Method",
- cell: (item) => <Enumerable value={item.getValue<string>()} />,
+ cell: (item) => (
+ <Badge variant="secondary">
+ <MethodIcon type={item.getValue<string>()} className="mr-2" />
+ <span>{item.getValue<string>()}</span>
+ </Badge>
+ ),
meta: {
filter: {
type: "static",
options: methodType.map((value) => ({
value,
- label: <Enumerable value={value} />,
+ label: (
+ <Badge variant="secondary">
+ <MethodIcon type={value} className="mr-2" />
+ <span>{value}</span>
+ </Badge>
+ ),
})),
},
},
diff --git a/apps/carbon/app/modules/items/ui/Fixtures/FixtureProperties.tsx b/apps/carbon/app/modules/items/ui/Fixtures/FixtureProperties.tsx
index d22e9ebdeb..e3520c1b6f 100644
--- a/apps/carbon/app/modules/items/ui/Fixtures/FixtureProperties.tsx
+++ b/apps/carbon/app/modules/items/ui/Fixtures/FixtureProperties.tsx
@@ -1,10 +1,13 @@
import {
+ Badge,
Button,
+ Enumerable,
HStack,
Tooltip,
TooltipContent,
TooltipTrigger,
VStack,
+ cn,
} from "@carbon/react";
import { useParams } from "@remix-run/react";
import { LuCopy, LuLink } from "react-icons/lu";
@@ -14,6 +17,7 @@ import { useRouteData } from "~/hooks";
import type { ListItem } from "~/types";
import { path } from "~/utils/path";
import type { BuyMethod, Fixture, PickMethod } from "../../types";
+import { MethodIcon, TrackingTypeIcon } from "../Item";
import { MethodBadge } from "../Item/MethodBadge";
const FixtureProperties = () => {
@@ -100,6 +104,44 @@ const FixtureProperties = () => {
<Assignee id={itemId} table="item" value={assignee ?? ""} />
</VStack>
+ <VStack spacing={2}>
+ <h3 className="text-xs text-muted-foreground">Tracking Type</h3>
+ <Badge variant="secondary">
+ <TrackingTypeIcon
+ type={routeData?.fixtureSummary?.itemTrackingType!}
+ className={cn(
+ "mr-2",
+ routeData?.fixtureSummary?.active === false && "opacity-50"
+ )}
+ />
+ <span>{routeData?.fixtureSummary?.itemTrackingType!}</span>
+ </Badge>
+ </VStack>
+
+ <VStack spacing={2}>
+ <h3 className="text-xs text-muted-foreground">Replenishment</h3>
+ <Enumerable
+ className={cn(
+ routeData?.fixtureSummary?.active === false && "opacity-50"
+ )}
+ value={routeData?.fixtureSummary?.replenishmentSystem ?? null}
+ />
+ </VStack>
+
+ <VStack spacing={2}>
+ <h3 className="text-xs text-muted-foreground">Default Method Type</h3>
+ <Badge variant="secondary">
+ <MethodIcon
+ type={routeData?.fixtureSummary?.defaultMethodType!}
+ className={cn(
+ "mr-2",
+ routeData?.fixtureSummary?.active === false && "opacity-50"
+ )}
+ />
+ <span>{routeData?.fixtureSummary?.defaultMethodType!}</span>
+ </Badge>
+ </VStack>
+
<VStack spacing={2}>
<h3 className="text-xs text-muted-foreground">Customer</h3>
{routeData?.fixtureSummary?.customerId ? (
diff --git a/apps/carbon/app/modules/items/ui/Fixtures/FixturesTable.tsx b/apps/carbon/app/modules/items/ui/Fixtures/FixturesTable.tsx
index b6723742d9..fcaf9190df 100644
--- a/apps/carbon/app/modules/items/ui/Fixtures/FixturesTable.tsx
+++ b/apps/carbon/app/modules/items/ui/Fixtures/FixturesTable.tsx
@@ -1,4 +1,4 @@
-import { Checkbox, Enumerable, MenuIcon, MenuItem } from "@carbon/react";
+import { Badge, Checkbox, Enumerable, MenuIcon, MenuItem } from "@carbon/react";
import { formatDate } from "@carbon/utils";
import { useNavigate } from "@remix-run/react";
import type { ColumnDef } from "@tanstack/react-table";
@@ -14,7 +14,13 @@ import {
import { usePermissions, useUrlParams } from "~/hooks";
import { useCustomColumns } from "~/hooks/useCustomColumns";
import type { Fixture } from "~/modules/items";
-import { itemTrackingTypes, methodType } from "~/modules/items";
+import {
+ MethodIcon,
+ TrackingTypeIcon,
+ itemReplenishmentSystems,
+ itemTrackingTypes,
+ methodType,
+} from "~/modules/items";
import { useCustomers, usePeople } from "~/stores";
import type { ListItem } from "~/types";
import { path } from "~/utils/path";
@@ -58,11 +64,38 @@ const FixturesTable = memo(
{
accessorKey: "itemTrackingType",
header: "Tracking",
- cell: (item) => <Enumerable value={item.getValue<string>()} />,
+ cell: (item) => (
+ <Badge variant="secondary">
+ <TrackingTypeIcon
+ type={item.getValue<string>()}
+ className="mr-2"
+ />
+ <span>{item.getValue<string>()}</span>
+ </Badge>
+ ),
meta: {
filter: {
type: "static",
options: itemTrackingTypes.map((type) => ({
+ value: type,
+ label: (
+ <Badge variant="secondary">
+ <TrackingTypeIcon type={type} className="mr-2" />
+ <span>{type}</span>
+ </Badge>
+ ),
+ })),
+ },
+ },
+ },
+ {
+ accessorKey: "replenishmentSystem",
+ header: "Replenishment",
+ cell: (item) => <Enumerable value={item.getValue<string>()} />,
+ meta: {
+ filter: {
+ type: "static",
+ options: itemReplenishmentSystems.map((type) => ({
value: type,
label: <Enumerable value={type} />,
})),
@@ -72,13 +105,23 @@ const FixturesTable = memo(
{
accessorKey: "defaultMethodType",
header: "Default Method",
- cell: (item) => <Enumerable value={item.getValue<string>()} />,
+ cell: (item) => (
+ <Badge variant="secondary">
+ <MethodIcon type={item.getValue<string>()} className="mr-2" />
+ <span>{item.getValue<string>()}</span>
+ </Badge>
+ ),
meta: {
filter: {
type: "static",
options: methodType.map((value) => ({
value,
- label: <Enumerable value={value} />,
+ label: (
+ <Badge variant="secondary">
+ <MethodIcon type={value} className="mr-2" />
+ <span>{value}</span>
+ </Badge>
+ ),
})),
},
},
diff --git a/apps/carbon/app/modules/items/ui/Item/MethodIcon.tsx b/apps/carbon/app/modules/items/ui/Item/MethodIcon.tsx
index 1fc82c21ce..91cada4c90 100644
--- a/apps/carbon/app/modules/items/ui/Item/MethodIcon.tsx
+++ b/apps/carbon/app/modules/items/ui/Item/MethodIcon.tsx
@@ -8,6 +8,26 @@ import { CiFries } from "react-icons/ci";
import { GiIBeam } from "react-icons/gi";
import { RiCustomerServiceLine } from "react-icons/ri";
import { RxCodesandboxLogo } from "react-icons/rx";
+import { TbTargetArrow, TbTargetOff } from "react-icons/tb";
+
+export const TrackingTypeIcon = ({
+ type,
+ className,
+}: {
+ type: string;
+ className?: string;
+}) => {
+ switch (type) {
+ case "Inventory":
+ return <TbTargetArrow className={cn("text-blue-500", className)} />;
+ case "Non-Inventory":
+ return <TbTargetOff className={cn("text-red-500", className)} />;
+ default:
+ return (
+ <HiSquares2X2 className={cn("text-muted-foreground", className)} />
+ );
+ }
+};
export const MethodItemTypeIcon = ({
type,
diff --git a/apps/carbon/app/modules/items/ui/Item/index.ts b/apps/carbon/app/modules/items/ui/Item/index.ts
index f203fabcd9..50b2e6cd1c 100644
--- a/apps/carbon/app/modules/items/ui/Item/index.ts
+++ b/apps/carbon/app/modules/items/ui/Item/index.ts
@@ -7,7 +7,7 @@ import ItemForm from "./ItemForm";
import ItemPlanningForm from "./ItemPlanningForm";
import ItemPurchasingForm from "./ItemPurchasingForm";
import ItemSalePriceForm from "./ItemSalePriceForm";
-import { MethodIcon, MethodItemTypeIcon } from "./MethodIcon";
+import { MethodIcon, MethodItemTypeIcon, TrackingTypeIcon } from "./MethodIcon";
import PickMethodForm from "./PickMethodForm";
export {
@@ -23,4 +23,5 @@ export {
MethodIcon,
MethodItemTypeIcon,
PickMethodForm,
+ TrackingTypeIcon,
};
diff --git a/apps/carbon/app/modules/items/ui/Materials/MaterialProperties.tsx b/apps/carbon/app/modules/items/ui/Materials/MaterialProperties.tsx
index 0dcf5d2dac..f43ee8780a 100644
--- a/apps/carbon/app/modules/items/ui/Materials/MaterialProperties.tsx
+++ b/apps/carbon/app/modules/items/ui/Materials/MaterialProperties.tsx
@@ -1,4 +1,5 @@
import {
+ Badge,
Button,
Enumerable,
HStack,
@@ -16,6 +17,7 @@ import { useRouteData } from "~/hooks";
import type { ListItem } from "~/types";
import { path } from "~/utils/path";
import type { BuyMethod, Material, PickMethod } from "../../types";
+import { MethodIcon, TrackingTypeIcon } from "../Item";
import { MethodBadge } from "../Item/MethodBadge";
const MaterialProperties = () => {
@@ -102,6 +104,34 @@ const MaterialProperties = () => {
<Assignee id={itemId} table="item" value={assignee ?? ""} />
</VStack>
+ <VStack spacing={2}>
+ <h3 className="text-xs text-muted-foreground">Tracking Type</h3>
+ <Badge variant="secondary">
+ <TrackingTypeIcon
+ type={routeData?.materialSummary?.itemTrackingType!}
+ className={cn(
+ "mr-2",
+ routeData?.materialSummary?.active === false && "opacity-50"
+ )}
+ />
+ <span>{routeData?.materialSummary?.itemTrackingType!}</span>
+ </Badge>
+ </VStack>
+
+ <VStack spacing={2}>
+ <h3 className="text-xs text-muted-foreground">Default Method Type</h3>
+ <Badge variant="secondary">
+ <MethodIcon
+ type={routeData?.materialSummary?.defaultMethodType!}
+ className={cn(
+ "mr-2",
+ routeData?.materialSummary?.active === false && "opacity-50"
+ )}
+ />
+ <span>{routeData?.materialSummary?.defaultMethodType!}</span>
+ </Badge>
+ </VStack>
+
<VStack spacing={2}>
<h3 className="text-xs text-muted-foreground">Shape</h3>
<Enumerable value={routeData?.materialSummary?.materialForm ?? null} />
@@ -114,16 +144,6 @@ const MaterialProperties = () => {
/>
</VStack>
- <VStack spacing={2}>
- <h3 className="text-xs text-muted-foreground">Tracking Type</h3>
- <Enumerable
- className={cn(
- routeData?.materialSummary?.active === false && "opacity-50"
- )}
- value={routeData?.materialSummary?.itemTrackingType ?? null}
- />
- </VStack>
-
<VStack spacing={2}>
<h3 className="text-xs text-muted-foreground">Unit of Measure</h3>
<Enumerable value={routeData?.materialSummary?.unitOfMeasure ?? null} />
diff --git a/apps/carbon/app/modules/items/ui/Materials/MaterialsTable.tsx b/apps/carbon/app/modules/items/ui/Materials/MaterialsTable.tsx
index 5657890589..3b7fbf061b 100644
--- a/apps/carbon/app/modules/items/ui/Materials/MaterialsTable.tsx
+++ b/apps/carbon/app/modules/items/ui/Materials/MaterialsTable.tsx
@@ -1,4 +1,4 @@
-import { Checkbox, Enumerable, MenuIcon, MenuItem } from "@carbon/react";
+import { Badge, Checkbox, Enumerable, MenuIcon, MenuItem } from "@carbon/react";
import { formatDate } from "@carbon/utils";
import { useNavigate } from "@remix-run/react";
import type { ColumnDef } from "@tanstack/react-table";
@@ -8,7 +8,12 @@ import { EmployeeAvatar, Hyperlink, New, Table } from "~/components";
import { usePermissions, useUrlParams } from "~/hooks";
import { useCustomColumns } from "~/hooks/useCustomColumns";
import type { Material } from "~/modules/items";
-import { itemTrackingTypes, methodType } from "~/modules/items";
+import {
+ MethodIcon,
+ TrackingTypeIcon,
+ itemTrackingTypes,
+ methodType,
+} from "~/modules/items";
import { usePeople } from "~/stores";
import type { ListItem } from "~/types";
import { path } from "~/utils/path";
@@ -98,13 +103,26 @@ const MaterialsTable = memo(
{
accessorKey: "itemTrackingType",
header: "Tracking",
- cell: (item) => <Enumerable value={item.getValue<string>()} />,
+ cell: (item) => (
+ <Badge variant="secondary">
+ <TrackingTypeIcon
+ type={item.getValue<string>()}
+ className="mr-2"
+ />
+ <span>{item.getValue<string>()}</span>
+ </Badge>
+ ),
meta: {
filter: {
type: "static",
options: itemTrackingTypes.map((type) => ({
value: type,
- label: <Enumerable value={type} />,
+ label: (
+ <Badge variant="secondary">
+ <TrackingTypeIcon type={type} className="mr-2" />
+ <span>{type}</span>
+ </Badge>
+ ),
})),
},
},
@@ -112,13 +130,23 @@ const MaterialsTable = memo(
{
accessorKey: "defaultMethodType",
header: "Default Method",
- cell: (item) => <Enumerable value={item.getValue<string>()} />,
+ cell: (item) => (
+ <Badge variant="secondary">
+ <MethodIcon type={item.getValue<string>()} className="mr-2" />
+ <span>{item.getValue<string>()}</span>
+ </Badge>
+ ),
meta: {
filter: {
type: "static",
options: methodType.map((value) => ({
value,
- label: <Enumerable value={value} />,
+ label: (
+ <Badge variant="secondary">
+ <MethodIcon type={value} className="mr-2" />
+ <span>{value}</span>
+ </Badge>
+ ),
})),
},
},
diff --git a/apps/carbon/app/modules/items/ui/Parts/PartProperties.tsx b/apps/carbon/app/modules/items/ui/Parts/PartProperties.tsx
index e4074e8593..34b397db14 100644
--- a/apps/carbon/app/modules/items/ui/Parts/PartProperties.tsx
+++ b/apps/carbon/app/modules/items/ui/Parts/PartProperties.tsx
@@ -1,4 +1,5 @@
import {
+ Badge,
Button,
Enumerable,
HStack,
@@ -17,6 +18,7 @@ import type { ListItem } from "~/types";
import { path } from "~/utils/path";
import type { BuyMethod, PartSummary, PickMethod } from "../../types";
import { MethodBadge } from "../Item/MethodBadge";
+import { MethodIcon, TrackingTypeIcon } from "../Item/MethodIcon";
const PartProperties = () => {
const { itemId } = useParams();
@@ -102,6 +104,20 @@ const PartProperties = () => {
<Assignee id={itemId} table="item" value={assignee ?? ""} />
</VStack>
+ <VStack spacing={2}>
+ <h3 className="text-xs text-muted-foreground">Tracking Type</h3>
+ <Badge variant="secondary">
+ <TrackingTypeIcon
+ type={routeData?.partSummary?.itemTrackingType!}
+ className={cn(
+ "mr-2",
+ routeData?.partSummary?.active === false && "opacity-50"
+ )}
+ />
+ <span>{routeData?.partSummary?.itemTrackingType!}</span>
+ </Badge>
+ </VStack>
+
<VStack spacing={2}>
<h3 className="text-xs text-muted-foreground">Replenishment</h3>
<Enumerable
@@ -113,13 +129,17 @@ const PartProperties = () => {
</VStack>
<VStack spacing={2}>
- <h3 className="text-xs text-muted-foreground">Tracking Type</h3>
- <Enumerable
- className={cn(
- routeData?.partSummary?.active === false && "opacity-50"
- )}
- value={routeData?.partSummary?.itemTrackingType ?? null}
- />
+ <h3 className="text-xs text-muted-foreground">Default Method Type</h3>
+ <Badge variant="secondary">
+ <MethodIcon
+ type={routeData?.partSummary?.defaultMethodType!}
+ className={cn(
+ "mr-2",
+ routeData?.partSummary?.active === false && "opacity-50"
+ )}
+ />
+ <span>{routeData?.partSummary?.defaultMethodType!}</span>
+ </Badge>
</VStack>
<VStack spacing={2}>
diff --git a/apps/carbon/app/modules/items/ui/Parts/PartsTable.tsx b/apps/carbon/app/modules/items/ui/Parts/PartsTable.tsx
index 505850df1e..823e27b15c 100644
--- a/apps/carbon/app/modules/items/ui/Parts/PartsTable.tsx
+++ b/apps/carbon/app/modules/items/ui/Parts/PartsTable.tsx
@@ -1,4 +1,4 @@
-import { Checkbox, Enumerable, MenuIcon, MenuItem } from "@carbon/react";
+import { Badge, Checkbox, Enumerable, MenuIcon, MenuItem } from "@carbon/react";
import { formatDate } from "@carbon/utils";
import { useNavigate } from "@remix-run/react";
import type { ColumnDef } from "@tanstack/react-table";
@@ -9,6 +9,8 @@ import { usePermissions, useUrlParams } from "~/hooks";
import { useCustomColumns } from "~/hooks/useCustomColumns";
import type { Part } from "~/modules/items";
import {
+ MethodIcon,
+ TrackingTypeIcon,
itemReplenishmentSystems,
itemTrackingTypes,
methodType,
@@ -55,13 +57,26 @@ const PartsTable = memo(
{
accessorKey: "itemTrackingType",
header: "Tracking",
- cell: (item) => <Enumerable value={item.getValue<string>()} />,
+ cell: (item) => (
+ <Badge variant="secondary">
+ <TrackingTypeIcon
+ type={item.getValue<string>()}
+ className="mr-2"
+ />
+ <span>{item.getValue<string>()}</span>
+ </Badge>
+ ),
meta: {
filter: {
type: "static",
options: itemTrackingTypes.map((type) => ({
value: type,
- label: <Enumerable value={type} />,
+ label: (
+ <Badge variant="secondary">
+ <TrackingTypeIcon type={type} className="mr-2" />
+ <span>{type}</span>
+ </Badge>
+ ),
})),
},
},
@@ -83,13 +98,23 @@ const PartsTable = memo(
{
accessorKey: "defaultMethodType",
header: "Default Method",
- cell: (item) => <Enumerable value={item.getValue<string>()} />,
+ cell: (item) => (
+ <Badge variant="secondary">
+ <MethodIcon type={item.getValue<string>()} className="mr-2" />
+ <span>{item.getValue<string>()}</span>
+ </Badge>
+ ),
meta: {
filter: {
type: "static",
options: methodType.map((value) => ({
value,
- label: <Enumerable value={value} />,
+ label: (
+ <Badge variant="secondary">
+ <MethodIcon type={value} className="mr-2" />
+ <span>{value}</span>
+ </Badge>
+ ),
})),
},
},
diff --git a/apps/carbon/app/modules/items/ui/Services/ServiceProperties.tsx b/apps/carbon/app/modules/items/ui/Services/ServiceProperties.tsx
index bdf9f4018e..39206a4a47 100644
--- a/apps/carbon/app/modules/items/ui/Services/ServiceProperties.tsx
+++ b/apps/carbon/app/modules/items/ui/Services/ServiceProperties.tsx
@@ -1,4 +1,5 @@
import {
+ Badge,
Button,
Enumerable,
HStack,
@@ -6,6 +7,7 @@ import {
TooltipContent,
TooltipTrigger,
VStack,
+ cn,
} from "@carbon/react";
import { useParams } from "@remix-run/react";
import { LuCopy, LuLink } from "react-icons/lu";
@@ -14,6 +16,7 @@ import Assignee from "~/components/Assignee";
import { useRouteData } from "~/hooks";
import { path } from "~/utils/path";
import type { BuyMethod, PickMethod, Service } from "../../types";
+import { MethodIcon } from "../Item";
import { MethodBadge } from "../Item/MethodBadge";
const ServiceProperties = () => {
@@ -98,6 +101,20 @@ const ServiceProperties = () => {
<Enumerable value={routeData?.service?.serviceType ?? null} />
</VStack>
+ <VStack spacing={2}>
+ <h3 className="text-xs text-muted-foreground">Default Method Type</h3>
+ <Badge variant="secondary">
+ <MethodIcon
+ type={routeData?.service?.defaultMethodType!}
+ className={cn(
+ "mr-2",
+ routeData?.service?.active === false && "opacity-50"
+ )}
+ />
+ <span>{routeData?.service?.defaultMethodType!}</span>
+ </Badge>
+ </VStack>
+
<VStack spacing={2}>
<HStack className="w-full justify-between">
<h3 className="text-xs text-muted-foreground">Methods</h3>
diff --git a/apps/carbon/app/modules/items/ui/Services/ServicesTable.tsx b/apps/carbon/app/modules/items/ui/Services/ServicesTable.tsx
index 921dfb438a..fae22d8363 100644
--- a/apps/carbon/app/modules/items/ui/Services/ServicesTable.tsx
+++ b/apps/carbon/app/modules/items/ui/Services/ServicesTable.tsx
@@ -1,4 +1,4 @@
-import { Checkbox, Enumerable, MenuIcon, MenuItem } from "@carbon/react";
+import { Badge, Checkbox, Enumerable, MenuIcon, MenuItem } from "@carbon/react";
import { formatDate } from "@carbon/utils";
import { useNavigate } from "@remix-run/react";
import type { ColumnDef } from "@tanstack/react-table";
@@ -8,7 +8,7 @@ import { EmployeeAvatar, Hyperlink, New, Table } from "~/components";
import { usePermissions } from "~/hooks";
import { useCustomColumns } from "~/hooks/useCustomColumns";
import type { Service } from "~/modules/items";
-import { methodType, serviceType } from "~/modules/items";
+import { MethodIcon, methodType, serviceType } from "~/modules/items";
import { usePeople } from "~/stores";
import { path } from "~/utils/path";
@@ -61,13 +61,23 @@ const ServicesTable = memo(({ data, count }: ServicesTableProps) => {
{
accessorKey: "defaultMethodType",
header: "Default Method",
- cell: (item) => <Enumerable value={item.getValue<string>()} />,
+ cell: (item) => (
+ <Badge variant="secondary">
+ <MethodIcon type={item.getValue<string>()} className="mr-2" />
+ <span>{item.getValue<string>()}</span>
+ </Badge>
+ ),
meta: {
filter: {
type: "static",
options: methodType.map((value) => ({
value,
- label: <Enumerable value={value} />,
+ label: (
+ <Badge variant="secondary">
+ <MethodIcon type={value} className="mr-2" />
+ <span>{value}</span>
+ </Badge>
+ ),
})),
},
},
diff --git a/apps/carbon/app/modules/items/ui/Tools/ToolProperties.tsx b/apps/carbon/app/modules/items/ui/Tools/ToolProperties.tsx
index b4ee891d0f..f35f35df13 100644
--- a/apps/carbon/app/modules/items/ui/Tools/ToolProperties.tsx
+++ b/apps/carbon/app/modules/items/ui/Tools/ToolProperties.tsx
@@ -1,4 +1,5 @@
import {
+ Badge,
Button,
Enumerable,
HStack,
@@ -16,6 +17,7 @@ import { useRouteData } from "~/hooks";
import type { ListItem } from "~/types";
import { path } from "~/utils/path";
import type { BuyMethod, PickMethod, Tool } from "../../types";
+import { MethodIcon, TrackingTypeIcon } from "../Item";
import { MethodBadge } from "../Item/MethodBadge";
const ToolProperties = () => {
@@ -104,12 +106,30 @@ const ToolProperties = () => {
<VStack spacing={2}>
<h3 className="text-xs text-muted-foreground">Tracking Type</h3>
- <Enumerable
- className={cn(
- routeData?.toolSummary?.active === false && "opacity-50"
- )}
- value={routeData?.toolSummary?.itemTrackingType ?? null}
- />
+ <Badge variant="secondary">
+ <TrackingTypeIcon
+ type={routeData?.toolSummary?.itemTrackingType!}
+ className={cn(
+ "mr-2",
+ routeData?.toolSummary?.active === false && "opacity-50"
+ )}
+ />
+ <span>{routeData?.toolSummary?.itemTrackingType!}</span>
+ </Badge>
+ </VStack>
+
+ <VStack spacing={2}>
+ <h3 className="text-xs text-muted-foreground">Default Method Type</h3>
+ <Badge variant="secondary">
+ <MethodIcon
+ type={routeData?.toolSummary?.defaultMethodType!}
+ className={cn(
+ "mr-2",
+ routeData?.toolSummary?.active === false && "opacity-50"
+ )}
+ />
+ <span>{routeData?.toolSummary?.defaultMethodType!}</span>
+ </Badge>
</VStack>
<VStack spacing={2}>
diff --git a/apps/carbon/app/modules/items/ui/Tools/ToolsTable.tsx b/apps/carbon/app/modules/items/ui/Tools/ToolsTable.tsx
index 18a3c0dbb8..f95168624c 100644
--- a/apps/carbon/app/modules/items/ui/Tools/ToolsTable.tsx
+++ b/apps/carbon/app/modules/items/ui/Tools/ToolsTable.tsx
@@ -1,4 +1,4 @@
-import { Checkbox, Enumerable, MenuIcon, MenuItem } from "@carbon/react";
+import { Badge, Checkbox, MenuIcon, MenuItem } from "@carbon/react";
import { formatDate } from "@carbon/utils";
import { useNavigate } from "@remix-run/react";
import type { ColumnDef } from "@tanstack/react-table";
@@ -8,7 +8,12 @@ import { EmployeeAvatar, Hyperlink, New, Table } from "~/components";
import { usePermissions, useUrlParams } from "~/hooks";
import { useCustomColumns } from "~/hooks/useCustomColumns";
import type { Tool } from "~/modules/items";
-import { itemTrackingTypes, methodType } from "~/modules/items";
+import {
+ MethodIcon,
+ TrackingTypeIcon,
+ itemTrackingTypes,
+ methodType,
+} from "~/modules/items";
import { usePeople } from "~/stores";
import type { ListItem } from "~/types";
import { path } from "~/utils/path";
@@ -51,13 +56,26 @@ const ToolsTable = memo(
{
accessorKey: "itemTrackingType",
header: "Tracking",
- cell: (item) => <Enumerable value={item.getValue<string>()} />,
+ cell: (item) => (
+ <Badge variant="secondary">
+ <TrackingTypeIcon
+ type={item.getValue<string>()}
+ className="mr-2"
+ />
+ <span>{item.getValue<string>()}</span>
+ </Badge>
+ ),
meta: {
filter: {
type: "static",
options: itemTrackingTypes.map((type) => ({
value: type,
- label: <Enumerable value={type} />,
+ label: (
+ <Badge variant="secondary">
+ <TrackingTypeIcon type={type} className="mr-2" />
+ <span>{type}</span>
+ </Badge>
+ ),
})),
},
},
@@ -65,13 +83,23 @@ const ToolsTable = memo(
{
accessorKey: "defaultMethodType",
header: "Default Method",
- cell: (item) => <Enumerable value={item.getValue<string>()} />,
+ cell: (item) => (
+ <Badge variant="secondary">
+ <MethodIcon type={item.getValue<string>()} className="mr-2" />
+ <span>{item.getValue<string>()}</span>
+ </Badge>
+ ),
meta: {
filter: {
type: "static",
options: methodType.map((value) => ({
value,
- label: <Enumerable value={value} />,
+ label: (
+ <Badge variant="secondary">
+ <MethodIcon type={value} className="mr-2" />
+ <span>{value}</span>
+ </Badge>
+ ),
})),
},
},