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

Samples Table: Search by metadata field and value presence #807

Merged
merged 9 commits into from
Oct 4, 2024

Conversation

ericenns
Copy link
Member

@ericenns ericenns commented Oct 3, 2024

What does this PR do and why?

Describe in detail what your merge request does and why.

This PR adds in support for searching the samples table by metadata field and value presence through the existing search box only when metadata has been toggled to be displayed.

Samples can be searched for by metadata using the following format FIELD_NAME:FIELD_VALUE, where the case does not matter for field_name or field_value.

Note: only string values can be searched for, a separate PR will ensure that we only store string values for metadata (#808 )

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other pull requests.

image

image

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Run bin/bundle to install the gems required by this branch
  2. Go to Project Samples page toggle metadata and try out a search using the format FIELD_NAME:FIELD_VALUE
  3. Go to Group Samples page toggle metadata and try out a search using the format FIELD_NAME:FIELD_VALUE

PR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

This comment has been minimized.

@ericenns ericenns force-pushed the samples/search-by-metadata-key-value branch from 864fa3e to dc1d570 Compare October 4, 2024 14:32

This comment has been minimized.

@ericenns ericenns marked this pull request as ready for review October 4, 2024 16:52

This comment has been minimized.

@ericenns ericenns self-assigned this Oct 4, 2024

This comment has been minimized.

ksierks
ksierks previously approved these changes Oct 4, 2024
Copy link
Contributor

@ksierks ksierks left a comment

Choose a reason for hiding this comment

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

Love it! I'm just wondering if displaying columns "project", "created", "last updated", and "files last updated" within the metadata section of the samples table might lead the user to think they can search those fields with the metadata search?
image

@ericenns
Copy link
Member Author

ericenns commented Oct 4, 2024

Love it! I'm just wondering if displaying columns "project", "created", "last updated", and "files last updated" within the metadata section of the samples table might lead the user to think they can search those fields with the metadata search? image

I haven't thought of the non locked columns as being in the "metadata section", but I understand now that a user might think that. I think for now we can leave it as is, but I will bring up that concern to the rest of the GSP team and see what their thoughts are. Potentially in a followup PR we could change the background color of the metadata cells to differentiate them from sample attributes.

Copy link

github-actions bot commented Oct 4, 2024

Code Metrics Report

Coverage Test Execution Time
93.3% 7m59s

Code coverage of files in pull request scope (96.8%)

Files Coverage
app/components/samples/table_component.html.erb 98.6%
app/controllers/groups/samples_controller.rb 100.0%
app/controllers/projects/samples_controller.rb 100.0%
app/views/groups/samples/index.html.erb 100.0%
app/views/projects/samples/index.html.erb 100.0%
lib/irida/search_syntax/ransack.rb 100.0%
lib/irida/search_syntax/ransack_transformer.rb 71.7%

Reported by octocov

Copy link
Collaborator

@ChrisHuynh333 ChrisHuynh333 left a comment

Choose a reason for hiding this comment

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

Looks good!

@ChrisHuynh333 ChrisHuynh333 merged commit 52817d8 into main Oct 4, 2024
3 checks passed
@ChrisHuynh333 ChrisHuynh333 deleted the samples/search-by-metadata-key-value branch October 4, 2024 21:15
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