ag-computational-bio / bakrep-web

The user interface for bakrep
1 stars 0 forks source link

Add min/max values from database for filter fields on browse page #65

Closed lukasjelonek closed 8 months ago

lukasjelonek commented 10 months ago

Currently the min/max values are hardcoded on the browse page. It would be better to extract them from database to cover the whole range of values.

Proposal:

Include min/max values to searchinfo.

Example:


{
    "fields": [
        {
            "field": "id",
            "ops": [
                "eq"
            ],
            "type": "text",
            "sortable": true
        },
        {
            "field": "bakta.stats.no_sequences",
            "ops": [
                "==",
                "!=",
                "<",
                "<=",
                ">",
                ">=",
                "[]"
            ],
            "type": "number",
            "sortable": true,
                        "range": { "min": 1, "max": 12345 }  
        },
                [...]
    ]
}
lukasjelonek commented 10 months ago

The server now outputs the min and max values for each field, but not as shown in the previous example.

[...]
                      {
            "field": "bakta.stats.no_sequences",
            "ops": [
                "==",
                "!=",
                "<",
                "<=",
                ">",
                ">=",
                "[]"
            ],
            "type": "number",
            "sortable": true,
                        "min": 1, 
                        "max": 12345
        },
[...]
crsct commented 8 months ago

this should be resolved when #74 is closed. if not please let me know