Skip to content

refactor: convert the admin insights-projects and collections stores to setup stores (CM-1571) - #5005

Merged
gaspergrom merged 2 commits into
mainfrom
refactor/CM-1571-admin-setup-stores
Oct 16, 2026
Merged

gaspergrom merged 2 commits into
mainfrom
refactor/CM-1571-admin-setup-stores

Conversation

@gaspergrom

Copy link
Copy Markdown
Contributor

Summary

Converts the admin insights-projects and collections stores to Pinia setup stores. Store ids, APIs and initial values are unchanged, and both files carry MIT headers.

  • $reset() is not available on setup stores. Nothing calls it.
  • useCollectionsStore has no consumers today; CM-1633 covers that.

Closes linuxfoundation/lfx-cdp-insights-ops#271

…to setup stores (CM-1571)

Refs linuxfoundation/lfx-cdp-insights-ops#271

Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 12:42
@cursor

cursor Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Mechanical Pinia style migration with unchanged store APIs; no $reset() usage on these stores.

Overview
Refactors the admin collections and insights-projects Pinia modules from split state/actions option stores into single setup stores (collections.store.ts, insights-projects.store.ts) using ref and returned functions.

Store ids, exported hook names (useCollectionsStore, useInsightsProjectsStore), and the public methods/state shape stay the same; pinia/index.ts now re-exports from the new files and the old state.ts / actions.ts files are removed. MIT license headers are added on the new store files.

Reviewed by Cursor Bugbot for commit 90023ee. Bugbot is set up for automated code reviews on this repo. Configure here.

Copilot AI 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.

🟢 Approval recommended

The refactor preserves existing behavior, with no identified compatibility issues or affected $reset() callers.

0 open findings

What changed in this PR

Migrates the admin insights-projects and collections stores to Pinia setup stores while preserving existing consumers.

Changes:

  • Consolidates state and actions into two MIT-licensed setup-store files.
  • Preserves store IDs, action APIs, and initial values.
  • Retains barrel exports and removes obsolete modules.
File Description
frontend/​src/​modules/​admin/​modules/​insights-projects/​pinia/​state.ts Removes legacy state module.
frontend/​src/​modules/​admin/​modules/​insights-projects/​pinia/​insights-projects.store.ts Implements the projects setup store.
frontend/​src/​modules/​admin/​modules/​insights-projects/​pinia/​index.ts Re-exports the setup store.
frontend/​src/​modules/​admin/​modules/​insights-projects/​pinia/​actions.ts Removes consolidated actions.
frontend/​src/​modules/​admin/​modules/​collections/​pinia/​state.ts Removes legacy state module.
frontend/​src/​modules/​admin/​modules/​collections/​pinia/​index.ts Re-exports the setup store.
frontend/​src/​modules/​admin/​modules/​collections/​pinia/​collections.store.ts Implements the collections setup store.
frontend/​src/​modules/​admin/​modules/​collections/​pinia/​actions.ts Removes consolidated actions.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 12:55

Copilot AI 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.

🟢 Approval recommended

The conversion preserves existing behavior, with no identified broken consumers or dependencies on removed $reset() support.

0 open findings

🧠 Review effort: Balanced

@gaspergrom
gaspergrom merged commit 4467383 into main Oct 16, 2026
14 checks passed
@gaspergrom
gaspergrom deleted the refactor/CM-1571-admin-setup-stores branch October 16, 2026 12:58
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.

2 participants