feat(den): add simulated org seat billing#2010
Draft
benjaminshafii wants to merge 4 commits into
Draft
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
1 issue found across 9 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="ee/apps/den-web/app/(den)/dashboard/_components/billing-dashboard-screen.tsx">
<violation number="1" location="ee/apps/den-web/app/(den)/dashboard/_components/billing-dashboard-screen.tsx:236">
P2: Loading state won't display on the simulated-mode button because the `actionBusy` key set by `updateSimulated` (`"org_seats:active"`) doesn't match the key checked in `loading` (`"org-seats:portal"`). The spinner never activates in simulated mode.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
| <input className="mt-2 w-full rounded-[14px] border border-gray-200 px-3 py-2 text-[14px]" type="number" min={minSeats} max={500} value={seatQuantity} onChange={(event) => setSeatQuantity(Number(event.target.value))} /> | ||
| </label> | ||
| <div className="flex flex-wrap justify-end gap-3"> | ||
| {orgSeats.hasActiveSubscription ? <DenButton disabled={!isOwner || !orgSeats.configured} loading={actionBusy === "org-seats:portal"} onClick={() => simulated ? void updateSimulated("org_seats", "active", seatQuantity) : void openUrlFromResponse("/v1/billing/org-seats/portal", { method: "POST" }, "org-seats:portal")}>{simulated ? "Update simulated seats" : "Manage seats"}</DenButton> : null} |
There was a problem hiding this comment.
P2: Loading state won't display on the simulated-mode button because the actionBusy key set by updateSimulated ("org_seats:active") doesn't match the key checked in loading ("org-seats:portal"). The spinner never activates in simulated mode.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At ee/apps/den-web/app/(den)/dashboard/_components/billing-dashboard-screen.tsx, line 236:
<comment>Loading state won't display on the simulated-mode button because the `actionBusy` key set by `updateSimulated` (`"org_seats:active"`) doesn't match the key checked in `loading` (`"org-seats:portal"`). The spinner never activates in simulated mode.</comment>
<file context>
@@ -70,170 +95,185 @@ function parsePolarBilling(payload: unknown): PolarBilling | null {
+ <input className="mt-2 w-full rounded-[14px] border border-gray-200 px-3 py-2 text-[14px]" type="number" min={minSeats} max={500} value={seatQuantity} onChange={(event) => setSeatQuantity(Number(event.target.value))} />
+ </label>
+ <div className="flex flex-wrap justify-end gap-3">
+ {orgSeats.hasActiveSubscription ? <DenButton disabled={!isOwner || !orgSeats.configured} loading={actionBusy === "org-seats:portal"} onClick={() => simulated ? void updateSimulated("org_seats", "active", seatQuantity) : void openUrlFromResponse("/v1/billing/org-seats/portal", { method: "POST" }, "org-seats:portal")}>{simulated ? "Update simulated seats" : "Manage seats"}</DenButton> : null}
+ {!orgSeats.hasActiveSubscription ? <DenButton disabled={!isOwner || !orgSeats.configured} loading={actionBusy === "org-seats:checkout"} onClick={() => void openUrlFromResponse("/v1/billing/org-seats/checkout", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ quantity: seatQuantity }) }, "org-seats:checkout")}>Buy Team Seats</DenButton> : null}
+ {simulated && orgSeats.hasActiveSubscription ? <DenButton variant="secondary" disabled={!isOwner} loading={actionBusy === "org_seats:canceled"} onClick={() => void updateSimulated("org_seats", "canceled", seatQuantity)}>Cancel simulated seats</DenButton> : null}
</file context>
Suggested change
| {orgSeats.hasActiveSubscription ? <DenButton disabled={!isOwner || !orgSeats.configured} loading={actionBusy === "org-seats:portal"} onClick={() => simulated ? void updateSimulated("org_seats", "active", seatQuantity) : void openUrlFromResponse("/v1/billing/org-seats/portal", { method: "POST" }, "org-seats:portal")}>{simulated ? "Update simulated seats" : "Manage seats"}</DenButton> : null} | |
| {orgSeats.hasActiveSubscription ? <DenButton disabled={!isOwner || !orgSeats.configured} loading={actionBusy === "org-seats:portal" || actionBusy === "org_seats:active"} onClick={() => simulated ? void updateSimulated("org_seats", "active", seatQuantity) : void openUrlFromResponse("/v1/billing/org-seats/portal", { method: "POST" }, "org-seats:portal")}>{simulated ? "Update simulated seats" : "Manage seats"}</DenButton> : null} |
Member
Author
|
Added clearer Daytona recordings for the billing UX:
These are using simulated billing mode, so the UI/seat state is exercised end-to-end without Stripe credentials. |
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.
Summary
Verification
Daytona Flow Covered
Flags