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(erp): open Shop Floor (MES) in a new tab

sidgaikwad2486133a8183
diff --git a/apps/erp/app/components/Layout/Navigation/PrimaryNavigation.tsx b/apps/erp/app/components/Layout/Navigation/PrimaryNavigation.tsx
index 5cb930cbe0..f8a9b5e945 100644
--- a/apps/erp/app/components/Layout/Navigation/PrimaryNavigation.tsx
+++ b/apps/erp/app/components/Layout/Navigation/PrimaryNavigation.tsx
@@ -229,10 +229,13 @@ const NavigationIconLink = forwardRef<
aria-current={isActive}
ref={ref}
to={link.to}
+ {...(link.external
+ ? { target: "_blank", rel: "noopener noreferrer" }
+ : {})}
{...props}
onClick={onClick}
className={cn(classes, props.className)}
- prefetch="intent"
+ prefetch={link.external ? "none" : "intent"}
>
<link.icon className={cn(...iconClasses)} />
diff --git a/apps/erp/app/hooks/useModules.tsx b/apps/erp/app/hooks/useModules.tsx
index 35725f44fa..ca99ddbb2a 100644
--- a/apps/erp/app/hooks/useModules.tsx
+++ b/apps/erp/app/hooks/useModules.tsx
@@ -135,7 +135,8 @@ function useModuleDefinitions(): ModuleDefinition[] {
name: t`Shop Floor`,
to: path.to.external.mes,
icon: LuTvMinimalPlay,
- role: "employee"
+ role: "employee",
+ external: true
},
{
key: "users",
diff --git a/apps/erp/app/routes/x+/_index.tsx b/apps/erp/app/routes/x+/_index.tsx
index d68c25a349..e4ce904f5b 100644
--- a/apps/erp/app/routes/x+/_index.tsx
+++ b/apps/erp/app/routes/x+/_index.tsx
@@ -205,7 +205,10 @@ const Subheading = ({ children, className }: ComponentProps<"p">) => (
const ModuleCard = ({ module }: { module: Authenticated<NavItem> }) => (
<Link
to={module.to}
- prefetch="intent"
+ prefetch={module.external ? "none" : "intent"}
+ {...(module.external
+ ? { target: "_blank", rel: "noopener noreferrer" }
+ : {})}
className="flex items-center gap-4 p-4 bg-card/70 backdrop-blur-md rounded-lg border border-border group hover:bg-accent/40 hover:border-foreground/20 cursor-pointer transition-colors duration-200"
>
<div className="shrink-0 p-2.5 rounded-lg border border-border group-hover:border-foreground/20 transition-colors">
diff --git a/apps/erp/app/types/index.ts b/apps/erp/app/types/index.ts
index 0087ab4ac2..4bf8fe2fb2 100644
--- a/apps/erp/app/types/index.ts
+++ b/apps/erp/app/types/index.ts
@@ -65,6 +65,7 @@ export type NavItem = Omit<Route, "icon"> & {
icon: IconType;
backgroundColor?: string;
foregroundColor?: string;
+ external?: boolean;
};
export type Result = {