Coder Social home page Coder Social logo

neurobagel / old-query-tool Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 5.19 MB

User interface for searching across Neurobagel graph

Home Page: https://query.neurobagel.org/

License: MIT License

JavaScript 51.24% Vue 46.34% Shell 0.09% HTML 0.39% CSS 1.39% Dockerfile 0.56%
bootstrapvue nuxt vue

old-query-tool's People

Contributors

alyssadai avatar dependabot[bot] avatar joshunrau avatar remi-gau avatar rmanaem avatar surchs avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

remi-gau

old-query-tool's Issues

Update README.md

Clarify what the API_QUERY_URL env var does and mention that the content of the file should be changed based on whether you want the app to contact a local or remote api

Implement UI elements for assessment tool availability

  • Add field options to categoricalOptions in index.vue
  • Implement the UI using CategoricalField.vue component
  • Update updateCategoricalField in QueryForm.vue
  • Update submitQuery function in QueryForm.vue
  • Have a short line added to the README about what the UI element queries
  • Update QueryForm.cy.js

Create README.md

The README should have information on how one can:

  • Set up the application
  • Launch the application
  • Run tests

Implement UI elements for age

  • Implement the UI element as a vue component
  • Display the component in the QueryFrom.vue component
  • Connect the element to an (asynchronous) API request
  • Test the implementation with a component test
  • Add a short line to the README about what the UI element queries (like an early draft of user docs)

decide on implementation

We want to be as consistent with our tooling as we can. So far, there is only one other frontend tool, and that is built with Vue2 using Nuxt. We should have a quick chat on the choices for the implementation.

Decided:

  • it'll be a vue app
  • we'll use cypress for testing

To be decided:

  • vue2 or vue3
  • nuxt or plain vue?

If we go with vue3/Nuxt3, then I believe the only widely adopted and ready to go component library would be vuetify - and so far we have been using vue-bootstrap.

WDYT @rmanaem and @jarmoza

e2e test

A test that uses all existing query fields and response checks out.

send HTTP requests to the API

This tool will have to translate the selections a user makes on the UI into a (single) HTTP request that is sent to the bagelAPI, so that the bagelAPI can in turn make the corresponding SPARQL query to the graph and return the results to this tool. This tool then needs to be able to display the results it has received from bagelAPI in some way that is interesting to the user.

Modify tool for new subject level results

To implement the functionality for specs outlined here:

  • Implement a check box to switch between the two .csv files
  • Modify generateCSVString to return new subject-level results (the two .csv files).
  • Update DownloadResultsButton component test
  • Update README.md to mention what the tool now returns based on the status of the checkbox

As part of this, we need to make sure that we return the human-readable labels to the users, not the IRI for diagnosis levels and sex. See https://github.com/neurobagel/project/issues/47

For the moment, we will use the hard-coded mapping of controlled term IRI to human-readable label that already exists in the query tool

[ENH] Hide assessment tool until its usable

Is there an existing issue for this?

  • I have searched the existing issues

New feature

As far as I can tell that field does nothing, hide it until there's a use?

Unclear documentation

No response

Update README.md

  • Update the badge for component-test workflow
  • Replace the npm badge with a badge for e2e-test workflow

Diagnosis and healthy control bug

To reproduce the bug:
Select a diagnosis other than All, check healthy control checkbox and you'll have a 422 error which is coming from the API validation, see here

Validate query form

Input fields in the query form need to be validated before the form is submitted.

Cases to keep in mind for validation:

  • Age
    • minAge < maxAge
    • both minAge and maxAge must be non-negative
      currently, min property of the input element enforces this but this can't be tested inside the AgeField.cy.js test

Should the validations fail, the user shouldn't be able to submit the form, Perhaps the button becomes disabled and the field with the issue is highlighted and an informative message is given to the user.

Implementation

  • Implement displayToast method to be called from inside the validateQueryForm
  • Implement validateQueryForm method
    • To be called when the submitQuery button Is clicked
    • Call displayToast method if there is an error otherwise call submitQuery method
  • Update QueryForm.cy.js to test the above functionalities

Fix cd workflow

Every time the workflow is run, the domain is reset back to GitHub pages default and to set it to a specific domain a CNAME file including the domain needs to be added to the build.

Expose query variables with UI elements

The UI should expose the same variables with UI elements (sliders, dropdowns, etc) that the API is exposing (see here).

  • #14
  • #15
  • #16
  • #17
  • #18
  • #19
  • #20
    • e.g. whether a participant is a control subject or not (as implemented in the API)

Each of these should:

  • Implement the UI element as a vue component
  • Display the component in the QueryFrom.vue component
  • Connect the element to an (asynchronous) API request
  • Test the implementation with a component test
  • have a short line added to the README about what the UI element queries (like an early draft of user docs)
    • e.g.: age: select the minimal and/or maximal age (in years) of a participant that should still be included in the results
  • provide options for sex, diagnosis, imaging modality, assessment tools

Implement UI elements for diagnosis

  • Add field options to categoricalOptions in index.vue
  • Implement the UI using CategoricalField.vue component
  • Update updateCategoricalField in QueryForm.vue
  • Update submitQuery function in QueryForm.vue
  • Update CategoricalField.cy.js
  • Have a short line added to the README about what the UI element queries

Implement generic component for continuous fields

