Skip to content

Conversation

@luannmoreira
Copy link
Member

@luannmoreira luannmoreira commented Sep 19, 2025

Description:

This PR introduces improvements to how filters and sorting are managed for the Devices, Users and Namespace sections in the admin UI. Specifically:

State Persistence:

Moved filter, sortField, and sortOrder state into their respective stores (devices, users and namespace) using reactive variables.

Refactored Fetch Logic:

Updated fetchDeviceList, fetchNamespaces and fetchUsersList to default to the store's current filter/sort values if none are explicitly passed.

Minor Cleanups:

  • Moved loading.value = false into finally blocks to prevent spinner hangs.
  • Simplified filter formatting code in Device.vue, Users.vue and Namespaces.vue.

Testing:

  • Verified filters persist across search calls.
  • Ensured fallback to stored values when parameters are not explicitly passed.
  • Checked that loading indicators behave correctly on success/failure.

@luannmoreira luannmoreira self-assigned this Sep 19, 2025
@luannmoreira luannmoreira requested a review from a team as a code owner September 19, 2025 12:32
@luannmoreira luannmoreira added kind/bug Something isn't working area/ui status/ready-for-testing product/enterprise Issue/PR related to Enterprise Edition labels Sep 19, 2025
@luannmoreira luannmoreira force-pushed the fix/keep-filter-upon-search branch from 794d942 to 7521aef Compare September 19, 2025 12:35
Move current filter and sort state into the respective stores
(devices and users) to ensure consistent behavior across views.
Also refactor fetch calls to use stored values when parameters
are not explicitly provided. Adds `setFilter` and `setSort`
methods for better control over these states.
@luannmoreira luannmoreira force-pushed the fix/keep-filter-upon-search branch from 7521aef to 0cb506e Compare September 19, 2025 12:44
@luannmoreira luannmoreira changed the title fix(ui): persist filters and sorting in user/device stores fix(ui): persist filters and sorting in several admin stores Sep 19, 2025
@gustavosbarreto gustavosbarreto merged commit a982f76 into master Sep 22, 2025
16 checks passed
@gustavosbarreto gustavosbarreto deleted the fix/keep-filter-upon-search branch September 22, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ui kind/bug Something isn't working product/enterprise Issue/PR related to Enterprise Edition status/ready-for-testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants