Skip to content

fix(dashboard): allow licenses across parent plans - #2299

Merged
charlietlamb merged 1 commit into
mainfrom
charlie/licnese-limitation-fix
Jul 20, 2026
Merged

fix(dashboard): allow licenses across parent plans#2299
charlietlamb merged 1 commit into
mainfrom
charlie/licnese-limitation-fix

Conversation

@charlietlamb

@charlietlamb charlietlamb commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • show license plans even when they are linked to another parent plan
  • keep excluding the current, archived, and already-selected plans
  • remove the unnecessary global license-products query from the eligibility hook

Validation

  • bun -F @autumn/vite ts
  • ESLint on useLinkableLicenses.ts
  • React Doctor: 100/100

The 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 useLinkableLicenses while still excluding the current plan, archived plans, and already linked or staged licenses.

  • Bug Fixes
    • Removed useLicenseProductsQuery and the ownedIds filter 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.

Review in cubic

Greptile Summary

This PR removes the one-to-one license-linking constraint from the dashboard's useLinkableLicenses hook, allowing a license plan to appear as an option under multiple parent plans. It also drops the now-unnecessary useLicenseProductsQuery call that was fetching all globally-licensed plans solely to enforce that constraint.

  • [Bug fixes] Removes the ownedIds filter 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.
  • [Improvements] Eliminates the global /products/license_products network 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

Filename Overview
vite/src/views/products/plan/components/plan-licenses/useLinkableLicenses.ts Removes one-to-one license ownership constraint and the associated useLicenseProductsQuery call; available-license filtering now only excludes the current plan, archived plans, and plans already linked/staged for this specific plan.

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
Loading
%%{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:#fff
Loading

Reviews (1): Last reviewed commit: "fix(dashboard): 🐛 allow licenses across..." | Re-trigger Greptile

@capy-ai

capy-ai Bot commented Jul 20, 2026

Copy link
Copy Markdown
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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@charlietlamb
charlietlamb merged commit e5dc579 into main Jul 20, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant