-
Notifications
You must be signed in to change notification settings - Fork 4
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
DSEGOG-143-hide-empty-rows #297
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #297 +/- ##
===========================================
- Coverage 95.23% 94.99% -0.24%
===========================================
Files 76 76
Lines 3481 3498 +17
Branches 964 968 +4
===========================================
+ Hits 3315 3323 +8
- Misses 164 173 +9
Partials 2 2 ☔ View full report in Codecov by Sentry. |
src/api/records.tsx
Outdated
@@ -68,8 +68,29 @@ const fetchRecords = async ( | |||
|
|||
searchObj.push(...filtersObj); | |||
|
|||
if (searchObj.length > 0) { | |||
queryParams.append('conditions', JSON.stringify({ $and: searchObj })); | |||
const conditions: { [x: string]: { $exists: boolean } }[] = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename this to something like existsConditions
to be more explicit what it is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we also need to apply this change to the useRecordsCount
query - as otherwise the pagination component which tells you how many items there are in the table (e.g. if unlimited is selected or 1000 is selected and count < 1000) would be wrong - this leads to there being "empty" pages in the table
src/api/records.tsx
Outdated
{ | ||
searchParams: finalisedSearchParams, | ||
filters: finalisedFilters, | ||
projection, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to remove the projection from the incoming record count query, as otherwise we'd need to check the user isn't querying for too many rows whenever they change the data channels they're viewing.
A slight optimisation we can do is to keep the projection
key here in the query key, but set it to projection: [timeChannelName]
- this way we can still optimise the recordCount
query in the "blank table" use case, but otherwise we don't use the projection elsewhere in incomingRecordCount
Description
Rows with no valid data for all displayed columns are hidden from display.
Added the '$or' condition to the search query parameters to check for the existence of data in displayed channels.
Testing instructions
Updated unit tests to include the '$or' part of the condition in search query parameters comparison.
Agile board tracking
connect to DSEGOG-143