From c7c328973b91e2ed6e1ea2e45334fbe946004cc6 Mon Sep 17 00:00:00 2001 From: olekkorob Date: Tue, 20 Dec 2022 16:40:50 +0200 Subject: [PATCH 1/4] chore: start working --- web/src/views/LocationReports.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/src/views/LocationReports.vue b/web/src/views/LocationReports.vue index 02ca8fbb1..152b626b2 100644 --- a/web/src/views/LocationReports.vue +++ b/web/src/views/LocationReports.vue @@ -75,6 +75,9 @@ How to interpret these reports +
+ +
From 88f9e644e385db1721af25fa6e5447599b882af4 Mon Sep 17 00:00:00 2001 From: olekkorob Date: Thu, 22 Dec 2022 05:05:33 +0200 Subject: [PATCH 2/4] chore: add worldreport button --- web/src/api/genomics.js | 21 +++++++---- web/src/components/CustomLocationForm.vue | 7 ---- .../components/LocationReportComponent.vue | 7 ++-- web/src/components/TypeaheadSelect.vue | 36 +++++++++++++------ web/src/js/get-location.js | 24 +++++++++---- web/src/views/LocationReports.vue | 18 +++++++++- 6 files changed, 81 insertions(+), 32 deletions(-) diff --git a/web/src/api/genomics.js b/web/src/api/genomics.js index 384dca1df..ea40c6944 100644 --- a/web/src/api/genomics.js +++ b/web/src/api/genomics.js @@ -1929,10 +1929,12 @@ export const getBasicLocationReportData = (apiurl, location) => { const curatedLineages = filtered.map((d) => { let reportQuery = d.reportQuery; - reportQuery.loc = reportQuery.loc - ? uniq(reportQuery.loc.push(location)) - : [location]; - reportQuery.selected = location; + if (location !== 'Worldwide') { + reportQuery.loc = reportQuery.loc + ? uniq(reportQuery.loc.push(location)) + : [location]; + reportQuery.selected = location; + } return { label: d.label, @@ -1954,9 +1956,16 @@ export const getBasicLocationReportData = (apiurl, location) => { const ofInterest = getVOCs(); return forkJoin([ - findLocationMetadata(apiurl, location), + findLocationMetadata( + apiurl, + location && location !== 'Worldwide' ? location : null, + ), getDateUpdated(apiurl), - getSequenceCount(apiurl, location, true), + getSequenceCount( + apiurl, + location && location !== 'Worldwide' ? location : null, + true, + ), ]).pipe( map(([location, dateUpdated, total]) => { return { diff --git a/web/src/components/CustomLocationForm.vue b/web/src/components/CustomLocationForm.vue index 38b21fc49..91283ffda 100644 --- a/web/src/components/CustomLocationForm.vue +++ b/web/src/components/CustomLocationForm.vue @@ -84,7 +84,6 @@ From e134bdcabf1c89c4eb2aba5f1b8821753d64c0bc Mon Sep 17 00:00:00 2001 From: olekkorob Date: Thu, 22 Dec 2022 05:49:44 +0200 Subject: [PATCH 3/4] update: enable geo distribution --- web/src/api/genomics.js | 13 +++---------- web/src/components/LocationReportComponent.vue | 11 ++++++----- web/src/js/get-location.js | 2 +- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/web/src/api/genomics.js b/web/src/api/genomics.js index ea40c6944..6d975bfef 100644 --- a/web/src/api/genomics.js +++ b/web/src/api/genomics.js @@ -1929,7 +1929,7 @@ export const getBasicLocationReportData = (apiurl, location) => { const curatedLineages = filtered.map((d) => { let reportQuery = d.reportQuery; - if (location !== 'Worldwide') { + if (location) { reportQuery.loc = reportQuery.loc ? uniq(reportQuery.loc.push(location)) : [location]; @@ -1956,16 +1956,9 @@ export const getBasicLocationReportData = (apiurl, location) => { const ofInterest = getVOCs(); return forkJoin([ - findLocationMetadata( - apiurl, - location && location !== 'Worldwide' ? location : null, - ), + findLocationMetadata(apiurl, location), getDateUpdated(apiurl), - getSequenceCount( - apiurl, - location && location !== 'Worldwide' ? location : null, - true, - ), + getSequenceCount(apiurl, location, true), ]).pipe( map(([location, dateUpdated, total]) => { return { diff --git a/web/src/components/LocationReportComponent.vue b/web/src/components/LocationReportComponent.vue index 1e8d58a37..0799c3e38 100644 --- a/web/src/components/LocationReportComponent.vue +++ b/web/src/components/LocationReportComponent.vue @@ -1428,7 +1428,7 @@ export default { setupReport() { this.basicSubscription = getBasicLocationReportData( this.$genomicsurl, - this.loc, + this.loc && this.loc !== 'Worldwide' ? this.loc : null, ).subscribe((results) => { this.dateUpdated = results.dateUpdated.dateUpdated; this.lastUpdated = results.dateUpdated.lastUpdated; @@ -1452,9 +1452,10 @@ export default { this.recentWindow, ).subscribe((results) => { this.lineagesByDay = results.lineagesByDay; - this.noRecentData = !( - results.mostRecentLineages && results.mostRecentLineages.length - ); + this.noRecentData = + this.loc !== 'Worldwide' + ? !(results.mostRecentLineages && results.mostRecentLineages.length) + : false; this.mostRecentLineages = results.mostRecentLineages; this.lineageDomain = results.lineageDomain; @@ -1695,7 +1696,7 @@ export default { updateSequenceCount() { this.countSubscription = getSequenceCount( this.$genomicsurl, - this.loc, + this.loc && this.loc !== 'Worldwide' ? this.loc : null, false, ).subscribe((results) => { this.seqCounts = results; diff --git a/web/src/js/get-location.js b/web/src/js/get-location.js index c3b691e58..e4ace689e 100644 --- a/web/src/js/get-location.js +++ b/web/src/js/get-location.js @@ -84,7 +84,7 @@ const failedLocation = (location) => { const worldLocation = { admin_level: 0, id: 'Worldwide', - label: 'World', + label: 'Worldwide', query_id: 'Worldwide', who_region: 'World', }; From 7a00ddc34c2af4baa386067da15431e2c63587c8 Mon Sep 17 00:00:00 2001 From: olekkorob Date: Thu, 22 Dec 2022 06:08:27 +0200 Subject: [PATCH 4/4] chore: world location object --- web/src/components/TypeaheadSelect.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/web/src/components/TypeaheadSelect.vue b/web/src/components/TypeaheadSelect.vue index feb8e67a6..ecf3cc8ca 100644 --- a/web/src/components/TypeaheadSelect.vue +++ b/web/src/components/TypeaheadSelect.vue @@ -39,6 +39,7 @@