fix(dashboard): allow licenses across parent plans - #2299
Merged
Conversation
Contributor
|
Capy auto-review is paused for this organization because the usage-cycle auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews. |
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
Validation
bun -F @autumn/vite tsuseLinkableLicenses.tsThe backend already supports and tests one license linked under multiple parents.
Summary by cubic
Allow linking a license plan to multiple parent plans in the dashboard. Drops the one-to-one restriction in
useLinkableLicenseswhile still excluding the current plan, archived plans, and already linked or staged licenses.useLicenseProductsQueryand theownedIdsfilter so licenses linked under another parent remain eligible. Availability now excludes only current, archived, and already linked/staged plans.Written for commit e5b524d. Summary will update on new commits.
Greptile Summary
This PR removes the one-to-one license-linking constraint from the dashboard's
useLinkableLicenseshook, allowing a license plan to appear as an option under multiple parent plans. It also drops the now-unnecessaryuseLicenseProductsQuerycall that was fetching all globally-licensed plans solely to enforce that constraint.ownedIdsfilter that previously excluded any plan already linked as a license elsewhere, so users can now attach the same license plan to multiple parent plans as the backend already supports./products/license_productsnetwork request from this hook, reducing an unnecessary fetch on every plan editor open.Confidence Score: 5/5
Safe to merge — the change is a straightforward removal of a frontend-only restriction that no longer matches the backend's supported behavior.
The diff touches a single hook and makes a minimal, well-scoped change: it drops the global license-ownership filter and its associated network call. The remaining filtering logic (exclude self, archived, and already-linked plans) is unchanged and correct. The useLicenseProductsQuery hook is still present and used by five other files, so nothing is broken by its removal here.
No files require special attention.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[useLinkableLicenses] --> B[useProductsQuery\nall plans] A --> C[usePlanLicensesQuery\ncurrent plan's linked licenses] A --> D[usePendingLicenseLinks\nstaged / pending links] B --> E[candidatePlans\nexclude: self + archived] C --> F[linkedIds\nalready linked to THIS plan] D --> F E --> G[availableLicenses\nexclude: linkedIds] F --> G G --> H[Return to UI] style A fill:#6366f1,color:#fff style G fill:#22c55e,color:#fff%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A[useLinkableLicenses] --> B[useProductsQuery\nall plans] A --> C[usePlanLicensesQuery\ncurrent plan's linked licenses] A --> D[usePendingLicenseLinks\nstaged / pending links] B --> E[candidatePlans\nexclude: self + archived] C --> F[linkedIds\nalready linked to THIS plan] D --> F E --> G[availableLicenses\nexclude: linkedIds] F --> G G --> H[Return to UI] style A fill:#6366f1,color:#fff style G fill:#22c55e,color:#fffReviews (1): Last reviewed commit: "fix(dashboard): 🐛 allow licenses across..." | Re-trigger Greptile