Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): display filtered rows count #112

Merged

Conversation

oshcherbakovv
Copy link

No description provided.

@oshcherbakovv oshcherbakovv self-assigned this Feb 6, 2025
@oshcherbakovv oshcherbakovv requested a review from a team as a code owner February 6, 2025 13:22
@oshcherbakovv oshcherbakovv force-pushed the o.shcherbakov/add-filtered-rows-count/QA-16086 branch from d46ff5e to ab5d918 Compare February 6, 2025 13:40
@oshcherbakovv
Copy link
Author

image

@@ -96,6 +96,10 @@ export const DeviceTable = observer(({ data, isSuccess, isLoading, isError }: De
table.setColumnFilters(existingColumnFilters)
}, [debouncedGlobalFilter])

useEffect(() => {
deviceTableState.setFilteredDeviceCount(table.getRowModel().rows.length)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if this value can be computed, and not updated with a useEffect

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is impossible. The getRowModel() function returns the final model after all processing (like filtering, sorting, and any other features) has been applied. Using useEffect ensures that you capture the correct row count once all changes are reflected in the model.

@@ -361,5 +361,6 @@
"SD Card Mounted": "SD Card Mounted",
"CPU Platform": "CPU Platform",
"OS": "OS",
"ABI": "ABI"
"ABI": "ABI",
"Displayed devices count": "Count of displayed devices"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "Count of displayed devices" is too long. Maybe just "Displayed"?

@oshcherbakovv oshcherbakovv merged commit 6c036f2 into master Feb 7, 2025
1 check passed
@oshcherbakovv oshcherbakovv deleted the o.shcherbakov/add-filtered-rows-count/QA-16086 branch February 7, 2025 10:20
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.

3 participants