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: add uncommitted files

Brad Barbin6e0604ce3905
diff --git a/apps/erp/app/modules/production/ui/Schedule/Kanban/context/KanbanContext.tsx b/apps/erp/app/modules/production/ui/Schedule/Kanban/context/KanbanContext.tsx
new file mode 100644
index 0000000000..77e7d5dd2f
--- /dev/null
+++ b/apps/erp/app/modules/production/ui/Schedule/Kanban/context/KanbanContext.tsx
@@ -0,0 +1,48 @@
+import { createContext, useContext, type ReactNode } from "react";
+import type { DisplaySettings } from "../types";
+
+interface KanbanContextType {
+ displaySettings: DisplaySettings;
+ selectedGroup: string | null;
+ setSelectedGroup: (jobId: string | null) => void;
+ tags: { name: string }[];
+}
+
+const KanbanContext = createContext<KanbanContextType | null>(null);
+
+interface KanbanProviderProps {
+ children: ReactNode;
+ displaySettings: DisplaySettings;
+ selectedGroup: string | null;
+ setSelectedGroup: (jobId: string | null) => void;
+ tags: { name: string }[];
+}
+
+export function KanbanProvider({
+ children,
+ displaySettings,
+ selectedGroup,
+ setSelectedGroup,
+ tags,
+}: KanbanProviderProps) {
+ return (
+ <KanbanContext.Provider
+ value={{
+ displaySettings,
+ selectedGroup,
+ setSelectedGroup,
+ tags,
+ }}
+ >
+ {children}
+ </KanbanContext.Provider>
+ );
+}
+
+export function useKanban() {
+ const context = useContext(KanbanContext);
+ if (!context) {
+ throw new Error("useKanban must be used within a KanbanProvider");
+ }
+ return context;
+}
diff --git a/apps/mes/app/components/EmployeeAvatar.tsx b/apps/mes/app/components/EmployeeAvatar.tsx
new file mode 100644
index 0000000000..c5abb06146
--- /dev/null
+++ b/apps/mes/app/components/EmployeeAvatar.tsx
@@ -0,0 +1,49 @@
+import type { AvatarProps } from "@carbon/react";
+import { HStack } from "@carbon/react";
+import { usePeople } from "~/stores";
+import Avatar from "./Avatar";
+
+type EmployeeAvatarProps = AvatarProps & {
+ employeeId: string | null;
+ className?: string;
+ withName?: boolean;
+};
+
+const EmployeeAvatar = ({
+ employeeId,
+ size,
+ withName = true,
+ className,
+ ...props
+}: EmployeeAvatarProps) => {
+ const [people] = usePeople();
+ if (!employeeId) return null;
+
+ if (employeeId === "system") {
+ return (
+ <HStack className="truncate no-underline hover:no-underline">
+ <Avatar size={size ?? "xs"} path={undefined} name={"System"} />
+ {withName && <span>System</span>}
+ </HStack>
+ );
+ }
+
+ const person = people.find((p) => p.id === employeeId);
+
+ if (!person) {
+ return null;
+ }
+
+ return (
+ <HStack className="truncate no-underline hover:no-underline">
+ <Avatar
+ size={size ?? "xs"}
+ path={person.avatarUrl ?? undefined}
+ name={person?.name ?? ""}
+ />
+ {withName && <span>{person.name}</span>}
+ </HStack>
+ );
+};
+
+export default EmployeeAvatar;