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.

style: default step to open if there's a description

Brad Barbinc57589a9dbba
diff --git a/apps/mes/app/components/JobOperation/components/Step.tsx b/apps/mes/app/components/JobOperation/components/Step.tsx
index fa43e31545..b49e5f4d56 100644
--- a/apps/mes/app/components/JobOperation/components/Step.tsx
+++ b/apps/mes/app/components/JobOperation/components/Step.tsx
@@ -68,13 +68,15 @@ export function StepsListItem({
onRecord: (step: JobOperationStep) => void;
onDelete: (step: JobOperationStep) => void;
}) {
- const disclosure = useDisclosure();
const fetcher = useFetcher<{ success: boolean }>();
const user = useUser();
const { name, description, type, unitOfMeasureCode, minValue, maxValue } =
step;
const hasDescription = description && Object.keys(description).length > 0;
+ const disclosure = useDisclosure({
+ defaultIsOpen: !!hasDescription,
+ });
if (!operationId) return null;
const record = step.jobOperationStepRecord.find(
@@ -201,6 +203,7 @@ export function StepsListItem({
disclosure.isOpen ? "Hide description" : "Show description"
}
variant="ghost"
+ isDisabled={!hasDescription}
icon={disclosure.isOpen ? <LuChevronDown /> : <LuChevronRight />}
onClick={disclosure.onToggle}
/>