Skip to content

Commit 8f5aa1d

Browse files
committed
add is_resference to the results and make the logic similar to species selector's
1 parent 8d24f09 commit 8f5aa1d

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

app/api/models/resolver.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class MetadataResult(BaseModel):
3232
scientific_name: str
3333
common_name: str
3434
type: Optional[Dict[str, str]] = None
35+
is_reference: bool = False
3536

3637

3738
class ResolvedPayload(MetadataResult):

app/api/resources/templates/search_results.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,17 @@ <h1>Resolved URLs</h1>
2121
<td>{{ item.assembly.accession_id }}</td>
2222
<td>{{ item.scientific_name }}</td>
2323
<td>{{ item.common_name }}</td>
24-
<td>{{ item.type.kind }} - {{ item.type.value }}</td>
24+
<td>
25+
{% if item.type and item.is_reference %}
26+
{{ item.type.kind }} - {{ item.type.value }}, Reference
27+
{% elif item.is_reference %}
28+
Reference
29+
{% elif item.type %}
30+
{{ item.type.kind }} - {{ item.type.value }}
31+
{% else %}
32+
-
33+
{% endif %}
34+
</td>
2535
<td>
2636
<a href="{{ item.resolved_url }}">Ensembl</a>
2737
</td>

app/static/APISpecification.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ paths:
8787
resolved_url:
8888
type: string
8989
description: Resolved url to Ensembl site
90+
is_reference:
91+
type: boolean
92+
description: Whether a genome is reference or not
9093
'302':
9194
description: Redirect to resolved URL
9295
headers:

0 commit comments

Comments
 (0)