Filtering by descriptors
This ticket aims to extend the filtering capability of AccessionFilter
and InventoryFilter
.
- I would like to be able to filter
Accessions
by specifying a set ofSourceDescriptors
and their values. - Similarly, I would like to filter
Inventories
by specifying a set ofCropTraits
and their values. - Finally, I would like to be able to find
Accessions
that have inventories (incl ** system inventory) that match a set ofCropTraits
and their values.
The API change is in grin-global-server#404 (closed).
This ticket adds support for new filter types (handling []
of SourceDescValueFilter
where:
type SourceDescValueFilter = {
sourceDescriptorId: number,
numericValue: NumberFilter,
stringValue: StringFilter,
}
UI
In accession filter there should be a new filter group "Source observations". The user should be able to:
- Click something to select a
SourceDescriptor
using a lookup (descriptor should not be in the filter already) - The selected
SourceDescriptor
is added to the section and the UI displays eitherNumberFilter
orStringArrFilter
depending on descriptor type - User enters the filter values
Next, there should be a filter group titled "Trait observations" in accession filter. The user should be able to:
-
Click something to select a
CropTrait
-
The selected
CropTrait
is added to the section and the UI displays eitherNumberFilter
orStringArrFilter
depending on descriptor type. The "Trait observations" group is also added to the inventory filter. -
User enters filter values
Descriptor types
We have numeric, string and coded descriptors. Coded descriptors specify the list of options, but this will first require API updates and can be implemented in a separate ticket. For now we use StringArrFilter
for coded descriptors.
The important thing is to demonstrate that numeric and string filtering works.