Repository navigation
feat: add Premium upsell to the Licenses page - #30909
Draft
designertyler wants to merge 1 commit into
Draft
designertyler wants to merge 1 commit into
designertyler wants to merge 1 commit into
Conversation
When a deployment has no licenses, /deployment/licenses now shows the shared PremiumPaywall card instead of a one-line message. Clicks are attributed to a new "licenses" premium funnel source. The page also stops rendering a blank area when the licenses request fails (shows ErrorAlert) or when the user cannot read licenses (shows an EmptyState). GET /licenses filters by RBAC and returns an empty list for those users, so they no longer see an upsell meant for admins. The Refresh button toasts said "removed license"; they now describe the entitlement refresh. Fixes DES-22147
This branch has not been deployed
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.
When a deployment has no licenses,
/deployment/licensesnow shows the sharedPremiumPaywallcard (same one used on Audit, Groups, Appearance, etc.) instead of a one-line "You don't have any licenses!" message. Clicks report a newlicensespremium funnel source so this page is attributable in funnel data.The page also no longer renders a blank area in two cases:
ErrorAlert, no upsell.GET /licensesfilters by RBAC and returns[], which previously looked like "no licenses". These users now see anEmptyStateexplaining they lack permission, not an upsell meant for admins.Also fixes the Refresh button toasts, which said "Successfully removed license." / "Failed to remove license.", and switches that handler to
mutate()callbacks.Fixes DES-22147
Implementation notes and decisions
Investigation
licenseswas[](enterprise handler returns[]since fix: marshalconvertLicenses()into a[]instead ofnil#22366), but it was a single line of text with inline links, not the Premium upsell used elsewhere.datastayedundefinedafter loading, so only the header rendered.GET /api/v2/licensesis only registered in the enterprise router; on an AGPL-only build it returns 404. That case now showsErrorAlert. A dedicated "open source edition" message was considered and skipped as niche.Decisions
PremiumPaywall(wired to funnel telemetry) rather than the barePaywallPremiumor a new component.PremiumFunnelSourceLicensesrather than reusingdirect, so Licenses-page clicks are distinguishable. Generated files updated viamake gentargets.permissions.viewAllLicensesis true and the list is empty.canViewPremiumis therefore always true on that branch.descriptioncopy instead of the default "You need a Premium license to use this feature."; design may want to tune it.Verification
pnpm lint:types, Biome check on the page folder,go build ./codersdk/.LicensesSettingsPage.stories.tsxandLicensesSettingsPageView.stories.tsx(8 passing). New stories:NoLicensePermission,LoadError;Emptynow shows the paywall.frontend-deep-review(8 roles): all checkpoints pass after fixes for paywall copy (TN6), the no-permission state (DF5), and the refresh mutation (DF3).make pre-commit/make test(workspace was too slow for a full Go test compile).Generated by Coder Agents on behalf of @designertyler.