Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/components/plans/PlanSettingsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ gql`
description
interval
name
selfServe
taxes {
...TaxForPlanSettingsSection
}
Expand Down Expand Up @@ -175,6 +176,15 @@ export const PlanSettingsSection = ({
)}
</form.AppField>

<form.AppField name="selfServe">
{(field) => (
<field.SwitchField
label="Show in customer portal"
subLabel="When off, this plan is hidden from the self-serve plan list in the customer portal but can still be assigned to customers by an operator (e.g. enterprise / white-label)."
/>
)}
</form.AppField>

{canApplyChargesMonthly && (
<>
{hasAnyFixedCharge && (
Expand Down
3 changes: 3 additions & 0 deletions src/hooks/plans/usePlanForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ const buildDefaultValues = (
taxes: plan?.taxes || [],
invoiceDisplayName: plan?.invoiceDisplayName || undefined,
payInAdvance: plan?.payInAdvance || false,
// Default new plans to visible in the customer portal; false hides them
// from self-serve while keeping them operator-assignable.
selfServe: plan?.selfServe ?? true,
amountCents: isNaN(plan?.amountCents)
? '0'
: String(deserializeAmount(plan?.amountCents || 0, initialCurrency)),
Expand Down
1 change: 1 addition & 0 deletions src/pages/CreatePlan.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ gql`
description
interval
payInAdvance
selfServe
invoiceDisplayName
amountCents
amountCurrency
Expand Down
Loading