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.

refactor: hide editable badge in external supplier quote after submitted

Brad Barbin6e74d115fa74
diff --git a/apps/erp/app/components/Chat/ChatInput.tsx b/apps/erp/app/components/Chat/ChatInput.tsx
index 471739b8f8..001d4d445d 100644
--- a/apps/erp/app/components/Chat/ChatInput.tsx
+++ b/apps/erp/app/components/Chat/ChatInput.tsx
@@ -98,7 +98,7 @@ export const ChatInput = forwardRef<RecordButtonRef, ChatInputProps>(
<div
className={cn(
"transition-all duration-300 ease-in-out",
- hasMessages ? "absolute bottom-6 left-0 z-20" : ""
+ hasMessages ? "absolute bottom-6 left-0 z-20 w-full" : ""
// isCanvasVisible ? "right-[603px]" : "right-0"
)}
>
diff --git a/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteHeader.tsx b/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteHeader.tsx
index 6e67e8114c..26b87f5f80 100644
--- a/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteHeader.tsx
+++ b/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteHeader.tsx
@@ -35,7 +35,6 @@ import {
LuPanelRight,
LuShoppingCart,
LuTrash,
- LuShare,
LuEye,
LuChevronDown,
LuExternalLink,
@@ -94,9 +93,6 @@ const SupplierQuoteHeader = () => {
const editableStatuses = ["Draft", "Declined"];
const isEditableStatus = editableStatuses.includes(quoteStatus);
- const canShare = routeData?.quote.externalLinkId && isEditableStatus;
- const canPreview = routeData?.quote.externalLinkId && isEditableStatus;
-
const canSend =
isEditableStatus && permissions.can("update", "purchasing") && hasLines;
@@ -150,42 +146,31 @@ const SupplierQuoteHeader = () => {
)}
</HStack>
<HStack>
- {canShare && (
- <Button
- leftIcon={<LuShare />}
- variant="secondary"
- onClick={shareModal.onOpen}
- >
- Share
- </Button>
- )}
- {canPreview && (
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button
- leftIcon={<LuEye />}
- variant="secondary"
- rightIcon={<LuChevronDown />}
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <Button
+ leftIcon={<LuEye />}
+ variant="secondary"
+ rightIcon={<LuChevronDown />}
+ >
+ Preview
+ </Button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent>
+ <DropdownMenuItem asChild>
+ <a
+ target="_blank"
+ href={path.to.externalSupplierQuote(
+ (routeData?.quote as any).externalLinkId
+ )}
+ rel="noreferrer"
>
- Preview
- </Button>
- </DropdownMenuTrigger>
- <DropdownMenuContent>
- <DropdownMenuItem asChild>
- <a
- target="_blank"
- href={path.to.externalSupplierQuote(
- (routeData?.quote as any).externalLinkId
- )}
- rel="noreferrer"
- >
- <DropdownMenuIcon icon={<LuExternalLink />} />
- Digital Quote
- </a>
- </DropdownMenuItem>
- </DropdownMenuContent>
- </DropdownMenu>
- )}
+ <DropdownMenuIcon icon={<LuExternalLink />} />
+ Digital Quote
+ </a>
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
{canSend && (
<Button
diff --git a/apps/erp/app/routes/share+/supplier-quote.$id.tsx b/apps/erp/app/routes/share+/supplier-quote.$id.tsx
index a536f8a941..df8ab48bf2 100644
--- a/apps/erp/app/routes/share+/supplier-quote.$id.tsx
+++ b/apps/erp/app/routes/share+/supplier-quote.$id.tsx
@@ -197,10 +197,12 @@ const Header = ({ company, quote }: { company: any; quote: any }) => (
)}
</div>
- <span className="text-base font-semibold text-blue-900 dark:text-blue-100">
- Please fill the columns marked with the <EditableBadge /> icon to
- provide pricing
- </span>
+ {quote.status === "Draft" ? (
+ <span className="text-base font-semibold foreground">
+ Please fill the columns marked with the <EditableBadge /> icon to
+ provide pricing
+ </span>
+ ) : null}
</VStack>
</CardHeader>
);
@@ -483,25 +485,25 @@ const LinePricing = ({
<Th className="w-[150px]">
<HStack spacing={4}>
<span>Unit Price</span>
- <EditableBadge />
+ {quoteStatus === "Draft" ? <EditableBadge /> : null}
</HStack>
</Th>
<Th className="w-[120px]">
<HStack spacing={4}>
<span>Lead Time</span>
- <EditableBadge />
+ {quoteStatus === "Draft" ? <EditableBadge /> : null}
</HStack>
</Th>
<Th className="w-[150px]">
<HStack spacing={4}>
<span>Shipping Cost</span>
- <EditableBadge />
+ {quoteStatus === "Draft" ? <EditableBadge /> : null}
</HStack>
</Th>
<Th className="w-[150px]">
<HStack spacing={4}>
<span>Tax</span>
- <EditableBadge />
+ {quoteStatus === "Draft" ? <EditableBadge /> : null}
</HStack>
</Th>
<Th className="w-[100px] bg-muted/50">Total</Th>
@@ -511,6 +513,7 @@ const LinePricing = ({
{quantities.map((qty, index) => {
const storedPricing = pricingByQuantity[qty];
const pricing = getPricingForQuantity(qty);
+
const selectedLine = selectedLines[qty];
const isSelected = !!selectedLine && selectedLine.quantity === qty;
const unitPrice =
diff --git a/packages/react/src/Status.tsx b/packages/react/src/Status.tsx
index 545d6ca7f4..db0c9568d1 100644
--- a/packages/react/src/Status.tsx
+++ b/packages/react/src/Status.tsx
@@ -43,7 +43,7 @@ const Status = ({
return (
<Badge
variant={color}
- className={cn("flex items-center gap-1", className)}
+ className={cn("items-center gap-1", className)}
{...props}
>
{getStatusIcon(color)}