From 4ac25424af7be7494467be3acc87c52cbef3faa9 Mon Sep 17 00:00:00 2001 From: Daniel Perrett Date: Thu, 22 Aug 2024 13:53:35 +0100 Subject: [PATCH 1/2] feat: remove split listing override, now that the underlying issue is fixed --- CHANGELOG.md | 7 ++++++- .../models/timelines_for_taxon_concept.js | 16 ---------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f26422..1ac0de5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +### 1.1.2 + +* Remove the fix specific to Turbinicarpus spp. where 'taxon is split-listed' + message appears incorrectly, as the issue has now been solved in Species+. + ### 1.1.1 * Implement a fix specific to Turbinicarpus spp. where 'taxon is split-listed' @@ -12,4 +17,4 @@ *Add hotjar tracking* -* Add hotjar tracking code \ No newline at end of file +* Add hotjar tracking code diff --git a/app/javascripts/models/timelines_for_taxon_concept.js b/app/javascripts/models/timelines_for_taxon_concept.js index 0706440..7bd1a9b 100644 --- a/app/javascripts/models/timelines_for_taxon_concept.js +++ b/app/javascripts/models/timelines_for_taxon_concept.js @@ -7,22 +7,6 @@ Checklist.TimelinesForTaxonConcept = DS.Model.extend({ hasEvents: DS.attr('boolean'), hasReservations: DS.attr('boolean'), isSplitListed: Ember.computed(function() { - // There is a hard-to-fix upstream bug, and this is a hack to override - // individual cases. Most of the time we just want to return the value of - // hasDescendantTimelines but sometimes that's not correct - see - // https://unep-wcmc.codebasehq.com/projects/cites-support-maintenance/tickets/240 - var overrideSplitListingIds = { - 13183: false, // GENUS Turbinicarpus spp. - }; - - var taxonConceptId = this.get('taxon_concept_id'); - - if ( - taxonConceptId && overrideSplitListingIds.hasOwnProperty(taxonConceptId) - ) { - return overrideSplitListingIds[taxonConceptId] - } - return this.get('hasDescendantTimelines'); }) }); From 2516d7321e2e9cca22a0237b594d89bde5fdd3c9 Mon Sep 17 00:00:00 2001 From: Daniel Perrett Date: Wed, 14 May 2025 12:14:28 +0100 Subject: [PATCH 2/2] fix: download buttons were not always working --- CHANGELOG.md | 1 + app/javascripts/views/download_collection_view.js | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ac0de5..925b21b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ * Remove the fix specific to Turbinicarpus spp. where 'taxon is split-listed' message appears incorrectly, as the issue has now been solved in Species+. +* Fix an issue where downloads were not working. ### 1.1.1 diff --git a/app/javascripts/views/download_collection_view.js b/app/javascripts/views/download_collection_view.js index 61868eb..96a0e6f 100644 --- a/app/javascripts/views/download_collection_view.js +++ b/app/javascripts/views/download_collection_view.js @@ -21,13 +21,22 @@ Checklist.DownloadCollectionView = Ember.CollectionView.extend({ }.property(), download: function(event) { - var id = $(event.target).parent().attr('data-download-id'); + var eventTarget = $(event.target); + + var id = ( + // Might be the or a within it + eventTarget.attr('data-download-id') || + eventTarget.parent().attr('data-download-id') + ); + ga('send', { hitType: 'event', eventCategory: 'Downloads: ' + this.get('content.doc_type') + ' (custom) ', eventAction: 'Format: ' + this.get('content.format') }); + window.location = Checklist.Download.downloadUrl(id); + $.colorbox.close(); },