Skip to content

Conversation

@luizhf42
Copy link
Member

@luizhf42 luizhf42 commented Dec 9, 2025

This PR modernizes the tags module by migrating from Vuex-like patterns to Pinia composition API, simplifying the store interface and improving consistency with other modules in the codebase.

Changes

  • Store refactoring

    • Migrated to Pinia composition API with ref-based state
    • Consolidated state: numberTagstagCount, removed page, perPage, filter from state
    • Unified tag selection into single selectedTags array (removed device/container variants)
    • Removed computed getters - components access state directly
    • Simplified method signatures: removed tenant parameter objects to match the new API endpoints
    • Removed redundant methods: search, autocomplete (unified into fetchTagList), setSelected, clearSelected
  • Components

    • Updated all components to use new store API
    • Refactored TagFormUpdate with dedicated addTag/removeTag methods
    • Improved validation logic in TagCreate and TagEdit
    • Updated TagSelector to use toggleSelectedTag and direct array manipulation
  • API layer

    • Reordered getTags parameters for better ergonomics: getTags(page, perPage, filter?)
    • Added IUpdateTagName interface for type safety
  • Tests

    • Updated all component tests to match new store API
    • Completely rewrote store unit tests with comprehensive coverage

@luizhf42 luizhf42 self-assigned this Dec 9, 2025
@luizhf42 luizhf42 force-pushed the refactor/tags-api-and-store branch from 7c76c32 to 11cfe61 Compare December 10, 2025 20:10
@luizhf42 luizhf42 marked this pull request as ready for review December 10, 2025 20:23
@luizhf42 luizhf42 requested review from a team as code owners December 10, 2025 20:23
@luizhf42 luizhf42 force-pushed the refactor/tags-api-and-store branch from 11cfe61 to 4ae3e40 Compare December 10, 2025 20:28
@luizhf42 luizhf42 force-pushed the refactor/tags-api-and-store branch from 4ae3e40 to a5d1d4e Compare December 10, 2025 20:30
@luizhf42 luizhf42 force-pushed the refactor/tags-api-and-store branch from a5d1d4e to 78d98a5 Compare December 10, 2025 21:03
@gustavosbarreto gustavosbarreto merged commit fba16df into master Dec 11, 2025
8 checks passed
@gustavosbarreto gustavosbarreto deleted the refactor/tags-api-and-store branch December 11, 2025 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants