From a092be6dc3b71b0ea52104af9f585af48cf5c867 Mon Sep 17 00:00:00 2001 From: Armaan Jain <84474476+Developing-Gamer@users.noreply.github.com> Date: Thu, 11 Jun 2026 11:38:00 -0700 Subject: [PATCH] Payments minor navigation and UI bugs fixed (#1585) --- ## Summary by cubic Fixes product creation navigation and the quantity selector layout in Payments. Links now resolve to the correct project route and the quantity control no longer squishes or wraps. - **Bug Fixes** - Use admin app `projectId` and a shared `getCreateProductHref` helper to build product creation URLs, preserving `productLineId` and `customerType` when present. - Prevent quantity selector buttons from shrinking and wrap the input in a fixed-width container to keep the control stable in tight layouts. Written for commit 22d2eb6d908a2045752681d0242cb3a873a41cd1. Summary will update on new commits. Review in cubic --- .../page-client-product-lines-view.tsx | 13 ++++++-- .../payments/purchase-quantity-selector.tsx | 30 ++++++++++--------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/products/page-client-product-lines-view.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/products/page-client-product-lines-view.tsx index f8231d210..2bb1e15d7 100644 --- a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/products/page-client-product-lines-view.tsx +++ b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/products/page-client-product-lines-view.tsx @@ -1155,7 +1155,8 @@ function productLineTypeKeyToString(key: ProductLineTypeKey): string { } function ProductLineView({ groupedProducts, groups, existingItems, onSaveProduct, onDeleteProduct, onCreateNewItem, onOpenProductDetails, onSaveProductWithGroup, onCreateProductLine, onUpdateProductLine, onDeleteProductLine, createDraftRequestId, draftCustomerType, onDraftHandled, paymentsConfig, onMoveProduct }: ProductLineViewProps) { - const projectId = useProjectId(); + const hexclaveAdminApp = useAdminApp(); + const projectId = hexclaveAdminApp.projectId; const [drafts, setDrafts] = useState>([]); const [creatingGroupKey, setCreatingGroupKey] = useState(undefined); const [newProductLineDisplayName, setNewProductLineDisplayName] = useState(""); @@ -1203,6 +1204,12 @@ function ProductLineView({ groupedProducts, groups, existingItems, onSaveProduct return new Set(all); }, [groupedProducts, drafts]); const lastHandledDraftRequestRef = useRef(undefined); + const getCreateProductHref = (productLineId: string | undefined, customerType: 'user' | 'team' | 'custom' | undefined) => { + if (productLineId == null || customerType == null) { + return urlString`/projects/${projectId}/payments/products/new`; + } + return urlString`/projects/${projectId}/payments/products/new?productLineId=${productLineId}&customerType=${customerType}`; + }; useEffect(() => { if (!createDraftRequestId) return; @@ -1478,7 +1485,7 @@ function ProductLineView({ groupedProducts, groups, existingItems, onSaveProduct ))} {/* Add product button */} - +