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: sales rfq 3d model

Brad Barbine7fccae1de11
diff --git a/apps/carbon/app/components/SortableList.tsx b/apps/carbon/app/components/SortableList.tsx
index 4f374de8b9..dbf73bac26 100644
--- a/apps/carbon/app/components/SortableList.tsx
+++ b/apps/carbon/app/components/SortableList.tsx
@@ -1,15 +1,8 @@
"use client";
-import {
- AnimatePresence,
- LayoutGroup,
- Reorder,
- motion,
- useDragControls,
-} from "framer-motion";
+import { LayoutGroup, Reorder, useDragControls } from "framer-motion";
import type { ReactNode } from "react";
-import { memo, useState } from "react";
-import useMeasure from "react-use-measure";
+import { useState } from "react";
import { Checkbox, HStack, cn } from "@carbon/react";
import { LuTrash } from "react-icons/lu";
@@ -39,7 +32,7 @@ interface SortableListItemProps<T> {
handleDrag: () => void;
}
-function _SortableListItem<T>({
+function SortableListItem<T>({
item,
items,
order,
@@ -50,7 +43,6 @@ function _SortableListItem<T>({
isExpanded,
className,
}: SortableListItemProps<T>) {
- let [ref, bounds] = useMeasure();
const [isDragging, setIsDragging] = useState(false);
const [isDraggable] = useState(true);
const dragControls = useDragControls();
@@ -66,7 +58,7 @@ function _SortableListItem<T>({
};
return (
- <motion.div className={cn("", className)} key={item.id}>
+ <div className={cn("", className)} key={item.id}>
<div className="flex w-full items-center">
<Reorder.Item
value={item}
@@ -79,26 +71,6 @@ function _SortableListItem<T>({
item.checked && !isDragging ? "w-7/10" : "w-full"
)}
key={item.id}
- initial={{ opacity: 0 }}
- animate={{
- opacity: 1,
- height: bounds.height > 0 ? bounds.height : undefined,
- transition: {
- type: "spring",
- bounce: 0,
- duration: 0.4,
- },
- }}
- exit={{
- opacity: 0,
- transition: {
- duration: 0.05,
- type: "spring",
- bounce: 0.1,
- },
- }}
- layout
- layoutId={`item-${item.id}`}
dragListener={!item.checked}
dragControls={dragControls}
onDragEnd={handleDragEnd}
@@ -118,80 +90,57 @@ function _SortableListItem<T>({
}
whileDrag={{ zIndex: 9999 }}
>
- <div ref={ref} className={cn(isExpanded ? "w-full" : "", "z-20 ")}>
- <motion.div
- layout="position"
- className="grid items-center justify-between grid-cols-[1fr_auto] w-full gap-2 py-1"
- >
- <AnimatePresence>
- {!isExpanded ? (
- <motion.div
- initial={{ opacity: 0, filter: "blur(4px)" }}
- animate={{ opacity: 1, filter: "blur(0px)" }}
- exit={{ opacity: 0, filter: "blur(4px)" }}
- transition={{ duration: 0.001 }}
- className="flex w-full items-center gap-x-2 truncate"
+ <div className={cn(isExpanded ? "w-full" : "", "z-20 ")}>
+ <div className="grid items-center justify-between grid-cols-[1fr_auto] w-full gap-2 py-1">
+ {!isExpanded ? (
+ <div className="flex w-full items-center gap-x-2 truncate">
+ {/* List Remove Actions */}
+ <Checkbox
+ checked={item.checked}
+ id={`checkbox-${item.id}`}
+ aria-label="Mark to delete"
+ onCheckedChange={() => onToggleItem(item.id)}
+ className="ml-3 border-foreground/20 bg-background/30 data-[state=checked]:bg-background data-[state=checked]:text-red-200 flex flex-shrink-0 "
+ />
+ {/* List Order */}
+ <p className="font-mono text-xs pl-1 text-foreground/50 flex flex-shrink-0">
+ {getParallelizedOrder(order, item, items)}
+ </p>
+
+ {/* List Title */}
+ <div
+ key={`${item.checked}`}
+ className="px-1 flex flex-grow truncate"
>
- {/* List Remove Actions */}
- <Checkbox
- checked={item.checked}
- id={`checkbox-${item.id}`}
- aria-label="Mark to delete"
- onCheckedChange={() => onToggleItem(item.id)}
- className="ml-3 border-foreground/20 bg-background/30 data-[state=checked]:bg-background data-[state=checked]:text-red-200 flex flex-shrink-0 "
- />
- {/* List Order */}
- <p className="font-mono text-xs pl-1 text-foreground/50 flex flex-shrink-0">
- {getParallelizedOrder(order, item, items)}
- </p>
-
- {/* List Title */}
- <motion.div
- key={`${item.checked}`}
- className="px-1 flex flex-grow truncate"
- initial={{
- opacity: 0,
- filter: "blur(4px)",
- }}
- animate={{ opacity: 1, filter: "blur(0px)" }}
- transition={{
- bounce: 0.2,
- delay: item.checked ? 0.2 : 0,
- type: "spring",
- }}
- >
- <HStack className="w-full justify-between">
- {typeof item.title === "string" ? (
- <h4
- className={cn(
- "flex tracking-tighter text-base md:text-lg truncate",
- item.checked
- ? "text-red-400"
- : "text-foreground dark:text-foreground/70"
- )}
- >
- {item.title}
- </h4>
- ) : (
- <div className={item.checked ? "text-red-400" : ""}>
- {item.title}
- </div>
- )}
-
- {item.details && (
- <div className="flex flex-shrink-0">
- {item.details}
- </div>
- )}
- </HStack>
- </motion.div>
- </motion.div>
- ) : null}
- </AnimatePresence>
+ <HStack className="w-full justify-between">
+ {typeof item.title === "string" ? (
+ <h4
+ className={cn(
+ "flex tracking-tighter text-base md:text-lg truncate",
+ item.checked
+ ? "text-red-400"
+ : "text-foreground dark:text-foreground/70"
+ )}
+ >
+ {item.title}
+ </h4>
+ ) : (
+ <div className={item.checked ? "text-red-400" : ""}>
+ {item.title}
+ </div>
+ )}
+
+ {item.details && (
+ <div className="flex flex-shrink-0">{item.details}</div>
+ )}
+ </HStack>
+ </div>
+ </div>
+ ) : null}
{/* List Item Children */}
{renderExtra && renderExtra(item)}
- </motion.div>
+ </div>
</div>
<div
onPointerDown={isDraggable ? handleDragStart : undefined}
@@ -199,83 +148,24 @@ function _SortableListItem<T>({
/>
</Reorder.Item>
{/* List Delete Action Animation */}
- <AnimatePresence mode="popLayout">
- {item.checked ? (
- <motion.div
- layout
- initial={{ opacity: 0, x: -10 }}
- animate={{
- opacity: 1,
- x: 0,
- transition: {
- delay: 0.17,
- duration: 0.17,
- type: "spring",
- bounce: 0.6,
- },
- zIndex: 5,
- }}
- exit={{
- opacity: 0,
- x: -5,
- transition: {
- delay: 0,
- duration: 0.0,
- type: "spring",
- bounce: 0,
- },
- }}
- className="h-[1.5rem] w-3"
- />
- ) : null}
- </AnimatePresence>
- <AnimatePresence mode="popLayout">
- {item.checked ? (
- <motion.div
- layout
- initial={{ opacity: 0, x: -5, filter: "blur(4px)" }}
- animate={{
- opacity: 1,
- x: 0,
- filter: "blur(0px)",
- transition: {
- delay: 0.3,
- duration: 0.15,
- type: "spring",
- bounce: 0.9,
- },
- }}
- exit={{
- opacity: 0,
- filter: "blur(4px)",
- x: -10,
- transition: { delay: 0, duration: 0.12 },
- }}
- className="inset-0 z-0 rounded-full bg-card border-border border dark:shadow-[0_1px_0_0_rgba(255,255,255,0.03)_inset,0_0_0_1px_rgba(255,255,255,0.03)_inset,0_0_0_1px_rgba(0,0,0,0.1),0_2px_2px_0_rgba(0,0,0,0.1),0_4px_4px_0_rgba(0,0,0,0.1),0_8px_8px_0_rgba(0,0,0,0.1)] dark:bg-[#161716]/50"
+
+ {item.checked ? <div className="h-[1.5rem] w-3" /> : null}
+
+ {item.checked ? (
+ <div className="inset-0 z-0 rounded-full bg-card border-border border dark:shadow-[0_1px_0_0_rgba(255,255,255,0.03)_inset,0_0_0_1px_rgba(255,255,255,0.03)_inset,0_0_0_1px_rgba(0,0,0,0.1),0_2px_2px_0_rgba(0,0,0,0.1),0_4px_4px_0_rgba(0,0,0,0.1),0_8px_8px_0_rgba(0,0,0,0.1)] dark:bg-[#161716]/50">
+ <button
+ className="inline-flex h-10 items-center justify-center space-nowrap rounded-md px-3 text-sm font-medium transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
+ onClick={() => onRemoveItem(item.id)}
>
- <button
- className="inline-flex h-10 items-center justify-center space-nowrap rounded-md px-3 text-sm font-medium transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
- onClick={() => onRemoveItem(item.id)}
- >
- <LuTrash className="h-4 w-4 text-red-400 transition-colors duration-150 fill-red-400/60 " />
- </button>
- </motion.div>
- ) : null}
- </AnimatePresence>
+ <LuTrash className="h-4 w-4 text-red-400 transition-colors duration-150 fill-red-400/60 " />
+ </button>
+ </div>
+ ) : null}
</div>
- </motion.div>
+ </div>
);
}
-const SortableListItem = memo(_SortableListItem, (prevProps, nextProps) => {
- return (
- prevProps.item.id === nextProps.item.id &&
- prevProps.item.checked === nextProps.item.checked &&
- prevProps.item.order === nextProps.item.order &&
- prevProps.isExpanded === nextProps.isExpanded
- );
-}) as typeof _SortableListItem;
-
export type SortableItemRenderProps<T extends Item> = {
item: T;
items: T[];
@@ -308,17 +198,15 @@ function SortableList<T extends Item>({
onReorder={onReorder}
className="flex flex-col"
>
- <AnimatePresence>
- {items?.map((item, index) =>
- renderItem({
- item,
- items,
- order: index,
- onToggleItem,
- onRemoveItem,
- })
- )}
- </AnimatePresence>
+ {items?.map((item, index) =>
+ renderItem({
+ item,
+ items,
+ order: index,
+ onToggleItem,
+ onRemoveItem,
+ })
+ )}
</Reorder.Group>
</LayoutGroup>
);
diff --git a/apps/carbon/app/modules/items/ui/Item/BillOfProcess.tsx b/apps/carbon/app/modules/items/ui/Item/BillOfProcess.tsx
index cce81ea98e..8184b83b6d 100644
--- a/apps/carbon/app/modules/items/ui/Item/BillOfProcess.tsx
+++ b/apps/carbon/app/modules/items/ui/Item/BillOfProcess.tsx
@@ -289,7 +289,7 @@ const BillOfProcess = ({ makeMethodId, operations }: BillOfProcessProps) => {
label: "Work Instructions",
disabled: isTemporaryId(item.id),
content: (
- <div className="flex flex-col p-2">
+ <div className="flex flex-col">
<motion.div
initial={{ opacity: 0, filter: "blur(4px)" }}
animate={{ opacity: 1, filter: "blur(0px)" }}
diff --git a/apps/carbon/app/modules/items/ui/Item/CadModel.tsx b/apps/carbon/app/modules/items/ui/Item/CadModel.tsx
index 9987484d82..bf29baa1b2 100644
--- a/apps/carbon/app/modules/items/ui/Item/CadModel.tsx
+++ b/apps/carbon/app/modules/items/ui/Item/CadModel.tsx
@@ -1,5 +1,5 @@
import { AutodeskViewer, ClientOnly, Spinner, toast } from "@carbon/react";
-import { useFetcher, useParams } from "@remix-run/react";
+import { useFetcher } from "@remix-run/react";
import { nanoid } from "nanoid";
import { useEffect, useState } from "react";
import { useRealtime, useUser } from "~/hooks";
@@ -11,9 +11,23 @@ import { path } from "~/utils/path";
type CadModelProps = {
autodeskUrn: string | null;
modelPath: string | null;
+ metadata?: {
+ itemId?: string;
+ salesRfqLineId?: string;
+ };
+ title?: string;
+ uploadClassName?: string;
+ viewerClassName?: string;
};
-const CadModel = ({ autodeskUrn, modelPath }: CadModelProps) => {
+const CadModel = ({
+ autodeskUrn,
+ metadata,
+ modelPath,
+ title,
+ uploadClassName,
+ viewerClassName,
+}: CadModelProps) => {
useRealtime("modelUpload", `modelPath=eq.${modelPath ?? "unknown"}`);
const {
@@ -21,8 +35,6 @@ const CadModel = ({ autodeskUrn, modelPath }: CadModelProps) => {
} = useUser();
const { supabase } = useSupabase();
- const { itemId } = useParams();
- if (!itemId) throw new Error("Could not find itemId");
const { autodeskToken } = useAutodeskToken();
const fetcher = useFetcher();
@@ -55,7 +67,11 @@ const CadModel = ({ autodeskUrn, modelPath }: CadModelProps) => {
formData.append("name", file.name);
formData.append("fileId", fileId);
formData.append("modelPath", modelUpload.data!.path);
- formData.append("itemId", itemId);
+ if (metadata) {
+ if (metadata.itemId) formData.append("itemId", metadata.itemId);
+ if (metadata.salesRfqLineId)
+ formData.append("salesRfqLineId", metadata.salesRfqLineId);
+ }
fetcher.submit(formData, {
method: "post",
@@ -63,6 +79,7 @@ const CadModel = ({ autodeskUrn, modelPath }: CadModelProps) => {
});
}
};
+
return (
<ClientOnly
fallback={
@@ -75,13 +92,16 @@ const CadModel = ({ autodeskUrn, modelPath }: CadModelProps) => {
return autodeskUrn && autodeskToken ? (
<AutodeskViewer
accessToken={autodeskToken}
- urn={autodeskUrn}
+ className={viewerClassName}
showDefaultToolbar
+ urn={autodeskUrn}
/>
) : (
<CadModelUpload
+ className={uploadClassName}
file={file}
loading={loading}
+ title={title}
onFileChange={onFileChange}
/>
);
diff --git a/apps/carbon/app/modules/sales/ui/SalesRFQ/SalesRFQLines.tsx b/apps/carbon/app/modules/sales/ui/SalesRFQ/SalesRFQLines.tsx
index 878384bc61..3d329a4aeb 100644
--- a/apps/carbon/app/modules/sales/ui/SalesRFQ/SalesRFQLines.tsx
+++ b/apps/carbon/app/modules/sales/ui/SalesRFQ/SalesRFQLines.tsx
@@ -23,7 +23,7 @@ import { AnimatePresence, LayoutGroup, motion } from "framer-motion";
import { nanoid } from "nanoid";
import type { Dispatch, SetStateAction } from "react";
import { useCallback, useEffect, useState } from "react";
-import { LuSettings2, LuX } from "react-icons/lu";
+import { LuMove3D, LuSettings2, LuX } from "react-icons/lu";
import type { z } from "zod";
import { DirectionAwareTabs } from "~/components/DirectionAwareTabs";
import {
@@ -42,6 +42,8 @@ import type {
import { SortableList, SortableListItem } from "~/components/SortableList";
import { useUser } from "~/hooks";
import { useSupabase } from "~/lib/supabase";
+import type { ModelUpload } from "~/modules/items";
+import { CadModel } from "~/modules/items";
import { path } from "~/utils/path";
import { salesRfqLineValidator } from "../../sales.models";
@@ -52,17 +54,24 @@ type Line = z.infer<typeof salesRfqLineValidator> & {
type ItemWithData = SortableItem & {
data: Line;
+ modelUpload?: ModelUpload;
};
type SalesRFQLinesProps = {
lines: Line[];
+ modelUploads: ModelUpload[];
};
-function makeItems(lines: Line[]): ItemWithData[] {
- return lines.map(makeItem);
+function makeItems(lines: Line[], modelUploads: ModelUpload[]): ItemWithData[] {
+ return lines.map((line) =>
+ makeItem(
+ line,
+ modelUploads.find((m) => m?.salesRfqLineId === line.id)
+ )
+ );
}
-function makeItem(line: Line): ItemWithData {
+function makeItem(line: Line, modelUpload?: ModelUpload): ItemWithData {
return {
id: line.id!,
title: (
@@ -87,9 +96,15 @@ function makeItem(line: Line): ItemWithData {
{q}
</Badge>
))}
+ {modelUpload && (
+ <Badge variant="secondary">
+ <LuMove3D className="w-4 h-4 text-green-500" />
+ </Badge>
+ )}
</HStack>
),
data: line,
+ modelUpload,
};
}
@@ -104,7 +119,7 @@ const initialLine: Omit<Line, "id" | "salesRfqId" | "order"> = {
externalNotes: {} as JSONContent,
};
-const SalesRFQLines = ({ lines }: SalesRFQLinesProps) => {
+const SalesRFQLines = ({ lines, modelUploads }: SalesRFQLinesProps) => {
const { rfqId } = useParams();
if (!rfqId) throw new Error("rfqId not found");
@@ -115,9 +130,16 @@ const SalesRFQLines = ({ lines }: SalesRFQLinesProps) => {
id: userId,
} = useUser();
- const [items, setItems] = useState<ItemWithData[]>(makeItems(lines ?? []));
+ const [items, setItems] = useState<ItemWithData[]>(
+ makeItems(lines ?? [], modelUploads)
+ );
const [selectedLineId, setSelectedLineId] = useState<string | null>(null);
+ useEffect(() => {
+ setItems(makeItems(lines, modelUploads));
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [modelUploads]);
+
const onToggleItem = (id: string) => {
setItems((prevItems) =>
prevItems.map((item) =>
@@ -325,7 +347,7 @@ const SalesRFQLines = ({ lines }: SalesRFQLinesProps) => {
label: "Model",
content: (
- <div className="flex flex-col p-2">
+ <div className="flex flex-col py-4">
<motion.div
initial={{ opacity: 0, filter: "blur(4px)" }}
animate={{ opacity: 1, filter: "blur(0px)" }}
@@ -335,7 +357,16 @@ const SalesRFQLines = ({ lines }: SalesRFQLinesProps) => {
duration: 0.75,
delay: 0.15,
}}
- ></motion.div>
+ >
+ <CadModel
+ autodeskUrn={item.modelUpload?.autodeskUrn ?? null}
+ metadata={{
+ salesRfqLineId: item.id,
+ }}
+ modelPath={item.modelUpload?.modelPath ?? null}
+ uploadClassName="min-h-[300px]"
+ />
+ </motion.div>
</div>
),
},
@@ -344,7 +375,7 @@ const SalesRFQLines = ({ lines }: SalesRFQLinesProps) => {
label: "Drawing",
content: (
- <div className="flex flex-col p-2">
+ <div className="flex flex-col">
<motion.div
initial={{ opacity: 0, filter: "blur(4px)" }}
animate={{ opacity: 1, filter: "blur(0px)" }}
@@ -363,7 +394,7 @@ const SalesRFQLines = ({ lines }: SalesRFQLinesProps) => {
label: "Internal Notes",
content: (
- <div className="flex flex-col p-2">
+ <div className="flex flex-col">
<motion.div
initial={{ opacity: 0, filter: "blur(4px)" }}
animate={{ opacity: 1, filter: "blur(0px)" }}
@@ -375,6 +406,7 @@ const SalesRFQLines = ({ lines }: SalesRFQLinesProps) => {
}}
>
<Editor
+ className="min-h-[300px]"
initialValue={item.data.internalNotes}
onUpload={onUploadImage}
onChange={onUpdateInternalNotes}
@@ -388,7 +420,7 @@ const SalesRFQLines = ({ lines }: SalesRFQLinesProps) => {
label: "External Notes",
content: (
- <div className="flex flex-col p-2">
+ <div className="flex flex-col">
<motion.div
initial={{ opacity: 0, filter: "blur(4px)" }}
animate={{ opacity: 1, filter: "blur(0px)" }}
@@ -400,6 +432,7 @@ const SalesRFQLines = ({ lines }: SalesRFQLinesProps) => {
}}
>
<Editor
+ className="min-h-[300px]"
initialValue={item.data.externalNotes ?? ({} as JSONContent)}
onUpload={onUploadImage}
onChange={onUpdateExternalNotes}
diff --git a/apps/carbon/app/modules/shared/shared.service.ts b/apps/carbon/app/modules/shared/shared.service.ts
index 910cb2fcd4..d5094c53d7 100644
--- a/apps/carbon/app/modules/shared/shared.service.ts
+++ b/apps/carbon/app/modules/shared/shared.service.ts
@@ -47,6 +47,7 @@ export async function upsertModelUpload(
id: string;
modelPath: string;
itemId?: string;
+ salesRfqLineId?: string;
companyId: string;
createdBy: string;
}
diff --git a/apps/carbon/app/modules/shared/ui/CadModelUpload.tsx b/apps/carbon/app/modules/shared/ui/CadModelUpload.tsx
index dcb8b7ba3e..6e1b2d916b 100644
--- a/apps/carbon/app/modules/shared/ui/CadModelUpload.tsx
+++ b/apps/carbon/app/modules/shared/ui/CadModelUpload.tsx
@@ -6,8 +6,10 @@ import { HiArrowUpTray } from "react-icons/hi2";
const fileSizeLimitMb = 50;
type CadModelUploadProps = {
+ title?: string;
file: File | null;
loading: boolean;
+ className?: string;
onFileChange: (file: File | null) => void;
};
@@ -30,9 +32,11 @@ const supportedFileTypes = [
];
const CadModelUpload = ({
+ title,
file,
loading,
onFileChange,
+ className,
}: CadModelUploadProps) => {
const hasFile = !!file;
@@ -78,17 +82,20 @@ const CadModelUpload = ({
className={cn(
"group flex flex-col flex-grow rounded-lg border border-border bg-gradient-to-tr from-background to-card text-card-foreground shadow-sm w-full",
!hasFile &&
- "cursor-pointer hover:border-primary/30 hover:border-dashed hover:to-primary/10 hover:via-card"
+ "cursor-pointer hover:border-primary/30 hover:border-dashed hover:to-primary/10 hover:via-card",
+ className
)}
>
<input {...getInputProps()} name="file" className="sr-only" />
<div className="flex flex-col h-full w-full">
<CardHeader>
- <CardTitle>CAD Model</CardTitle>
+ <CardTitle>{title}</CardTitle>
</CardHeader>
- <div className="flex flex-col flex-grow items-center justify-center gap-2 p-2">
- {(file || loading) && <Spinner className="h-16 w-16 -mt-16" />}
+ <div className="flex flex-col flex-grow items-center justify-center gap-2 p-6">
+ {(file || loading) && (
+ <Spinner className={cn("h-16 w-16", title && "-mt-16")} />
+ )}
{file && (
<>
<p className="text-lg text-card-foreground mt-8">{file.name}</p>
@@ -99,7 +106,12 @@ const CadModelUpload = ({
)}
{!file && !loading && (
<>
- <div className="p-4 bg-accent rounded-full group-hover:bg-primary -mt-16">
+ <div
+ className={cn(
+ "p-4 bg-accent rounded-full group-hover:bg-primary",
+ title ? "-mt-16" : "-mt-6"
+ )}
+ >
<HiArrowUpTray
className="h-10 w-10 text-foreground group-hover:text-primary-foreground"
aria-hidden="true"
diff --git a/apps/carbon/app/routes/api+/autodesk.upload.ts b/apps/carbon/app/routes/api+/autodesk.upload.ts
index 33c28f8362..31820d92f6 100644
--- a/apps/carbon/app/routes/api+/autodesk.upload.ts
+++ b/apps/carbon/app/routes/api+/autodesk.upload.ts
@@ -15,11 +15,15 @@ export async function action({ request }: ActionFunctionArgs) {
const name = formData.get("name") as string;
const modelPath = formData.get("modelPath") as string;
const itemId = (formData.get("itemId") ?? undefined) as string | undefined;
+ const salesRfqLineId = (formData.get("salesRfqLineId") ?? undefined) as
+ | string
+ | undefined;
const modelRecord = await upsertModelUpload(client, {
id: fileId,
modelPath,
itemId,
+ salesRfqLineId,
companyId,
createdBy: userId,
});
diff --git a/apps/carbon/app/routes/x+/fixture+/$itemId.details.tsx b/apps/carbon/app/routes/x+/fixture+/$itemId.details.tsx
index 38f0b43e2d..c51b5f84e8 100644
--- a/apps/carbon/app/routes/x+/fixture+/$itemId.details.tsx
+++ b/apps/carbon/app/routes/x+/fixture+/$itemId.details.tsx
@@ -96,12 +96,16 @@ export default function FixtureDetailsRoute() {
<div className="grid grid-cols-1 md:grid-cols-2 w-full flex-grow gap-2">
<CadModel
autodeskUrn={fixtureData?.modelUpload?.autodeskUrn ?? null}
+ metadata={{
+ itemId,
+ }}
modelPath={fixtureData?.modelUpload?.modelPath ?? null}
+ title="CAD Model"
/>
<ItemDocuments
files={fixtureData?.files ?? []}
- modelUpload={fixtureData.modelUpload}
itemId={itemId}
+ modelUpload={fixtureData.modelUpload}
type="Fixture"
/>
</div>
diff --git a/apps/carbon/app/routes/x+/part+/$itemId.details.tsx b/apps/carbon/app/routes/x+/part+/$itemId.details.tsx
index 2588454299..fd74eb6bef 100644
--- a/apps/carbon/app/routes/x+/part+/$itemId.details.tsx
+++ b/apps/carbon/app/routes/x+/part+/$itemId.details.tsx
@@ -87,12 +87,14 @@ export default function PartDetailsRoute() {
<div className="grid grid-cols-1 md:grid-cols-2 w-full flex-grow gap-2">
<CadModel
autodeskUrn={partData?.modelUpload?.autodeskUrn ?? null}
+ metadata={{ itemId }}
modelPath={partData?.modelUpload?.modelPath ?? null}
+ title="CAD Model"
/>
<ItemDocuments
files={partData?.files ?? []}
- modelUpload={partData.modelUpload}
itemId={itemId}
+ modelUpload={partData.modelUpload}
type="Part"
/>
</div>
diff --git a/apps/carbon/app/routes/x+/sales-rfq+/$rfqId.details.tsx b/apps/carbon/app/routes/x+/sales-rfq+/$rfqId.details.tsx
index 7e254d8b84..12a8d93aa5 100644
--- a/apps/carbon/app/routes/x+/sales-rfq+/$rfqId.details.tsx
+++ b/apps/carbon/app/routes/x+/sales-rfq+/$rfqId.details.tsx
@@ -123,7 +123,7 @@ export default function SalesRFQDetailsRoute() {
return (
<VStack spacing={2} className="p-2">
<SalesRFQForm key={initialValues.id} initialValues={initialValues} />
- <SalesRFQLines lines={lines} />
+ <SalesRFQLines lines={lines} modelUploads={rfqData?.modelUploads ?? []} />
</VStack>
);
}