From 33e2da3a5b0bcd2a7f150c8dd3f235cd1f6f5a02 Mon Sep 17 00:00:00 2001 From: amianthus <49116958+SirTenzin@users.noreply.github.com> Date: Fri, 17 Oct 2025 12:44:39 +0100 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20product=20->=20plan?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/utils/utils.ts | 8 +++++++- vite/src/views/command-bar/CommandBar.tsx | 4 ++-- .../AttachProductDropdown.tsx | 4 ++-- .../customer-product-list/CancelProductDialog.tsx | 4 ++-- .../TransferProductDialog.tsx | 6 +++--- .../customer/product/components/AttachButton.tsx | 2 +- .../customer/product/components/AttachModal.tsx | 12 ++++++------ .../product/components/InvoiceCustomerButton.tsx | 10 +++++----- .../customer/product/hooks/useAttachState.tsx | 6 +++--- .../product/multi-attach/MultiAttachDialog.tsx | 12 ++++++------ vite/src/views/general/LoadingScreen.tsx | 2 +- vite/src/views/main-sidebar/MainSidebar.tsx | 6 +++--- .../onboarding/onboarding-steps/AttachProduct.tsx | 2 +- .../onboarding/onboarding-steps/CheckAccess.tsx | 4 ++-- .../onboarding/onboarding-steps/ProductList.tsx | 10 +++++----- vite/src/views/onboarding2/AttachProduct.tsx | 2 +- .../onboarding2/model-pricing/EditProduct.tsx | 2 +- .../onboarding2/model-pricing/ModelPricing.tsx | 2 +- .../edit-product/EditProductDetails.tsx | 4 ++-- vite/src/views/products/ProductsView.tsx | 2 +- .../feature-row-toolbar/DeleteFeatureDialog.tsx | 8 ++++---- vite/src/views/products/plan/PlanEditorView.tsx | 6 +++--- .../products/plan/components/DeletePlanDialog.tsx | 8 ++++---- .../edit-plan-details/MainDetailsSection.tsx | 2 +- .../product/components/UpdateProductButton.tsx | 2 +- .../products/product/hooks/useProductData.tsx | 4 ++-- .../products/product/prices/CreateFixedPrice.tsx | 4 ++-- .../product-item-config/PriceItemConfig.tsx | 2 +- .../product-sidebar/ToggleDefaultProduct.tsx | 2 +- vite/src/views/products/products/ProductsPage.tsx | 6 +++--- .../products/components/CopyProductDialog.tsx | 6 +++--- .../products/components/CreateProductDialog.tsx | 4 ++-- .../products/components/CreateProductSheet.tsx | 14 +++++++------- .../products/components/UpdateProductDialog.tsx | 8 ++++---- .../reward-config/components/CreateRewardSheet.tsx | 4 ++-- .../components/FreeProductRewardConfig.tsx | 8 ++++---- .../components/ProductPriceSelector.tsx | 2 +- .../reward-config/components/UpdateRewardSheet.tsx | 4 ++-- .../reward-programs/CreateRewardProgramSheet.tsx | 2 +- .../reward-programs/RewardProgramConfig.tsx | 6 +++--- 40 files changed, 106 insertions(+), 100 deletions(-) diff --git a/shared/utils/utils.ts b/shared/utils/utils.ts index 1a97024b1..ece36c37f 100644 --- a/shared/utils/utils.ts +++ b/shared/utils/utils.ts @@ -13,7 +13,13 @@ export const sumValues = (vals: number[]) => { return vals.reduce((acc, curr) => acc + curr, 0); }; -export const keyToTitle = (key: string) => { +export const keyToTitle = ( + key: string, + options?: { exclusionMap?: Record }, +) => { + if (options?.exclusionMap?.[key]) { + return options.exclusionMap[key]; + } return key .replace(/[-_]/g, " ") .replace(/\b\w/g, (char) => char.toUpperCase()); diff --git a/vite/src/views/command-bar/CommandBar.tsx b/vite/src/views/command-bar/CommandBar.tsx index 1e825373e..83f895238 100644 --- a/vite/src/views/command-bar/CommandBar.tsx +++ b/vite/src/views/command-bar/CommandBar.tsx @@ -294,7 +294,7 @@ const CommandBar = () => { const navigationItems = [ { - title: "Go to Products", + title: "Go to Plans", icon: , shortcutKey: "1", onSelect: () => { @@ -627,7 +627,7 @@ const CommandBar = () => { setSearchQuery(e.target.value)} diff --git a/vite/src/views/customers/customer/customer-product-list/CancelProductDialog.tsx b/vite/src/views/customers/customer/customer-product-list/CancelProductDialog.tsx index 64ec7cd86..c2a784b7e 100644 --- a/vite/src/views/customers/customer/customer-product-list/CancelProductDialog.tsx +++ b/vite/src/views/customers/customer/customer-product-list/CancelProductDialog.tsx @@ -50,9 +50,9 @@ export const CancelProductDialog = ({ }); await refetch(); setOpen(false); - toast.success("Product cancelled"); + toast.success("Plan cancelled"); } catch (error) { - toast.error(getBackendErr(error, "Failed to cancel product")); + toast.error(getBackendErr(error, "Failed to cancel plan")); } finally { if (cancelImmediately) { setImmediateLoading(false); diff --git a/vite/src/views/customers/customer/customer-product-list/TransferProductDialog.tsx b/vite/src/views/customers/customer/customer-product-list/TransferProductDialog.tsx index fbdba8187..3d1ba5d5f 100644 --- a/vite/src/views/customers/customer/customer-product-list/TransferProductDialog.tsx +++ b/vite/src/views/customers/customer/customer-product-list/TransferProductDialog.tsx @@ -47,7 +47,7 @@ export const TransferProductDialog = ({ const handleClicked = async () => { if (!selectedEntity) { - toast.error("Please select an entity to transfer the product to"); + toast.error("Please select an entity to transfer the plan to"); return; } @@ -68,11 +68,11 @@ export const TransferProductDialog = ({ }, ); await refetch(); - toast.success("Product transferred successfully"); + toast.success("Plan transferred successfully"); setOpen(false); } catch (error) { console.log(error); - toast.error(getBackendErr(error, "Failed to transfer product")); + toast.error(getBackendErr(error, "Failed to transfer plan")); } setLoading(false); }; diff --git a/vite/src/views/customers/customer/product/components/AttachButton.tsx b/vite/src/views/customers/customer/product/components/AttachButton.tsx index 8bab58054..6f385b631 100644 --- a/vite/src/views/customers/customer/product/components/AttachButton.tsx +++ b/vite/src/views/customers/customer/product/components/AttachButton.tsx @@ -40,7 +40,7 @@ export const AttachButton = () => { setOpen(true); } catch (error) { console.log("error", error); - toast.error(getBackendErr(error, "Failed to attach product")); + toast.error(getBackendErr(error, "Failed to attach plan")); } setButtonLoading(false); diff --git a/vite/src/views/customers/customer/product/components/AttachModal.tsx b/vite/src/views/customers/customer/product/components/AttachModal.tsx index 6fa829c7c..db194808c 100644 --- a/vite/src/views/customers/customer/product/components/AttachModal.tsx +++ b/vite/src/views/customers/customer/product/components/AttachModal.tsx @@ -110,7 +110,7 @@ export const AttachModal = ({ } if (flags.isCanceled) { - return "Renew Product"; + return "Renew Plan"; } if (preview?.func === AttachFunction.CreateCheckout) { @@ -182,7 +182,7 @@ export const AttachModal = ({ } navigateTo(`/customers/${cusId}`, navigation, env); - toast.success(data.message || "Successfully attached product"); + toast.success(data.message || "Successfully attached plan"); setOpen(false); } catch (error) { console.log("Error creating product: ", error); @@ -197,9 +197,9 @@ export const AttachModal = ({ env, ); } else { - toast.error(getBackendErr(error, "Error creating product")); + toast.error(getBackendErr(error, "Error creating plan")); } - } finally { + } finally{ setLoading(false); } }; @@ -217,7 +217,7 @@ export const AttachModal = ({ > - Attach product + Attach plan @@ -226,7 +226,7 @@ export const AttachModal = ({

Details

- Product + Plan {product?.name} diff --git a/vite/src/views/customers/customer/product/components/InvoiceCustomerButton.tsx b/vite/src/views/customers/customer/product/components/InvoiceCustomerButton.tsx index 834dbec06..62268a862 100644 --- a/vite/src/views/customers/customer/product/components/InvoiceCustomerButton.tsx +++ b/vite/src/views/customers/customer/product/components/InvoiceCustomerButton.tsx @@ -43,7 +43,7 @@ export const InvoiceCustomerButton = ({ endIcon={} disableStartIcon={true} tabIndex={-1} - tooltipContent="This will enable the product for the customer immediately, and redirect you to Stripe to finalize the invoice" + tooltipContent="This will enable the plan for the customer immediately, and redirect you to Stripe to finalize the invoice" disabled={disabled} > Invoice Customer @@ -52,9 +52,9 @@ export const InvoiceCustomerButton = ({
-

Enable Product Immediately

+

Enable Plan Immediately

- This will enable the product for the customer immediately, and + This will enable the plan for the customer immediately, and redirect you to Stripe to finalize the invoice

diff --git a/vite/src/views/general/LoadingScreen.tsx b/vite/src/views/general/LoadingScreen.tsx index 15c52e5e2..70dbf46c4 100644 --- a/vite/src/views/general/LoadingScreen.tsx +++ b/vite/src/views/general/LoadingScreen.tsx @@ -6,7 +6,7 @@ import React from "react"; function LoadingScreen() { const texts = [ "Counting pennies", - "Forging products", + "Forging plans", "Increasing ARR", "Optimizing pricing", "Blasting competitors", diff --git a/vite/src/views/main-sidebar/MainSidebar.tsx b/vite/src/views/main-sidebar/MainSidebar.tsx index ceafbc6b8..400cdaed1 100644 --- a/vite/src/views/main-sidebar/MainSidebar.tsx +++ b/vite/src/views/main-sidebar/MainSidebar.tsx @@ -84,7 +84,7 @@ export const MainSidebar = () => { value="products" onClick={onProductTabClick} icon={} - title="Products" + title="Plans" env={env} isOpen={expanded ? productGroupOpen : undefined} isGroup @@ -93,7 +93,7 @@ export const MainSidebar = () => { value="products" productGroup={productGroupOpen} subTabs={[ - { title: "Products", value: "products" }, + { title: "Plans", value: "products" }, { title: "Features", value: "features" }, { title: "Rewards", value: "rewards" }, ]} @@ -181,7 +181,7 @@ export const MainSidebar = () => { diff --git a/vite/src/views/onboarding/onboarding-steps/AttachProduct.tsx b/vite/src/views/onboarding/onboarding-steps/AttachProduct.tsx index 0d367d884..6d1922425 100644 --- a/vite/src/views/onboarding/onboarding-steps/AttachProduct.tsx +++ b/vite/src/views/onboarding/onboarding-steps/AttachProduct.tsx @@ -72,7 +72,7 @@ export default function AttachProduct({ onValueChange={setSelectedProductId} > - + {products.map((product) => ( diff --git a/vite/src/views/onboarding/onboarding-steps/CheckAccess.tsx b/vite/src/views/onboarding/onboarding-steps/CheckAccess.tsx index c4335c683..3060e87ae 100644 --- a/vite/src/views/onboarding/onboarding-steps/CheckAccess.tsx +++ b/vite/src/views/onboarding/onboarding-steps/CheckAccess.tsx @@ -134,7 +134,7 @@ export default function CheckAccessStep({
Check whether a customer can access a{" "} - {isProduct ? "product" : "feature"} by calling the{" "} + {isProduct ? "plan" : "feature"} by calling the{" "} ) : ( )} diff --git a/vite/src/views/onboarding/onboarding-steps/ProductList.tsx b/vite/src/views/onboarding/onboarding-steps/ProductList.tsx index 4346e0858..9ce9c7239 100644 --- a/vite/src/views/onboarding/onboarding-steps/ProductList.tsx +++ b/vite/src/views/onboarding/onboarding-steps/ProductList.tsx @@ -70,8 +70,8 @@ export const ProductList = ({ 0 - ? "Your products" - : "Create your products" + ? "Your plans" + : "Create your plans" } number={1} description={ @@ -104,7 +104,7 @@ export const ProductList = ({ }} > @@ -189,11 +189,11 @@ export const EditProductDialog = ({ product.id, product, ); - toast.success("Product updated successfully"); + toast.success("Plan updated successfully"); await mutate(); setOpen(false); } catch (error) { - toast.error(getBackendErr(error, "Failed to update product")); + toast.error(getBackendErr(error, "Failed to update plan")); } setCreateProductLoading(false); }; diff --git a/vite/src/views/onboarding2/AttachProduct.tsx b/vite/src/views/onboarding2/AttachProduct.tsx index 8f51ee2a1..aea69f2f4 100644 --- a/vite/src/views/onboarding2/AttachProduct.tsx +++ b/vite/src/views/onboarding2/AttachProduct.tsx @@ -70,7 +70,7 @@ export default function AttachProduct({ onValueChange={setSelectedProductId} > - + {products.map((product) => ( diff --git a/vite/src/views/onboarding2/model-pricing/EditProduct.tsx b/vite/src/views/onboarding2/model-pricing/EditProduct.tsx index b2eeb5508..4e3678a7e 100644 --- a/vite/src/views/onboarding2/model-pricing/EditProduct.tsx +++ b/vite/src/views/onboarding2/model-pricing/EditProduct.tsx @@ -78,7 +78,7 @@ export const EditProduct = ({ // Validate if (key === "is_default" && !isFreeProduct(product.items)) { - toast.error("Default product must be a free product"); + toast.error("Default plan must be a free plan"); return; } diff --git a/vite/src/views/onboarding2/model-pricing/ModelPricing.tsx b/vite/src/views/onboarding2/model-pricing/ModelPricing.tsx index 468739283..342ccccdd 100644 --- a/vite/src/views/onboarding2/model-pricing/ModelPricing.tsx +++ b/vite/src/views/onboarding2/model-pricing/ModelPricing.tsx @@ -236,7 +236,7 @@ const NewProductPopover = () => { setProduct(newProduct); setOpen(false); } catch (error) { - toast.error(getBackendErr(error, "Failed to create product")); + toast.error(getBackendErr(error, "Failed to create plan")); } finally { setCreating(false); } diff --git a/vite/src/views/onboarding2/model-pricing/edit-product/EditProductDetails.tsx b/vite/src/views/onboarding2/model-pricing/edit-product/EditProductDetails.tsx index de9ae6f9e..d90fc7c89 100644 --- a/vite/src/views/onboarding2/model-pricing/edit-product/EditProductDetails.tsx +++ b/vite/src/views/onboarding2/model-pricing/edit-product/EditProductDetails.tsx @@ -46,7 +46,7 @@ export const EditProductDetails = () => { }); await refetch(); } catch (error) { - toast.error(getBackendErr(error, "Failed to create product")); + toast.error(getBackendErr(error, "Failed to create plan")); } finally { setCreateLoading(false); } @@ -76,7 +76,7 @@ export const EditProductDetails = () => { id: details.id, }); }} - placeholder="Eg. Free Product" + placeholder="Eg. Free Plan" value={details.name} onChange={(e) => { const newIdData = allowCreate diff --git a/vite/src/views/products/ProductsView.tsx b/vite/src/views/products/ProductsView.tsx index d357970dc..fc2588c7d 100644 --- a/vite/src/views/products/ProductsView.tsx +++ b/vite/src/views/products/ProductsView.tsx @@ -28,7 +28,7 @@ function ProductsView({ env }: { env: AppEnv }) {

- {keyToTitle(tab)} + {keyToTitle(tab, { exclusionMap: { products: "Plans" } })}

{tab === "products" && } diff --git a/vite/src/views/products/features/feature-row-toolbar/DeleteFeatureDialog.tsx b/vite/src/views/products/features/feature-row-toolbar/DeleteFeatureDialog.tsx index 6459a2185..6e4749b44 100644 --- a/vite/src/views/products/features/feature-row-toolbar/DeleteFeatureDialog.tsx +++ b/vite/src/views/products/features/feature-row-toolbar/DeleteFeatureDialog.tsx @@ -60,15 +60,15 @@ export const DeleteFeatureDialog = ({ const totalCount = Number.parseInt(deletionText.totalCount); if (Number.isNaN(totalCount) || totalCount <= 0) { - return "There are products using this feature. You must remove this feature from the products first, or archive it instead."; + return "There are plans using this feature. You must remove this feature from the plans first, or archive it instead."; } if (totalCount === 1) { - return `${deletionText.productName} is using this feature. You must remove this feature from the product first, or archive it instead.`; + return `${deletionText.productName} is using this feature. You must remove this feature from the plan first, or archive it instead.`; } const otherCount = totalCount - 1; - return `${deletionText.productName} and ${otherCount} other product${otherCount > 1 ? "s" : ""} are using this feature. You must remove this feature from the products first, or archive it instead.`; + return `${deletionText.productName} and ${otherCount} other plan${otherCount > 1 ? "s" : ""} are using this feature. You must remove this feature from the plans first, or archive it instead.`; } - return "There are products using this feature. You must remove this feature from the products first, or archive it instead."; + return "There are plans using this feature. You must remove this feature from the plans first, or archive it instead."; } return "Are you sure you want to delete this feature? This action cannot be undone."; }; diff --git a/vite/src/views/products/plan/PlanEditorView.tsx b/vite/src/views/products/plan/PlanEditorView.tsx index 5442c5e4a..177032661 100644 --- a/vite/src/views/products/plan/PlanEditorView.tsx +++ b/vite/src/views/products/plan/PlanEditorView.tsx @@ -36,12 +36,12 @@ export default function PlanEditorView() { if (error || !originalProduct) { // Handle 500 errors from backend when product doesn't exist - let errorMessage = `Product ${product_id} not found`; + let errorMessage = `Plan ${product_id} not found`; if (error instanceof AxiosError && error.response?.status === 500) { - errorMessage = `Product ${product_id} not found`; + errorMessage = `Plan ${product_id} not found`; } else if (error) { - errorMessage = error.message || `Product ${product_id} not found`; + errorMessage = error.message || `Plan ${product_id} not found`; } return {errorMessage}; diff --git a/vite/src/views/products/plan/components/DeletePlanDialog.tsx b/vite/src/views/products/plan/components/DeletePlanDialog.tsx index bb2abb40a..b0d1f3cd4 100644 --- a/vite/src/views/products/plan/components/DeletePlanDialog.tsx +++ b/vite/src/views/products/plan/components/DeletePlanDialog.tsx @@ -76,9 +76,9 @@ export const DeletePlanDialog = ({ } setOpen(false); - toast.success("Product deleted successfully"); + toast.success("Plan deleted successfully"); } catch (error: unknown) { - toast.error(getBackendErr(error as AxiosError, "Error deleting product")); + toast.error(getBackendErr(error as AxiosError, "Error deleting plan")); } finally { setLoading(false); } @@ -98,7 +98,7 @@ export const DeletePlanDialog = ({ setOpen(false); await Promise.all([invalidateProducts(), invalidateProduct()]); } catch (error) { - toast.error(getBackendErr(error, "Error archiving product")); + toast.error(getBackendErr(error, "Error archiving plan")); } finally { setLoading(false); } @@ -118,7 +118,7 @@ export const DeletePlanDialog = ({ toast.success(`${product.name} unarchived successfully`); setOpen(false); } catch (error) { - toast.error(getBackendErr(error, "Error unarchiving product")); + toast.error(getBackendErr(error, "Error unarchiving plan")); } finally { setLoading(false); } diff --git a/vite/src/views/products/plan/components/edit-plan-details/MainDetailsSection.tsx b/vite/src/views/products/plan/components/edit-plan-details/MainDetailsSection.tsx index ae3d99d10..c7703ec12 100644 --- a/vite/src/views/products/plan/components/edit-plan-details/MainDetailsSection.tsx +++ b/vite/src/views/products/plan/components/edit-plan-details/MainDetailsSection.tsx @@ -31,7 +31,7 @@ export const MainDetailsSection = () => { {/*
Description
setProduct({ ...product, description: e.target.value }) diff --git a/vite/src/views/products/product/components/UpdateProductButton.tsx b/vite/src/views/products/product/components/UpdateProductButton.tsx index 683a2c8c8..7e8842dba 100644 --- a/vite/src/views/products/product/components/UpdateProductButton.tsx +++ b/vite/src/views/products/product/components/UpdateProductButton.tsx @@ -18,7 +18,7 @@ export const UpdateProductButton = () => { const { refetch } = useProductQuery(); const handleUpdateClicked = async () => { - if (isLoading) toast.error("Product counts are loading"); + if (isLoading) toast.error("Plan counts are loading"); if (counts?.all > 0) { setShowNewVersionDialog(true); diff --git a/vite/src/views/products/product/hooks/useProductData.tsx b/vite/src/views/products/product/hooks/useProductData.tsx index 58a936713..01125c571 100644 --- a/vite/src/views/products/product/hooks/useProductData.tsx +++ b/vite/src/views/products/product/hooks/useProductData.tsx @@ -79,10 +79,10 @@ export const useProductData = ({ const actionState = { disabled: !hasChanges, - buttonText: isNewProduct ? "Create Product" : "Update Product", + buttonText: isNewProduct ? "Create Plan" : "Update Plan", tooltipText: !hasChanges ? isNewProduct - ? "Add entitlements and prices to create a new product" + ? "Add entitlements and prices to create a new plan" : `Make a change to the entitlements or prices to update ${product?.name}` : isNewProduct ? `Create a new product: ${product?.name} ` diff --git a/vite/src/views/products/product/prices/CreateFixedPrice.tsx b/vite/src/views/products/product/prices/CreateFixedPrice.tsx index 8e0b8e079..33581f133 100644 --- a/vite/src/views/products/product/prices/CreateFixedPrice.tsx +++ b/vite/src/views/products/product/prices/CreateFixedPrice.tsx @@ -90,7 +90,7 @@ function CreateFixedPrice() { try { if (hasChanges) { if (counts?.all > 0) { - toast.error("Please save the current changes to your product first"); + toast.error("Please save the current changes to your plan first"); return; } @@ -111,7 +111,7 @@ function CreateFixedPrice() { await navigate(getRedirectUrl(`/products/${newId}`, env)); } catch (error) { - toast.error(getBackendErr(error, "Failed to update product")); + toast.error(getBackendErr(error, "Failed to update plan")); } finally { setCopyLoading(false); } diff --git a/vite/src/views/products/product/product-item/product-item-config/PriceItemConfig.tsx b/vite/src/views/products/product/product-item/product-item-config/PriceItemConfig.tsx index 731127028..dab5d948c 100644 --- a/vite/src/views/products/product/product-item/product-item-config/PriceItemConfig.tsx +++ b/vite/src/views/products/product/product-item/product-item-config/PriceItemConfig.tsx @@ -21,7 +21,7 @@ export const PriceItemConfig = () => {
} isSelected={item.isVariable === false} onClick={() => { diff --git a/vite/src/views/products/product/product-sidebar/ToggleDefaultProduct.tsx b/vite/src/views/products/product/product-sidebar/ToggleDefaultProduct.tsx index 389afcbaa..02699b4a4 100644 --- a/vite/src/views/products/product/product-sidebar/ToggleDefaultProduct.tsx +++ b/vite/src/views/products/product/product-sidebar/ToggleDefaultProduct.tsx @@ -41,7 +41,7 @@ const ToggleProductDialog = ({ await toggleProduct(value, false); setOpen(false); } catch (error) { - toast.error(getBackendErr(error, "Failed to update product")); + toast.error(getBackendErr(error, "Failed to update plan")); } setLoading(false); }; diff --git a/vite/src/views/products/products/ProductsPage.tsx b/vite/src/views/products/products/ProductsPage.tsx index b24e2fc67..fd46d856f 100644 --- a/vite/src/views/products/products/ProductsPage.tsx +++ b/vite/src/views/products/products/ProductsPage.tsx @@ -48,7 +48,7 @@ export const ProductsPage = () => { return (
@@ -75,8 +75,8 @@ export const ProductsPage = () => { { type: "item", label: queryStates.showArchivedProducts - ? `Show active products` - : `Show archived products`, + ? `Show active plans` + : `Show archived plans`, onClick: () => setQueryStates({ ...queryStates, diff --git a/vite/src/views/products/products/components/CopyProductDialog.tsx b/vite/src/views/products/products/components/CopyProductDialog.tsx index dded463ff..74de85f6e 100644 --- a/vite/src/views/products/products/components/CopyProductDialog.tsx +++ b/vite/src/views/products/products/components/CopyProductDialog.tsx @@ -48,7 +48,7 @@ export const CopyProductDialog = ({ const handleCopy = async () => { // 1. If env is the same and id is same, throw error if (env === toEnv && id === product.id) { - toast.error("Product ID already exists"); + toast.error("Plan ID already exists"); return; } @@ -61,11 +61,11 @@ export const CopyProductDialog = ({ }); await refetch(); - toast.success("Successfully copied product"); + toast.success("Successfully copied plan"); setOpen(false); } catch (error: unknown) { console.log("Error copying product", error); - toast.error(getBackendErr(error as AxiosError, "Failed to copy product")); + toast.error(getBackendErr(error as AxiosError, "Failed to copy plan")); } finally { setLoading(false); } diff --git a/vite/src/views/products/products/components/CreateProductDialog.tsx b/vite/src/views/products/products/components/CreateProductDialog.tsx index c24a8bfd5..2d36bdac6 100644 --- a/vite/src/views/products/products/components/CreateProductDialog.tsx +++ b/vite/src/views/products/products/components/CreateProductDialog.tsx @@ -107,7 +107,7 @@ function CreateProduct({ setProduct({ @@ -119,7 +119,7 @@ function CreateProduct({ setProduct({ ...product, is_add_on: !product?.is_add_on }) diff --git a/vite/src/views/products/products/components/CreateProductSheet.tsx b/vite/src/views/products/products/components/CreateProductSheet.tsx index 19a87c820..b4a2dd6d1 100644 --- a/vite/src/views/products/products/components/CreateProductSheet.tsx +++ b/vite/src/views/products/products/components/CreateProductSheet.tsx @@ -51,8 +51,8 @@ function CreateProductSheet({ if (!/^[a-zA-Z0-9 _-]+$/.test(productName)) { toast.error( !productName - ? "Product name is required" - : "Product name can only contain alphanumeric characters, dashes (-), and underscores (_)", + ? "Plan name is required" + : "Plan name can only contain alphanumeric characters, dashes (-), and underscores (_)", ); return; } @@ -72,7 +72,7 @@ function CreateProductSheet({ setOpen(false); } catch (error) { toast.error( - getBackendErr(error as AxiosError, "Failed to create product"), + getBackendErr(error as AxiosError, "Failed to create plan"), ); } setLoading(false); @@ -94,13 +94,13 @@ function CreateProductSheet({
@@ -124,7 +124,7 @@ function CreateProductSheet({ metaShortcut="enter" isLoading={loading} > - Create product + Create plan diff --git a/vite/src/views/products/products/components/UpdateProductDialog.tsx b/vite/src/views/products/products/components/UpdateProductDialog.tsx index a7720fdb8..b8d4c3b1a 100644 --- a/vite/src/views/products/products/components/UpdateProductDialog.tsx +++ b/vite/src/views/products/products/components/UpdateProductDialog.tsx @@ -45,12 +45,12 @@ export const UpdateProductDialog = ({ await refetch(); setOpen(false); - toast.success(`Successfully updated product ${product.id}`); + toast.success(`Successfully updated plan ${product.id}`); } catch (error: unknown) { toast.error( - getBackendErr(error as AxiosError, "Failed to update product"), + getBackendErr(error as AxiosError, "Failed to update plan"), ); - } finally { + } finally{ setLoading(false); } }; @@ -59,7 +59,7 @@ export const UpdateProductDialog = ({ e.stopPropagation()}> - Edit Product + Edit Plan
diff --git a/vite/src/views/products/rewards/reward-config/components/FreeProductRewardConfig.tsx b/vite/src/views/products/rewards/reward-config/components/FreeProductRewardConfig.tsx index 4b41a8c47..ad25711ac 100644 --- a/vite/src/views/products/rewards/reward-config/components/FreeProductRewardConfig.tsx +++ b/vite/src/views/products/rewards/reward-config/components/FreeProductRewardConfig.tsx @@ -30,10 +30,10 @@ export function FreeProductRewardConfig({ const isEmpty = freeAddOns.length === 0; return ( - + {/* Product Selection */}
- Product + Plan