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.

fix: bug bash from friction logging

Brad Barbin474b58f760c5
diff --git a/apps/carbon/app/components/AvatarMenu.tsx b/apps/carbon/app/components/AvatarMenu.tsx
index 48929705a2..0ea122f054 100644
--- a/apps/carbon/app/components/AvatarMenu.tsx
+++ b/apps/carbon/app/components/AvatarMenu.tsx
@@ -16,9 +16,9 @@ import {
import { themes } from "@carbon/utils";
import { Form, Link, useFetcher } from "@remix-run/react";
import { useRef, useState } from "react";
-import { BsHexagon } from "react-icons/bs";
import {
LuFileText,
+ LuHome,
LuLogOut,
LuMoon,
LuPalette,
@@ -73,7 +73,7 @@ const AvatarMenu = () => {
<DropdownMenuSeparator />
<DropdownMenuItem asChild>
<Link to={path.to.authenticatedRoot}>
- <DropdownMenuIcon icon={<BsHexagon />} />
+ <DropdownMenuIcon icon={<LuHome />} />
Dashboard
</Link>
</DropdownMenuItem>
diff --git a/apps/carbon/app/components/Form/CustomerLocation.tsx b/apps/carbon/app/components/Form/CustomerLocation.tsx
index 3798dc34a1..dac925b76a 100644
--- a/apps/carbon/app/components/Form/CustomerLocation.tsx
+++ b/apps/carbon/app/components/Form/CustomerLocation.tsx
@@ -45,7 +45,7 @@ const CustomerLocation = (props: CustomerLocationSelectProps) => {
c.address?.addressLine1,
c.address?.addressLine2,
c.address?.city,
- c.address?.state
+ c.address?.stateProvince
)} (${c.name})`,
})) ?? [],
diff --git a/apps/carbon/app/components/Form/SupplierLocation.tsx b/apps/carbon/app/components/Form/SupplierLocation.tsx
index 38f5cb97bf..200a21cc04 100644
--- a/apps/carbon/app/components/Form/SupplierLocation.tsx
+++ b/apps/carbon/app/components/Form/SupplierLocation.tsx
@@ -43,7 +43,7 @@ const SupplierLocation = (props: SupplierLocationSelectProps) => {
c.address?.addressLine1,
c.address?.addressLine2,
c.address?.city,
- c.address?.state
+ c.address?.stateProvince
)} (${c.name})`,
})) ?? [],
diff --git a/apps/carbon/app/components/Layout/Navigation/useModules.tsx b/apps/carbon/app/components/Layout/Navigation/useModules.tsx
index a46a494b37..07b688dbb0 100644
--- a/apps/carbon/app/components/Layout/Navigation/useModules.tsx
+++ b/apps/carbon/app/components/Layout/Navigation/useModules.tsx
@@ -1,10 +1,10 @@
import {
LuBox,
- LuComponent,
LuCreditCard,
LuCrown,
LuFactory,
LuFiles,
+ LuHexagon,
LuSettings,
LuShield,
LuShoppingCart,
@@ -19,31 +19,30 @@ export function useModules() {
const permissions = usePermissions();
const modules: Authenticated<NavItem>[] = [
+ {
+ permission: "sales",
+ name: "Sales",
+ to: path.to.salesOrders,
+ icon: LuCrown,
+ },
+ {
+ permission: "production",
+ name: "Production",
+ to: path.to.production,
+ icon: LuFactory,
+ },
{
permission: "parts",
name: "Items",
to: path.to.parts,
- icon: LuComponent,
+ icon: LuHexagon,
},
-
{
permission: "inventory",
name: "Inventory",
to: path.to.inventory,
icon: LuBox,
},
- {
- permission: "production",
- name: "Production",
- to: path.to.production,
- icon: LuFactory,
- },
- {
- permission: "sales",
- name: "Sales",
- to: path.to.salesOrders,
- icon: LuCrown,
- },
{
permission: "purchasing",
name: "Purchasing",
diff --git a/apps/carbon/app/components/Layout/Topbar/CreateMenu.tsx b/apps/carbon/app/components/Layout/Topbar/CreateMenu.tsx
index fe7bf2e547..137a83b0ea 100644
--- a/apps/carbon/app/components/Layout/Topbar/CreateMenu.tsx
+++ b/apps/carbon/app/components/Layout/Topbar/CreateMenu.tsx
@@ -9,9 +9,9 @@ import {
import { Link } from "@remix-run/react";
import {
- LuComponent,
LuContainer,
LuHardHat,
+ LuHexagon,
LuPlus,
LuShoppingCart,
LuUserSquare,
@@ -38,7 +38,7 @@ function useCreate(): Route[] {
links.push({
name: "Part",
to: path.to.newPart,
- icon: <LuComponent />,
+ icon: <LuHexagon />,
});
}
diff --git a/apps/carbon/app/components/SortableList.tsx b/apps/carbon/app/components/SortableList.tsx
index efd94a5c3c..db97cc35ad 100644
--- a/apps/carbon/app/components/SortableList.tsx
+++ b/apps/carbon/app/components/SortableList.tsx
@@ -123,7 +123,7 @@ function SortableListItem<T>({
{typeof item.title === "string" ? (
<span
className={cn(
- "flex font-semibold text-sm md:text-base truncate hover:underline",
+ "flex font-medium text-sm md:text-base truncate hover:underline",
item.checked ? "text-red-400" : "text-foreground"
)}
onClick={(e) => {
diff --git a/apps/carbon/app/modules/documents/ui/Documents/DocumentsTable.tsx b/apps/carbon/app/modules/documents/ui/Documents/DocumentsTable.tsx
index 6a4c61e1d6..b482972b8c 100644
--- a/apps/carbon/app/modules/documents/ui/Documents/DocumentsTable.tsx
+++ b/apps/carbon/app/modules/documents/ui/Documents/DocumentsTable.tsx
@@ -629,8 +629,8 @@ function getDocumentLocation(
return path.to.fixture(sourceDocumentId);
case "Consumable":
return path.to.consumable(sourceDocumentId);
- case "Service":
- return path.to.service(sourceDocumentId);
+ // case "Service":
+ // return path.to.service(sourceDocumentId);
case "Purchase Order":
return path.to.purchaseOrder(sourceDocumentId);
case "Quote":
diff --git a/apps/carbon/app/modules/inventory/inventory.models.ts b/apps/carbon/app/modules/inventory/inventory.models.ts
index bb9c6a3d1f..f520adb33a 100644
--- a/apps/carbon/app/modules/inventory/inventory.models.ts
+++ b/apps/carbon/app/modules/inventory/inventory.models.ts
@@ -7,7 +7,7 @@ export const itemTypes = [
"Tool",
"Fixture",
"Consumable",
- "Service",
+ // "Service",
] as const;
export const itemLedgerTypes = [
diff --git a/apps/carbon/app/modules/inventory/ui/Inventory/InventoryTable.tsx b/apps/carbon/app/modules/inventory/ui/Inventory/InventoryTable.tsx
index 431098b8d3..81f3be8da2 100644
--- a/apps/carbon/app/modules/inventory/ui/Inventory/InventoryTable.tsx
+++ b/apps/carbon/app/modules/inventory/ui/Inventory/InventoryTable.tsx
@@ -55,6 +55,7 @@ const InventoryTable = memo(
<HStack className="py-1">
<ItemThumbnail
thumbnailPath={row.original.thumbnailPath}
+ // @ts-ignore
type={row.original.type}
/>
<Hyperlink
diff --git a/apps/carbon/app/modules/invoicing/invoicing.models.ts b/apps/carbon/app/modules/invoicing/invoicing.models.ts
index 5a5de678bc..686efb37e7 100644
--- a/apps/carbon/app/modules/invoicing/invoicing.models.ts
+++ b/apps/carbon/app/modules/invoicing/invoicing.models.ts
@@ -3,7 +3,7 @@ import { zfd } from "zod-form-data";
export const purchaseInvoiceLineType = [
"Part",
- "Service",
+ // "Service",
"Material",
"Tool",
"Fixture",
diff --git a/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceLineForm.tsx b/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceLineForm.tsx
index 9d53e359bc..54678cd68c 100644
--- a/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceLineForm.tsx
+++ b/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceLineForm.tsx
@@ -187,28 +187,28 @@ const PurchaseInvoiceLineForm = ({
});
break;
- case "Service":
- const service = await carbon
- .from("item")
- .select("readableId, name")
- .eq("id", itemId)
- .eq("companyId", company.id)
- .single();
+ // case "Service":
+ // const service = await carbon
+ // .from("item")
+ // .select("readableId, name")
+ // .eq("id", itemId)
+ // .eq("companyId", company.id)
+ // .single();
- setItemData({
- itemId: itemId,
- itemReadableId: service.data?.readableId ?? "",
- description: service.data?.name ?? "",
- quantity: 1,
- unitPrice: 0,
- purchaseUom: "EA",
- inventoryUom: "EA",
- conversionFactor: 1,
- shelfId: "",
- minimumOrderQuantity: undefined,
- });
+ // setItemData({
+ // itemId: itemId,
+ // itemReadableId: service.data?.readableId ?? "",
+ // description: service.data?.name ?? "",
+ // quantity: 1,
+ // unitPrice: 0,
+ // purchaseUom: "EA",
+ // inventoryUom: "EA",
+ // conversionFactor: 1,
+ // shelfId: "",
+ // minimumOrderQuantity: undefined,
+ // });
- break;
+ // break;
default:
throw new Error(
`Invalid invoice line type: ${type} is not implemented`
diff --git a/apps/carbon/app/modules/items/items.models.ts b/apps/carbon/app/modules/items/items.models.ts
index d28af19f82..2805155f86 100644
--- a/apps/carbon/app/modules/items/items.models.ts
+++ b/apps/carbon/app/modules/items/items.models.ts
@@ -203,19 +203,19 @@ export const methodMaterialValidator = z
message: "Consumable ID is required",
path: ["itemId"],
}
- )
- .refine(
- (data) => {
- if (data.itemType === "Service") {
- return !!data.itemReadableId;
- }
- return true;
- },
- {
- message: "Service ID is required",
- path: ["itemId"],
- }
);
+// .refine(
+// (data) => {
+// if (data.itemType === "Service") {
+// return !!data.itemReadableId;
+// }
+// return true;
+// },
+// {
+// message: "Service ID is required",
+// path: ["itemId"],
+// }
+// );
export const methodOperationValidator = z
.object({
diff --git a/apps/carbon/app/modules/items/ui/Item/BillOfProcess.tsx b/apps/carbon/app/modules/items/ui/Item/BillOfProcess.tsx
index ca242fbb3f..00dfd7e44f 100644
--- a/apps/carbon/app/modules/items/ui/Item/BillOfProcess.tsx
+++ b/apps/carbon/app/modules/items/ui/Item/BillOfProcess.tsx
@@ -676,21 +676,30 @@ function OperationForm({
}}
/>
- <Select
- name="operationOrder"
- label="Operation Order"
- placeholder="Operation Order"
- options={methodOperationOrders.map((o) => ({
- value: o,
- label: o,
- }))}
- onChange={(value) => {
- setProcessData((d) => ({
- ...d,
- operationOrder: value?.value as string,
- }));
- }}
- />
+ {processData.operationType === "Outside" ? (
+ <>
+ <SupplierProcess
+ name="operationSupplierProcessId"
+ label="Supplier"
+ processId={processData.processId}
+ isOptional
+ />
+ </>
+ ) : (
+ <>
+ <WorkCenter
+ name="workCenterId"
+ label="Work Center"
+ isOptional
+ processId={processData.processId}
+ onChange={(value) => {
+ if (value) {
+ onWorkCenterChange(value?.value as string);
+ }
+ }}
+ />
+ </>
+ )}
<SelectControlled
name="operationType"
@@ -723,30 +732,21 @@ function OperationForm({
className="col-span-2"
/>
- {processData.operationType === "Outside" ? (
- <>
- <SupplierProcess
- name="operationSupplierProcessId"
- label="Supplier"
- processId={processData.processId}
- isOptional
- />
- </>
- ) : (
- <>
- <WorkCenter
- name="workCenterId"
- label="Work Center"
- isOptional
- processId={processData.processId}
- onChange={(value) => {
- if (value) {
- onWorkCenterChange(value?.value as string);
- }
- }}
- />
- </>
- )}
+ <Select
+ name="operationOrder"
+ label="Operation Order"
+ placeholder="Operation Order"
+ options={methodOperationOrders.map((o) => ({
+ value: o,
+ label: o,
+ }))}
+ onChange={(value) => {
+ setProcessData((d) => ({
+ ...d,
+ operationOrder: value?.value as string,
+ }));
+ }}
+ />
</div>
{processData.operationType === "Inside" && (
<>
diff --git a/apps/carbon/app/modules/items/ui/Item/ItemForm.tsx b/apps/carbon/app/modules/items/ui/Item/ItemForm.tsx
index eed9100ec5..4d1cfb5cad 100644
--- a/apps/carbon/app/modules/items/ui/Item/ItemForm.tsx
+++ b/apps/carbon/app/modules/items/ui/Item/ItemForm.tsx
@@ -84,6 +84,7 @@ const ItemForm = ({ initialValues, type }: ItemFormProps) => {
</CardHeader>
<CardAction>
<Button isIcon asChild variant="ghost" size="lg">
+ {/* @ts-ignore */}
<Link to={getLinkToItemDetails(type, initialValues.id)}>
<LuExternalLink />
</Link>
@@ -156,8 +157,8 @@ export function getLinkToItemDetails(type: MethodItemType, id: string) {
return path.to.toolDetails(id);
case "Consumable":
return path.to.consumableDetails(id);
- case "Service":
- return path.to.serviceDetails(id);
+ // case "Service":
+ // return path.to.serviceDetails(id);
case "Fixture":
return path.to.fixtureDetails(id);
default:
diff --git a/apps/carbon/app/modules/items/ui/Services/ServiceForm.tsx b/apps/carbon/app/modules/items/ui/Services/ServiceForm.tsx
deleted file mode 100644
index 52480f20dc..0000000000
--- a/apps/carbon/app/modules/items/ui/Services/ServiceForm.tsx
+++ /dev/null
@@ -1,126 +0,0 @@
-import { ValidatedForm } from "@carbon/form";
-import {
- Card,
- CardContent,
- CardDescription,
- CardFooter,
- CardHeader,
- CardTitle,
- cn,
-} from "@carbon/react";
-import type { z } from "zod";
-import {
- Boolean,
- CustomFormFields,
- Hidden,
- Input,
- InputControlled,
- Number,
- Select,
- Submit,
- TextArea,
-} from "~/components/Form";
-import { useNextItemId, usePermissions } from "~/hooks";
-import { serviceType, serviceValidator } from "~/modules/items";
-
-type ServiceFormProps = {
- initialValues: z.infer<typeof serviceValidator>;
-};
-
-const ServiceForm = ({ initialValues }: ServiceFormProps) => {
- const { id, onIdChange, loading } = useNextItemId("Service");
-
- const permissions = usePermissions();
- const isEditing = initialValues.id !== undefined;
-
- const serviceTypeOptions =
- serviceType.map((type) => ({
- label: type,
- value: type,
- })) ?? [];
-
- return (
- <ValidatedForm
- method="post"
- validator={serviceValidator}
- defaultValues={initialValues}
- className="w-full"
- >
- <Card>
- <CardHeader>
- <CardTitle>{isEditing ? "Service Details" : "New Service"}</CardTitle>
- {!isEditing && (
- <CardDescription>
- A service is an intangible activity that can be purchased or sold.
- When a service is purchased, it is accounted for as overhead.
- </CardDescription>
- )}
- </CardHeader>
- <CardContent>
- <Hidden name="itemTrackingType" value="Non-Inventory" />
- <Hidden name="unitOfMeasureCode" value="EA" />
- <Hidden name="replenishmentSystem" value="Buy" />
- <Hidden name="defaultMethodType" value="Buy" />
- <div
- className={cn(
- "grid w-full gap-x-8 gap-y-4",
- isEditing
- ? "grid-cols-1 lg:grid-cols-3"
- : "grid-cols-1 md:grid-cols-2"
- )}
- >
- {isEditing ? (
- <Input name="id" label="Service ID" isReadOnly />
- ) : (
- <InputControlled
- name="id"
- label="Service ID"
- helperText="Use ... to get the next service ID"
- value={id}
- onChange={onIdChange}
- isDisabled={loading}
- isUppercase
- autoFocus
- />
- )}
- <Input name="name" label="Short Description" />
- <Select
- name="serviceType"
- label="Service Type"
- options={serviceTypeOptions}
- />
- {isEditing && (
- <TextArea name="description" label="Long Description" />
- )}
- {!isEditing && (
- <Number
- name="unitCost"
- label="Unit Cost"
- formatOptions={{
- style: "currency",
- currency: "USD",
- }}
- minValue={0}
- />
- )}
- <Boolean name="active" label="Active" />
- <CustomFormFields table="service" />
- </div>
- </CardContent>
- <CardFooter>
- <Submit
- isDisabled={
- isEditing
- ? !permissions.can("update", "parts")
- : !permissions.can("create", "parts")
- }
- >
- Save
- </Submit>
- </CardFooter>
- </Card>
- </ValidatedForm>
- );
-};
-
-export default ServiceForm;
diff --git a/apps/carbon/app/modules/items/ui/Services/ServiceHeader.tsx b/apps/carbon/app/modules/items/ui/Services/ServiceHeader.tsx
deleted file mode 100644
index e8a6e5ce3e..0000000000
--- a/apps/carbon/app/modules/items/ui/Services/ServiceHeader.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import { HStack, Heading, VStack } from "@carbon/react";
-
-import { Link, useParams } from "@remix-run/react";
-import { Copy, MethodItemTypeIcon, ModuleIcon } from "~/components";
-import { DetailsTopbar } from "~/components/Layout";
-import { useRouteData } from "~/hooks";
-import type { Service } from "~/modules/items";
-import { path } from "~/utils/path";
-import { useServiceNavigation } from "./useServiceNavigation";
-
-const ServiceHeader = () => {
- const { itemId } = useParams();
- if (!itemId) throw new Error("itemId not found");
-
- const routeData = useRouteData<{ service: Service }>(path.to.service(itemId));
-
- const links = useServiceNavigation(
- routeData?.service?.serviceType ?? "External"
- );
-
- return (
- <div className="flex flex-shrink-0 items-center justify-between px-4 py-2 bg-card border-b border-border">
- <VStack spacing={0} className="flex-grow">
- <HStack>
- <Link to={path.to.serviceDetails(itemId)}>
- <Heading size="h3" className="flex items-center gap-2">
- <ModuleIcon icon={<MethodItemTypeIcon type="Service" />} />
- <span>{routeData?.service?.id}</span>
- </Heading>
- </Link>
- <Copy text={routeData?.service?.id ?? ""} />
- </HStack>
- </VStack>
- <VStack spacing={0} className="flex-shrink justify-center items-end">
- <DetailsTopbar links={links} />
- </VStack>
- </div>
- );
-};
-
-export default ServiceHeader;
diff --git a/apps/carbon/app/modules/items/ui/Services/ServiceProperties.tsx b/apps/carbon/app/modules/items/ui/Services/ServiceProperties.tsx
deleted file mode 100644
index 0dcd3c14d2..0000000000
--- a/apps/carbon/app/modules/items/ui/Services/ServiceProperties.tsx
+++ /dev/null
@@ -1,163 +0,0 @@
-import {
- Badge,
- Button,
- HStack,
- Tooltip,
- TooltipContent,
- TooltipTrigger,
- VStack,
- cn,
-} from "@carbon/react";
-import { useParams } from "@remix-run/react";
-import { LuCopy, LuLink } from "react-icons/lu";
-import {
- Assignee,
- MethodBadge,
- MethodIcon,
- useOptimisticAssignment,
-} from "~/components";
-import { Enumerable } from "~/components/Enumerable";
-import { usePermissions, useRouteData } from "~/hooks";
-import { path } from "~/utils/path";
-import { copyToClipboard } from "~/utils/string";
-import type { BuyMethod, ItemFile, PickMethod, Service } from "../../types";
-import { FileBadge } from "../Item";
-
-const ServiceProperties = () => {
- const permissions = usePermissions();
- const { itemId } = useParams();
- if (!itemId) throw new Error("itemId not found");
-
- const routeData = useRouteData<{
- service: Service;
- files: ItemFile[];
- buyMethods: BuyMethod[];
- pickMethods: PickMethod[];
- }>(path.to.service(itemId));
-
- const buyMethods = routeData?.buyMethods ?? [];
-
- const optimisticAssignment = useOptimisticAssignment({
- id: itemId,
- table: "item",
- });
- const assignee =
- optimisticAssignment !== undefined
- ? optimisticAssignment
- : routeData?.service?.assignee;
-
- return (
- <VStack
- spacing={4}
- className="w-96 bg-card h-full overflow-y-auto border-l border-border px-4 py-2"
- >
- <VStack spacing={2}>
- <HStack className="w-full justify-between">
- <h3 className="text-xs text-muted-foreground">Properties</h3>
- <HStack spacing={1}>
- <Tooltip>
- <TooltipTrigger asChild>
- <Button
- variant="ghost"
- aria-label="Link"
- size="sm"
- className="p-1"
- onClick={() =>
- copyToClipboard(
- window.location.origin + path.to.service(itemId)
- )
- }
- >
- <LuLink className="w-3 h-3" />
- </Button>
- </TooltipTrigger>
- <TooltipContent>
- <span>Copy link to service</span>
- </TooltipContent>
- </Tooltip>
- <Tooltip>
- <TooltipTrigger asChild>
- <Button
- variant="ghost"
- aria-label="Copy"
- size="sm"
- className="p-1"
- onClick={() => copyToClipboard(routeData?.service?.id ?? "")}
- >
- <LuCopy className="w-3 h-3" />
- </Button>
- </TooltipTrigger>
- <TooltipContent>
- <span>Copy service number</span>
- </TooltipContent>
- </Tooltip>
- </HStack>
- </HStack>
- <span className="text-sm">{routeData?.service?.name}</span>
- </VStack>
- <VStack spacing={2}>
- <h3 className="text-xs text-muted-foreground">Assignee</h3>
- <Assignee
- id={itemId}
- table="item"
- value={assignee ?? ""}
- isReadOnly={!permissions.can("update", "parts")}
- />
- </VStack>
-
- <VStack spacing={2}>
- <h3 className="text-xs text-muted-foreground">Service Type</h3>
- <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>
- </HStack>
-
- {routeData?.service?.replenishmentSystem?.includes("Buy") &&
- buyMethods.map((method) => (
- <MethodBadge
- key={method.id}
- type="Buy"
- text={method?.supplier?.name ?? ""}
- to={path.to.partPurchasing(itemId)}
- />
- ))}
- </VStack>
-
- <VStack spacing={2}>
- <HStack className="w-full justify-between">
- <h3 className="text-xs text-muted-foreground">Files</h3>
- </HStack>
-
- {routeData?.files.map((file) => {
- return (
- <FileBadge
- key={file.id}
- file={file}
- itemId={itemId}
- itemType="Service"
- />
- );
- })}
- </VStack>
- </VStack>
- );
-};
-
-export default ServiceProperties;
diff --git a/apps/carbon/app/modules/items/ui/Services/ServicesTable.tsx b/apps/carbon/app/modules/items/ui/Services/ServicesTable.tsx
deleted file mode 100644
index 3167d59a98..0000000000
--- a/apps/carbon/app/modules/items/ui/Services/ServicesTable.tsx
+++ /dev/null
@@ -1,249 +0,0 @@
-import {
- Badge,
- Checkbox,
- MenuIcon,
- MenuItem,
- useDisclosure,
-} from "@carbon/react";
-import { formatDate } from "@carbon/utils";
-import { useNavigate } from "@remix-run/react";
-import type { ColumnDef } from "@tanstack/react-table";
-import { memo, useMemo, useState } from "react";
-import { LuPencil, LuTrash } from "react-icons/lu";
-import {
- EmployeeAvatar,
- Hyperlink,
- MethodIcon,
- New,
- Table,
-} from "~/components";
-import { Enumerable } from "~/components/Enumerable";
-import { ConfirmDelete } from "~/components/Modals";
-import { usePermissions } from "~/hooks";
-import { useCustomColumns } from "~/hooks/useCustomColumns";
-import type { Service } from "~/modules/items";
-import { serviceType } from "~/modules/items";
-import { methodType } from "~/modules/shared";
-import { usePeople } from "~/stores";
-import { path } from "~/utils/path";
-
-type ServicesTableProps = {
- data: Service[];
- count: number;
-};
-
-const ServicesTable = memo(({ data, count }: ServicesTableProps) => {
- const navigate = useNavigate();
- const permissions = usePermissions();
-
- const deleteItemModal = useDisclosure();
- const [selectedItem, setSelectedItem] = useState<Service | null>(null);
-
- const customColumns = useCustomColumns<Service>("part");
- const [people] = usePeople();
-
- const columns = useMemo<ColumnDef<Service>[]>(() => {
- const defaultColumns: ColumnDef<Service>[] = [
- {
- accessorKey: "id",
- header: "Service ID",
- cell: ({ row }) => (
- <Hyperlink to={path.to.serviceDetails(row.original.itemId!)}>
- {row.original.id}
- </Hyperlink>
- ),
- },
- {
- accessorKey: "name",
- header: "Short Description",
- cell: (item) => item.getValue(),
- },
- {
- accessorKey: "description",
- header: "Description",
- cell: (item) => item.getValue(),
- },
- {
- accessorKey: "serviceType",
- header: "Service Type",
- cell: (item) => <Enumerable value={item.getValue<string>()} />,
- meta: {
- filter: {
- type: "static",
- options: serviceType.map((type) => ({
- value: type,
- label: <Enumerable value={type} />,
- })),
- },
- },
- },
- {
- accessorKey: "defaultMethodType",
- header: "Default Method",
- 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: (
- <Badge variant="secondary">
- <MethodIcon type={value} className="mr-2" />
- <span>{value}</span>
- </Badge>
- ),
- })),
- },
- },
- },
- {
- accessorKey: "active",
- header: "Active",
- cell: (item) => <Checkbox isChecked={item.getValue<boolean>()} />,
- meta: {
- filter: {
- type: "static",
- options: [
- { value: "true", label: "Active" },
- { value: "false", label: "Inactive" },
- ],
- },
- pluralHeader: "Active Statuses",
- },
- },
- {
- id: "assignee",
- header: "Assignee",
- cell: ({ row }) => (
- <EmployeeAvatar employeeId={row.original.assignee} />
- ),
- meta: {
- filter: {
- type: "static",
- options: people.map((employee) => ({
- value: employee.id,
- label: employee.name,
- })),
- },
- },
- },
- {
- id: "createdBy",
- header: "Created By",
- cell: ({ row }) => (
- <EmployeeAvatar employeeId={row.original.createdBy} />
- ),
- meta: {
- filter: {
- type: "static",
- options: people.map((employee) => ({
- value: employee.id,
- label: employee.name,
- })),
- },
- },
- },
- {
- accessorKey: "createdAt",
- header: "Created At",
- cell: (item) => formatDate(item.getValue<string>()),
- },
- {
- id: "updatedBy",
- header: "Updated By",
- cell: ({ row }) => (
- <EmployeeAvatar employeeId={row.original.updatedBy} />
- ),
- meta: {
- filter: {
- type: "static",
- options: people.map((employee) => ({
- value: employee.id,
- label: employee.name,
- })),
- },
- },
- },
- {
- accessorKey: "updatedAt",
- header: "Created At",
- cell: (item) => formatDate(item.getValue<string>()),
- },
- ];
- return [...defaultColumns, ...customColumns];
- }, [customColumns, people]);
-
- const renderContextMenu = useMemo(() => {
- // eslint-disable-next-line react/display-name
- return (row: Service) => (
- <>
- <MenuItem onClick={() => navigate(path.to.part(row.itemId!))}>
- <MenuIcon icon={<LuPencil />} />
- Edit Service
- </MenuItem>
- <MenuItem
- disabled={!permissions.can("delete", "parts")}
- onClick={() => {
- setSelectedItem(row);
- deleteItemModal.onOpen();
- }}
- >
- <MenuIcon icon={<LuTrash />} />
- Delete Service
- </MenuItem>
- </>
- );
- }, [deleteItemModal, navigate, permissions]);
-
- return (
- <>
- <Table<Service>
- count={count}
- columns={columns}
- data={data}
- defaultColumnPinning={{
- left: ["id"],
- }}
- defaultColumnVisibility={{
- description: false,
- active: false,
- createdBy: false,
- createdAt: false,
- updatedBy: false,
- updatedAt: false,
- }}
- primaryAction={
- permissions.can("create", "parts") && (
- <New label="Service" to={path.to.newService} />
- )
- }
- renderContextMenu={renderContextMenu}
- />
- {selectedItem && selectedItem.id && (
- <ConfirmDelete
- action={path.to.deleteItem(selectedItem.itemId!)}
- isOpen={deleteItemModal.isOpen}
- name={selectedItem.id!}
- text={`Are you sure you want to delete ${selectedItem.id!}? This cannot be undone.`}
- onCancel={() => {
- deleteItemModal.onClose();
- setSelectedItem(null);
- }}
- onSubmit={() => {
- deleteItemModal.onClose();
- setSelectedItem(null);
- }}
- />
- )}
- </>
- );
-});
-
-ServicesTable.displayName = "ServiceTable";
-
-export default ServicesTable;
diff --git a/apps/carbon/app/modules/items/ui/Services/index.ts b/apps/carbon/app/modules/items/ui/Services/index.ts
deleted file mode 100644
index 6f7f5bd211..0000000000
--- a/apps/carbon/app/modules/items/ui/Services/index.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import ServiceForm from "./ServiceForm";
-import ServiceHeader from "./ServiceHeader";
-import ServiceProperties from "./ServiceProperties";
-import ServicesTable from "./ServicesTable";
-
-export { ServiceForm, ServiceHeader, ServiceProperties, ServicesTable };
diff --git a/apps/carbon/app/modules/items/ui/Services/useServiceNavigation.tsx b/apps/carbon/app/modules/items/ui/Services/useServiceNavigation.tsx
deleted file mode 100644
index 18bab805f2..0000000000
--- a/apps/carbon/app/modules/items/ui/Services/useServiceNavigation.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import { LuFileText, LuShoppingCart } from "react-icons/lu";
-import { usePermissions } from "~/hooks";
-import type { ServiceType } from "~/modules/items/types";
-import type { Role } from "~/types";
-
-export function useServiceNavigation(type: ServiceType) {
- const permissions = usePermissions();
- return [
- {
- name: "Details",
- to: "details",
- icon: LuFileText,
- shortcut: "Command+Shift+d",
- },
- {
- name: "Purchasing",
- to: "purchasing",
- isDisabled: type === "Internal",
- role: ["employee", "supplier"],
- icon: LuShoppingCart,
- shortcut: "Command+Shift+p",
- },
- ].filter(
- (item) =>
- !item.isDisabled &&
- (item.role === undefined ||
- item.role.some((role) => permissions.is(role as Role)))
- );
-}
diff --git a/apps/carbon/app/modules/items/ui/index.ts b/apps/carbon/app/modules/items/ui/index.ts
index b7404fadce..3a7f2729a3 100644
--- a/apps/carbon/app/modules/items/ui/index.ts
+++ b/apps/carbon/app/modules/items/ui/index.ts
@@ -5,10 +5,9 @@ export * from "./Fixtures";
export * from "./Item";
export * from "./ItemPostingGroups";
export * from "./MaterialForms";
-export * from "./MaterialSubstances";
export * from "./Materials";
+export * from "./MaterialSubstances";
export * from "./Parts";
-export * from "./Services";
export * from "./Tools";
export * from "./UnitOfMeasure";
export { useItemsSubmodules };
diff --git a/apps/carbon/app/modules/items/ui/useItemsSubmodules.tsx b/apps/carbon/app/modules/items/ui/useItemsSubmodules.tsx
index d314f0e8a5..e3ad465f31 100644
--- a/apps/carbon/app/modules/items/ui/useItemsSubmodules.tsx
+++ b/apps/carbon/app/modules/items/ui/useItemsSubmodules.tsx
@@ -4,7 +4,6 @@ import {
LuAtom,
LuGrip,
LuHammer,
- LuHeadphones,
LuPizza,
LuRuler,
LuShapes,
@@ -43,15 +42,10 @@ const itemsRoutes: AuthenticatedRouteGroup[] = [
to: path.to.consumables,
icon: <LuPizza />,
},
- {
- name: "Services",
- to: path.to.services,
- icon: <LuHeadphones />,
- },
// {
- // name: "Routing",
- // to: path.to.routings,
- // role: "employee",
+ // name: "Services",
+ // to: path.to.services,
+ // icon: <LuHeadphones />,
// },
],
},
diff --git a/apps/carbon/app/modules/production/production.models.ts b/apps/carbon/app/modules/production/production.models.ts
index ee286e2b0c..beadb97d70 100644
--- a/apps/carbon/app/modules/production/production.models.ts
+++ b/apps/carbon/app/modules/production/production.models.ts
@@ -357,19 +357,19 @@ export const jobMaterialValidator = z
message: "Consumable ID is required",
path: ["itemId"],
}
- )
- .refine(
- (data) => {
- if (data.itemType === "Service") {
- return !!data.itemReadableId;
- }
- return true;
- },
- {
- message: "Service ID is required",
- path: ["itemId"],
- }
);
+// .refine(
+// (data) => {
+// if (data.itemType === "Service") {
+// return !!data.itemReadableId;
+// }
+// return true;
+// },
+// {
+// message: "Service ID is required",
+// path: ["itemId"],
+// }
+// );
export const getJobMethodValidator = z.object({
sourceId: z.string().min(1, { message: "Source ID is required" }),
diff --git a/apps/carbon/app/modules/production/ui/Jobs/JobBreadcrumbs.tsx b/apps/carbon/app/modules/production/ui/Jobs/JobBreadcrumbs.tsx
index 2b4e18be93..c24bb31426 100644
--- a/apps/carbon/app/modules/production/ui/Jobs/JobBreadcrumbs.tsx
+++ b/apps/carbon/app/modules/production/ui/Jobs/JobBreadcrumbs.tsx
@@ -28,9 +28,9 @@ import type { PostgrestResponse } from "@supabase/supabase-js";
import { useEffect, useMemo, useState } from "react";
import {
LuAlertTriangle,
- LuComponent,
LuDownload,
LuHardHat,
+ LuHexagon,
LuUpload,
} from "react-icons/lu";
import { RiProgress4Line } from "react-icons/ri";
@@ -154,7 +154,7 @@ const JobBreadcrumbs = () => {
{isJobMethod && (
<TabsList className="grid w-full grid-cols-2 my-4">
<TabsTrigger value="item">
- <LuComponent className="mr-2" /> Item
+ <LuHexagon className="mr-2" /> Item
</TabsTrigger>
<TabsTrigger value="quote">
<RiProgress4Line className="mr-2" />
diff --git a/apps/carbon/app/modules/purchasing/purchasing.models.ts b/apps/carbon/app/modules/purchasing/purchasing.models.ts
index 28ca5d13de..e7cd5d0299 100644
--- a/apps/carbon/app/modules/purchasing/purchasing.models.ts
+++ b/apps/carbon/app/modules/purchasing/purchasing.models.ts
@@ -5,7 +5,7 @@ import { currencyCodes } from "../accounting";
export const purchaseOrderLineType = [
"Part",
- "Service",
+ // "Service",
"Material",
"Tool",
"Fixture",
diff --git a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderLineForm.tsx b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderLineForm.tsx
index cb05260e27..2952a7ae3f 100644
--- a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderLineForm.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderLineForm.tsx
@@ -115,6 +115,7 @@ const PurchaseOrderLineForm = ({
const onClose = () => navigate(-1);
const onTypeChange = (type: PurchaseOrderLineType) => {
+ // @ts-ignore
setType(type);
setItemData({
itemId: "",
@@ -183,28 +184,28 @@ const PurchaseOrderLineForm = ({
});
break;
- case "Service":
- const service = await carbon
- .from("item")
- .select("readableId, name")
- .eq("id", itemId)
- .eq("companyId", company.id)
- .single();
+ // case "Service":
+ // const service = await carbon
+ // .from("item")
+ // .select("readableId, name")
+ // .eq("id", itemId)
+ // .eq("companyId", company.id)
+ // .single();
- setItemData({
- itemId: itemId,
- itemReadableId: service.data?.readableId ?? "",
- description: service.data?.name ?? "",
- purchaseQuantity: 1,
- unitPrice: 0,
- purchaseUom: "EA",
- inventoryUom: "EA",
- conversionFactor: 1,
- shelfId: "",
- minimumOrderQuantity: undefined,
- });
+ // setItemData({
+ // itemId: itemId,
+ // itemReadableId: service.data?.readableId ?? "",
+ // description: service.data?.name ?? "",
+ // purchaseQuantity: 1,
+ // unitPrice: 0,
+ // purchaseUom: "EA",
+ // inventoryUom: "EA",
+ // conversionFactor: 1,
+ // shelfId: "",
+ // minimumOrderQuantity: undefined,
+ // });
- break;
+ // break;
default:
throw new Error(
`Invalid invoice line type: ${type} is not implemented`
diff --git a/apps/carbon/app/modules/purchasing/ui/usePurchasingSubmodules.tsx b/apps/carbon/app/modules/purchasing/ui/usePurchasingSubmodules.tsx
index 82d3091f07..cc72871e68 100644
--- a/apps/carbon/app/modules/purchasing/ui/usePurchasingSubmodules.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/usePurchasingSubmodules.tsx
@@ -1,4 +1,4 @@
-import { LuContainer, LuLayoutList, LuShapes, LuStar } from "react-icons/lu";
+import { LuContainer, LuLayoutList, LuShapes } from "react-icons/lu";
import { usePermissions } from "~/hooks";
import type { AuthenticatedRouteGroup } from "~/types";
import { path } from "~/utils/path";
@@ -28,12 +28,12 @@ const purchasingRoutes: AuthenticatedRouteGroup[] = [
role: "employee",
icon: <LuShapes />,
},
- {
- name: "Types",
- to: path.to.supplierTypes,
- role: "employee",
- icon: <LuStar />,
- },
+ // {
+ // name: "Types",
+ // to: path.to.supplierTypes,
+ // role: "employee",
+ // icon: <LuStar />,
+ // },
],
},
];
diff --git a/apps/carbon/app/modules/resources/ui/WorkCenters/WorkCentersTable.tsx b/apps/carbon/app/modules/resources/ui/WorkCenters/WorkCentersTable.tsx
index 076cd71e85..3e26f14286 100644
--- a/apps/carbon/app/modules/resources/ui/WorkCenters/WorkCentersTable.tsx
+++ b/apps/carbon/app/modules/resources/ui/WorkCenters/WorkCentersTable.tsx
@@ -22,9 +22,6 @@ type WorkCentersTableProps = {
const defaultColumnVisibility = {
description: false,
- laborRate: false,
- machineRate: false,
- overheadRate: false,
createdAt: false,
createdBy: false,
updatedAt: false,
diff --git a/apps/carbon/app/modules/sales/sales.models.ts b/apps/carbon/app/modules/sales/sales.models.ts
index 872f481b2d..d74c582e5c 100644
--- a/apps/carbon/app/modules/sales/sales.models.ts
+++ b/apps/carbon/app/modules/sales/sales.models.ts
@@ -233,19 +233,19 @@ export const quoteMaterialValidator = z
message: "Consumable ID is required",
path: ["itemId"],
}
- )
- .refine(
- (data) => {
- if (data.itemType === "Service") {
- return !!data.itemReadableId;
- }
- return true;
- },
- {
- message: "Service ID is required",
- path: ["itemId"],
- }
);
+// .refine(
+// (data) => {
+// if (data.itemType === "Service") {
+// return !!data.itemReadableId;
+// }
+// return true;
+// },
+// {
+// message: "Service ID is required",
+// path: ["itemId"],
+// }
+// );
export const quoteOperationValidator = z
.object({
@@ -471,7 +471,7 @@ export const quoteShipmentValidator = z.object({
export const salesOrderLineType = [
"Part",
- "Service",
+ // "Service",
"Material",
"Tool",
"Fixture",
diff --git a/apps/carbon/app/modules/sales/types.ts b/apps/carbon/app/modules/sales/types.ts
index 149dc998be..bccd0f47b2 100644
--- a/apps/carbon/app/modules/sales/types.ts
+++ b/apps/carbon/app/modules/sales/types.ts
@@ -140,8 +140,10 @@ export type SalesOrderLine = NonNullable<
Awaited<ReturnType<typeof getSalesOrderLines>>["data"]
>[number];
-export type SalesOrderLineType =
- Database["public"]["Enums"]["salesOrderLineType"];
+export type SalesOrderLineType = Omit<
+ Database["public"]["Enums"]["salesOrderLineType"],
+ "Service"
+>;
export type SalesOrderStatus = Database["public"]["Enums"]["salesOrderStatus"];
diff --git a/apps/carbon/app/modules/sales/ui/OpportunityDocuments/OpportunityDocuments.tsx b/apps/carbon/app/modules/sales/ui/OpportunityDocuments/OpportunityDocuments.tsx
index 535d1a851a..e85caeb2ca 100644
--- a/apps/carbon/app/modules/sales/ui/OpportunityDocuments/OpportunityDocuments.tsx
+++ b/apps/carbon/app/modules/sales/ui/OpportunityDocuments/OpportunityDocuments.tsx
@@ -126,7 +126,7 @@ const OpportunityDocuments = ({
<Card>
<HStack className="justify-between items-start">
<CardHeader>
- <CardTitle>Documents</CardTitle>
+ <CardTitle>Files</CardTitle>
</CardHeader>
<CardAction>
<OpportunityDocumentForm
diff --git a/apps/carbon/app/modules/sales/ui/SalesRFQ/SalesRFQHeader.tsx b/apps/carbon/app/modules/sales/ui/SalesRFQ/SalesRFQHeader.tsx
index 29ba2c2d42..45e6a68474 100644
--- a/apps/carbon/app/modules/sales/ui/SalesRFQ/SalesRFQHeader.tsx
+++ b/apps/carbon/app/modules/sales/ui/SalesRFQ/SalesRFQHeader.tsx
@@ -95,6 +95,22 @@ const SalesRFQHeader = () => {
</>
)}
+ {["Ready for Quote", "Closed"].includes(status) && (
+ <>
+ <Form method="post" action={path.to.salesRfqStatus(rfqId)}>
+ <input type="hidden" name="status" value="Draft" />
+ <Button
+ isDisabled={!permissions.can("update", "sales")}
+ leftIcon={<LuRefreshCw />}
+ type="submit"
+ variant="secondary"
+ >
+ Reopen
+ </Button>
+ </Form>
+ </>
+ )}
+
{status === "Ready for Quote" && (
<>
<Form method="post" action={path.to.salesRfqStatus(rfqId)}>
@@ -138,33 +154,6 @@ const SalesRFQHeader = () => {
</Link>
</Button>
)}
-
- {status === "Closed" && (
- <>
- <Form method="post" action={path.to.salesRfqStatus(rfqId)}>
- <input type="hidden" name="status" value="Draft" />
- <Button
- isDisabled={!permissions.can("update", "sales")}
- leftIcon={<LuRefreshCw />}
- type="submit"
- variant="secondary"
- >
- Reopen
- </Button>
- </Form>
- </>
- )}
-
- {/* <IconButton
- aria-label="Previous"
- icon={<LuMoveLeft />}
- variant="secondary"
- />
- <IconButton
- aria-label="Next"
- icon={<LuMoveRight />}
- variant="secondary"
- /> */}
</HStack>
</HStack>
{convertToQuoteModal.isOpen && (
diff --git a/apps/carbon/app/modules/sales/ui/useSalesSubmodules.tsx b/apps/carbon/app/modules/sales/ui/useSalesSubmodules.tsx
index a630746623..3bfad80e31 100644
--- a/apps/carbon/app/modules/sales/ui/useSalesSubmodules.tsx
+++ b/apps/carbon/app/modules/sales/ui/useSalesSubmodules.tsx
@@ -1,4 +1,4 @@
-import { LuShapes, LuStar, LuUserSquare } from "react-icons/lu";
+import { LuStar, LuUserSquare } from "react-icons/lu";
import {
RiProgress2Line,
RiProgress4Line,
@@ -43,12 +43,12 @@ const salesRoutes: AuthenticatedRouteGroup[] = [
role: "employee",
icon: <LuStar />,
},
- {
- name: "Types",
- to: path.to.customerTypes,
- role: "employee",
- icon: <LuShapes />,
- },
+ // {
+ // name: "Types",
+ // to: path.to.customerTypes,
+ // role: "employee",
+ // icon: <LuShapes />,
+ // },
],
},
];
diff --git a/apps/carbon/app/modules/shared/shared.models.ts b/apps/carbon/app/modules/shared/shared.models.ts
index eb49485e53..ec002c62d5 100644
--- a/apps/carbon/app/modules/shared/shared.models.ts
+++ b/apps/carbon/app/modules/shared/shared.models.ts
@@ -7,7 +7,7 @@ export const methodItemType = [
"Tool",
"Fixture",
"Consumable",
- "Service",
+ // "Service",
] as const;
export const methodOperationOrders = [
diff --git a/apps/carbon/app/modules/users/ui/Employees/EmployeesTable.tsx b/apps/carbon/app/modules/users/ui/Employees/EmployeesTable.tsx
index dc8cb31b6b..cda48b1626 100644
--- a/apps/carbon/app/modules/users/ui/Employees/EmployeesTable.tsx
+++ b/apps/carbon/app/modules/users/ui/Employees/EmployeesTable.tsx
@@ -184,7 +184,7 @@ const EmployeesTable = memo(
}
>
<MenuIcon icon={<LuPencil />} />
- Edit Employee
+ Edit Permissions
</MenuItem>
<MenuItem
onClick={() => {
@@ -203,7 +203,7 @@ const EmployeesTable = memo(
}}
>
<MenuIcon icon={<FaBan />} />
- Deactivate Employee
+ Deactivate Account
</MenuItem>
)}
</>
@@ -222,7 +222,7 @@ const EmployeesTable = memo(
defaultColumnVisibility={defaultColumnVisibility}
primaryAction={
permissions.can("create", "users") && (
- <New label="Employee" to={`new?${params.toString()}`} />
+ <New label="Account" to={`new?${params.toString()}`} />
)
}
renderContextMenu={renderContextMenu}
diff --git a/apps/carbon/app/modules/users/ui/Suppliers/SupplierAccountsTable/SuppliersAccountsTable.tsx b/apps/carbon/app/modules/users/ui/Suppliers/SupplierAccountsTable/SuppliersAccountsTable.tsx
index 32a35314d0..4d3a3a200b 100644
--- a/apps/carbon/app/modules/users/ui/Suppliers/SupplierAccountsTable/SuppliersAccountsTable.tsx
+++ b/apps/carbon/app/modules/users/ui/Suppliers/SupplierAccountsTable/SuppliersAccountsTable.tsx
@@ -227,7 +227,7 @@ const SupplierAccountsTable = memo(
defaultColumnVisibility={defaultColumnVisibility}
primaryAction={
permissions.can("create", "users") && (
- <New label="Customer" to={`new?${params.toString()}`} />
+ <New label="Supplier" to={`new?${params.toString()}`} />
)
}
renderContextMenu={renderContextMenu}
diff --git a/apps/carbon/app/modules/users/ui/useUsersSubmodules.tsx b/apps/carbon/app/modules/users/ui/useUsersSubmodules.tsx
index a733a91085..64bcd4d626 100644
--- a/apps/carbon/app/modules/users/ui/useUsersSubmodules.tsx
+++ b/apps/carbon/app/modules/users/ui/useUsersSubmodules.tsx
@@ -1,10 +1,4 @@
-import {
- LuContainer,
- LuFileBadge2,
- LuGroup,
- LuUserSquare,
- LuUsers,
-} from "react-icons/lu";
+import { LuFileBadge2, LuGroup, LuUsers } from "react-icons/lu";
import type { RouteGroup } from "~/types";
import { path } from "~/utils/path";
@@ -13,20 +7,20 @@ const usersRoutes: RouteGroup[] = [
name: "Manage",
routes: [
{
- name: "Employees",
+ name: "Accounts",
to: path.to.employeeAccounts,
icon: <LuUsers />,
},
- {
- name: "Customers",
- to: path.to.customerAccounts,
- icon: <LuUserSquare />,
- },
- {
- name: "Suppliers",
- to: path.to.supplierAccounts,
- icon: <LuContainer />,
- },
+ // {
+ // name: "Customers",
+ // to: path.to.customerAccounts,
+ // icon: <LuUserSquare />,
+ // },
+ // {
+ // name: "Suppliers",
+ // to: path.to.supplierAccounts,
+ // icon: <LuContainer />,
+ // },
{
name: "Groups",
to: path.to.groups,
diff --git a/apps/carbon/app/routes/x+/inventory+/quantities+/$itemId.tsx b/apps/carbon/app/routes/x+/inventory+/quantities+/$itemId.tsx
index 0d8d4c0ee8..4662e8f699 100644
--- a/apps/carbon/app/routes/x+/inventory+/quantities+/$itemId.tsx
+++ b/apps/carbon/app/routes/x+/inventory+/quantities+/$itemId.tsx
@@ -121,6 +121,7 @@ export default function ItemInventoryRoute() {
<ScrollArea className="h-[calc(100vh-49px)]">
<InventoryItemHeader
itemReadableId={item.readableId}
+ // @ts-ignore
itemType={item.type}
/>
<VStack className="p-2">
diff --git a/apps/carbon/app/routes/x+/items+/services.tsx b/apps/carbon/app/routes/x+/items+/services.tsx
deleted file mode 100644
index 3a3672ecf6..0000000000
--- a/apps/carbon/app/routes/x+/items+/services.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-import { error } from "@carbon/auth";
-import { requirePermissions } from "@carbon/auth/auth.server";
-import { flash } from "@carbon/auth/session.server";
-import { VStack } from "@carbon/react";
-import { Outlet, useLoaderData } from "@remix-run/react";
-import type { LoaderFunctionArgs } from "@vercel/remix";
-import { json, redirect } from "@vercel/remix";
-import {
- ServicesTable,
- getItemPostingGroupsList,
- getServices,
-} from "~/modules/items";
-import type { Handle } from "~/utils/handle";
-import { path } from "~/utils/path";
-import { getGenericQueryFilters } from "~/utils/query";
-
-export const handle: Handle = {
- breadcrumb: "Services",
- to: path.to.services,
-};
-
-export async function loader({ request }: LoaderFunctionArgs) {
- const { client, companyId } = await requirePermissions(request, {
- view: "parts",
- });
-
- const url = new URL(request.url);
- const searchParams = new URLSearchParams(url.search);
- const search = searchParams.get("search");
- const type = searchParams.get("type");
- const group = searchParams.get("group");
- const supplierId = searchParams.get("supplierId");
-
- const { limit, offset, sorts, filters } =
- getGenericQueryFilters(searchParams);
-
- const [services] = await Promise.all([
- getServices(client, companyId, {
- search,
- type,
- group,
- supplierId,
- limit,
- offset,
- sorts,
- filters,
- }),
- getItemPostingGroupsList(client, companyId),
- ]);
-
- if (services.error) {
- redirect(
- path.to.items,
- await flash(request, error(services.error, "Failed to fetch services"))
- );
- }
-
- return json({
- count: services.count ?? 0,
- services: services.data ?? [],
- });
-}
-
-export default function ServicesSearchRoute() {
- const { count, services } = useLoaderData<typeof loader>();
-
- return (
- <VStack spacing={0} className="h-full">
- <ServicesTable data={services} count={count} />
- <Outlet />
- </VStack>
- );
-}
diff --git a/apps/carbon/app/routes/x+/job+/$jobId.details.tsx b/apps/carbon/app/routes/x+/job+/$jobId.details.tsx
index 0d9543179a..5e484589cc 100644
--- a/apps/carbon/app/routes/x+/job+/$jobId.details.tsx
+++ b/apps/carbon/app/routes/x+/job+/$jobId.details.tsx
@@ -117,6 +117,7 @@ export default function JobDetailsRoute() {
return (
<VStack spacing={2} className="p-2">
<JobBreadcrumbs />
+ {/* @ts-ignore */}
<JobForm key={jobInitialValues.id} initialValues={jobInitialValues} />
{permissions.is("employee") && (
<div className="grid grid-cols-1 md:grid-cols-2 w-full flex-grow gap-2">
diff --git a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.$lineId.tsx b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.$lineId.tsx
index 525687e8b4..e83be6ce0a 100644
--- a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.$lineId.tsx
+++ b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.$lineId.tsx
@@ -119,6 +119,7 @@ export default function EditPurchaseInvoiceLineRoute() {
return (
<PurchaseInvoiceLineForm
key={initialValues.id}
+ // @ts-ignore
initialValues={initialValues}
/>
);
diff --git a/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.$lineId.tsx b/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.$lineId.tsx
index a481d3b5a5..ff976843bd 100644
--- a/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.$lineId.tsx
+++ b/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.$lineId.tsx
@@ -119,6 +119,7 @@ export default function EditPurchaseOrderLineRoute() {
return (
<PurchaseOrderLineForm
key={initialValues.id}
+ // @ts-ignore
initialValues={initialValues}
/>
);
diff --git a/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.new.tsx b/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.new.tsx
index 985c2b30f6..3b61b25940 100644
--- a/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.new.tsx
+++ b/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.new.tsx
@@ -75,5 +75,10 @@ export default function NewPurchaseOrderLineRoute() {
shelfId: "",
};
- return <PurchaseOrderLineForm initialValues={initialValues} />;
+ return (
+ <PurchaseOrderLineForm
+ // @ts-ignore
+ initialValues={initialValues}
+ />
+ );
}
diff --git a/apps/carbon/app/routes/x+/quote+/$quoteId.$lineId.details.tsx b/apps/carbon/app/routes/x+/quote+/$quoteId.$lineId.details.tsx
index 0b710997bb..c4c59fe1d7 100644
--- a/apps/carbon/app/routes/x+/quote+/$quoteId.$lineId.details.tsx
+++ b/apps/carbon/app/routes/x+/quote+/$quoteId.$lineId.details.tsx
@@ -146,6 +146,7 @@ export default function QuoteLine() {
itemReadableId: line.itemReadableId ?? "",
methodType: line.methodType ?? "Make",
modelUploadId: line.modelUploadId ?? undefined,
+ noQuoteReason: line.noQuoteReason ?? undefined,
status: line.status ?? "Not Started",
quantity: line.quantity ?? [1],
unitOfMeasureCode: line.unitOfMeasureCode ?? "",
diff --git a/apps/carbon/app/routes/x+/sales-order+/$orderId.$lineId.details.tsx b/apps/carbon/app/routes/x+/sales-order+/$orderId.$lineId.details.tsx
index daf137af7c..1db297eb40 100644
--- a/apps/carbon/app/routes/x+/sales-order+/$orderId.$lineId.details.tsx
+++ b/apps/carbon/app/routes/x+/sales-order+/$orderId.$lineId.details.tsx
@@ -157,6 +157,7 @@ export default function EditSalesOrderLineRoute() {
<>
<SalesOrderLineForm
key={initialValues.id}
+ // @ts-ignore
initialValues={initialValues}
/>
{line.methodType === "Make" && (
diff --git a/apps/carbon/app/routes/x+/sales-order+/$orderId.new.tsx b/apps/carbon/app/routes/x+/sales-order+/$orderId.new.tsx
index 60dfbaaabb..c2fe7a59ac 100644
--- a/apps/carbon/app/routes/x+/sales-order+/$orderId.new.tsx
+++ b/apps/carbon/app/routes/x+/sales-order+/$orderId.new.tsx
@@ -78,5 +78,10 @@ export default function NewSalesOrderLineRoute() {
salesOrderData?.salesOrder?.locationId ?? defaults.locationId ?? "",
};
- return <SalesOrderLineForm initialValues={initialValues} />;
+ return (
+ <SalesOrderLineForm
+ // @ts-ignore
+ initialValues={initialValues}
+ />
+ );
}
diff --git a/apps/carbon/app/routes/x+/service+/$itemId._index.tsx b/apps/carbon/app/routes/x+/service+/$itemId._index.tsx
deleted file mode 100644
index 3117e25c0d..0000000000
--- a/apps/carbon/app/routes/x+/service+/$itemId._index.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import type { LoaderFunctionArgs } from "@vercel/remix";
-import { redirect } from "@vercel/remix";
-import { path } from "~/utils/path";
-
-export async function loader({ params }: LoaderFunctionArgs) {
- const { itemId } = params;
- if (!itemId) throw new Error("Could not find itemId");
- throw redirect(path.to.serviceDetails(itemId));
-}
diff --git a/apps/carbon/app/routes/x+/service+/$itemId.details.tsx b/apps/carbon/app/routes/x+/service+/$itemId.details.tsx
deleted file mode 100644
index eddd13d731..0000000000
--- a/apps/carbon/app/routes/x+/service+/$itemId.details.tsx
+++ /dev/null
@@ -1,95 +0,0 @@
-import { assertIsPost, error, success } from "@carbon/auth";
-import { requirePermissions } from "@carbon/auth/auth.server";
-import { flash } from "@carbon/auth/session.server";
-import { validationError, validator } from "@carbon/form";
-import { VStack } from "@carbon/react";
-import { useParams } from "@remix-run/react";
-import type { ActionFunctionArgs } from "@vercel/remix";
-import { redirect } from "@vercel/remix";
-import { usePermissions, useRouteData } from "~/hooks";
-import type { ItemFile, Service } from "~/modules/items";
-import {
- ItemDocuments,
- ServiceForm,
- serviceValidator,
- upsertService,
-} from "~/modules/items";
-import { getCustomFields, setCustomFields } from "~/utils/form";
-import { path } from "~/utils/path";
-
-export async function action({ request, params }: ActionFunctionArgs) {
- assertIsPost(request);
- const { client, userId } = await requirePermissions(request, {
- update: "parts",
- });
-
- const { itemId } = params;
- if (!itemId) throw new Error("Could not find itemId");
-
- const formData = await request.formData();
- const validation = await validator(serviceValidator).validate(formData);
-
- if (validation.error) {
- return validationError(validation.error);
- }
-
- const updatePart = await upsertService(client, {
- ...validation.data,
- id: itemId,
- updatedBy: userId,
- customFields: setCustomFields(formData),
- });
-
- if (updatePart.error) {
- throw redirect(
- path.to.service(itemId),
- await flash(request, error(updatePart.error, "Failed to update part"))
- );
- }
-
- throw redirect(
- path.to.service(itemId),
- await flash(request, success("Updated part"))
- );
-}
-
-export default function ServiceDetailsRoute() {
- const permissions = usePermissions();
-
- const { itemId } = useParams();
- if (!itemId) throw new Error("Could not find itemId");
-
- const routeData = useRouteData<{ service: Service; files: ItemFile[] }>(
- path.to.service(itemId)
- );
- if (!routeData) throw new Error("Could not find part data");
-
- const serviceInitialValues = {
- id: routeData.service?.id!,
- name: routeData.service?.name ?? "",
- description: routeData.service?.description ?? undefined,
- serviceType: routeData.service?.serviceType ?? "Internal",
- replenishmentSystem: routeData.service?.replenishmentSystem ?? "Make",
- defaultMethodType: routeData.service?.defaultMethodType ?? "Make",
- itemTrackingType: "Non-Inventory" as const,
- active: routeData.service?.active ?? true,
- unitOfMeasureCode: "EA",
- ...getCustomFields(routeData.service?.customFields),
- };
-
- return (
- <VStack spacing={2} className="w-full h-full">
- <ServiceForm
- key={serviceInitialValues.id}
- initialValues={serviceInitialValues}
- />
- {permissions.is("employee") && (
- <ItemDocuments
- files={routeData?.files ?? []}
- itemId={itemId}
- type="Material"
- />
- )}
- </VStack>
- );
-}
diff --git a/apps/carbon/app/routes/x+/service+/$itemId.purchasing.new.tsx b/apps/carbon/app/routes/x+/service+/$itemId.purchasing.new.tsx
deleted file mode 100644
index 304b0919ad..0000000000
--- a/apps/carbon/app/routes/x+/service+/$itemId.purchasing.new.tsx
+++ /dev/null
@@ -1,70 +0,0 @@
-import { assertIsPost, error } from "@carbon/auth";
-import { requirePermissions } from "@carbon/auth/auth.server";
-import { flash } from "@carbon/auth/session.server";
-import { validationError, validator } from "@carbon/form";
-import { useParams } from "@remix-run/react";
-import type { ActionFunctionArgs } from "@vercel/remix";
-import { redirect } from "@vercel/remix";
-import {
- BuyMethodForm,
- buyMethodValidator,
- upsertBuyMethod,
-} from "~/modules/items";
-import { setCustomFields } from "~/utils/form";
-import { path } from "~/utils/path";
-
-export async function action({ request, params }: ActionFunctionArgs) {
- assertIsPost(request);
- const { client, companyId, userId } = await requirePermissions(request, {
- create: "parts",
- });
-
- const { itemId } = params;
- if (!itemId) throw new Error("Could not find itemId");
-
- const formData = await request.formData();
- const validation = await validator(buyMethodValidator).validate(formData);
-
- if (validation.error) {
- return validationError(validation.error);
- }
-
- const { id, ...data } = validation.data;
-
- const createPartSupplier = await upsertBuyMethod(client, {
- ...data,
- companyId,
- createdBy: userId,
- customFields: setCustomFields(formData),
- });
-
- if (createPartSupplier.error) {
- throw redirect(
- path.to.servicePurchasing(itemId),
- await flash(
- request,
- error(createPartSupplier.error, "Failed to create service supplier")
- )
- );
- }
-
- throw redirect(path.to.servicePurchasing(itemId));
-}
-
-export default function NewPartSupplierRoute() {
- const { itemId } = useParams();
-
- if (!itemId) throw new Error("itemId not found");
-
- const initialValues = {
- itemId: itemId,
- supplierId: "",
- supplierPartId: "",
- unitPrice: 0,
- supplierUnitOfMeasureCode: "EA",
- minimumOrderQuantity: 1,
- conversionFactor: 1,
- };
-
- return <BuyMethodForm type="Service" initialValues={initialValues} />;
-}
diff --git a/apps/carbon/app/routes/x+/service+/$itemId.purchasing.tsx b/apps/carbon/app/routes/x+/service+/$itemId.purchasing.tsx
deleted file mode 100644
index 60514cd5e5..0000000000
--- a/apps/carbon/app/routes/x+/service+/$itemId.purchasing.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import { error } from "@carbon/auth";
-import { requirePermissions } from "@carbon/auth/auth.server";
-import { flash } from "@carbon/auth/session.server";
-import { useLoaderData } from "@remix-run/react";
-import type { LoaderFunctionArgs } from "@vercel/remix";
-import { json, redirect } from "@vercel/remix";
-import { getBuyMethods } from "~/modules/items";
-import BuyMethods from "~/modules/items/ui/Item/BuyMethods/BuyMethods";
-import { path } from "~/utils/path";
-
-export async function loader({ request, params }: LoaderFunctionArgs) {
- const { client, companyId } = await requirePermissions(request, {
- view: "parts",
- });
-
- const { itemId } = params;
- if (!itemId) throw new Error("Could not find itemId");
-
- const [suppliers] = await Promise.all([
- getBuyMethods(client, itemId, companyId),
- ]);
-
- if (suppliers.error) {
- throw redirect(
- path.to.service(itemId),
- await flash(
- request,
- error(suppliers.error, "Failed to load service suppliers")
- )
- );
- }
-
- return json({
- suppliers: suppliers.data ?? [],
- });
-}
-
-export default function ServiceSuppliersRoute() {
- const { suppliers } = useLoaderData<typeof loader>();
-
- return <BuyMethods buyMethods={suppliers} />;
-}
diff --git a/apps/carbon/app/routes/x+/service+/$itemId.tsx b/apps/carbon/app/routes/x+/service+/$itemId.tsx
deleted file mode 100644
index a62af366ee..0000000000
--- a/apps/carbon/app/routes/x+/service+/$itemId.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import { error } from "@carbon/auth";
-import { requirePermissions } from "@carbon/auth/auth.server";
-import { flash } from "@carbon/auth/session.server";
-import { VStack } from "@carbon/react";
-import { Outlet } from "@remix-run/react";
-import type { LoaderFunctionArgs } from "@vercel/remix";
-import { json, redirect } from "@vercel/remix";
-import {
- ServiceHeader,
- ServiceProperties,
- getBuyMethods,
- getItemFiles,
- getPickMethods,
- getService,
-} from "~/modules/items";
-import type { Handle } from "~/utils/handle";
-import { path } from "~/utils/path";
-
-export const handle: Handle = {
- breadcrumb: "Services",
- to: path.to.services,
-};
-
-export async function loader({ request, params }: LoaderFunctionArgs) {
- const { client, companyId } = await requirePermissions(request, {
- view: "parts",
- });
-
- const { itemId } = params;
- if (!itemId) throw new Error("Could not find itemId");
-
- const [service, files, buyMethods, pickMethods] = await Promise.all([
- getService(client, itemId, companyId),
- getItemFiles(client, itemId, companyId),
- getBuyMethods(client, itemId, companyId),
- getPickMethods(client, itemId, companyId),
- ]);
-
- if (service.error) {
- throw redirect(
- path.to.items,
- await flash(request, error(service.error, "Failed to load service"))
- );
- }
-
- return json({
- service: service.data,
- files: files.data ?? [],
- buyMethods: buyMethods.data ?? [],
- pickMethods: pickMethods.data ?? [],
- });
-}
-
-export default function ServiceRoute() {
- return (
- <div className="flex flex-col h-[calc(100vh-49px)] w-full">
- <ServiceHeader />
- <div className="flex h-[calc(100vh-99px)] w-full">
- <div className="flex h-full w-full overflow-y-auto">
- <VStack spacing={2} className="p-2 w-full h-full">
- <Outlet />
- </VStack>
- </div>
- <ServiceProperties />
- </div>
- </div>
- );
-}
diff --git a/apps/carbon/app/routes/x+/service+/_layout.tsx b/apps/carbon/app/routes/x+/service+/_layout.tsx
deleted file mode 100644
index 12853d150e..0000000000
--- a/apps/carbon/app/routes/x+/service+/_layout.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import { requirePermissions } from "@carbon/auth/auth.server";
-import { Outlet } from "@remix-run/react";
-import type { LoaderFunctionArgs, MetaFunction } from "@vercel/remix";
-import { getItemPostingGroupsList } from "~/modules/items";
-import { getLocationsList } from "~/modules/resources";
-import type { Handle } from "~/utils/handle";
-import { path } from "~/utils/path";
-
-export const meta: MetaFunction = () => {
- return [{ title: "Carbon | Service" }];
-};
-
-export const handle: Handle = {
- breadcrumb: "Items",
- to: path.to.items,
- module: "items",
-};
-
-export async function loader({ request }: LoaderFunctionArgs) {
- const { client, companyId } = await requirePermissions(request, {
- view: "parts",
- });
-
- const [itemPostingGroups, locations] = await Promise.all([
- getItemPostingGroupsList(client, companyId),
- getLocationsList(client, companyId),
- ]);
-
- return {
- locations: locations?.data ?? [],
- itemPostingGroups: itemPostingGroups?.data ?? [],
- };
-}
-
-export default function ServiceRoute() {
- return <Outlet />;
-}
diff --git a/apps/carbon/app/routes/x+/service+/new.tsx b/apps/carbon/app/routes/x+/service+/new.tsx
deleted file mode 100644
index 90dde04042..0000000000
--- a/apps/carbon/app/routes/x+/service+/new.tsx
+++ /dev/null
@@ -1,75 +0,0 @@
-import { assertIsPost, error } from "@carbon/auth";
-import { requirePermissions } from "@carbon/auth/auth.server";
-import { flash } from "@carbon/auth/session.server";
-import { validationError, validator } from "@carbon/form";
-import type { ActionFunctionArgs } from "@vercel/remix";
-import { redirect } from "@vercel/remix";
-import { ServiceForm, serviceValidator, upsertService } from "~/modules/items";
-import { setCustomFields } from "~/utils/form";
-import type { Handle } from "~/utils/handle";
-import { path } from "~/utils/path";
-
-export const handle: Handle = {
- breadcrumb: "Services",
- to: path.to.services,
-};
-
-export async function action({ request }: ActionFunctionArgs) {
- assertIsPost(request);
- const { client, companyId, userId } = await requirePermissions(request, {
- create: "parts",
- });
-
- const formData = await request.formData();
- const validation = await validator(serviceValidator).validate(formData);
-
- if (validation.error) {
- return validationError(validation.error);
- }
-
- const createService = await upsertService(client, {
- ...validation.data,
- companyId,
- createdBy: userId,
- customFields: setCustomFields(formData),
- });
- if (createService.error) {
- throw redirect(
- path.to.services,
- await flash(
- request,
- error(createService.error, "Failed to create service")
- )
- );
- }
-
- const serviceId = createService.data?.itemId;
- if (!serviceId) {
- throw redirect(
- path.to.services,
- await flash(
- request,
- error(createService.error, "Failed to create service")
- )
- );
- }
-
- throw redirect(path.to.service(serviceId));
-}
-
-export default function ServiceNewRoute() {
- const initialValues = {
- name: "",
- description: "",
- serviceType: "External" as "External",
- unitCost: 0,
- active: true,
- };
-
- return (
- <div className="w-1/2 max-w-[600px] min-w-[420px] mx-auto mt-8">
- {/* @ts-ignore */}
- <ServiceForm initialValues={initialValues} />
- </div>
- );
-}
diff --git a/apps/mes-prototype/package.json b/apps/mes-prototype/package.json
index 82cf1de672..68cb405744 100644
--- a/apps/mes-prototype/package.json
+++ b/apps/mes-prototype/package.json
@@ -21,7 +21,7 @@
"non.geist": "~1.0.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
- "react-icons": "^5.2.1",
+ "react-icons": "^5.3.0",
"react-router-dom": "^6.23.1",
"react-hook-form": "7.51.2",
"zod": "3.23.8"
diff --git a/package-lock.json b/package-lock.json
index 0e2e4c2166..2b08b7a2bd 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -301,7 +301,7 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "7.51.2",
- "react-icons": "^5.2.1",
+ "react-icons": "^5.3.0",
"react-router-dom": "^6.23.1",
"zod": "3.23.8"
},
@@ -35868,7 +35868,7 @@
"@remix-run/server-runtime": ">= 1.16.1 <3.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
- "react-icons": "^5.2.1"
+ "react-icons": "^5.3.0"
}
},
"packages/form/node_modules/ts-toolbelt": {
@@ -36006,7 +36006,7 @@
"@internationalized/date": "^3.5.2",
"framer-motion": "^11.1.7",
"react": "^18.3.1",
- "react-icons": "^5.2.1"
+ "react-icons": "^5.3.0"
}
},
"packages/react-hook-form": {
diff --git a/packages/form/package.json b/packages/form/package.json
index ffd1ba40ed..19bb8861ed 100644
--- a/packages/form/package.json
+++ b/packages/form/package.json
@@ -7,7 +7,7 @@
"@remix-run/server-runtime": ">= 1.16.1 <3.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
- "react-icons": "^5.2.1"
+ "react-icons": "^5.3.0"
},
"devDependencies": {
"@types/lodash.get": "^4.4.7",
diff --git a/packages/react/package.json b/packages/react/package.json
index 428ca4b1be..77ed1a2aa0 100644
--- a/packages/react/package.json
+++ b/packages/react/package.json
@@ -90,7 +90,7 @@
"@internationalized/date": "^3.5.2",
"framer-motion": "^11.1.7",
"react": "^18.3.1",
- "react-icons": "^5.2.1"
+ "react-icons": "^5.3.0"
},
"private": true,
"scripts": {
diff --git a/packages/react/src/CreateableMultiSelect.tsx b/packages/react/src/CreateableMultiSelect.tsx
index c8e213187f..58b4683c6b 100644
--- a/packages/react/src/CreateableMultiSelect.tsx
+++ b/packages/react/src/CreateableMultiSelect.tsx
@@ -321,14 +321,14 @@ function SelectedOption({
return (
<Badge
key={item}
- onClick={() => onUnselect(item)}
variant="secondary"
className="border border-border shadow-sm"
>
{options.find((option) => option.value === item)?.label}
<BadgeCloseButton
- tabIndex={-1}
disabled={isReadOnly}
+ tabIndex={-1}
+ type="button"
onKeyDown={(e) => {
if (e.key === "Enter" && !isReadOnly) {
onUnselect(item);
diff --git a/packages/react/src/MultiSelect.tsx b/packages/react/src/MultiSelect.tsx
index 8048be25e2..2fa71be651 100644
--- a/packages/react/src/MultiSelect.tsx
+++ b/packages/react/src/MultiSelect.tsx
@@ -79,22 +79,11 @@ const MultiSelect = forwardRef<HTMLButtonElement, MultiSelectProps>(
{hasSelections ? (
<div className="flex gap-1 flex-wrap">
{value.map((item) => (
- <Badge
- key={item}
- variant="secondary"
- onClick={() => handleUnselect(item)}
- >
+ <Badge key={item} variant="secondary">
{options.find((option) => option.value === item)?.label}
<BadgeCloseButton
- onKeyDown={(e) => {
- if (e.key === "Enter") {
- handleUnselect(item);
- }
- }}
- onMouseDown={(e) => {
- e.preventDefault();
- e.stopPropagation();
- }}
+ type="button"
+ tabIndex={-1}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();