From 217ceeef42175e0b4d074d2b939a4350e6b5533f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Pereira?= Date: Fri, 9 Sep 2022 16:03:55 -0300 Subject: [PATCH 01/11] Fix button --- CHANGELOG.md | 3 +- .../interactive_keys/components/RowFilter.vue | 62 +++++++++++-------- 2 files changed, 39 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fcb1d6c2c1..4ac2ea0da0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ This project does not yet adheres to [Semantic Versioning](https://semv ## [unreleased] -\- +### Fixed +- View image matrix button doesn't work in Interactive key task ## [0.29.2] - 2022-09-08 ### Added diff --git a/app/javascript/vue/tasks/interactive_keys/components/RowFilter.vue b/app/javascript/vue/tasks/interactive_keys/components/RowFilter.vue index 366bd26df8..f2f45121cf 100644 --- a/app/javascript/vue/tasks/interactive_keys/components/RowFilter.vue +++ b/app/javascript/vue/tasks/interactive_keys/components/RowFilter.vue @@ -3,7 +3,8 @@ + }" + > @@ -22,37 +24,41 @@ - +
  • + class="margin-small-bottom middle" + >
@@ -62,25 +68,27 @@ - +
@@ -125,11 +133,15 @@ export default { }, otuIds () { - const objects = this.remaining - .map(item => item.object) - .filter(item => this.selectedRows.includes(item.id)) + const ids = [] - return objects.map(item => item.otu_id).filter(id => id) + this.remaining.forEach(({ object }) => { + if (this.selectedRows.includes(object.id)) { + ids.push(object.observation_object_id) + } + }) + + return ids }, allSelected () { From d1827988b33997ab8ff964882ef575638305add0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Pereira?= Date: Sun, 11 Sep 2022 21:21:43 -0300 Subject: [PATCH 02/11] Fix missing collectors params --- CHANGELOG.md | 1 + .../vue/tasks/collecting_events/filter/components/Filter.vue | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ac2ea0da0..b789c5653d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ This project does not yet adheres to [Semantic Versioning](https://semv ### Fixed - View image matrix button doesn't work in Interactive key task +- Missing collectors parameters in Filter collecting events. ## [0.29.2] - 2022-09-08 ### Added diff --git a/app/javascript/vue/tasks/collecting_events/filter/components/Filter.vue b/app/javascript/vue/tasks/collecting_events/filter/components/Filter.vue index a20a53d6c9..5e7adefabb 100644 --- a/app/javascript/vue/tasks/collecting_events/filter/components/Filter.vue +++ b/app/javascript/vue/tasks/collecting_events/filter/components/Filter.vue @@ -171,6 +171,7 @@ export default { if (this.emptyParams) return const params = this.filterEmptyParams({ ...checkMatchIdentifiersParams(this.params.matchIdentifiers), + ...this.params.collectors, ...this.params.keywords, ...this.params.dataAttributes, ...this.params.identifier, @@ -179,6 +180,7 @@ export default { ...this.params.byRecordsWith, ...this.params.user, ...this.params.settings, + ...this.params.types, ...this.flatObject(this.params.collectingEvents, 'fields') }) From 5b41f86b55308b71fafbd128e4d2ffce169d0bb0 Mon Sep 17 00:00:00 2001 From: mjy Date: Sun, 11 Sep 2022 19:32:51 -0500 Subject: [PATCH 03/11] Add missing colleting event boolean params --- .../collecting_events_controller.rb | 4 ++ lib/queries/collecting_event/filter.rb | 38 ++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/app/controllers/collecting_events_controller.rb b/app/controllers/collecting_events_controller.rb index c0ad5b1054..917ab198d3 100644 --- a/app/controllers/collecting_events_controller.rb +++ b/app/controllers/collecting_events_controller.rb @@ -307,6 +307,8 @@ def filter_params :end_date, # used in date range :geo_json, :geographic_area_id, + :georeferences, + :geographic_area, :identifier, :identifier_end, :identifier_exact, @@ -350,7 +352,9 @@ def api_params :depictions, :end_date, # used in date range :geo_json, + :georeferences, :geographic_area_id, + :geographic_area, :identifier, :identifier_end, :identifier_exact, diff --git a/lib/queries/collecting_event/filter.rb b/lib/queries/collecting_event/filter.rb index 13f9933854..eccfae8074 100644 --- a/lib/queries/collecting_event/filter.rb +++ b/lib/queries/collecting_event/filter.rb @@ -95,7 +95,6 @@ class Filter # whether the CollectingEvent has associated CollectionObjects attr_accessor :collection_objects - # @return Array # @param collection_object_id [Array, Integer, String] # all collecting events matching collection objects @@ -107,6 +106,18 @@ class Filter # nil - not applied attr_accessor :depictions + # @return [True, False, nil] + # true - georeferences + # false - not georeferenced + # nil - not applied + attr_accessor :georeferences + + # @return [True, False, nil] + # true - has geographic_area present + # false - without geographic_area + # nil - not applied + attr_accessor :geographic_area + def initialize(params) # @spatial_geographic_area_ids = params[:spatial_geographic_areas].blank? ? [] : params[:spatial_geographic_area_ids] @@ -116,6 +127,8 @@ def initialize(params) @collection_objects = boolean_param(params, :collection_objects ) @collection_object_id = params[:collection_object_id] @depictions = boolean_param(params, :depictions) + @georeferences = boolean_param(params, :georeferences) + @geographic_area = boolean_param(params, :geographic_area) @geo_json = params[:geo_json] @geographic_area_id = params[:geographic_area_id] @in_labels = params[:in_labels] @@ -183,6 +196,15 @@ def attribute_clauses c end + def geographic_area_facet + return nil if geographic_area.nil? + if geographic_area + ::CollectingEvent.where.not(geographic_area_id: null).distinct + else + ::CollectingEvent.where(geographic_area_id: null).distinct + end + end + def depictions_facet return nil if depictions.nil? @@ -195,6 +217,18 @@ def depictions_facet end end + def georeferences_facet + return nil if georeferences.nil? + + if georeferences + ::CollectingEvent.joins(:georeferences).distinct + else + ::CollectingEvent.left_outer_joins(:georeferences) + .where(georeferences: {id: nil}) + .distinct + end + end + # @return Scope def collection_objects_facet return nil if collection_objects.nil? @@ -336,7 +370,9 @@ def base_merge_clauses data_attribute_predicate_facet, data_attribute_value_facet, data_attributes_facet, + geographic_area_facet, depictions_facet, + georeferences_facet, geo_json_facet, identifier_between_facet, identifier_facet, # See Queries::Concerns::Identifiers From 3a231169ff10bb7c61eba3e796cd634a18f18781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Pereira?= Date: Mon, 12 Sep 2022 00:00:01 -0300 Subject: [PATCH 04/11] Fix pagination --- CHANGELOG.md | 1 + app/javascript/vue/tasks/observation_matrices/image/app.vue | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b789c5653d..37a92a3025 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ This project does not yet adheres to [Semantic Versioning](https://semv ### Fixed - View image matrix button doesn't work in Interactive key task - Missing collectors parameters in Filter collecting events. +- Pagination on Image Matrix task ## [0.29.2] - 2022-09-08 ### Added diff --git a/app/javascript/vue/tasks/observation_matrices/image/app.vue b/app/javascript/vue/tasks/observation_matrices/image/app.vue index 13d01be7fd..420684b9c2 100644 --- a/app/javascript/vue/tasks/observation_matrices/image/app.vue +++ b/app/javascript/vue/tasks/observation_matrices/image/app.vue @@ -216,8 +216,9 @@ export default { loadPage ({ page }) { this.$store.dispatch(ActionNames.LoadObservationMatrix, { - observation_matrix_id: this.matrixId, + observation_matrix_id: this.matrixId || 0, page, + otu_filter: this.otuFilter, per: this.per }) setParam(RouteNames.ImageMatrix, 'observation_matrix_id', this.matrixId) From d906289448466d1259dee7795c7b4a192bd2ac60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Pereira?= Date: Mon, 12 Sep 2022 00:25:07 -0300 Subject: [PATCH 05/11] Update filter url --- app/javascript/vue/routes/endpoints/CollectingEvents.js | 2 +- app/javascript/vue/routes/endpoints/CollectionObject.js | 2 +- app/javascript/vue/routes/endpoints/Extract.js | 2 +- app/javascript/vue/routes/endpoints/Image.js | 2 +- app/javascript/vue/routes/endpoints/People.js | 2 +- app/javascript/vue/routes/endpoints/Source.js | 2 +- app/javascript/vue/routes/endpoints/TaxonName.js | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/javascript/vue/routes/endpoints/CollectingEvents.js b/app/javascript/vue/routes/endpoints/CollectingEvents.js index a0c3f90326..fb42e9a66e 100644 --- a/app/javascript/vue/routes/endpoints/CollectingEvents.js +++ b/app/javascript/vue/routes/endpoints/CollectingEvents.js @@ -84,7 +84,7 @@ export const CollectingEvent = { clone: (id, params) => AjaxCall('post', `/${controller}/${id}/clone`, params), - filter: params => AjaxCall('post', `/${controller}/filter`, params), + filter: params => AjaxCall('post', `/${controller}/filter.json`, params), navigation: (id) => AjaxCall('get', `/${controller}/${id}/navigation`), diff --git a/app/javascript/vue/routes/endpoints/CollectionObject.js b/app/javascript/vue/routes/endpoints/CollectionObject.js index ff1412d112..d3c924218f 100644 --- a/app/javascript/vue/routes/endpoints/CollectionObject.js +++ b/app/javascript/vue/routes/endpoints/CollectionObject.js @@ -56,7 +56,7 @@ export const CollectionObject = { dwcIndex: (params) => AjaxCall('get', `/${controller}/dwc_index`, { params }), - filter: (params) => AjaxCall('post', `/${controller}/filter`, params), + filter: (params) => AjaxCall('post', `/${controller}/filter.json`, params), metadataBadge: (id) => AjaxCall('get', `/${controller}/${id}/metadata_badge`), diff --git a/app/javascript/vue/routes/endpoints/Extract.js b/app/javascript/vue/routes/endpoints/Extract.js index b3c2ad0dcf..eb8d34bfd0 100644 --- a/app/javascript/vue/routes/endpoints/Extract.js +++ b/app/javascript/vue/routes/endpoints/Extract.js @@ -40,5 +40,5 @@ export const Extract = { ...baseCRUD(controller, permitParams), ...annotations(controller), - filter: params => AjaxCall('post', `/${controller}/filter`, params) + filter: params => AjaxCall('post', `/${controller}/filter.json`, params) } diff --git a/app/javascript/vue/routes/endpoints/Image.js b/app/javascript/vue/routes/endpoints/Image.js index 71925c7f74..4f1642b674 100644 --- a/app/javascript/vue/routes/endpoints/Image.js +++ b/app/javascript/vue/routes/endpoints/Image.js @@ -29,5 +29,5 @@ export const Image = { ...baseCRUD(controller, permitParams), ...annotations(controller), - filter: params => AjaxCall('post', `/${controller}/filter`, params) + filter: params => AjaxCall('post', `/${controller}/filter.json`, params) } diff --git a/app/javascript/vue/routes/endpoints/People.js b/app/javascript/vue/routes/endpoints/People.js index 4ab359eaa2..4fe190d044 100644 --- a/app/javascript/vue/routes/endpoints/People.js +++ b/app/javascript/vue/routes/endpoints/People.js @@ -25,7 +25,7 @@ export const People = { roles: id => AjaxCall('get', `/${controller}/${id}/roles.json`), - filter: params => AjaxCall('post', `/${controller}/filter`, params), + filter: params => AjaxCall('post', `/${controller}/filter.json`, params), merge: (id, params) => AjaxCall('post', `/people/${id}/merge`, params) } diff --git a/app/javascript/vue/routes/endpoints/Source.js b/app/javascript/vue/routes/endpoints/Source.js index 14e70140c3..3cdc444095 100644 --- a/app/javascript/vue/routes/endpoints/Source.js +++ b/app/javascript/vue/routes/endpoints/Source.js @@ -73,7 +73,7 @@ export const Source = { clone: (id, params) => AjaxCall('post', `/${model}/${id}/clone`, params), - filter: params => AjaxCall('post', `/${model}/filter`, params), + filter: params => AjaxCall('post', `/${model}/filter.json`, params), parse: params => AjaxCall('get', `/${model}/parse.json`, { params }) } diff --git a/app/javascript/vue/routes/endpoints/TaxonName.js b/app/javascript/vue/routes/endpoints/TaxonName.js index d6304e9499..aa088dbf67 100644 --- a/app/javascript/vue/routes/endpoints/TaxonName.js +++ b/app/javascript/vue/routes/endpoints/TaxonName.js @@ -42,7 +42,7 @@ const permitParams = { export const TaxonName = { ...baseCRUD(model, permitParams), - filter: params => AjaxCall('post', `/${model}/filter`, params), + filter: params => AjaxCall('post', `/${model}/filter.json`, params), ranks: () => AjaxCall('get', `/${model}/ranks`), From f97227a7997a304a95b07e27270894760f36227d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A1n=20Lucas=20Pereira?= Date: Mon, 12 Sep 2022 11:30:52 -0300 Subject: [PATCH 06/11] Fixed project controller json show view --- CHANGELOG.md | 1 + app/views/projects/show.json.jbuilder | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37a92a3025..163ae0c0c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ This project does not yet adheres to [Semantic Versioning](https://semv - View image matrix button doesn't work in Interactive key task - Missing collectors parameters in Filter collecting events. - Pagination on Image Matrix task +- Project Preferences task causing internal server errors ## [0.29.2] - 2022-09-08 ### Added diff --git a/app/views/projects/show.json.jbuilder b/app/views/projects/show.json.jbuilder index dd82b0a6b8..83d63f7ea1 100644 --- a/app/views/projects/show.json.jbuilder +++ b/app/views/projects/show.json.jbuilder @@ -1 +1 @@ -json.partial '/projects/attributes', project: @project +json.partial! '/projects/attributes', project: @project From 05c957788864188963e92fdffbe07a2ab3af5de2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A1n=20Lucas=20Pereira?= Date: Mon, 12 Sep 2022 11:44:43 -0300 Subject: [PATCH 07/11] Ensure boolean params are strings before comparing in some filters --- CHANGELOG.md | 1 + lib/queries/concerns/protocols.rb | 2 +- lib/queries/concerns/tags.rb | 2 +- lib/queries/content/filter.rb | 6 ++--- lib/queries/source/filter.rb | 24 +++++++++---------- lib/queries/taxon_name_relationship/filter.rb | 4 ++-- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 163ae0c0c8..67b5c0ca0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ This project does not yet adheres to [Semantic Versioning](https://semv - Missing collectors parameters in Filter collecting events. - Pagination on Image Matrix task - Project Preferences task causing internal server errors +- Boolean params not handled correctly on specific conditions in some filters ## [0.29.2] - 2022-09-08 ### Added diff --git a/lib/queries/concerns/protocols.rb b/lib/queries/concerns/protocols.rb index 48685608f2..4e0236565d 100644 --- a/lib/queries/concerns/protocols.rb +++ b/lib/queries/concerns/protocols.rb @@ -31,7 +31,7 @@ def set_protocols_params(params) @protocol_id_and = params[:protocol_id_and].blank? ? [] : params[:protocol_id_and] @protocol_id_or = params[:protocol_id_or].blank? ? [] : params[:protocol_id_or] - @protocols = (params[:protocols]&.downcase == 'true' ? true : false) if !params[:protocols].nil? + @protocols = (params[:protocols]&.to_s&.downcase == 'true' ? true : false) if !params[:protocols].nil? end def protocol_id_and diff --git a/lib/queries/concerns/tags.rb b/lib/queries/concerns/tags.rb index a94caa1a5a..bc6ed2ce82 100644 --- a/lib/queries/concerns/tags.rb +++ b/lib/queries/concerns/tags.rb @@ -33,7 +33,7 @@ def set_tags_params(params) @keyword_id_and = params[:keyword_id_and].blank? ? [] : params[:keyword_id_and] @keyword_id_or = params[:keyword_id_or].blank? ? [] : params[:keyword_id_or] - @tags = (params[:tags]&.downcase == 'true' ? true : false) if !params[:tags].nil? + @tags = (params[:tags]&.to_s&.downcase == 'true' ? true : false) if !params[:tags].nil? end def keyword_id_and diff --git a/lib/queries/content/filter.rb b/lib/queries/content/filter.rb index 3ff988f306..4ce17c88d2 100644 --- a/lib/queries/content/filter.rb +++ b/lib/queries/content/filter.rb @@ -38,9 +38,9 @@ def initialize(params) @text = params[:text] # TODO: use helper method - @exact = (params[:exact]&.downcase == 'true' ? true : false) if !params[:exact].nil? - @depictions = (params[:depictions]&.downcase == 'true' ? true : false) if !params[:depictions].nil? - @citations = (params[:citations]&.downcase == 'true' ? true : false) if !params[:citations].nil? + @exact = (params[:exact]&.to_s&.downcase == 'true' ? true : false) if !params[:exact].nil? + @depictions = (params[:depictions]&.to_s&.downcase == 'true' ? true : false) if !params[:depictions].nil? + @citations = (params[:citations]&.to_s&.downcase == 'true' ? true : false) if !params[:citations].nil? set_user_dates(params) end diff --git a/lib/queries/source/filter.rb b/lib/queries/source/filter.rb index 62847a5daa..1bbdcfa1a8 100644 --- a/lib/queries/source/filter.rb +++ b/lib/queries/source/filter.rb @@ -114,29 +114,29 @@ def initialize(params) @author = params[:author] @author_ids = params[:author_ids] || [] - @author_ids_or = (params[:author_ids_or]&.downcase == 'true' ? true : false) if !params[:author_ids_or].nil? + @author_ids_or = (params[:author_ids_or]&.to_s&.downcase == 'true' ? true : false) if !params[:author_ids_or].nil? @ids = params[:ids] || [] @topic_ids = params[:topic_ids] || [] @serial_ids = params[:serial_ids] || [] @citation_object_type = params[:citation_object_type] || [] - @citations = (params[:citations]&.downcase == 'true' ? true : false) if !params[:citations].nil? - @documents = (params[:documents]&.downcase == 'true' ? true : false) if !params[:documents].nil? - @exact_author = (params[:exact_author]&.downcase == 'true' ? true : false) if !params[:exact_author].nil? - @exact_title = (params[:exact_title]&.downcase == 'true' ? true : false) if !params[:exact_title].nil? - @in_project = (params[:in_project]&.downcase == 'true' ? true : false) if !params[:in_project].nil? - @nomenclature = (params[:nomenclature]&.downcase == 'true' ? true : false) if !params[:nomenclature].nil? - @notes = (params[:notes]&.downcase == 'true' ? true : false) if !params[:notes].nil? + @citations = (params[:citations]&.to_s&.downcase == 'true' ? true : false) if !params[:citations].nil? + @documents = (params[:documents]&.to_s&.downcase == 'true' ? true : false) if !params[:documents].nil? + @exact_author = (params[:exact_author]&.to_s&.downcase == 'true' ? true : false) if !params[:exact_author].nil? + @exact_title = (params[:exact_title]&.to_s&.downcase == 'true' ? true : false) if !params[:exact_title].nil? + @in_project = (params[:in_project]&.to_s&.downcase == 'true' ? true : false) if !params[:in_project].nil? + @nomenclature = (params[:nomenclature]&.to_s&.downcase == 'true' ? true : false) if !params[:nomenclature].nil? + @notes = (params[:notes]&.to_s&.downcase == 'true' ? true : false) if !params[:notes].nil? @project_id = params[:project_id] # TODO: also in Queries::Query - @roles = (params[:roles]&.downcase == 'true' ? true : false) if !params[:roles].nil? + @roles = (params[:roles]&.to_s&.downcase == 'true' ? true : false) if !params[:roles].nil? @source_type = params[:source_type] @title = params[:title] - @with_doi = (params[:with_doi]&.downcase == 'true' ? true : false) if !params[:with_doi].nil? + @with_doi = (params[:with_doi]&.to_s&.downcase == 'true' ? true : false) if !params[:with_doi].nil? @year_end = params[:year_end] @year_start = params[:year_start] - @recent = (params[:recent]&.downcase == 'true' ? true : false) if !params[:recent].nil? + @recent = (params[:recent]&.to_s&.downcase == 'true' ? true : false) if !params[:recent].nil? - @citations_on_otus = (params[:citations_on_otus]&.downcase == 'true' ? true : false) if !params[:citations_on_otus].nil? + @citations_on_otus = (params[:citations_on_otus]&.to_s&.downcase == 'true' ? true : false) if !params[:citations_on_otus].nil? @ancestor_id = params[:ancestor_id] build_terms diff --git a/lib/queries/taxon_name_relationship/filter.rb b/lib/queries/taxon_name_relationship/filter.rb index 972f9600f4..ef0961f4c7 100644 --- a/lib/queries/taxon_name_relationship/filter.rb +++ b/lib/queries/taxon_name_relationship/filter.rb @@ -43,8 +43,8 @@ def initialize(params) @subject_taxon_name_id = params[:subject_taxon_name_id] @object_taxon_name_id = params[:object_taxon_name_id] - @as_object = (params[:as_object]&.downcase == 'true' ? true : false) if !params[:as_object].nil? - @as_subject = (params[:as_subject]&.downcase == 'true' ? true : false) if !params[:as_subject].nil? + @as_object = (params[:as_object]&.to_s&.downcase == 'true' ? true : false) if !params[:as_object].nil? + @as_subject = (params[:as_subject]&.to_s&.downcase == 'true' ? true : false) if !params[:as_subject].nil? @taxon_name_relationship_type = [params[:taxon_name_relationship_type]].flatten.compact @taxon_name_relationship_set = [params[:taxon_name_relationship_set]].flatten.compact From 4fe9d3479179a5b8a10f1ff1b4bca538219fe1f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A1n=20Lucas=20Pereira?= Date: Mon, 12 Sep 2022 13:11:04 -0300 Subject: [PATCH 08/11] Small correction to development Dockerfile --- Dockerfile.development | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.development b/Dockerfile.development index f967734d44..1c40ae4b7a 100644 --- a/Dockerfile.development +++ b/Dockerfile.development @@ -4,7 +4,7 @@ ARG BUNDLER_WORKERS=1 # Install Firefox (for headless feature tests) RUN apt-get update && \ apt-get install -y locales \ - libgtk-3-0 libgtk-3-dev libdbus-glib-1-2 libxt6 && \ + libgtk-3-0 libgtk-3-dev libdbus-glib-1-2 libxt6 libasound2 && \ curl -sL 'https://download.mozilla.org/?product=firefox-latest&lang=en-US&os=linux64' | \ tar -xjf - -C /usr/bin && \ /usr/bin/firefox/firefox --version && \ From 16d3a8935ac03971cf51823b2f1435919825c786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A1n=20Lucas=20Pereira?= Date: Mon, 12 Sep 2022 13:49:20 -0300 Subject: [PATCH 09/11] Removed byebug call --- app/models/source/verbatim.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/models/source/verbatim.rb b/app/models/source/verbatim.rb index e90b8d5f67..71268110fa 100644 --- a/app/models/source/verbatim.rb +++ b/app/models/source/verbatim.rb @@ -48,7 +48,6 @@ def date def generate_bibtex return false if verbatim.blank? result = TaxonWorks::Vendor::Serrano.new_from_citation(citation: verbatim) - byebug if result.type == 'Source::Bibtex' result else From 7f143e331183e44ed56fd1eac18549a542425ef4 Mon Sep 17 00:00:00 2001 From: mjy Date: Mon, 12 Sep 2022 21:41:11 -0500 Subject: [PATCH 10/11] Tweak rejection of "empty" params to allow Boolean --- lib/queries/collection_object/filter.rb | 2 +- lib/queries/georeference/filter.rb | 2 +- lib/queries/image/filter.rb | 2 +- lib/queries/otu/filter.rb | 17 +++++++++-------- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/queries/collection_object/filter.rb b/lib/queries/collection_object/filter.rb index 9f23fcc636..deaf1eaef8 100644 --- a/lib/queries/collection_object/filter.rb +++ b/lib/queries/collection_object/filter.rb @@ -215,7 +215,7 @@ class Filter < Queries::Query # @param [Hash] args are permitted params def initialize(params) - params.reject!{ |_k, v| v.blank? } # dump all entries with empty values + params.reject!{ |_k, v| v.nil? || (v == '') } # dump all entries with empty values # Only CollectingEvent fields are permitted now. # (Perhaps) TODO: allow concern attributes nested inside as well, e.g. show me all COs with this Tag on CE. diff --git a/lib/queries/georeference/filter.rb b/lib/queries/georeference/filter.rb index 14645b5719..cf88031d55 100644 --- a/lib/queries/georeference/filter.rb +++ b/lib/queries/georeference/filter.rb @@ -8,7 +8,7 @@ class Georeference::Filter < Queries::Query # @param [Hash] params def initialize(params) - params.reject! { |_k, v| v.blank? } + params.reject!{ |_k, v| v.nil? || (v == '') } @collecting_event_id = params[:collecting_event_id] @collecting_event_ids = [params[:collecting_event_ids]].flatten diff --git a/lib/queries/image/filter.rb b/lib/queries/image/filter.rb index 75de3312f0..fd9dbba233 100644 --- a/lib/queries/image/filter.rb +++ b/lib/queries/image/filter.rb @@ -80,7 +80,7 @@ class Filter # @param params [Hash] def initialize(params) - params.reject!{ |_k, v| v.blank? } # dump all entries with empty values + params.reject!{ |_k, v| v.nil? || (v == '') } # dump all entries with empty values @otu_id = params[:otu_id] @otu_scope = params[:otu_scope]&.map(&:to_sym) diff --git a/lib/queries/otu/filter.rb b/lib/queries/otu/filter.rb index 09b3ccde98..b76982303d 100644 --- a/lib/queries/otu/filter.rb +++ b/lib/queries/otu/filter.rb @@ -17,7 +17,7 @@ class Otu::Filter < Queries::Query # @param [Hash] params def initialize(params) - params.reject! { |_k, v| v.blank? } + params.reject!{ |_k, v| v.nil? || (v == '') } @and_or_select = params[:and_or_select] @geographic_area_ids = params[:geographic_area_ids] @@ -218,7 +218,7 @@ def author_scope r['role_object_id'].eq(t['id']).and( r['type'].eq('TaxonNameAuthor') ) - ) + ) author_ids.each_with_index do |person_id, i| x = r.alias("#{table_alias}_#{i}") @@ -275,12 +275,12 @@ def matching_taxon_name_relationship_ids b = b.join(c, Arel::Nodes::OuterJoin) .on( a[:taxon_name_id].eq(c[:subject_taxon_name_id]) - ) + ) b = b.join(d, Arel::Nodes::OuterJoin) .on( a[:id].eq(d[:object_taxon_name_id]) - ) + ) e = c[:subject_taxon_name_id].not_eq(nil) f = d[:object_taxon_name_id].not_eq(nil) @@ -310,13 +310,13 @@ def matching_biological_association_ids .on( a[:id].eq(c[:biological_association_subject_id]) .and(c[:biological_association_subject_type].eq('Otu')) - ) + ) b = b.join(d, Arel::Nodes::OuterJoin) .on( a[:id].eq(d[:biological_association_object_id]) .and(d[:biological_association_object_type].eq('Otu')) - ) + ) e = c[:biological_association_subject_id].not_eq(nil) f = d[:biological_association_object_id].not_eq(nil) @@ -344,7 +344,7 @@ def matching_taxon_name_classification_ids b = b.join(c, Arel::Nodes::OuterJoin) .on( a[:taxon_name_id].eq(c[:taxon_name_id]) - ) + ) e = c[:id].not_eq(nil) f = c[:id].eq_any(taxon_name_classification_ids) @@ -369,7 +369,7 @@ def matching_asserted_distribution_ids b = b.join(c, Arel::Nodes::OuterJoin) .on( a[:id].eq(c[:otu_id]) - ) + ) e = c[:otu_id].not_eq(nil) f = c[:id].eq_any(asserted_distribution_ids) @@ -437,3 +437,4 @@ def all end end + From 640ff389b57ee0b0779c4101805e1041274cbb17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A1n=20Lucas=20Pereira?= Date: Tue, 13 Sep 2022 07:29:58 -0300 Subject: [PATCH 11/11] Preparing for version 0.29.3 release [skip ci] --- CHANGELOG.md | 7 ++++++- lib/taxonworks/version.rb | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67b5c0ca0d..d74690dc7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ This project does not yet adheres to [Semantic Versioning](https://semv ## [unreleased] +\- + +## [0.29.3] - 2022-09-13 + ### Fixed - View image matrix button doesn't work in Interactive key task - Missing collectors parameters in Filter collecting events. @@ -2898,7 +2902,8 @@ This project does not yet adheres to [Semantic Versioning](https://semv [#1532]: https://github.com/SpeciesFileGroup/taxonworks/issues/1532 -[unreleased]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.29.2...development +[unreleased]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.29.3...development +[0.29.3]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.29.2...v0.29.3 [0.29.2]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.29.1...v0.29.2 [0.29.1]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.29.0...v0.29.1 [0.29.0]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.28.1...v0.29.0 diff --git a/lib/taxonworks/version.rb b/lib/taxonworks/version.rb index f0a558a8f9..548dcdc5cc 100644 --- a/lib/taxonworks/version.rb +++ b/lib/taxonworks/version.rb @@ -1,3 +1,3 @@ module Taxonworks - VERSION = "0.29.2" + VERSION = "0.29.3" end