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
feat: open PDF documents in a new tab on click instead of downloading
Rob Carringtonc25e353cc7fe
diff --git a/apps/erp/app/components/Documents.tsx b/apps/erp/app/components/Documents.tsxindex ef5f408928..7d12c56164 100644--- a/apps/erp/app/components/Documents.tsx+++ b/apps/erp/app/components/Documents.tsx@@ -353,7 +353,18 @@ const Documents = ({<DocumentIcon type={type} /><spanclassName="font-medium"- onClick={() => download(file)}+ onClick={() => {+ if (["PDF", "Image"].includes(type)) {+ window.open(+ path.to.file.previewFile(+ `${"private"}/${getReadPath(file)}`+ ),+ "_blank"+ );+ } else {+ download(file);+ }+ }}>{isPreviewable ? (<DocumentPreviewdiff --git a/apps/erp/app/modules/items/ui/Item/ItemDocuments.tsx b/apps/erp/app/modules/items/ui/Item/ItemDocuments.tsxindex 642358d30b..bcb6f1330e 100644--- a/apps/erp/app/modules/items/ui/Item/ItemDocuments.tsx+++ b/apps/erp/app/modules/items/ui/Item/ItemDocuments.tsx@@ -165,7 +165,18 @@ const ItemDocuments = ({<DocumentIcon type={type} /><spanclassName="font-medium"- onClick={() => download(file)}+ onClick={() => {+ if (["PDF", "Image"].includes(type)) {+ window.open(+ path.to.file.previewFile(+ `${"private"}/${getPath(file)}`+ ),+ "_blank"+ );+ } else {+ download(file);+ }+ }}>{["PDF", "Image"].includes(type) ? (<DocumentPreviewdiff --git a/apps/erp/app/modules/purchasing/ui/SupplierInteraction/SupplierInteractionLineDocuments.tsx b/apps/erp/app/modules/purchasing/ui/SupplierInteraction/SupplierInteractionLineDocuments.tsxindex 153cbce6f7..1d272ec38d 100644--- a/apps/erp/app/modules/purchasing/ui/SupplierInteraction/SupplierInteractionLineDocuments.tsx+++ b/apps/erp/app/modules/purchasing/ui/SupplierInteraction/SupplierInteractionLineDocuments.tsx@@ -259,7 +259,18 @@ const SupplierInteractionLineDocuments = ({<DocumentIcon type={type} /><spanclassName="font-medium"- onClick={() => download(file)}+ onClick={() => {+ if (["PDF", "Image"].includes(type)) {+ window.open(+ path.to.file.previewFile(+ `${"private"}/${getPath(file)}`+ ),+ "_blank"+ );+ } else {+ download(file);+ }+ }}>{["PDF", "Image"].includes(type) ? (<DocumentPreviewdiff --git a/apps/erp/app/modules/sales/ui/Opportunity/OpportunityLineDocuments.tsx b/apps/erp/app/modules/sales/ui/Opportunity/OpportunityLineDocuments.tsxindex 381ec85fef..6151ebf462 100644--- a/apps/erp/app/modules/sales/ui/Opportunity/OpportunityLineDocuments.tsx+++ b/apps/erp/app/modules/sales/ui/Opportunity/OpportunityLineDocuments.tsx@@ -388,7 +388,18 @@ const OpportunityLineDocuments = ({<DocumentIcon type={type} /><spanclassName="font-medium"- onClick={() => download(file)}+ onClick={() => {+ if (["PDF", "Image"].includes(type)) {+ window.open(+ path.to.file.previewFile(+ `${"private"}/${getPath(file)}`+ ),+ "_blank"+ );+ } else {+ download(file);+ }+ }}>{["PDF", "Image"].includes(type) ? (<DocumentPreview