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

OurDNA: Improve project table view and filtering #742

Merged
merged 48 commits into from
Jun 26, 2024

Conversation

illusional
Copy link
Collaborator

@illusional illusional commented Apr 24, 2024

OurDNA RFC: https://docs.google.com/document/d/1bG8oZQdhA3lEeqlvnCZ1n_P1OqaqDBPlMPB7oz275ns/edit#heading=h.sxmryphgwrnn

Aims:

  • Improve the filtering and usability of the table grid on the project page
  • Make this page generally more useful

Consider:

  • How to hide / show columns for specific projects
  • Exporting data to CSV / etc

Actual changes:

  • [large changes]:

    • Split the project summary from participant grid
    • Further decompose component structure for participant grid
    • Use generic filters for participant grid instead of custom query format
    • Add ability to export changes
    • Added ability to write more expressive queries
    • Encode more params on the URL to make sharing better
    • Migrate in support for multiple external IDs for participants / samples.
  • [unrelated changes]

    • Display improvements to ErrorBoundary
    • Upgrade Vite
    • Add startswith GenericFilter operator
    • Improve participant query, by allowing for more nested objects to query against
    • Add participant tests

@illusional illusional changed the title Improve project table view and filtering OurDNA: Improve project table view and filtering Apr 24, 2024
@codecov-commenter
Copy link

codecov-commenter commented May 2, 2024

Codecov Report

Attention: Patch coverage is 88.01653% with 145 lines in your changes missing coverage. Please review.

Project coverage is 79.79%. Comparing base (8124a13) to head (65dc8e9).

Files Patch % Lines
db/python/filters/generic.py 85.00% 30 Missing ⚠️
api/routes/web.py 70.96% 27 Missing ⚠️
db/python/tables/participant.py 80.21% 18 Missing ⚠️
models/models/web.py 81.70% 15 Missing ⚠️
test/test_web.py 87.17% 15 Missing ⚠️
db/python/layers/web.py 87.64% 11 Missing ⚠️
db/python/tables/sample.py 82.45% 10 Missing ⚠️
db/python/tables/sequencing_group.py 89.58% 5 Missing ⚠️
db/python/layers/participant.py 84.61% 2 Missing ⚠️
db/python/layers/seqr.py 60.00% 2 Missing ⚠️
... and 8 more
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #742      +/-   ##
==========================================
+ Coverage   79.15%   79.79%   +0.63%     
==========================================
  Files         161      168       +7     
  Lines       13622    14127     +505     
==========================================
+ Hits        10782    11272     +490     
- Misses       2840     2855      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

api/routes/web.py Show resolved Hide resolved
@@ -79,14 +340,14 @@ async def search_by_keyword(keyword: str, connection=get_projectless_db_connecti
This searches the keyword, in families, participants + samples in the projects
that you are a part of (automatically).
"""
# raise ValueError("Test")
# raise ValueError('Test')
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
# raise ValueError('Test')

db/python/tables/participant.py Show resolved Hide resolved
@@ -17,7 +18,7 @@ class WebProject(SMBase):
class PagingLinks(SMBase):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can delete this now

web/src/pages/project/ExportProjectButton.tsx Outdated Show resolved Hide resolved
web/src/pages/project/ProjectGrid.tsx Outdated Show resolved Hide resolved
web/src/pages/project/ProjectGrid.tsx Outdated Show resolved Hide resolved
}) => {
// Use the combination of category and filterKey to turn that into the correct value
// Note filterValues is a ParticipantGridFilter object, which has nested keys for each
// category (except participant).
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
// category (except participant).
// category.

// set name to the filterKey without the .meta prefix
const name = props.filterKey.replace(/^meta\./, '')

// if we are filtering on the participant level, check the filterValues directly
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
// if we are filtering on the participant level, check the filterValues directly

web/src/pages/project/ValueFilter.tsx Outdated Show resolved Hide resolved
@illusional
Copy link
Collaborator Author

Having some issues with the Form component in the ValueFilter, when it's wrapped in a Form, the sizing doesn't work correctly, but if it's removed I can't catch the "on enter" event.

image

Copy link
Contributor

@dancoates dancoates left a comment

Choose a reason for hiding this comment

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

Frontend is looking good! all comments are pretty small

web/src/pages/project/DictEditor.tsx Outdated Show resolved Hide resolved
web/src/pages/project/DictEditor.tsx Outdated Show resolved Hide resolved
web/src/pages/project/ProjectGridContainer.tsx Outdated Show resolved Hide resolved
web/src/pages/project/DictEditor.tsx Outdated Show resolved Hide resolved
web/src/pages/project/ParticipantGridRow.tsx Show resolved Hide resolved
web/src/pages/project/ProjectGrid.tsx Outdated Show resolved Hide resolved
web/src/pages/project/ProjectGrid.tsx Outdated Show resolved Hide resolved
web/src/pages/project/ParticipantGridRow.tsx Outdated Show resolved Hide resolved
web/src/pages/project/ParticipantGridRow.tsx Outdated Show resolved Hide resolved
web/src/pages/project/ProjectColumnOptions.tsx Outdated Show resolved Hide resolved
@illusional illusional marked this pull request as ready for review June 19, 2024 20:34
* tmp

* Linting

---------

Co-authored-by: Dan Coates <[email protected]>
Co-authored-by: Michael Franklin <[email protected]>
db/python/filters/generic.py Outdated Show resolved Hide resolved
db/python/filters/generic.py Outdated Show resolved Hide resolved
@@ -333,6 +334,7 @@ async def import_pedigree(
[
ParticipantUpsertInternal(
id=external_participant_ids_map[row.individual_id],
external_ids={PRIMARY_EXTERNAL_ORG: row.individual_id},
Copy link
Contributor

Choose a reason for hiding this comment

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

Huzzah! 😄

db/python/tables/assay.py Show resolved Hide resolved
db/python/tables/assay.py Show resolved Hide resolved
db/python/tables/participant.py Show resolved Hide resolved
models/base.py Show resolved Hide resolved
models/models/participant.py Outdated Show resolved Hide resolved
test/test_web.py Outdated Show resolved Hide resolved
@illusional illusional merged commit 7c88308 into dev Jun 26, 2024
5 checks passed
@illusional illusional deleted the ourdna/update-table-view-and-filtering branch June 26, 2024 22:34
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