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

DSEGOG-143-hide-empty-rows #297

Merged
merged 9 commits into from
Dec 14, 2023
Merged

DSEGOG-143-hide-empty-rows #297

merged 9 commits into from
Dec 14, 2023

Conversation

kaperoo
Copy link
Contributor

@kaperoo kaperoo commented Nov 10, 2023

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.

  • Review code
  • Check Actions build
  • Review changes to test coverage

Agile board tracking

connect to DSEGOG-143

Sorry, something went wrong.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@kaperoo kaperoo self-assigned this Nov 10, 2023
Copy link

codecov bot commented Nov 13, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (55b6c9a) 95.23% compared to head (0bd0895) 94.99%.
Report is 38 commits behind head on develop.

Files Patch % Lines
src/api/records.tsx 96.66% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@kaperoo kaperoo marked this pull request as ready for review November 13, 2023 10:23
@@ -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 } }[] = [];
Copy link
Member

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?

Copy link
Member

@louise-davies louise-davies left a 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

{
searchParams: finalisedSearchParams,
filters: finalisedFilters,
projection,
Copy link
Member

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

@kaperoo kaperoo merged commit 9a133b4 into develop Dec 14, 2023
@louise-davies louise-davies deleted the DSEGOG-143-hide-empty-rows branch January 16, 2024 14:50
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.

None yet

2 participants