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

[ENH] Implemented custom filtering function #831

Merged
merged 10 commits into from
Dec 13, 2024
Merged

[ENH] Implemented custom filtering function #831

merged 10 commits into from
Dec 13, 2024

Conversation

rmanaem
Copy link
Contributor

@rmanaem rmanaem commented Dec 12, 2024

Checklist

This section is for the PR reviewer

  • PR has an interpretable title with a prefix ([ENH], [FIX], [REF], [TST], [CI], [MNT], [INF], [MODEL], [DOC]) (see our Contributing Guidelines for more info)
  • PR links to GitHub issue with mention Closes #XXXX
  • Tests pass
  • Checks pass

For new features:

  • Tests have been added

For bug fixes:

  • There is at least one test that would fail under the original bug conditions.

Summary by Sourcery

Implement a custom filtering function for v-select components to improve search functionality and enhance user interface text for clarity.

New Features:

  • Introduce a custom filtering function for v-select components to enhance search capabilities.

Enhancements:

  • Improve user interface text for better clarity in annotation and download pages.

Copy link

sourcery-ai bot commented Dec 12, 2024

Reviewer's Guide by Sourcery

This PR implements a custom filtering function for dropdown selections and removes the integer value transformation option. The filtering function provides a more intuitive search experience by matching characters in sequence rather than requiring exact substring matches. The changes are implemented across multiple Vue components and include updates to the store and test files.

ER diagram for removed integer value transformation option

erDiagram
    STORE {
        string bounded
        string euro
        string float
        string iso8601
    }
    STORE ||--o{ TRANSFORM_OPTIONS : contains
    TRANSFORM_OPTIONS {
        string TermURL
        string Label
    }
    note for STORE "Removed 'int' transformation option"
Loading

Class diagram for updated Vue components with custom filtering

classDiagram
    class CategoryToolgroup {
        +filterOptions(option, label, search)
        +selectTool(selectedTool)
    }
    class AnnotCategorical {
        +filterOptions(option, label, search)
        +selectOptionAndUpdate(p_optionValue, p_columnName, p_rawValue)
    }
    CategoryToolgroup --> AnnotCategorical : uses
    note for CategoryToolgroup "Added custom filtering function"
    note for AnnotCategorical "Added custom filtering function"
Loading

File-Level Changes

Change Details Files
Added custom filtering function for dropdown selections
  • Implemented filterOptions method that matches search characters sequentially
  • First character must match exactly (case-insensitive)
  • Subsequent characters must appear in order but can be non-consecutive
  • Applied filter to tool selection dropdown
  • Applied filter to categorical value selection dropdown
components/category-toolgroup.vue
components/annot-categorical.vue
Removed integer value transformation option
  • Removed int transformation option from store state
  • Updated tests to reflect removal of int option
  • Removed int option from transform options list
store/index.js
cypress/unit/store-getter-getTransformOptions.cy.js
cypress/unit/store-getter-getContinousJsonOutput.cy.js
Minor text and UI improvements
  • Added asterisk to age format dropdown explanation text
  • Updated incomplete annotations message wording
  • Updated example JSON fixture file
components/annot-continuous-values.vue
pages/download.vue
cypress/fixtures/examples/good/ds003653_participant_annotated_1698934398962.json

Assessment against linked issues

Issue Objective Addressed Explanation
#821 Enable searching assessments by both full names and abbreviations

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

netlify bot commented Dec 12, 2024

Deploy Preview for neurobagel-annotator ready!

Name Link
🔨 Latest commit 0946910
🔍 Latest deploy log https://app.netlify.com/sites/neurobagel-annotator/deploys/675b979599a1740008a9511a
😎 Deploy Preview https://deploy-preview-831--neurobagel-annotator.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @rmanaem - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider extracting the duplicate filterOptions function into a shared utility function or mixin to avoid code duplication between category-toolgroup.vue and annot-categorical.vue
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@surchs surchs self-requested a review December 12, 2024 22:24
Copy link
Contributor

@surchs surchs left a comment

Choose a reason for hiding this comment

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

✔️ 🧑‍🍳 ✔️

components/annot-categorical.vue Show resolved Hide resolved
components/annot-categorical.vue Outdated Show resolved Hide resolved
components/category-toolgroup.vue Outdated Show resolved Hide resolved
Copy link
Contributor

@surchs surchs left a comment

Choose a reason for hiding this comment

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

🧑‍🍳

@rmanaem rmanaem merged commit 37f6c89 into main Dec 13, 2024
9 checks passed
@rmanaem rmanaem deleted the enh-821 branch December 13, 2024 02:14
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.

Being able to search by instrument abbreviations as well as full names
2 participants