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.

refactor: remove console.logs

Brad Barbin0b8ac3e0672e
diff --git a/apps/carbon/app/components/Form/Sequence.tsx b/apps/carbon/app/components/Form/Sequence.tsx
index aa5220bcc8..90cb6aad4e 100644
--- a/apps/carbon/app/components/Form/Sequence.tsx
+++ b/apps/carbon/app/components/Form/Sequence.tsx
@@ -48,8 +48,6 @@ const Sequence = ({
[sequenceFetcher.data]
);
- console.log(sequenceFetcher.data?.data);
-
const handleChange = (selection: {
value: string | number;
label: string;
diff --git a/apps/carbon/app/components/Form/Service.tsx b/apps/carbon/app/components/Form/Service.tsx
index c2f4948079..f31f641a9f 100644
--- a/apps/carbon/app/components/Form/Service.tsx
+++ b/apps/carbon/app/components/Form/Service.tsx
@@ -30,8 +30,6 @@ const Service = ({
const { getInputProps, error } = useField(name);
const [value, setValue] = useControlField<string | undefined>(name);
- console.log(value);
-
const servicesFetcher =
useFetcher<Awaited<ReturnType<typeof getServicesList>>>();
diff --git a/apps/carbon/app/components/Grid/Grid.tsx b/apps/carbon/app/components/Grid/Grid.tsx
index b771c43f3e..a2df589545 100644
--- a/apps/carbon/app/components/Grid/Grid.tsx
+++ b/apps/carbon/app/components/Grid/Grid.tsx
@@ -128,7 +128,6 @@ const Grid = <T extends object>({
}
return row;
});
- console.log("calling onDataChange", newData);
onDataChange?.(newData);
return newData;
diff --git a/apps/carbon/app/modules/documents/ui/Documents/DocumentsTable/DocumentsTable.tsx b/apps/carbon/app/modules/documents/ui/Documents/DocumentsTable/DocumentsTable.tsx
index 9cba00b816..aa6a988019 100644
--- a/apps/carbon/app/modules/documents/ui/Documents/DocumentsTable/DocumentsTable.tsx
+++ b/apps/carbon/app/modules/documents/ui/Documents/DocumentsTable/DocumentsTable.tsx
@@ -20,13 +20,7 @@ import {
} from "@chakra-ui/react";
import type { ColumnDef } from "@tanstack/react-table";
import { memo, useCallback, useEffect, useMemo, useState } from "react";
-import {
- BsEyeFill,
- BsPencilSquare,
- BsStar,
- BsStarFill,
- BsTag,
-} from "react-icons/bs";
+import { BsPencilSquare, BsStar, BsStarFill } from "react-icons/bs";
import { IoMdAdd, IoMdTrash } from "react-icons/io";
import { VscOpenPreview } from "react-icons/vsc";
import { Avatar, Table } from "~/components";
@@ -239,40 +233,40 @@ const DocumentsTable = memo(({ data, count, labels }: DocumentsTableProps) => {
const actions = useMemo(() => {
return [
- {
- label: "Add to Favorites",
- icon: <BsStar />,
- onClick: (selected: Document[]) => {
- console.log("move to favorites", selected);
- },
- },
- {
- label: "Add Labels",
- icon: <BsTag />,
- // TODO - disabled can be a function of selected
- disabled: true,
- onClick: (selected: Document[]) => {
- console.log("move to favorites", selected);
- },
- },
- {
- label: "Move to Trash",
- icon: <IoMdTrash />,
- // TODO - disabled can be a function of selected
- disabled: true,
- onClick: (selected: Document[]) => {
- console.log("move to trash", selected);
- },
- },
- {
- label: "Update Visibility",
- icon: <BsEyeFill />,
- // TODO - disabled can be a function of selected
- disabled: true,
- onClick: (selected: Document[]) => {
- console.log("update visibility", selected);
- },
- },
+ // {
+ // label: "Add to Favorites",
+ // icon: <BsStar />,
+ // onClick: (selected: Document[]) => {
+ // console.log("move to favorites", selected);
+ // },
+ // },
+ // {
+ // label: "Add Labels",
+ // icon: <BsTag />,
+ // // TODO - disabled can be a function of selected
+ // disabled: true,
+ // onClick: (selected: Document[]) => {
+ // console.log("move to favorites", selected);
+ // },
+ // },
+ // {
+ // label: "Move to Trash",
+ // icon: <IoMdTrash />,
+ // // TODO - disabled can be a function of selected
+ // disabled: true,
+ // onClick: (selected: Document[]) => {
+ // console.log("move to trash", selected);
+ // },
+ // },
+ // {
+ // label: "Update Visibility",
+ // icon: <BsEyeFill />,
+ // // TODO - disabled can be a function of selected
+ // disabled: true,
+ // onClick: (selected: Document[]) => {
+ // console.log("update visibility", selected);
+ // },
+ // },
];
}, []);
diff --git a/apps/carbon/app/modules/inventory/inventory.service.ts b/apps/carbon/app/modules/inventory/inventory.service.ts
index 39d3a1927b..30b81161e2 100644
--- a/apps/carbon/app/modules/inventory/inventory.service.ts
+++ b/apps/carbon/app/modules/inventory/inventory.service.ts
@@ -134,7 +134,6 @@ export async function upsertReceipt(
updatedBy: string;
})
) {
- console.log("upserting receipt", receipt);
if ("createdBy" in receipt) {
return client.from("receipt").insert([receipt]).select("id").single();
}
diff --git a/apps/carbon/app/modules/inventory/ui/Receipts/ReceiptForm/useReceiptForm.tsx b/apps/carbon/app/modules/inventory/ui/Receipts/ReceiptForm/useReceiptForm.tsx
index 539fded73f..6f43d722ea 100644
--- a/apps/carbon/app/modules/inventory/ui/Receipts/ReceiptForm/useReceiptForm.tsx
+++ b/apps/carbon/app/modules/inventory/ui/Receipts/ReceiptForm/useReceiptForm.tsx
@@ -100,9 +100,7 @@ export default function useReceiptForm({
try {
await fetch(path.to.api.rollback("receipt", receipt.id), {
method: "DELETE",
- })
- .then(() => console.log("successfully rolled back receipt sequence"))
- .catch(console.error);
+ }).catch(console.error);
await supabase.from("receipt").delete().eq("receiptId", receipt.id);
} catch {
@@ -229,7 +227,7 @@ export default function useReceiptForm({
const outstandingQuantity =
d.purchaseQuantity -
- (previouslyReceivedQuantitiesByLine[d.id] ?? 0);
+ (previouslyReceivedQuantitiesByLine[d.id!] ?? 0);
acc.push({
receiptId: receipt.id,
diff --git a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderInternalDocuments/usePurchaseOrderDocuments.ts b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderInternalDocuments/usePurchaseOrderDocuments.ts
index 143400518b..eb74ca3001 100644
--- a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderInternalDocuments/usePurchaseOrderDocuments.ts
+++ b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderInternalDocuments/usePurchaseOrderDocuments.ts
@@ -21,15 +21,6 @@ export const usePurchaseOrderDocuments = ({
const permissions = usePermissions();
const { supabase } = useSupabase();
- // const [users, setUsers] = useState<
- // {
- // id: string;
- // firstName: string | null;
- // lastName: string | null;
- // avatarUrl: string | null;
- // }[]
- // >([]);
-
const canDelete = permissions.can("delete", "purchasing"); // TODO: or is document owner
const refresh = useCallback(
@@ -37,44 +28,6 @@ export const usePurchaseOrderDocuments = ({
[fetcher]
);
- // const getUsers = useCallback(async () => {
- // const userIds = [
- // ...new Set(attachments.map((attachment) => attachment.owner)),
- // ];
-
- // if (!supabase) return {};
-
- // const { data, error } = await supabase
- // .from("users")
- // .select("*")
- // .in("id", userIds);
-
- // if (error) {
- // setUsers([]);
- // } else {
- // console.log(data);
- // setUsers(data);
- // }
- // }, [attachments, supabase]);
-
- // useEffect(() => {
- // getUsers();
- // }, [getUsers]);
-
- // const usersMap = useMemo<
- // Record<string, { fullName: string; avatarUrl: string | null }>
- // >(() => {
- // return users.reduce<
- // Record<string, { fullName: string; avatarUrl: string | null }>
- // >((acc, user) => {
- // acc[user.id] = {
- // fullName: `${user.firstName} ${user.lastName}`,
- // avatarUrl: user.avatarUrl,
- // };
- // return acc;
- // }, {});
- // }, [users]);
-
const deleteAttachment = useCallback(
async (attachment: PurchaseOrderAttachment) => {
const result = await supabase?.storage
diff --git a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.tsx b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.tsx
index af2a5f6b9b..f9402fc8fe 100644
--- a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.tsx
+++ b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.tsx
@@ -62,7 +62,6 @@ export default function PurchaseInvoiceRoute() {
const [, setPurchaseInvoiceTotals] = usePurchaseInvoiceTotals();
useEffect(() => {
- console.log({ purchaseInvoiceLines });
const totals = purchaseInvoiceLines.reduce(
(acc, line) => {
acc.total += line?.totalAmount ?? 0;
diff --git a/apps/carbon/app/routes/x+/purchase-order+/$orderId.details.tsx b/apps/carbon/app/routes/x+/purchase-order+/$orderId.details.tsx
index 72c7bc07e8..a9517809fc 100644
--- a/apps/carbon/app/routes/x+/purchase-order+/$orderId.details.tsx
+++ b/apps/carbon/app/routes/x+/purchase-order+/$orderId.details.tsx
@@ -36,8 +36,6 @@ export async function action({ request, params }: ActionFunctionArgs) {
const { purchaseOrderId, ...data } = validation.data;
if (!purchaseOrderId) throw new Error("Could not find purchaseOrderId");
- console.log({ data });
-
const updatePurchaseOrder = await upsertPurchaseOrder(client, {
id: orderId,
purchaseOrderId,
diff --git a/apps/carbon/app/routes/x+/resources+/equipment.unit.new.tsx b/apps/carbon/app/routes/x+/resources+/equipment.unit.new.tsx
index dac172b1b4..a18b43f2ce 100644
--- a/apps/carbon/app/routes/x+/resources+/equipment.unit.new.tsx
+++ b/apps/carbon/app/routes/x+/resources+/equipment.unit.new.tsx
@@ -24,8 +24,6 @@ export async function action({ request }: ActionFunctionArgs) {
const { id, ...data } = validation.data;
- console.log(data);
-
const insertEquipment = await upsertEquipment(client, {
...data,
createdBy: userId,