Skip to content

feat: querybuilder component that can be used to create valid query strings for the ena api #310 #420

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Smeds
Copy link
Collaborator

@Smeds Smeds commented Mar 27, 2025

Here’s the first version of a query builder component for constructing valid query strings for the ENA REST API. It still needs some refinements:

  1. The UI could use some styling improvements.
  2. The dialog for selecting fields and setting values needs:
    1. Styling enhancements.
    2. Support for displaying field descriptions.
    3. The ability to provide example values or validation hints.
  3. would be great if we could extend runReadFields.json with information about possible values and improved type validation.

Screenshoot

querybuilder20250318

Example of usage

viewBuilders.ts

export const buildGenomePrimaryData = (
  genome: BRCDataCatalogGenome
): ComponentProps<typeof C.QueryBuilder> => {
  return {
    initialQuery: `tax_id=${genome.speciesTaxonomyId}`,
    onQueryChange: (query: string): void => {
      console.log(query);
    },
  };
};

analysisMethodMainColumn.ts

export const mainColumn: ComponentsConfig = [
  {
    children: [
      {
        component: C.AnalysisMethodsCatalog,
        viewBuilder: V.buildGenomeAnalysisMethods,
      },
      {
        component: C.QueryBuilder,
        viewBuilder: V.buildGenomePrimaryData,
      },
    ],
    component: C.BackPageContentMainColumn,
  },
];

onQueryChange

Implement a version of onQueryChange that will query our API to fetch data and populate a table with this information.

@Smeds Smeds requested a review from NoopDog March 27, 2025 18:47
@Smeds Smeds marked this pull request as draft March 27, 2025 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant