Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
LocoDelAssembly committed Aug 10, 2024
2 parents 956f411 + 3827fba commit 001729c
Show file tree
Hide file tree
Showing 38 changed files with 1,448 additions and 1,182 deletions.
28 changes: 27 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,30 @@ This project <em>does not yet</em> adheres to [Semantic Versioning](https://semv

\-

## [0.43.2] - 2024-08-10

### Added

- `all` button to predicate selector in Field Synchronize [#4005]
- `recent_target` parameter to filters, one of `updated_at` (default) or `created_at` [#4004]
- `verbatim_name` facet to Filter Nomenclature
- Soft validation (and fix) identifying redudant use of `verbatim_name` in Combinations

### Changed

- Comprehensive Specimen Digitization: Prevent user add duplicate types for type materials [#4002]
- Improved visual differentiation of Sandboxes

### Fixed

- Fixed Loan rendering when `date_sent` is blank [#4001]
- New combination: Links in `Other matches`panel didn't work

[#4001]: https://github.com/SpeciesFileGroup/taxonworks/issues/4001
[#4002]: https://github.com/SpeciesFileGroup/taxonworks/issues/4002
[#4004]: https://github.com/SpeciesFileGroup/taxonworks/issues/4004
[#4005]: https://github.com/SpeciesFileGroup/taxonworks/issues/4005

## [0.43.1] - 2024-08-04

### Changed
Expand All @@ -22,6 +46,7 @@ This project <em>does not yet</em> adheres to [Semantic Versioning](https://semv
- Misspelled DwcOccurrence attribute

[#4000]: https://github.com/SpeciesFileGroup/taxonworks/issues/4000
[#4002]: https://github.com/SpeciesFileGroup/taxonworks/issues/4002

## [0.43.0] - 2024-07-31

Expand Down Expand Up @@ -4726,7 +4751,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.43.1..development
[unreleased]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.43.2..development
[0.43.2]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.43.1...v0.43.2
[0.43.1]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.43.0...v0.43.1
[0.43.0]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.42.0...v0.43.0
[0.42.0]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.41.1...v0.42.0
Expand Down
20 changes: 10 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ GEM
bindex (0.8.1)
binding_of_caller (1.0.1)
debug_inspector (>= 1.2.0)
bootsnap (1.18.3)
bootsnap (1.18.4)
msgpack (~> 1.2)
brakeman (6.1.2)
racc
Expand Down Expand Up @@ -381,7 +381,7 @@ GEM
method_source (1.1.0)
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0702)
mime-types-data (3.2024.0806)
mini_mime (1.1.5)
minitest (5.24.1)
modularity (3.0.1)
Expand Down Expand Up @@ -425,10 +425,10 @@ GEM
paper_trail (15.1.0)
activerecord (>= 6.1)
request_store (~> 1.4)
parallel (1.25.1)
parallel (1.26.1)
parallel_tests (4.7.1)
parallel
parser (3.3.4.0)
parser (3.3.4.2)
ast (~> 2.4.1)
racc
parslet (2.0.0)
Expand Down Expand Up @@ -598,7 +598,7 @@ GEM
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.3)
rubocop-ast (1.32.0)
parser (>= 3.3.1.0)
rubocop-capybara (2.21.0)
rubocop (~> 1.41)
Expand Down Expand Up @@ -694,11 +694,11 @@ GEM
terser (1.2.3)
execjs (>= 0.3.0, < 3)
thor (1.2.2)
thruster (0.1.7)
thruster (0.1.7-aarch64-linux)
thruster (0.1.7-arm64-darwin)
thruster (0.1.7-x86_64-darwin)
thruster (0.1.7-x86_64-linux)
thruster (0.1.8)
thruster (0.1.8-aarch64-linux)
thruster (0.1.8-arm64-darwin)
thruster (0.1.8-x86_64-darwin)
thruster (0.1.8-x86_64-linux)
tilt (2.4.0)
timecop (0.9.10)
timeliness (0.4.5)
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/loans_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ def loan_items_totals_per_year(loans)
q = selected_loan_items(loans)

q.where(loan_item_object_type: 'Otu').joins(:loan).pluck(:date_sent, :total).each do |d, t|
data.first[:data][d&.year] += t if t
data.first[:data][d.year] += t if d&.year && t
end

q.where(loan_item_object_type: 'CollectionObject')
.joins(:loan)
.joins('JOIN collection_objects on collection_objects.id = loan_items.loan_item_object_id')
.pluck(:date_sent, 'collection_objects.total' ).each do |d, t|
data.last[:data][d&.year] += t if t
data.last[:data][d.year] += t if d&.year && t
end

data
Expand Down
12 changes: 9 additions & 3 deletions app/helpers/workbench/layout_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def sandbox_css
end

def navbar_css
Rails.env.production? ? 'header_production' : 'header_development'
Rails.env.production? ? 'header_production' : 'header_development'
end

def development_header_tag
Expand All @@ -25,7 +25,7 @@ def taxonworks_version_tag
def sandbox_details_tag
if Settings.sandbox_mode?
content_tag(:span, class: 'subtle') do
[ 'SANDBOX - build',
[ '<span data-icon="warning"></span> SANDBOX - TEMPORARY <span data-icon="warning"></span> build',
(Settings.sandbox_short_commit_sha ?
link_to(Settings.sandbox_short_commit_sha, 'https://github.com/SpeciesFileGroup/taxonworks/tree/' + Settings.sandbox_commit_sha, class: [:font_subtitle]) :
'unknown SHA'
Expand All @@ -37,13 +37,19 @@ def sandbox_details_tag
end
end

def sandbox_warning_tag
if Settings.sandbox_mode?
content_tag(:i, 'All data may be deleted at any time without warning', class: 'text-white-color')
end
end

def issue_tracker_tag
[
link_to(
'Issues',
'https://github.com/SpeciesFileGroup/taxonworks/issues',
target: '_blank',
data: { 'curation-issue-tracker': sessions_current_project&.data_curation_issue_tracker_url }
data: { 'curation-issue-tracker': sessions_current_project&.data_curation_issue_tracker_url }, rel: 'noopener'
),
(content_tag('div','', id: 'curation-issue-tracker-container') if sessions_current_project&.data_curation_issue_tracker_url)
].join().html_safe
Expand Down
171 changes: 83 additions & 88 deletions app/javascript/vue/components/soft_validations/panel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class="no_bullets"
>
<li
class="horizontal-left-content align-start"
class="horizontal-left-content align-start gap-small"
v-for="(error, index) in list.soft_validations"
:key="index"
>
Expand All @@ -40,49 +40,50 @@
arrow
:content="error.description"
>
<span data-icon="warning" />
<VIcon
name="attention"
color="attention"
x-small
/>
</tippy>
<span>
<button
v-if="error.fixable"
type="button"
class="button button-submit"
@click="
runFix([
{
global_id: list.instance.global_id,
only_methods: [error.soft_validation_method]
}
])
"

<button
v-if="error.fixable"
type="button"
class="button button-submit"
@click="
runFix([
{
global_id: list.instance.global_id,
only_methods: [error.soft_validation_method]
}
])
"
>
Fix
</button>
<span v-html="error.message" />
<template
v-for="(resolution, rIndex) in error.resolution"
:key="rIndex"
>
<tippy
class="d-inline-block"
animation="scale"
placement="bottom"
size="small"
inertia
arrow
content="Fixable here (may leave page)"
>
Fix
</button>
<span>
<span v-html="error.message" />
<template
v-for="(resolution, rIndex) in error.resolution"
:key="rIndex"
>
<tippy
class="d-inline-block"
animation="scale"
placement="bottom"
size="small"
inertia
arrow
content="Fixable here (may leave page)"
>
<a :href="resolution">
<span
class="small-icon icon-without-space"
data-icon="blue_wrench"
/>
</a>
</tippy>
</template>
</span>
</span>
<a :href="resolution">
<span
class="small-icon icon-without-space"
data-icon="blue_wrench"
/>
</a>
</tippy>
</template>
</li>
</ul>
<hr v-if="index !== validationSections.length - 1" />
Expand All @@ -92,60 +93,54 @@
</div>
</template>

<script>
<script setup>
import { SoftValidation } from '@/routes/endpoints'
import { Tippy } from 'vue-tippy'
import { computed } from 'vue'
import VIcon from '@/components/ui/VIcon/index.vue'
export default {
components: { Tippy },
props: {
validations: {
type: Object,
required: true
}
},
computed: {
validationSections() {
return Object.values(this.validations).filter((item) => item.list.length)
}
},
const props = defineProps({
validations: {
type: Object,
required: true
}
})
methods: {
runFix(fixItems) {
const promises = fixItems.map((params) =>
SoftValidation.fix(params.global_id, params)
)
const validationSections = computed(() =>
Object.values(props.validations).filter((item) => item.list.length)
)
Promise.all(promises).then((responses) => {
const softValidations = responses.map((r) => r.body.soft_validations)
const notFixed = []
.concat(...softValidations)
.filter((validation) => validation.fixed === 'fix_error')
function runFix(fixItems) {
const promises = fixItems.map((params) =>
SoftValidation.fix(params.global_id, params)
)
if (notFixed.length) {
TW.workbench.alert.create(
notFixed.map((f) => f.failure_message).join('; '),
'error'
)
} else {
location.reload()
}
})
},
Promise.all(promises).then((responses) => {
const softValidations = responses.map((r) => r.body.soft_validations)
const notFixed = []
.concat(...softValidations)
.filter((validation) => validation.fixed === 'fix_error')
getFixPresent(list) {
return list
.map((item) => ({
global_id: item.instance.global_id,
only_methods: item.soft_validations
.filter((v) => v.fixable)
.map((item) => item.soft_validation_method)
}))
.filter((item) => item.only_methods.length)
if (notFixed.length) {
TW.workbench.alert.create(
notFixed.map((f) => f.failure_message).join('; '),
'error'
)
} else {
location.reload()
}
}
})
}
function getFixPresent(list) {
return list
.map((item) => ({
global_id: item.instance.global_id,
only_methods: item.soft_validations
.filter((v) => v.fixable)
.map((item) => item.soft_validation_method)
}))
.filter((item) => item.only_methods.length)
}
</script>
<style lang="scss" scope>
Expand Down
Loading

0 comments on commit 001729c

Please sign in to comment.