Skip to content

Conversation

@luannmoreira
Copy link
Member

Replaced entire Vuex store in the Admin Dashboard UI with Pinia.
Structure and logic were remodeled to align with Pinia patterns.
Note: Tests are not yet updated or implemented.

@luannmoreira luannmoreira added area/ui javascript Pull requests that update Javascript code release/breaking-change kind/refactor status/require-tests product/enterprise Issue/PR related to Enterprise Edition labels Apr 15, 2025
@luannmoreira luannmoreira self-assigned this Apr 15, 2025
@luannmoreira luannmoreira requested a review from a team as a code owner April 15, 2025 11:33
@luannmoreira luannmoreira force-pushed the refactor/admin-pinia-store branch 3 times, most recently from 1dd4053 to 41972ef Compare April 23, 2025 16:59
@luannmoreira luannmoreira force-pushed the refactor/admin-pinia-store branch 2 times, most recently from 1f0adc6 to 53734c2 Compare May 13, 2025 14:08
Replaced entire Vuex store in the Admin Dashboard UI with Pinia.
Structure and logic were remodeled to align with Pinia patterns.
Note: Tests are not yet updated or implemented.
- Migrated all component and store unit tests from Vuex to Pinia:
  - Updated Dashboard, NamespaceDetails, FirewallRulesDetails, DeviceDetails,
 Login, and AnnouncementDetails view tests.
  - Replaced Vuex `createStore` mocks with Pinia `createPinia` and store
 instance mocks using `setActivePinia`.
  - Adjusted mock store data assignments and method spies for Pinia stores.

- Fixed TypeScript type errors across unit tests:
  - Corrected `firewallRules` mock objects by replacing `action: boolean`
 with valid `action: string` values (e.g., "allow" or "deny").
  - Fixed role types in `namespace.members` by using valid enum string
 values ("owner", "administrator", etc.).
  - Ensured `billing` property is explicitly typed as `undefined` instead
 of `null` to match optional interface definitions.
  - Declared mock objects using the correct `as` syntax or strongly typed
 interfaces when needed to enforce type safety.

- Ensured all wrapper expectations and computed property tests reflect
 updated store logic and structure.
- Maintained full snapshot coverage for migrated components.

These changes align all tests with the current Pinia store implementation
and eliminate type violations that were breaking the build.
@luannmoreira luannmoreira force-pushed the refactor/admin-pinia-store branch from 53734c2 to 12f57b7 Compare May 14, 2025 12:08
@gustavosbarreto gustavosbarreto merged commit a903bba into master May 14, 2025
8 checks passed
@gustavosbarreto gustavosbarreto deleted the refactor/admin-pinia-store branch May 14, 2025 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ui javascript Pull requests that update Javascript code kind/refactor product/enterprise Issue/PR related to Enterprise Edition release/breaking-change status/ready-for-testing status/under-testing Tests broadened

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants