feat(plans): "Show in customer portal" toggle (self_serve) - #8
Merged
Conversation
…n form Operator-facing checkbox for the `self_serve` plan flag (ThinkfleetAI/lago-api getlago#15). When off, the plan is hidden from the customer-portal self-serve list but stays assignable by operators — enterprise / white-label tiers. - PlanSettingsSection: SwitchField bound to `selfServe` + `selfServe` on the PlanForSettingsSection fragment - CreatePlan EditPlan fragment: fetch `selfServe` - usePlanForm: initial value `selfServe ?? true` (new plans default visible) - serialize: already forwarded via the `...otherValues` spread Requires (env-dependent, not done here): lago-api getlago#15 merged (schema exposes selfServe) + `graphql:codegen` to regenerate src/generated/graphql.tsx — the form won't type-check until then. Labels are literal strings (add i18n keys if lint requires). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the operator-facing checkbox for the
self_serveplan flag — the natural place to control it, since Lago is the master record for plans.Pairs with lago-api#15 (the
self_servecolumn + customer-portal resolver filter).What
SwitchFieldbound toselfServe, plusselfServeadded to thePlanForSettingsSectionfragment.EditPlanfragment — fetchselfServeso edit loads the current value.selfServe ?? true(new plans default visible).selfServeis forwarded via the existing...otherValuesspread, andPlanFormInput = Omit<CreatePlanInput, …>picks it up automatically.When off: the plan is hidden from the customer-portal self-serve list but stays fully assignable by operators (enterprise / white-label).
selfServe.graphql:codegenrun to regeneratesrc/generated/graphql.tsx(addsselfServetoPlan/CreatePlanInput/UpdatePlanInput). The form won't type-check until then.Labels are literal strings — swap to
translate()keys if the i18n lint requires.🤖 Generated with Claude Code