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.

feat: add created date to files widgets

Brad Barbind44772385052
diff --git a/apps/erp/app/components/Documents.tsx b/apps/erp/app/components/Documents.tsx
index 103895b9b0..863bc5797a 100644
--- a/apps/erp/app/components/Documents.tsx
+++ b/apps/erp/app/components/Documents.tsx
@@ -20,7 +20,7 @@ import {
Tr,
toast
} from "@carbon/react";
-import { convertKbToString } from "@carbon/utils";
+import { convertKbToString, formatDate } from "@carbon/utils";
import type { ChangeEvent } from "react";
import { useCallback } from "react";
import { LuAxis3D, LuEllipsisVertical, LuUpload } from "react-icons/lu";
@@ -271,6 +271,7 @@ const Documents = ({
<Tr>
<Th>Name</Th>
<Th>Size</Th>
+ <Th>Created</Th>
<Th></Th>
</Tr>
</Thead>
@@ -299,6 +300,7 @@ const Documents = ({
)
: "--"}
</Td>
+ <Td className="text-xs font-mono">--</Td>
<Td>
<div className="flex justify-end w-full">
<DropdownMenu>
@@ -382,6 +384,9 @@ const Documents = ({
Math.floor((file.metadata?.size ?? 0) / 1024)
)}
</Td>
+ <Td className="text-xs font-mono">
+ {file.created_at ? formatDate(file.created_at) : "--"}
+ </Td>
<Td>
<div className="flex justify-end w-full">
<DropdownMenu>
diff --git a/apps/erp/app/modules/items/ui/Item/ItemDocuments.tsx b/apps/erp/app/modules/items/ui/Item/ItemDocuments.tsx
index 2918131d71..c6736ffefc 100644
--- a/apps/erp/app/modules/items/ui/Item/ItemDocuments.tsx
+++ b/apps/erp/app/modules/items/ui/Item/ItemDocuments.tsx
@@ -20,7 +20,7 @@ import {
Tr,
toast
} from "@carbon/react";
-import { convertKbToString } from "@carbon/utils";
+import { convertKbToString, formatDate } from "@carbon/utils";
import type { FileObject } from "@supabase/storage-js";
import type { ChangeEvent } from "react";
import { useCallback } from "react";
@@ -100,6 +100,7 @@ const ItemDocuments = ({
<Tr>
<Th>Name</Th>
<Th>Size</Th>
+ <Th>Created</Th>
<Th></Th>
</Tr>
</Thead>
@@ -121,6 +122,7 @@ const ItemDocuments = ({
)
: "--"}
</Td>
+ <Td className="text-xs font-mono">--</Td>
<Td>
<div className="flex justify-end w-full">
<DropdownMenu>
@@ -195,6 +197,9 @@ const ItemDocuments = ({
Math.floor((file.metadata?.size ?? 0) / 1024)
)}
</Td>
+ <Td className="text-xs font-mono">
+ {file.created_at ? formatDate(file.created_at) : "--"}
+ </Td>
<Td>
<div className="flex justify-end w-full">
<DropdownMenu>
diff --git a/apps/erp/app/modules/production/ui/Jobs/JobDocuments.tsx b/apps/erp/app/modules/production/ui/Jobs/JobDocuments.tsx
index 4be7b10330..8db8690e64 100644
--- a/apps/erp/app/modules/production/ui/Jobs/JobDocuments.tsx
+++ b/apps/erp/app/modules/production/ui/Jobs/JobDocuments.tsx
@@ -26,7 +26,7 @@ import {
toast,
VStack
} from "@carbon/react";
-import { convertKbToString } from "@carbon/utils";
+import { convertKbToString, formatDate } from "@carbon/utils";
import type { FileObject } from "@supabase/storage-js";
import type { ChangeEvent } from "react";
import { useCallback } from "react";
@@ -388,6 +388,7 @@ const JobDocuments = ({
<Th>Name</Th>
<Th>Size</Th>
<Th>Bucket</Th>
+ <Th>Created</Th>
<Th />
</Tr>
</Thead>
@@ -417,6 +418,7 @@ const JobDocuments = ({
<Td>
<Enumerable value="Job" />
</Td>
+ <Td className="text-xs font-mono">--</Td>
<Td>
<div className="flex justify-end w-full">
<DropdownMenu>
@@ -514,6 +516,9 @@ const JobDocuments = ({
}
/>
</Td>
+ <Td className="text-xs font-mono">
+ {file.created_at ? formatDate(file.created_at) : "--"}
+ </Td>
<Td>
<div className="flex justify-end w-full">
<DropdownMenu>
@@ -572,7 +577,7 @@ const JobDocuments = ({
{allFiles.length === 0 && !modelUpload && (
<Tr>
<Td
- colSpan={4}
+ colSpan={5}
className="py-8 text-muted-foreground text-center"
>
No files
diff --git a/apps/erp/app/modules/purchasing/ui/SupplierInteraction/SupplierInteractionDocuments.tsx b/apps/erp/app/modules/purchasing/ui/SupplierInteraction/SupplierInteractionDocuments.tsx
index 01a3884f4d..8af2931ca9 100644
--- a/apps/erp/app/modules/purchasing/ui/SupplierInteraction/SupplierInteractionDocuments.tsx
+++ b/apps/erp/app/modules/purchasing/ui/SupplierInteraction/SupplierInteractionDocuments.tsx
@@ -20,7 +20,7 @@ import {
Tr,
toast
} from "@carbon/react";
-import { convertKbToString } from "@carbon/utils";
+import { convertKbToString, formatDate } from "@carbon/utils";
import type { FileObject } from "@supabase/storage-js";
import type { ChangeEvent } from "react";
import { useCallback } from "react";
@@ -85,6 +85,7 @@ const SupplierInteractionDocuments = ({
<Tr>
<Th>Name</Th>
<Th>Size</Th>
+ <Th>Created</Th>
<Th></Th>
</Tr>
</Thead>
@@ -121,6 +122,11 @@ const SupplierInteractionDocuments = ({
Math.floor((attachment.metadata?.size ?? 0) / 1024)
)}
</Td>
+ <Td className="text-xs font-mono">
+ {attachment.created_at
+ ? formatDate(attachment.created_at)
+ : "--"}
+ </Td>
<Td>
<div className="flex justify-end gap-2">
<DropdownMenu>
diff --git a/apps/erp/app/modules/purchasing/ui/SupplierInteraction/SupplierInteractionLineDocuments.tsx b/apps/erp/app/modules/purchasing/ui/SupplierInteraction/SupplierInteractionLineDocuments.tsx
index 608c89ebc5..08136321c4 100644
--- a/apps/erp/app/modules/purchasing/ui/SupplierInteraction/SupplierInteractionLineDocuments.tsx
+++ b/apps/erp/app/modules/purchasing/ui/SupplierInteraction/SupplierInteractionLineDocuments.tsx
@@ -20,7 +20,7 @@ import {
Tr,
toast
} from "@carbon/react";
-import { convertKbToString } from "@carbon/utils";
+import { convertKbToString, formatDate } from "@carbon/utils";
import type { FileObject } from "@supabase/storage-js";
import type { ChangeEvent } from "react";
import { useCallback } from "react";
@@ -241,6 +241,7 @@ const SupplierInteractionLineDocuments = ({
<Tr>
<Th>Name</Th>
<Th>Size</Th>
+ <Th>Created</Th>
<Th />
</Tr>
</Thead>
@@ -287,6 +288,9 @@ const SupplierInteractionLineDocuments = ({
Math.floor((file.metadata?.size ?? 0) / 1024)
)}
</Td>
+ <Td className="text-xs font-mono">
+ {file.created_at ? formatDate(file.created_at) : "--"}
+ </Td>
<Td>
<div className="flex justify-end w-full">
<DropdownMenu>
diff --git a/apps/erp/app/modules/sales/ui/Opportunity/OpportunityDocuments.tsx b/apps/erp/app/modules/sales/ui/Opportunity/OpportunityDocuments.tsx
index fc4cf1d99d..95381651bd 100644
--- a/apps/erp/app/modules/sales/ui/Opportunity/OpportunityDocuments.tsx
+++ b/apps/erp/app/modules/sales/ui/Opportunity/OpportunityDocuments.tsx
@@ -21,7 +21,7 @@ import {
Tr,
toast
} from "@carbon/react";
-import { convertKbToString } from "@carbon/utils";
+import { convertKbToString, formatDate } from "@carbon/utils";
import { useDndContext, useDraggable } from "@dnd-kit/core";
import type { FileObject } from "@supabase/storage-js";
import type { ChangeEvent } from "react";
@@ -107,6 +107,7 @@ const OpportunityDocuments = ({
<Tr>
<Th>Name</Th>
<Th>Size</Th>
+ <Th>Created</Th>
<Th></Th>
</Tr>
</Thead>
@@ -125,6 +126,11 @@ const OpportunityDocuments = ({
Math.floor((attachment.metadata?.size ?? 0) / 1024)
)}
</Td>
+ <Td className="text-xs font-mono">
+ {attachment.created_at
+ ? formatDate(attachment.created_at)
+ : "--"}
+ </Td>
<Td>
<div className="flex justify-end gap-2">
<DropdownMenu>
diff --git a/apps/erp/app/modules/sales/ui/Opportunity/OpportunityLineDocuments.tsx b/apps/erp/app/modules/sales/ui/Opportunity/OpportunityLineDocuments.tsx
index d975537854..a0f08525ad 100644
--- a/apps/erp/app/modules/sales/ui/Opportunity/OpportunityLineDocuments.tsx
+++ b/apps/erp/app/modules/sales/ui/Opportunity/OpportunityLineDocuments.tsx
@@ -26,7 +26,7 @@ import {
toast,
VStack
} from "@carbon/react";
-import { convertKbToString } from "@carbon/utils";
+import { convertKbToString, formatDate } from "@carbon/utils";
import type { FileObject } from "@supabase/storage-js";
import type { ChangeEvent } from "react";
import { useCallback } from "react";
@@ -449,6 +449,7 @@ const OpportunityLineDocuments = ({
<Th>Name</Th>
<Th>Size</Th>
<Th>Bucket</Th>
+ <Th>Created</Th>
<Th />
</Tr>
</Thead>
@@ -478,6 +479,7 @@ const OpportunityLineDocuments = ({
<Td>
<Enumerable value="Model" />
</Td>
+ <Td className="text-xs font-mono">--</Td>
<Td>
<div className="flex justify-end w-full">
<DropdownMenu>
@@ -573,6 +575,9 @@ const OpportunityLineDocuments = ({
}
/>
</Td>
+ <Td className="text-xs font-mono">
+ {file.created_at ? formatDate(file.created_at) : "--"}
+ </Td>
<Td>
<div className="flex justify-end w-full">
<DropdownMenu>
@@ -633,7 +638,7 @@ const OpportunityLineDocuments = ({
{allFiles.length === 0 && !modelUpload && (
<Tr>
<Td
- colSpan={4}
+ colSpan={5}
className="py-8 text-muted-foreground text-center"
>
No files