Implement ContinuousField.vue to be used as a generic component for continuous fields similar to CategoricalField.vue
ContinuousField.vue will replace AgeFields.vue component and will be used to implement minimum number of sessions field (#19)

Implement UI for healthy control

  • Implement using slots in CategoricalField.vue
  • Implement slot for the diagnosis field in QueryForm.vue
  • Integrate healthy control checkbox in QueryForm.vue
  • Update submitQuery method in QueryForm.vue
  • Update `QueryForm.cy.js
  • Implement test for disabling diagnosis field when healthy control checkbox is checked in QueryForm.cy.js
  • Refactor `CategoricalField.cy.js
  • Implement test for displaying control slot in CategoricalField.cy.js
  • Have a short line added to the README about what the UI element queries

Douglas feedback

Hi folks, the query tool is up and running https://query.neurobagel.org/.
We would like for you to give us feedback on the tool from the perspective
of a user, who would use it to search for sample-level cohorts of openneuro data.

In its current state the query tool:

  • has access to some but not all open neuro datasets (~170 datasets)
  • has up-to-date options for diagnosis, imaging modality, etc
  • has two output tsv files available for download
    • dataset-level contains: dataset portal uri, dataset file path, dataset name, number of matching subjects, and available imaging modalities
    • participant level contains: dataset file path, subject id, age, sex, diagnosis, session id, session file path, number of sessions, and imaging modality
  • doesn't have options for assessment

We'd love to get your feedback on:

  • overall functionality
  • content and format of the output tsv files
  • UI experience
  • anything else you notice or have thoughts on

Please add your feedback as comments on this issue or if it is very extensive, a GDoc/Hackpad could also work.

Set up workflow for eslint

Set up a workflow to run eslint on PRs to catch any issues in case eslint wasn't run before committing.

Set up a linter

  • Set up eslint using pre-existing style guide (airbnb/google)
  • Add eslint plugin Vue to enforce Vue style guide

Update dropdown options

Update the options in CategoricalOptions in index.vue once the data has been added to graph.

[BUG]: Dropdown options overflows container

Is there an existing issue for this?

  • I have searched the existing issues

Expected Behavior

The dropdown options will look nice for all items, regardless of how long the option is

Current Behavior

Screenshot 2023-06-08 at 7 23 14 PM

Error message

No response

Environment

  • OS:
  • Python/Node version:

How to reproduce

Use iPhone SE in browser dev tools then toggle the dropdown for diagnosis

Anything else?

No response

Install and configure lint-staged

Right now eslint doesn't understand the difference between the git staging area and the working directory. The consequence is that if I make a partial commit (i.e. I have more changes in my working dir than I include in the next commit), eslint will not limit itself to the files that are included in the commit.

We should install https://github.com/okonet/lint-staged and configure it so it can run as part of our husky pre-commit hooks so we get more informative eslint errors.

pre-populate valid query parameter choices

For this first release, we will hard-code the choices for categorical variables like diagnosis and imaging modality into the app. That is, in order to know what options a user should have in a UI element to select "diagnosis", we will rely on some internal, hardcoded variable. A good starting point could be to check what unique options are actually available in our graph (although that may change).

We need to code the options for:

  • provide options for sex
  • provide options for diagnosis
  • provide options for imaging modality
  • provide options for assessment tool

Update tool to reflect changes made to API

Once the OpenNeuro data is updated (https://github.com/neurobagel/project/issues/143) and the API is updated to adhere to the new model and data (neurobagel/api#129):

  • update corresponding examples of the outputs in our internal wiki
  • update dropdown options
  • replace DatasetFilePath with DatasetID in output files
  • update the generateTSVString method
  • update README.md
  • if possible, add some note (either directly in the column name or elsewhere) that the dataset uuid is just for merging the results TSVs and is not a persistent identifier (they're regenerated when the graph is remade)

Implement UI elements for sex

  • Provide options for sex
  • Be hooked up to an (asynchronous) API request
  • Have a short line added to the README about what the UI element queries (like an early draft of user docs)
  • Component test

Deploy the app on GitHub pages

We want

  • a static version of the app deployed publicly

  • a https enabled neurobagel URL to reach the app at

  • an automatic process that deploys the public app based on the most recent version of the main branch

  • Enable static build process for deployment in nuxt.config.js

  • Add dotenv nuxt module to buildmodules in nuxt.config.js

  • Add API_QUERY_URL as an repository variable

  • Set up deploy workflow following nuxt documentation

  • Add neurobagel domain as the deployment domain

  • Update README.md

Display response

Given a query result list received from BagelAPI, we want a component that can display visually some basic information about each result dataset object.

  • Default view before results are available that indicates how to run a query
  • A view If no results are returned (i.e. list is empty)

When a non-empty query is returned display:

  • A select all option
  • Summary stats
  • Download results button
  • File download functionality

For each dataset in the response display a:

  • Card
  • Dataset title
  • Number of subjects
  • Modalities toolbar on cards

Test

  • default view
  • No result view
  • Select all functionality: Whether it selects and unselects all checkboxes and updates download correctly
  • A card displayed for each dataset returned
  • Cards display the correct dataset title, number of subjects, and modalities
  • Summary stats
  • Download results button functionality sync with checkboxes
  • update-download event is emitted

Refactor before deployment

  • Go through existing props
    • Set them to required if the component doesn't work without them
    • or provide a sensible default for them
  • Change Cohort Definition Tool to Query Tool in index.vue
  • Rename Modality to Imagin modality
  • Rename updateCategoricalField method in CategoricalField.vue to updateField
  • Add bagel favicon
  • Update the modality colors
  • Update README.md to follow the same pattern as the api
  • Add loading animation while the result is being retrieved

[ENH] Add shortcuts

Implement the following shortcuts in the tool for users to have easy access to

  • #117
  • Feedback shortcut to GitHub issues of the repo
  • Website shortcut
  • Repo shortcut
  • Documentation shortcut

Implement UI elements for imaging modality

  • Add field options to categorical-options.js
  • Implement the UI using CategoricalField.vue component
  • Update updateCategoricalField in QueryForm.vue
  • Update submitQuery function in QueryForm.vue
  • Have a short line added to the README about what the UI element queries
  • Update QueryForm.cy.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.