From 2d8afebebb415ef1feee32b38bc779ebfdfeb654 Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Mon, 16 Dec 2019 16:57:57 -0500 Subject: [PATCH 1/6] Add batch mode option to region view toolbar --- .nvmrc | 2 +- assets/vue/gwas_region.vue | 36 +++++++++++++++++++++++++++++------- package.json | 4 ++-- yarn.lock | 16 ++++++++-------- 4 files changed, 40 insertions(+), 18 deletions(-) diff --git a/.nvmrc b/.nvmrc index 5debbed..e1fcd1e 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -lts/carbon +lts/erbium diff --git a/assets/vue/gwas_region.vue b/assets/vue/gwas_region.vue index 0d2c2f0..759fe8f 100644 --- a/assets/vue/gwas_region.vue +++ b/assets/vue/gwas_region.vue @@ -1,8 +1,12 @@ - - diff --git a/locuszoom_plotting_service/templates/base.html b/locuszoom_plotting_service/templates/base.html index 42edabc..1a2f132 100644 --- a/locuszoom_plotting_service/templates/base.html +++ b/locuszoom_plotting_service/templates/base.html @@ -39,8 +39,8 @@ - + {% block css %}{% endblock %} @@ -131,15 +131,12 @@ {# Javascript: global template code, plus custom items per page #} - - - + + + {% block javascript %}{% endblock javascript %} diff --git a/package.json b/package.json index f1395f3..ffa7448 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "d3-tip": "0.9.0", "gwas-credible-sets": "^0.1.0", "locuszoom": "0.10.0", - "locuszoom-tabix": "https://github.com/statgen/localzoom#v0.5.0", + "locuszoom-tabix": "https://github.com/statgen/localzoom#918fd75", "pako": "^1.0.8", "underscore": "1.8.3", "vue": "^2.6.10", diff --git a/yarn.lock b/yarn.lock index def7bf3..a5c1667 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3253,9 +3253,9 @@ locate-path@^3.0.0: p-locate "^3.0.0" path-exists "^3.0.0" -"locuszoom-tabix@https://github.com/statgen/localzoom#v0.5.0": +"locuszoom-tabix@https://github.com/statgen/localzoom#918fd75": version "0.5.0" - resolved "https://github.com/statgen/localzoom#b0b53bf835c84a196d145b6e17d0c317c384567a" + resolved "https://github.com/statgen/localzoom#918fd7525f7e14c13dae60dc6f630188b1669c53" dependencies: "@sentry/browser" "^4.5.2" bootstrap "^4.1.3" From 5fa39e9fde02f9f3ea8fea83804f2c920aab9ba5 Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Tue, 17 Dec 2019 16:51:27 -0500 Subject: [PATCH 4/6] Add "share" links to region view --- locuszoom_plotting_service/templates/gwas/gwas_region.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/locuszoom_plotting_service/templates/gwas/gwas_region.html b/locuszoom_plotting_service/templates/gwas/gwas_region.html index a5f529e..c38fa19 100644 --- a/locuszoom_plotting_service/templates/gwas/gwas_region.html +++ b/locuszoom_plotting_service/templates/gwas/gwas_region.html @@ -22,6 +22,9 @@ Uploaded by: {{ gwas.owner.display_name }}, {{ gwas.created | date }} {% if gwas.is_public %}Public {% else %}Private{% endif %} {% if gwas.pmid %}PubMed{% endif %} + {% if gwas.owner == request.user %}(edit) + {% if not gwas.is_public %}(share){% endif %} + {% endif %} From 8532cd94ba27e61e71bbc083a51ea0de80ced2f3 Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Tue, 17 Dec 2019 17:10:27 -0500 Subject: [PATCH 5/6] Add ingest logs link to email templates --- locuszoom_plotting_service/taskapp/tasks.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/locuszoom_plotting_service/taskapp/tasks.py b/locuszoom_plotting_service/taskapp/tasks.py index 9987218..006a1e7 100644 --- a/locuszoom_plotting_service/taskapp/tasks.py +++ b/locuszoom_plotting_service/taskapp/tasks.py @@ -8,6 +8,7 @@ from django.db.models import signals from django.db import transaction from django.dispatch import receiver +from django.urls import reverse from django.utils import timezone from zorp import ( @@ -156,8 +157,9 @@ def mark_success(self, fileset_id): metadata.save() # TODO: Render this as a nicer-looking template + log_url = reverse('gwas:gwas-ingest-log', kwargs={'slug': metadata.slug}) send_mail('[locuszoom] Upload succeeded', - f'Your upload is done processing. Please visit https://{settings.LZ_OFFICIAL_DOMAIN}{metadata.get_absolute_url()} to see the Manhattan plot and begin exploring regions of your data.', # noqa + f'Your upload is done processing. Please visit https://{settings.LZ_OFFICIAL_DOMAIN}{metadata.get_absolute_url()} to see the Manhattan plot and begin exploring regions of your data.\nBe sure to review the ingest logs for any warnings: https://{settings.LZ_OFFICIAL_DOMAIN}{log_url}', # noqa 'locuszoom-service@umich.edu', [metadata.owner.email]) @@ -176,8 +178,9 @@ def mark_failure(self, fileset_id): instance.save() metadata = instance.metadata + log_url = reverse('gwas:gwas-ingest-log', kwargs={'slug': metadata.slug}) send_mail('[locuszoom] Upload failed', - f'Your upload failed to process. Please visit https://{settings.LZ_OFFICIAL_DOMAIN}{metadata.get_absolute_url()} to see the error logs.', # noqa + f'Your upload failed to process. Please review the ingest logs for warnings and error messages: https://{settings.LZ_OFFICIAL_DOMAIN}{log_url}\nOr visit the upload page to change settings: https://{settings.LZ_OFFICIAL_DOMAIN}{metadata.get_absolute_url()}', # noqa 'locuszoom-service@umich.edu', [metadata.owner.email]) From 69c8400105cdb8f5bf7c7047831c9559b999bf7c Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Tue, 17 Dec 2019 17:14:23 -0500 Subject: [PATCH 6/6] Fix comments --- assets/vue/gwas_region.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/vue/gwas_region.vue b/assets/vue/gwas_region.vue index 177b2c7..6a55b53 100644 --- a/assets/vue/gwas_region.vue +++ b/assets/vue/gwas_region.vue @@ -50,7 +50,7 @@ }, fetchTopHits() { // Used for batch mode "get top hits" button - // Fetch pre-computed top loci, in sorted order, and return list of [ [chr, star, end] ] entries + // Fetch pre-computed top loci, in sorted order, and return list of [ {chr, start, end} ] entries return fetch(this.top_hits_url) .then(resp => { if (resp.ok) {