From 62a10f0e081f46886c94e4f0eb76842d3f4330ea Mon Sep 17 00:00:00 2001 From: Manuel Holtgrewe Date: Fri, 6 May 2022 13:54:25 +0200 Subject: [PATCH] Adding "variant carrier" popup modal (#470). Related-Issue: #470 Closes: #470 Projected-Results-Impact: none --- HISTORY.rst | 2 + varfish/static/js/variant_carrier.js | 17 +++++++ .../templates/variants/filter_result/row.html | 27 ++++++++++ .../variant_carriers_result.html | 51 +++++++++++++++++++ variants/templates/variants/scripts.html | 2 + variants/templatetags/variants_tags.py | 9 ++++ variants/tests/test_views.py | 47 +++++++++++++++++ variants/urls.py | 5 ++ variants/views.py | 47 +++++++++++++++++ 9 files changed, 207 insertions(+) create mode 100644 varfish/static/js/variant_carrier.js create mode 100644 variants/templates/variants/filter_result/variant_carriers_result.html diff --git a/HISTORY.rst b/HISTORY.rst index c72a1d326..c5394abda 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -19,6 +19,7 @@ End-User Summary - Fixing paths in "Variant Ingest" documentation (#472). - Small extension of "Resolution proposal" template (#472). - Adjusting wrong release name to "anthenea" (#479). +- Adding "show all variant carriers" feature (#470). Full Change List ================ @@ -33,6 +34,7 @@ Full Change List - Fixing paths in "Variant Ingest" documentation (#472). - Small extension of "Resolution proposal" template (#472). - Adjusting wrong release name to "anthenea" (#479). +- Adding "show all variant carriers" feature (#470). ------ v1.2.0 diff --git a/varfish/static/js/variant_carrier.js b/varfish/static/js/variant_carrier.js new file mode 100644 index 000000000..de79f3f32 --- /dev/null +++ b/varfish/static/js/variant_carrier.js @@ -0,0 +1,17 @@ +function showVariantCarrierModal(obj, release, chromosome, start, reference, alternative) { + const box = $(`#variantcarriermodal-${release}-${chromosome}-${start}-${reference}-${alternative}`).find('.variant-carrier-results'); + box.html(`
`); + $.ajax({ + type: 'GET', + url: `${variant_carriers_url}?release=${release}&chromosome=${chromosome}&position=${start}` + + `&reference=${reference}&alternative=${alternative}`, + success: (response) => { + // icon.removeClass('spin').attr('data-icon', 'fa-solid:cloud-upload'); + box.html(response); + }, + error: (jqXHR, textStatus, errorThrown) => { + alert("Error during AJAX call:", textStatus, + errorThrown); + }, + timeout: 0 + }); +} diff --git a/variants/templates/variants/filter_result/row.html b/variants/templates/variants/filter_result/row.html index 078b6d8e9..af35be879 100644 --- a/variants/templates/variants/filter_result/row.html +++ b/variants/templates/variants/filter_result/row.html @@ -455,6 +455,15 @@ {% endif %}
+ {% if entry.release == "GRCh37" %}
+