Accession trait data
Add a new tab "Traits" to accession browser. The tab is only enabled if the current filter includes one of institute.code
, taxonomy.genus
or crop
. The tab does not have SSR support.
The new component first executes an API call to /api/v1/datasets/accessions-datasets with the existing accession filter in the request body. This returns a set of dataset uuid
s. Next the code looks up the information of these datasets using /api/v1/datasets/list. For each dataset, it fetches descriptor details using /api/v1/descriptor/list/details. This allows us to build a datasetDescriptors: Map<uuid, List<Descriptor>>
and a descriptorDatasets: Map<uuid, List<Dataset>>
for lookups.
Selecting trait descriptors
All available trait descriptors are displayed and can be toggled on and off, similar to configuring the Subsetting Tool:
The body of each descriptor section displays (1) the names of datasets where descriptor is present and (2) the descriptor filter:
Table
Below the descriptor selection we display a <Table
. The table configuration
uses the selected descriptors (toggled on) for columns and their renderers. The "My list" and "Accession" columns are always included, same as in our searchable datasets.
Loading table data
"Apply trait filters" button is in the section where descriptors are selected (above the table). No data is loaded until trait filters are applied.
The button fetches trait data from /api/v1/datasets/data and submits the trait data filter in the body. This filter includes the accession filters:
{
"accession": <ACCESSION FILTER>,
"observations": <TRAIT FILTERS>
}