Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
LocoDelAssembly committed May 11, 2024
2 parents f2e1bfb + d4cace2 commit d00c578
Show file tree
Hide file tree
Showing 29 changed files with 1,178 additions and 1,000 deletions.
28 changes: 27 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,34 @@ This project <em>does not yet</em> adheres to [Semantic Versioning](https://semv

## [unreleased]

\-

## [0.41.1] - 2024-05-10

### Added

- An extended biological associations API endpoint [#3944]

### Fixed

- Empty `higherClassification` included ""
- Resaving Image resets height/width and original filename
- New image from Data raising from path error
- Filters: JSON request URL overflows container when too long
- PDF Button is missing in Filter Sources
- DwC Import task: Replace dialog shows `undefined` instead the current value
- Radial annotator: Data attributes can't be deleted from the list
- Radial quick forms: Collecting event slice doesn't render correctly
- CSD: In some cases, the locking mechanism does not work correctly [#3941]

[#3941]: https://github.com/SpeciesFileGroup/taxonworks/issues/3941
[#3944]: https://github.com/SpeciesFileGroup/taxonworks/issues/3944

## [0.41.0] - 2024-05-02

### Added

- Filter nomenclature: Local and global identifiers facets [#3942]
- Field synchronizer task- batch edit (regex too), update and syncronize columns and between columns
- `misspelling` option to API `taxon_name_relationship_set[]`

Expand All @@ -27,6 +51,7 @@ This project <em>does not yet</em> adheres to [Semantic Versioning](https://semv

[#3821]: https://github.com/SpeciesFileGroup/taxonworks/issues/3821
[#3933]: https://github.com/SpeciesFileGroup/taxonworks/issues/3833
[#3942]: https://github.com/SpeciesFileGroup/taxonworks/issues/3942

## [0.40.6] - 2024-04-30

Expand Down Expand Up @@ -4584,7 +4609,8 @@ _Special thanks to Tom Klein for his amazing open-source contributions on this r
- Loosing input page numbers when switching tabs on New Taxon Name task

[#1532]: https://github.com/SpeciesFileGroup/taxonworks/issues/1532
[unreleased]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.41.0..development
[unreleased]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.41.1..development
[0.41.1]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.41.0...v0.41.1
[0.41.0]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.40.6...v0.41.0
[0.40.6]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.40.5...v0.40.6
[0.40.5]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.40.4...v0.40.5
Expand Down
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ gem 'parallel_tests', group: [:development, :test]

group :development do
# gem "ruby-lsp", "~> 0.4.1", require: false


gem 'thruster'

# gem 'tunemygc'
gem 'ruby-prof', '~> 1.2'
gem 'better_errors', '~> 2.9'
Expand Down
21 changes: 12 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ GIT
GEM
remote: https://rubygems.org/
specs:
Ascii85 (1.1.0)
Ascii85 (1.1.1)
actioncable (6.1.7.7)
actionpack (= 6.1.7.7)
activesupport (= 6.1.7.7)
Expand Down Expand Up @@ -168,7 +168,7 @@ GEM
bibtex-ruby (6.1.0)
latex-decode (~> 0.0)
racc (~> 1.7)
bigdecimal (3.1.7)
bigdecimal (3.1.8)
bindex (0.8.1)
binding_of_caller (1.0.1)
debug_inspector (>= 1.2.0)
Expand Down Expand Up @@ -288,7 +288,7 @@ GEM
http-accept (1.7.0)
http-cookie (1.0.5)
domain_name (~> 0.5)
i18n (1.14.4)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
indefinite_article (0.2.5)
activesupport
Expand Down Expand Up @@ -339,7 +339,7 @@ GEM
method_source (1.1.0)
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0305)
mime-types-data (3.2024.0507)
mimemagic (0.3.10)
nokogiri (~> 1)
rake
Expand All @@ -353,7 +353,7 @@ GEM
nenv (0.3.0)
net-http (0.4.1)
uri
net-imap (0.4.10)
net-imap (0.4.11)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -363,7 +363,7 @@ GEM
net-smtp (0.3.4)
net-protocol
netrc (0.11.0)
nio4r (2.7.1)
nio4r (2.7.3)
nokogiri (1.16.4-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.4-x86_64-linux)
Expand Down Expand Up @@ -513,7 +513,7 @@ GEM
rspec-expectations (3.13.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.0)
rspec-mocks (3.13.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-rails (5.1.2)
Expand All @@ -526,7 +526,7 @@ GEM
rspec-support (~> 3.10)
rspec-support (3.13.1)
rtesseract (3.1.3)
rubocop (1.63.4)
rubocop (1.63.5)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand Down Expand Up @@ -554,7 +554,7 @@ GEM
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rspec (2.29.1)
rubocop-rspec (2.29.2)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
Expand Down Expand Up @@ -632,6 +632,8 @@ GEM
terrapin (0.6.0)
climate_control (>= 0.0.3, < 1.0)
thor (1.2.2)
thruster (0.1.4-x86_64-darwin)
thruster (0.1.4-x86_64-linux)
tilt (2.3.0)
timecop (0.9.8)
timeliness (0.4.5)
Expand Down Expand Up @@ -808,6 +810,7 @@ DEPENDENCIES
taxonifi (~> 0.6.0)
term-ansicolor (~> 1.6)
thor (~> 1.2)
thruster
timecop (~> 0.9.1)
turbolinks (~> 5.2.0)
tzinfo-data (~> 1.2019)
Expand Down
51 changes: 29 additions & 22 deletions app/assets/stylesheets/views/tasks/matrix/observation_matrices.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#observation_matrices {
margin-top:50px;
margin-top: 50px;
.otu_column {
min-width: 400px;
}
Expand All @@ -22,6 +22,7 @@
min-width: 70px;
position: relative;
text-align: left;
background-color: transparent;
}

#vue-interactive-keys {
Expand All @@ -31,7 +32,7 @@
.header-bar {
width: 100%;
height: 50px;
border-bottom: 1px solid #CCCCCC;
border-bottom: 1px solid #cccccc;
background-color: white;
}

Expand All @@ -41,7 +42,7 @@
grid-template-rows: repeat(2, 1fr);
grid-column-gap: 0px;
grid-row-gap: 0px;
background-color: #CCCCCC;
background-color: #cccccc;
grid-gap: 1px;
}
.grid-icon {
Expand All @@ -55,41 +56,47 @@
background-color: white;
overflow: scroll;
}

.layout-mode-1 {
.descriptors-view {
grid-area: 1 / 1 / 2 / 3;
.descriptors-view {
grid-area: 1 / 1 / 2 / 3;
}
.taxa-remaining {
grid-area: 2 / 1 / 3 / 2;
.taxa-remaining {
grid-area: 2 / 1 / 3 / 2;
}
.taxa-eliminated {
.taxa-eliminated {
grid-area: 2 / 2 / 3 / 3;
}
}

.layout-mode-2 {
.descriptors-view {
grid-area: 1 / 1 / 3 / 2;
.descriptors-view {
grid-area: 1 / 1 / 3 / 2;
}
.taxa-remaining {
grid-area: 1 / 2 / 2 / 3;
.taxa-remaining {
grid-area: 1 / 2 / 2 / 3;
}
.taxa-eliminated {
grid-area: 2 / 2 / 3 / 3;
.taxa-eliminated {
grid-area: 2 / 2 / 3 / 3;
}
}

.full-height {
height: 100%;
}

.mainfont { color: #004050;}
.red { color: #C00000; }
.redbold { color: #C00000; font-weight: bold; }
.mainfont {
color: #004050;
}
.red {
color: #c00000;
}
.redbold {
color: #c00000;
font-weight: bold;
}

.i3 {
box-shadow: 0px 2px 2px 0px rgba(0,0,0,0.2);
box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.2);
}

}
}
18 changes: 18 additions & 0 deletions app/controllers/biological_associations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,24 @@ def api_index_simple
end
end

def api_index_extended
@biological_associations = ::Queries::BiologicalAssociation::Filter.new(params.merge!(api: true))
.all
.where(project_id: sessions_current_project_id)
.order('biological_associations.id')
.page(params[:page])
.per(params[:per])

respond_to do |format|
format.json { render '/biological_associations/api/v1/extended' and return }
format.csv {
send_data Export::CSV::BiologicalAssociations::Extended.csv(@biological_associations),
type: 'text',
filename: "biological_associations_extended_#{DateTime.now}.tsv"
}
end
end

# PATCH /biological_associations/batch_update.json?biological_association_query=<>&biological_association={}
def batch_update
if r = BiologicalAssociation.batch_update(
Expand Down
30 changes: 30 additions & 0 deletions app/helpers/biological_associations_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,34 @@ def simple_hash(biological_associations)
h
end

def extended_hash(biological_associations)
h = []

biological_associations.each do |b|
types = biological_relationship_types(b.biological_relationship)

r = %I{order family genus}.inject({}) { |hsh, r| hsh[('subject_' + r.to_s).to_sym] = [b.biological_association_subject.taxonomy[r.to_s]].flatten.compact.join(' '); hsh }
r.merge!(
id: b.id,
subject_id: b.biological_association_subject_id,
subject_taxon_name_id: b.biological_association_subject.taxon_name_id,
subject_type: b.biological_association_subject_type,
subject: label_for(b.biological_association_subject),
subject_properties: types[:subject].join('|').presence,
biological_relationship_id: b.biological_relationship_id,
biological_relationships: label_for(b.biological_relationship),
object_properties: types[:object].join('|').presence,
object_id: b.biological_association_object_id,
object_taxon_name_id: b.biological_association_object.taxon_name_id,
object_type: b.biological_association_object_type,
object: label_for(b.biological_association_object),
)

r.merge! %I{order family genus}.inject({}) { |hsh, r| hsh[('object_' + r.to_s).to_sym] = [b.biological_association_object.taxonomy[r.to_s]].flatten.compact.join(' '); hsh }
h.push r
end

h
end

end
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="panel content">
<div class="flex-separate middle">
<span> JSON Request: {{ queryString }} </span>
<div class="flex-separate middle gap-small">
<span class="word_break"> JSON Request: {{ queryString }} </span>
<ButtonClipboard :text="queryString" />
</div>
</div>
Expand Down
4 changes: 0 additions & 4 deletions app/javascript/vue/components/layout/Filter/FilterLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,4 @@ onBeforeUnmount(() => {
grid-template-columns: 400px 1fr;
gap: 1em;
}
:deep(.btn-delete) {
background-color: #5d9ece;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@
<script setup>
import { computed, ref } from 'vue'
import { ControlledVocabularyTerm, DataAttribute } from '@/routes/endpoints'
import { IMPORT_ATTRIBUTE, PREDICATE } from '@/constants'
import {
DATA_ATTRIBUTE_INTERNAL_ATTRIBUTE,
IMPORT_ATTRIBUTE,
PREDICATE
} from '@/constants'
import { useSlice } from '@/components/radials/composables'
import VBtn from '@/components/ui/VBtn/index.vue'
import TableList from './shared/tableList'
Expand Down Expand Up @@ -132,7 +136,7 @@ function saveDataAttribute() {
const payload = {
data_attribute: {
id: currentId,
type: 'InternalAttribute',
type: DATA_ATTRIBUTE_INTERNAL_ATTRIBUTE,
value: text.value,
controlled_vocabulary_term_id: predicate.value.id,
annotated_global_entity: decodeURIComponent(props.globalId)
Expand All @@ -150,7 +154,7 @@ function saveDataAttribute() {
}
function removeItem(item) {
DataAttribute.destroy(item).then((_) => {
DataAttribute.destroy(item.id).then((_) => {
removeFromList(item)
})
}
Expand Down
Loading

0 comments on commit d00c578

Please sign in to comment.