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: work instructions and notes

Brad Barbind94f6a1ff741
diff --git a/apps/carbon/app/routes/x+/resources+/attributes.new.tsx b/apps/carbon/app/routes/x+/resources+/attributes.new.tsx
index fa6bd3ab85..f0c564badc 100644
--- a/apps/carbon/app/routes/x+/resources+/attributes.new.tsx
+++ b/apps/carbon/app/routes/x+/resources+/attributes.new.tsx
@@ -23,8 +23,6 @@ export async function action({ request }: ActionFunctionArgs) {
await request.formData()
);
- console.log({ data: validation.data });
-
if (validation.error) {
return validationError(validation.error);
}
diff --git a/apps/carbon/app/routes/x+/scheduling+/wysiwyg.tsx b/apps/carbon/app/routes/x+/scheduling+/wysiwyg.tsx
index 89cec0d4c4..c7ee8d5014 100644
--- a/apps/carbon/app/routes/x+/scheduling+/wysiwyg.tsx
+++ b/apps/carbon/app/routes/x+/scheduling+/wysiwyg.tsx
@@ -32,13 +32,14 @@ export async function action({ request }: ActionFunctionArgs) {
const formData = await request.formData();
const content = JSON.parse(formData.get("content") as string);
- console.log({ content });
+ console.log(content);
return null;
}
export default function WysiwygRoute() {
const { content } = useLoaderData<{ content: JSONContent }>();
const [value, setValue] = useState<JSONContent>(content);
+ console.log(value);
const fetcher = useFetcher();
const debounceSearch = useDebounce((c: JSONContent) => {
diff --git a/apps/mes/src/components/Authentication.tsx b/apps/mes/src/components/Authentication.tsx
index 3952218011..fcfdf95966 100644
--- a/apps/mes/src/components/Authentication.tsx
+++ b/apps/mes/src/components/Authentication.tsx
@@ -25,9 +25,7 @@ export function Authentication() {
return (
<>
- <div className="background">
- <div className="gradient" />
- </div>
+ <div className="background" />
<div className="relative z-10">
<div className="flex flex-col min-w-screen h-screen min-h-0">
{initializing ? (
diff --git a/apps/mes/src/components/Jobs/JobCard.tsx b/apps/mes/src/components/Jobs/JobCard.tsx
index 2c578e4dd1..61b55c5475 100644
--- a/apps/mes/src/components/Jobs/JobCard.tsx
+++ b/apps/mes/src/components/Jobs/JobCard.tsx
@@ -57,8 +57,6 @@ export function JobCard({
? new Date(job.dueDate) < new Date()
: false;
- console.log({ job, isSelected });
-
return (
<Card
onClick={() => navigate(job.id)}
diff --git a/apps/mes/src/hooks/useSession.ts b/apps/mes/src/hooks/useSession.ts
deleted file mode 100644
index 30d0361c85..0000000000
--- a/apps/mes/src/hooks/useSession.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import type { Session } from "@supabase/supabase-js";
-import { useOutletContext } from "react-router-dom";
-
-export function useSession(): Session {
- const { session } = useOutletContext<{ session: Session | null }>();
-
- if (!session) {
- throw new Error(
- "useSession must be used within a route an authenticated route"
- );
- }
-
- return session;
-}
diff --git a/apps/mes/src/lib/data.tsx b/apps/mes/src/lib/data.tsx
index 3dead00c6b..0d8dba3d1c 100644
--- a/apps/mes/src/lib/data.tsx
+++ b/apps/mes/src/lib/data.tsx
@@ -171,3 +171,238 @@ export const workCells = [
];
export type WorkCell = (typeof workCells)[number];
+
+export const scrapReasons = [
+ {
+ id: "1",
+ name: "Wrong material picked",
+ },
+ {
+ id: "2",
+ name: "Incorrect drawings",
+ },
+ {
+ id: "3",
+ name: "Human Error",
+ },
+ {
+ id: "4",
+ name: "Issue with equipment",
+ },
+ {
+ id: "5",
+ name: "Wrong tooling",
+ },
+ {
+ id: "6",
+ name: "Wrong program",
+ },
+ {
+ id: "7",
+ name: "Machine malfunction",
+ },
+ {
+ id: "7",
+ name: "Other",
+ },
+];
+
+export type ScrapReason = (typeof scrapReasons)[number];
+
+export const notes = [
+ {
+ id: "1",
+ content: "Hey How are you today?",
+ createdAt: "2022-01-01",
+ createdBy: "2e7dbae5-712d-4809-a29e-25cff4b90a36",
+ createdByName: "Brad Barbin",
+ },
+ {
+ id: "2",
+ content:
+ "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vel ipsa commodi illum saepe numquam maxime asperiores voluptate sit, minima perspiciatis.",
+ createdAt: "2022-01-02",
+ createdBy: "tom",
+ createdByName: "Tom Smith",
+ },
+ {
+ id: "3",
+ content: "I'm ok what about you?",
+ createdAt: "2022-01-03",
+ createdBy: "2e7dbae5-712d-4809-a29e-25cff4b90a36",
+ createdByName: "Brad Barbin",
+ },
+ {
+ id: "4",
+ content: "Lorem ipsum dolor sit, amet consectetur adipisicing. ?",
+ createdAt: "2022-01-04",
+ createdBy: "tom",
+ createdByName: "Tom Smith",
+ },
+ {
+ id: "5",
+ content: "Lorem ipsum dolor sit amet !",
+ createdAt: "2022-01-05",
+ createdBy: "2e7dbae5-712d-4809-a29e-25cff4b90a36",
+ createdByName: "Brad Barbin",
+ },
+ {
+ id: "6",
+ content: "Lorem ipsum dolor sit, amet consectetur adipisicing. ?",
+ createdAt: "2022-01-06",
+ createdBy: "tom",
+ createdByName: "Tom Smith",
+ },
+ {
+ id: "7",
+ content:
+ "Lorem ipsum dolor sit amet consectetur adipisicing elit. Perspiciatis, in.",
+ createdAt: "2022-01-07",
+ createdBy: "2e7dbae5-712d-4809-a29e-25cff4b90a36",
+ createdByName: "Brad Barbin",
+ },
+];
+
+export const workInstructions = {
+ type: "doc",
+ content: [
+ {
+ type: "heading",
+ attrs: {
+ level: 2,
+ },
+ content: [
+ {
+ type: "text",
+ text: "Work Instruction",
+ },
+ ],
+ },
+ {
+ type: "heading",
+ attrs: {
+ level: 3,
+ },
+ content: [
+ {
+ type: "text",
+ text: "Setup ",
+ },
+ ],
+ },
+ {
+ type: "paragraph",
+ content: [
+ {
+ type: "text",
+ marks: [
+ {
+ type: "textStyle",
+ attrs: {
+ color: "rgb(4, 4, 2)",
+ },
+ },
+ ],
+ text: "I'm baby letterpress franzen palo santo offal. XOXO lumbersexual farm-to-table mustache neutra selfies chillwave aesthetic green juice blue bottle letterpress fanny pack try-hard gorpcore. Selvage marfa butcher kale chips craft beer fashion axe lumbersexual mlkshk truffaut etsy same salvia activated charcoal kogi woke. Hoodie green juice put a bird on it, echo park swag disrupt ugh air plant vaporware vice hammock.",
+ },
+ ],
+ },
+ {
+ type: "taskList",
+ content: [
+ {
+ type: "taskItem",
+ attrs: {
+ checked: false,
+ },
+ content: [
+ {
+ type: "paragraph",
+ content: [
+ {
+ type: "text",
+
+ text: "Slow-carb fam same vexillologist bitters.",
+ },
+ ],
+ },
+ ],
+ },
+ {
+ type: "taskItem",
+ attrs: {
+ checked: false,
+ },
+ content: [
+ {
+ type: "paragraph",
+ content: [
+ {
+ type: "text",
+
+ text: "Roof party franzen slow-carb heirloom viral small batch. ",
+ },
+ ],
+ },
+ ],
+ },
+ {
+ type: "taskItem",
+ attrs: {
+ checked: false,
+ },
+ content: [
+ {
+ type: "paragraph",
+ content: [
+ {
+ type: "text",
+
+ text: "Bitters next level listicle, +1 same godard 90's big mood heirloom shabby chic hella.",
+ },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ {
+ type: "heading",
+ attrs: {
+ level: 3,
+ },
+ content: [
+ {
+ type: "text",
+ text: "Run",
+ },
+ ],
+ },
+ {
+ type: "taskList",
+ content: [
+ {
+ type: "taskItem",
+ attrs: {
+ checked: false,
+ },
+ content: [
+ {
+ type: "paragraph",
+ content: [
+ {
+ type: "text",
+
+ text: "DIY enamel pin viral ramps banjo DSA chartreuse.",
+ },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ {
+ type: "paragraph",
+ },
+ ],
+};
diff --git a/apps/mes/src/main.tsx b/apps/mes/src/main.tsx
index 0432089fa5..d80f889bc4 100644
--- a/apps/mes/src/main.tsx
+++ b/apps/mes/src/main.tsx
@@ -4,7 +4,7 @@ import { Authentication } from "~/components/Authentication";
import Error from "~/components/Error";
import { path } from "~/config";
import "~/index.css";
-import { Job } from "~/routes/job";
+import { Job, loader as jobLoader } from "~/routes/job";
import { Jobs, loader as jobsLoader } from "~/routes/jobs";
const router = createBrowserRouter([
@@ -20,6 +20,7 @@ const router = createBrowserRouter([
children: [
{
path: ":operationId",
+ loader: jobLoader,
element: <Job />,
},
],
diff --git a/apps/mes/src/routes/job.tsx b/apps/mes/src/routes/job.tsx
index 21b9c8b271..e46305ed33 100644
--- a/apps/mes/src/routes/job.tsx
+++ b/apps/mes/src/routes/job.tsx
@@ -1,9 +1,23 @@
+import type { JSONContent } from "@carbon/react";
import {
+ Avatar,
Button,
+ Editor,
Heading,
IconButton,
Modal,
+ ModalBody,
ModalContent,
+ ModalDescription,
+ ModalFooter,
+ ModalHeader,
+ ModalTitle,
+ NumberDecrementStepper,
+ NumberField,
+ NumberIncrementStepper,
+ NumberInput,
+ NumberInputGroup,
+ NumberInputStepper,
Popover,
PopoverClose,
PopoverContent,
@@ -19,122 +33,162 @@ import {
TooltipContent,
TooltipProvider,
TooltipTrigger,
+ cn,
+ useMount,
} from "@carbon/react";
-import type { LoaderFunctionArgs } from "@remix-run/node";
-import { useRef, useState, type ComponentProps, type ReactNode } from "react";
+import type { ComponentProps, ReactNode } from "react";
+import { useRef, useState } from "react";
import {
FaCheck,
FaOilCan,
+ FaPaperPlane,
FaPause,
FaPlay,
FaRedoAlt,
FaTrash,
FaTruckLoading,
} from "react-icons/fa";
-import { LuChevronLeft, LuExpand } from "react-icons/lu";
-import { useNavigate, useParams } from "react-router-dom";
+import {
+ LuChevronDown,
+ LuChevronLeft,
+ LuChevronUp,
+ LuExpand,
+} from "react-icons/lu";
+import {
+ useLoaderData,
+ useNavigate,
+ useOutletContext,
+ useParams,
+} from "react-router-dom";
import { path } from "~/config";
import { useRouteData } from "~/hooks/useRouteData";
-import type { Job as JobType } from "~/types";
+import { notes, workInstructions } from "~/lib/data";
+import type { Job as JobType, OutletContext } from "~/types";
import { defaultJobLayout } from "./jobs";
-export async function loader({ request }: LoaderFunctionArgs) {
- return null;
+export async function loader() {
+ return {
+ notes,
+ workInstructions,
+ };
}
export function Job() {
const navigate = useNavigate();
const { operationId } = useParams();
+
+ const { notes, workInstructions } = useLoaderData() as Awaited<
+ ReturnType<typeof loader>
+ >;
+
const routeData = useRouteData<{ jobs: JobType[] }>(path.to.jobs);
const job = routeData?.jobs.find((job) => job.id === operationId);
const [fullScreen, setFullScreen] = useState(false);
+ const [activeTab, setActiveTab] = useState("details");
+
+ const onWorkInstructionChange = (value: JSONContent) => {
+ console.log(value);
+ };
if (!job) {
return null;
}
return (
- <OptionallyFullscreen
- isFullScreen={fullScreen}
- onClose={() => setFullScreen(false)}
- >
- <Tabs defaultValue="details">
- <div className="flex items-center justify-between px-4 py-2 h-[52px] bg-background">
- <div className="flex items-start flex-grow gap-1">
- {!fullScreen && (
- <IconButton
- aria-label="Back"
- icon={<LuChevronLeft />}
- variant="ghost"
- onClick={() => navigate(path.to.jobs)}
- />
- )}
- <Heading size="h2">{job.readableId}</Heading>
- </div>
- <div className="flex flex-shrink-0 items-center justify-end gap-2">
- <TabsList className="ml-auto">
- <TabsTrigger value="details">Details</TabsTrigger>
- <TabsTrigger disabled value="model">
- Model
- </TabsTrigger>
- <TabsTrigger disabled value="instructions">
- Instructions
- </TabsTrigger>
- <TabsTrigger value="notes">Notes</TabsTrigger>
- </TabsList>
- {!fullScreen && (
- <IconButton
- aria-label="Expand"
- icon={<LuExpand />}
- variant="secondary"
- onClick={() => setFullScreen(true)}
- />
- )}
+ <>
+ <OptionallyFullscreen
+ isFullScreen={fullScreen}
+ onClose={() => setFullScreen(false)}
+ >
+ <Tabs
+ value={activeTab}
+ onValueChange={setActiveTab}
+ className="w-full h-full bg-card"
+ >
+ <div className="flex items-center justify-between px-4 py-2 h-[52px] bg-background">
+ <div className="flex items-start flex-grow gap-1">
+ {!fullScreen && (
+ <IconButton
+ aria-label="Back"
+ icon={<LuChevronLeft />}
+ variant="secondary"
+ onClick={() => navigate(path.to.jobs)}
+ />
+ )}
+ <Heading size="h2">{job.readableId}</Heading>
+ </div>
+ <div className="flex flex-shrink-0 items-center justify-end gap-2">
+ <TabsList className="ml-auto">
+ <TabsTrigger value="details">Details</TabsTrigger>
+ <TabsTrigger disabled value="model">
+ Model
+ </TabsTrigger>
+ <TabsTrigger disabled={!workInstructions} value="instructions">
+ Instructions
+ </TabsTrigger>
+ <TabsTrigger value="notes">Notes</TabsTrigger>
+ </TabsList>
+ {!fullScreen && (
+ <IconButton
+ aria-label="Expand"
+ icon={<LuExpand />}
+ variant="secondary"
+ onClick={() => setFullScreen(true)}
+ />
+ )}
+ </div>
</div>
- </div>
- {!fullScreen && <Separator />}
+ {!fullScreen && <Separator />}
- <TabsContent value="details"></TabsContent>
- <TabsContent value="model"></TabsContent>
- <TabsContent value="instructions"></TabsContent>
- <TabsContent value="notes"></TabsContent>
+ <TabsContent value="details"></TabsContent>
+ <TabsContent value="model"></TabsContent>
+ <TabsContent value="instructions" className="flex flex-grow bg-card">
+ <Editor
+ initialValue={workInstructions as JSONContent}
+ onChange={onWorkInstructionChange}
+ />
+ </TabsContent>
+ <TabsContent value="notes">
+ <Notes job={job} notes={notes} />
+ </TabsContent>
- <Controls>
- <IconButtonWithTooltip
- disabled
- icon={
- <FaOilCan className="text-accent-foreground group-hover:text-accent-foreground/80" />
- }
- tooltip="Non-Conformance Report"
- />
- <IconButtonWithTooltip
- icon={
- <FaTrash className="text-accent-foreground group-hover:text-accent-foreground/80" />
- }
- tooltip="Scrap"
- />
- <PlayButton
- onStart={(type) => {
- alert(type);
- }}
- />
- <IconButtonWithTooltip
- icon={
- <FaRedoAlt className="text-accent-foreground group-hover:text-accent-foreground/80" />
- }
- tooltip="Rework"
- />
- <IconButtonWithTooltip
- icon={
- <FaCheck className="text-accent-foreground group-hover:text-accent-foreground/80" />
- }
- tooltip="Complete"
- />
- </Controls>
- </Tabs>
- </OptionallyFullscreen>
+ <Controls>
+ <IconButtonWithTooltip
+ disabled
+ icon={
+ <FaOilCan className="text-accent-foreground group-hover:text-accent-foreground/80" />
+ }
+ tooltip="Non-Conformance Report"
+ />
+ <IconButtonWithTooltip
+ icon={
+ <FaTrash className="text-accent-foreground group-hover:text-accent-foreground/80" />
+ }
+ tooltip="Scrap"
+ />
+ <PlayButton
+ onStart={(type) => {
+ alert(type);
+ }}
+ />
+ <IconButtonWithTooltip
+ icon={
+ <FaRedoAlt className="text-accent-foreground group-hover:text-accent-foreground/80" />
+ }
+ tooltip="Rework"
+ />
+ <IconButtonWithTooltip
+ icon={
+ <FaCheck className="text-accent-foreground group-hover:text-accent-foreground/80" />
+ }
+ tooltip="Complete"
+ />
+ </Controls>
+ </Tabs>
+ </OptionallyFullscreen>
+ </>
);
}
@@ -160,7 +214,7 @@ function OptionallyFullscreen({
if (!open) onClose();
}}
>
- <ModalContent className="min-w-full h-screen">
+ <ModalContent className="min-w-full h-screen py-2">
{children}
</ModalContent>
</Modal>
@@ -169,10 +223,156 @@ function OptionallyFullscreen({
);
}
-function Controls({ children }: { children: ReactNode }) {
+type Note = {
+ id: string;
+ content: string;
+ createdAt: string;
+ createdBy: string;
+ createdByName: string;
+ createdByAvatar?: string;
+};
+
+function Notes({ notes }: { job: JobType; notes: Note[] }) {
+ const listRef = useRef<HTMLDivElement>(null);
+ const scrollToLastMessage = () => {
+ listRef.current?.scrollTo({
+ top: listRef.current.scrollHeight,
+ behavior: "smooth",
+ });
+ };
+ useMount(() => {
+ scrollToLastMessage();
+ });
+ const { user } = useOutletContext<OutletContext>();
+
+ return (
+ <div className="flex flex-col flex-auto h-[calc(100vh-130px)] p-6">
+ <div className="flex flex-col flex-auto flex-shrink-0 rounded-2xl bg-muted h-full p-4">
+ <div
+ ref={listRef}
+ className="flex flex-col h-full overflow-x-auto mb-4"
+ >
+ <div className="flex flex-col h-full">
+ <div className="grid grid-cols-12 gap-y-2">
+ {notes.map((note) => (
+ <Message
+ key={note.id}
+ note={note}
+ isFromUser={note.createdBy === user?.id}
+ />
+ ))}
+ </div>
+ </div>
+ </div>
+ <div className="flex flex-row items-center h-16 rounded-xl bg-background w-full px-2 space-x-2">
+ {/* <div>
+ <button className="flex items-center justify-center text-gray-400 hover:text-gray-600">
+ <svg
+ className="w-5 h-5"
+ fill="none"
+ stroke="currentColor"
+ viewBox="0 0 24 24"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ stroke-width="2"
+ d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"
+ ></path>
+ </svg>
+ </button>
+ </div> */}
+ <div className="flex-grow relative">
+ <input
+ type="text"
+ className="flex w-full border rounded-xl focus:outline-none focus:border-ring pl-4 h-11"
+ />
+ {/* <button className="absolute flex items-center justify-center h-full w-12 right-0 top-0 text-gray-400 hover:text-gray-600">
+ <svg
+ className="w-6 h-6"
+ fill="none"
+ stroke="currentColor"
+ viewBox="0 0 24 24"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ stroke-width="2"
+ d="M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
+ ></path>
+ </svg>
+ </button> */}
+ </div>
+
+ <Button
+ className="bg-indigo-600 hover:bg-indigo-500 rounded-2xl"
+ size="lg"
+ rightIcon={<FaPaperPlane />}
+ >
+ Send
+ </Button>
+ </div>
+ </div>
+ </div>
+ );
+}
+
+type MessageProps = {
+ note: Note;
+ isFromUser: boolean;
+};
+
+function Message({ note, isFromUser }: MessageProps) {
+ const { content, createdByAvatar, createdByName } = note;
+ return (
+ <div
+ className={cn(
+ "p-3 rounded-lg",
+ isFromUser ? "col-start-6 col-end-13" : "col-start-1 col-end-8"
+ )}
+ >
+ <div
+ className={cn(
+ "flex items-center justify-start",
+ isFromUser && "flex-row-reverse"
+ )}
+ >
+ <Avatar
+ className="flex flex-shrink-0"
+ size="md"
+ name={createdByName}
+ src={createdByAvatar}
+ />
+ <div
+ className={cn(
+ "relative text-sm py-2 px-4 shadow rounded-xl",
+ isFromUser ? "mr-3 bg-indigo-100" : "ml-3 bg-background"
+ )}
+ >
+ <div>{content}</div>
+ </div>
+ </div>
+ </div>
+ );
+}
+
+function Controls({
+ children,
+ className,
+}: {
+ children: ReactNode;
+ className?: string;
+}) {
return (
<TooltipProvider>
- <div className="flex items-center gap-4 absolute p-4 bottom-4 left-1/2 transform -translate-x-1/2">
+ <div
+ className={cn(
+ "flex items-center gap-4 absolute p-4 bottom-0 left-1/2 transform -translate-x-1/2",
+ className
+ )}
+ >
{children}
</div>
</TooltipProvider>
@@ -267,3 +467,45 @@ function PlayButton({
</Popover>
);
}
+
+function ScrapModal({ job }: { job: JobType }) {
+ <Modal open={false}>
+ <ModalContent>
+ <ModalHeader>
+ <ModalTitle>{`Scrap ${job.part}`}</ModalTitle>
+ <ModalDescription>Select a scrap quantity and reason</ModalDescription>
+ </ModalHeader>
+ <ModalBody>
+ <div className="grid grid-cols-2 gap-4">
+ <NumberField
+ defaultValue={1}
+ // value={1}
+ // onChange={onPurchaseUnitChange}
+ minValue={1}
+ maxValue={job.quantity}
+ >
+ <NumberInputGroup className="relative">
+ <NumberInput />
+ <NumberInputStepper>
+ <NumberIncrementStepper>
+ <LuChevronUp size="1em" strokeWidth="3" />
+ </NumberIncrementStepper>
+ <NumberDecrementStepper>
+ <LuChevronDown size="1em" strokeWidth="3" />
+ </NumberDecrementStepper>
+ </NumberInputStepper>
+ </NumberInputGroup>
+ </NumberField>
+ </div>
+ </ModalBody>
+ <ModalFooter>
+ <Button variant="secondary" onClick={() => {}}>
+ Cancel
+ </Button>
+ <Button variant="destructive" onClick={() => {}}>
+ Scrap
+ </Button>
+ </ModalFooter>
+ </ModalContent>
+ </Modal>;
+}
diff --git a/apps/mes/src/routes/jobs.tsx b/apps/mes/src/routes/jobs.tsx
index e1281e8363..9999149bad 100644
--- a/apps/mes/src/routes/jobs.tsx
+++ b/apps/mes/src/routes/jobs.tsx
@@ -243,7 +243,7 @@ export function Jobs({
</TabsContent>
</Tabs>
</ResizablePanel>
- <Outlet />
+ <Outlet context={{ user }} />
</ResizablePanelGroup>
</TooltipProvider>
);
diff --git a/apps/mes/src/types.ts b/apps/mes/src/types.ts
index 133169ea9a..77e7972026 100644
--- a/apps/mes/src/types.ts
+++ b/apps/mes/src/types.ts
@@ -33,6 +33,7 @@ const jobValidator = z.object({
.optional(),
progress: z.number().optional(), // miliseconds
order: z.number().optional(),
+ quantity: z.number().optional(),
status: z
.enum([
"CANCELED",
diff --git a/packages/react/src/Editor/Editor.tsx b/packages/react/src/Editor/Editor.tsx
index 272147fe42..29fab7b112 100644
--- a/packages/react/src/Editor/Editor.tsx
+++ b/packages/react/src/Editor/Editor.tsx
@@ -24,6 +24,7 @@ import {
import { useMemo, useState } from "react";
import { toast } from "sonner";
import { Separator } from "../Separator";
+import { cn } from "../utils/cn";
import { ColorSelector } from "./components/ColorSelector";
import { LinkSelector } from "./components/LinkSelector";
import { NodeSelector } from "./components/NodeSelector";
@@ -32,6 +33,7 @@ import { defaultExtensions } from "./extensions";
import { getSuggestionItems } from "./slash";
interface EditorProp {
+ className?: string;
initialValue?: JSONContent;
onChange: (value: JSONContent) => void;
onUpload?: (file: File) => Promise<string>;
@@ -44,7 +46,12 @@ const defaultOnUpload = async (file: File) => {
);
};
-const Editor = ({ initialValue, onChange, onUpload }: EditorProp) => {
+const Editor = ({
+ className,
+ initialValue,
+ onChange,
+ onUpload,
+}: EditorProp) => {
const [openNode, setOpenNode] = useState(false);
const [openColor, setOpenColor] = useState(false);
const [openLink, setOpenLink] = useState(false);
@@ -87,7 +94,7 @@ const Editor = ({ initialValue, onChange, onUpload }: EditorProp) => {
return (
<EditorRoot>
<EditorContent
- className="border border-border w-full h-full p-4"
+ className={cn("p-4", className)}
{...(initialValue && { initialContent: initialValue })}
extensions={extensions}
editorProps={{
diff --git a/packages/react/src/Tabs.tsx b/packages/react/src/Tabs.tsx
index 8c0fe39e17..562aa243e2 100644
--- a/packages/react/src/Tabs.tsx
+++ b/packages/react/src/Tabs.tsx
@@ -45,7 +45,7 @@ const TabsContent = forwardRef<
<TabsPrimitive.Content
ref={ref}
className={cn(
- "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
+ "ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
className
)}
{...props}