Skip to content

Conversation

@luannmoreira
Copy link
Member

Description:

This PR refactors how the itemsPerPage value is handled in the DataTable component to simplify state management and improve user input validation. Key changes include:

Refactors

  • Removed unnecessary v-model and internal state tracking for itemsPerPage
  • Replaced outlined and center-affix props with cleaner input markup
  • Introduced explicit parsing, clamping, and error messaging for invalid values
  • Reset page to 1 only when the value changes meaningfully
  • Simplified event handling (@blur, @keydown.enter, etc.)

Tests & Snapshots

  • Updated unit test descriptions for clarity (via combobox selection)
  • Adjusted all affected snapshots to reflect new rendered DOM
  • Ensured form validation behaves as expected across views

Affected Areas

This change impacts all components and views using the DataTable with pagination, including:

  • DeviceList
  • UserList
  • NamespaceList
  • SessionList
  • PublicKeyList
  • Tags, Connectors, Containers, and related pending/rejected views

Why?

  • Reduce unnecessary complexity from dual v-model bindings
  • Improve robustness of numeric input handling
  • Prevent invalid values and make validation UX clearer

Moved validation logic for itemsPerPage into clearer functions.
Replaced internal state tracking with direct model updates.
Removed unnecessary outlined and center-affix props.
Updated tests and snapshots accordingly to match new behavior.
@luannmoreira luannmoreira self-assigned this Dec 11, 2025
@luannmoreira luannmoreira requested a review from a team as a code owner December 11, 2025 13:03
@gustavosbarreto gustavosbarreto merged commit 905d7be into master Dec 11, 2025
16 checks passed
@gustavosbarreto gustavosbarreto deleted the refactor/items-per-page-validation branch December 11, 2025 14:31
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.

4 participants