Skip to content

Commit

Permalink
fix: empty state for blast results
Browse files Browse the repository at this point in the history
  • Loading branch information
alubbock committed Oct 15, 2024
1 parent 9f20d9c commit 9ddcbc5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/antigenapi/views_old.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ def get_blast_sequencing_run(self, request, pk):
"""BLAST sequencing run vs database."""
blast_str = run_blastp(pk)
if not blast_str:
return JsonResponse({}, status=status.HTTP_404_NOT_FOUND)
return JsonResponse({"hits": []}, status=status.HTTP_404_NOT_FOUND)

# Read query AIRR files for CDRs
results = SequencingRunResults.objects.filter(sequencing_run_id=int(pk))
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/crudtemplates/BlastResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ const BlastResults = (props) => {
</tr>
</thead>
<tbody className="bg-white">
{!blastResults.hits.length && (
<tr>
<td colSpan="5" className="py-4 font-medium text-center">
No results
</td>
</tr>
)}
{blastResults.hits.map((row, rowIdx, arr) => (
<tr
key={
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/crudtemplates/SequencingResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ const SequencingResults = (props) => {
</tr>
</thead>
<tbody className="bg-white">
{!sequencingResults.records.length && (
<tr>
<td colSpan="11" className="py-4 font-medium text-center">
No results
</td>
</tr>
)}
{sequencingResults.records.map((row) => (
<tr
key={row.sequence_id}
Expand Down

0 comments on commit 9ddcbc5

Please sign in to comment.