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.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
fix(production): friendly empty state for operations with no events
sidgaikwad678cf28e16cf
diff --git a/apps/erp/app/components/Table/Table.tsx b/apps/erp/app/components/Table/Table.tsxindex 602d80f7b4..c8188875a8 100644--- a/apps/erp/app/components/Table/Table.tsx+++ b/apps/erp/app/components/Table/Table.tsx@@ -102,6 +102,12 @@ interface TableProps<T extends object> {label: string;}[];primaryAction?: ReactNode;+ // Optional override for the "no rows" state. When provided and the table is+ // empty (and not loading), this is rendered instead of the default+ // "No results found" / "No data exists" blocks. Use it when the generic+ // filtered empty state would be misleading — e.g. a table pre-filtered to a+ // parent entity that simply has no child records yet.+ emptyState?: ReactNode;// Optional controls rendered in the toolbar row next to the search/filter// (e.g. quick filter toggles that write their own `filter` URL params).headerActions?: ReactNode;@@ -255,6 +261,7 @@ const Table = <T extends object>({editableComponents,importCSV,primaryAction,+ emptyState,headerActions,table: tableName,title,@@ -1054,6 +1061,10 @@ const Table = <T extends object>({</Tbody></TableBase></div>+ ) : emptyState ? (+ <div className="flex flex-col w-full h-full items-center justify-center gap-4">+ {emptyState}+ </div>) : hasFilters ? (<div className="flex flex-col w-full h-full items-center justify-center gap-4"><div className="flex justify-center items-center h-12 w-12 rounded-full bg-foreground text-background -mt-[10dvh]">diff --git a/apps/erp/app/modules/production/ui/Jobs/ProductionEventsTable.tsx b/apps/erp/app/modules/production/ui/Jobs/ProductionEventsTable.tsxindex e23a7e4a51..b8cc51b583 100644--- a/apps/erp/app/modules/production/ui/Jobs/ProductionEventsTable.tsx+++ b/apps/erp/app/modules/production/ui/Jobs/ProductionEventsTable.tsx@@ -1,9 +1,9 @@import { Badge, MenuIcon, MenuItem, useDisclosure } from "@carbon/react";import { formatDurationMilliseconds } from "@carbon/utils";-import { useLingui } from "@lingui/react/macro";+import { Trans, useLingui } from "@lingui/react/macro";import type { ColumnDef } from "@tanstack/react-table";import { memo, useCallback, useMemo, useState } from "react";-import { LuPencil, LuTrash } from "react-icons/lu";+import { LuPencil, LuTimer, LuTrash } from "react-icons/lu";import { useNavigate, useParams } from "react-router";import {EmployeeAvatar,@@ -219,6 +219,33 @@ const ProductionEventsTable = memo();const [params] = useUrlParams();+ // When arriving from a job's Estimates vs Actual view, the table is+ // pre-filtered to a single operation (`filter=jobOperationId:eq:...`). An+ // operation with no recorded time yet is a normal, expected state — not a+ // failed search — so show a plain message instead of the generic+ // "No results found / Remove Filters" empty state, which would imply the+ // filter is the problem.+ //+ // Only override when the operation filter is the *sole* narrowing: if the+ // user has also applied an employee/type filter or a search, "Remove+ // Filters" is genuinely useful, so keep the generic empty state for those.+ const activeFilters = params.getAll("filter");+ const isFilteredToOperation =+ !params.get("search") &&+ activeFilters.length === 1 &&+ activeFilters[0].startsWith("jobOperationId:");++ const emptyState = isFilteredToOperation ? (+ <>+ <div className="flex justify-center items-center h-12 w-12 rounded-full bg-muted text-muted-foreground -mt-[10dvh]">+ <LuTimer className="h-6 w-6 shrink-0" />+ </div>+ <span className="text-xs font-mono font-light text-muted-foreground uppercase text-center max-w-xs text-balance">+ <Trans>No production events recorded for this operation yet</Trans>+ </span>+ </>+ ) : undefined;+return (<><Table<ProductionEvent>@@ -226,6 +253,7 @@ const ProductionEventsTable = memo(count={count}columns={columns}data={data}+ emptyState={emptyState}primaryAction={permissions.can("update", "accounting") && (<Newdiff --git a/packages/locale/locales/de/erp.po b/packages/locale/locales/de/erp.poindex 7acb562b91..d61607c9c2 100644--- a/packages/locale/locales/de/erp.po+++ b/packages/locale/locales/de/erp.po@@ -8542,6 +8542,9 @@ msgstr "Keine Drucker konfiguriert. Klicken Sie auf „Drucker hinzufügen\", ummsgid "No process selected"msgstr "Kein Prozess ausgewählt"+msgid "No production events recorded for this operation yet"+msgstr "Für diesen Vorgang wurden noch keine Produktionsereignisse aufgezeichnet"+msgid "No Quote"msgstr "Kein Angebot"diff --git a/packages/locale/locales/en/erp.po b/packages/locale/locales/en/erp.poindex 5da22c279d..81227e2b68 100644--- a/packages/locale/locales/en/erp.po+++ b/packages/locale/locales/en/erp.po@@ -8542,6 +8542,9 @@ msgstr "No printers configured. Click \"Add Printer\" to create one."msgid "No process selected"msgstr "No process selected"+msgid "No production events recorded for this operation yet"+msgstr "No production events recorded for this operation yet"+msgid "No Quote"msgstr "No Quote"diff --git a/packages/locale/locales/es/erp.po b/packages/locale/locales/es/erp.poindex 743c1060fa..bbcf64d1cc 100644--- a/packages/locale/locales/es/erp.po+++ b/packages/locale/locales/es/erp.po@@ -8542,6 +8542,9 @@ msgstr "No hay impresoras configuradas. Haz clic en \"Agregar impresora\" para cmsgid "No process selected"msgstr "Ningún proceso seleccionado"+msgid "No production events recorded for this operation yet"+msgstr "Aún no se han registrado eventos de producción para esta operación"+msgid "No Quote"msgstr "Sin Cotización"diff --git a/packages/locale/locales/fr/erp.po b/packages/locale/locales/fr/erp.poindex ba380384b7..a63489a4e6 100644--- a/packages/locale/locales/fr/erp.po+++ b/packages/locale/locales/fr/erp.po@@ -8542,6 +8542,9 @@ msgstr "Aucune imprimante configurée. Cliquez sur « Ajouter une imprimante »msgid "No process selected"msgstr "Aucun processus sélectionné"+msgid "No production events recorded for this operation yet"+msgstr "Aucun événement de production n'a encore été enregistré pour cette opération"+msgid "No Quote"msgstr "Pas de devis"diff --git a/packages/locale/locales/hi/erp.po b/packages/locale/locales/hi/erp.poindex e5afa71410..16dc21ec12 100644--- a/packages/locale/locales/hi/erp.po+++ b/packages/locale/locales/hi/erp.po@@ -8542,6 +8542,9 @@ msgstr "कोई प्रिंटर कॉन्फ़िगर नहींmsgid "No process selected"msgstr "कोई प्रक्रिया चयनित नहीं है"+msgid "No production events recorded for this operation yet"+msgstr "इस ऑपरेशन के लिए अभी तक कोई उत्पादन घटना रिकॉर्ड नहीं की गई है"+msgid "No Quote"msgstr "कोई उद्धरण नहीं"diff --git a/packages/locale/locales/it/erp.po b/packages/locale/locales/it/erp.poindex 874d973f55..b02b47ac35 100644--- a/packages/locale/locales/it/erp.po+++ b/packages/locale/locales/it/erp.po@@ -8542,6 +8542,9 @@ msgstr "Nessuna stampante configurata. Fai clic su \"Aggiungi stampante\" per crmsgid "No process selected"msgstr "Nessun processo selezionato"+msgid "No production events recorded for this operation yet"+msgstr "Nessun evento di produzione ancora registrato per questa operazione"+msgid "No Quote"msgstr "Nessuna offerta"diff --git a/packages/locale/locales/ja/erp.po b/packages/locale/locales/ja/erp.poindex f1b1fbed21..7654faea85 100644--- a/packages/locale/locales/ja/erp.po+++ b/packages/locale/locales/ja/erp.po@@ -8542,6 +8542,9 @@ msgstr "プリンターが設定されていません。「プリンターを追msgid "No process selected"msgstr "プロセスが選択されていません"+msgid "No production events recorded for this operation yet"+msgstr "この操作で記録された生産イベントはまだありません"+msgid "No Quote"msgstr "見積なし"diff --git a/packages/locale/locales/ko/erp.po b/packages/locale/locales/ko/erp.poindex 7bbabd9a65..a02d5fceda 100644--- a/packages/locale/locales/ko/erp.po+++ b/packages/locale/locales/ko/erp.po@@ -8542,6 +8542,9 @@ msgstr "설정된 프린터가 없습니다. \"프린터 추가\"를 클릭하msgid "No process selected"msgstr "프로세스를 선택하지 않았습니다"+msgid "No production events recorded for this operation yet"+msgstr "이 공정작업에 대해 아직 기록된 생산 이벤트가 없습니다"+msgid "No Quote"msgstr "견적 없음"diff --git a/packages/locale/locales/pl/erp.po b/packages/locale/locales/pl/erp.poindex ddff45357c..ab2377d71b 100644--- a/packages/locale/locales/pl/erp.po+++ b/packages/locale/locales/pl/erp.po@@ -8542,6 +8542,9 @@ msgstr "Brak skonfigurowanych drukarek. Kliknij „Dodaj drukarkę\", aby utworzmsgid "No process selected"msgstr "Nie wybrano procesu"+msgid "No production events recorded for this operation yet"+msgstr "Brak zarejestrowanych zdarzeń produkcyjnych dla tej operacji"+msgid "No Quote"msgstr "Brak oferty"diff --git a/packages/locale/locales/pt/erp.po b/packages/locale/locales/pt/erp.poindex 8b5633efaf..2cf81ae711 100644--- a/packages/locale/locales/pt/erp.po+++ b/packages/locale/locales/pt/erp.po@@ -8542,6 +8542,9 @@ msgstr "Nenhuma impressora configurada. Clique em \"Adicionar Impressora\" paramsgid "No process selected"msgstr "Nenhum processo selecionado"+msgid "No production events recorded for this operation yet"+msgstr "Ainda não há eventos de produção registados para esta operação"+msgid "No Quote"msgstr "Sem Cotação"diff --git a/packages/locale/locales/ru/erp.po b/packages/locale/locales/ru/erp.poindex 0afbbe03d1..cbcbcd09b1 100644--- a/packages/locale/locales/ru/erp.po+++ b/packages/locale/locales/ru/erp.po@@ -8542,6 +8542,9 @@ msgstr "Принтеры не настроены. Нажмите «Добавиmsgid "No process selected"msgstr "Процесс не выбран"+msgid "No production events recorded for this operation yet"+msgstr "Для этой операции еще не записано ни одного производственного события"+msgid "No Quote"msgstr "Нет предложения"diff --git a/packages/locale/locales/tr/erp.po b/packages/locale/locales/tr/erp.poindex eab8a14a78..da88cb7109 100644--- a/packages/locale/locales/tr/erp.po+++ b/packages/locale/locales/tr/erp.po@@ -8542,6 +8542,9 @@ msgstr "Yapılandırılmış yazıcı yok. Bir tane oluşturmak için \"Yazıcımsgid "No process selected"msgstr "Hiçbir işlem seçilmedi"+msgid "No production events recorded for this operation yet"+msgstr "Bu işlem için henüz üretim etkinliği kaydedilmedi"+msgid "No Quote"msgstr "Teklif Yok"diff --git a/packages/locale/locales/zh/erp.po b/packages/locale/locales/zh/erp.poindex 67f50f7ecc..3484b96724 100644--- a/packages/locale/locales/zh/erp.po+++ b/packages/locale/locales/zh/erp.po@@ -8542,6 +8542,9 @@ msgstr "未配置打印机。点击\"添加打印机\"创建一个。"msgid "No process selected"msgstr "未选择工艺"+msgid "No production events recorded for this operation yet"+msgstr "此操作尚未记录任何生产事件"+msgid "No Quote"msgstr "无报价"