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: close supplier process drawer

Brad Barbine4a5b86b21c2
diff --git a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierProcessForm.tsx b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierProcessForm.tsx
index c8e554cac7..759e63cea5 100644
--- a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierProcessForm.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierProcessForm.tsx
@@ -12,7 +12,7 @@ import {
VStack,
} from "@carbon/react";
import { ValidatedForm } from "@carbon/remix-validated-form";
-import { useFetcher, useParams } from "@remix-run/react";
+import { useFetcher, useNavigate, useParams } from "@remix-run/react";
import type { PostgrestResponse } from "@supabase/supabase-js";
import { useEffect, useState } from "react";
import type { z } from "zod";
@@ -46,6 +46,7 @@ const SupplierProcessForm = ({
const fetcher = useFetcher<PostgrestResponse<SupplierProcess>>();
const { supplierId } = useParams();
const [supplier, setSupplier] = useState<string | undefined>(supplierId);
+ const navigate = useNavigate();
useEffect(() => {
if (type !== "modal") return;
@@ -69,7 +70,13 @@ const SupplierProcessForm = ({
<ModalDrawer
open={open}
onOpenChange={(isOpen) => {
- if (!isOpen) onClose?.();
+ if (!isOpen) {
+ if (type === "modal") {
+ onClose?.();
+ } else {
+ navigate(-1);
+ }
+ }
}}
>
<ModalDrawerContent>