Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
LocoDelAssembly committed Sep 25, 2024
2 parents 5730bfa + b1adc41 commit 01ee83d
Show file tree
Hide file tree
Showing 89 changed files with 1,001 additions and 845 deletions.
26 changes: 25 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,29 @@ This project <em>does not yet</em> adheres to [Semantic Versioning](https://semv

\-

## [0.44.1] - 2024-09-24

### Added

- `/api/v1/otus/:id/inventory/keys` a list of keys scoped to or containing the Otu
- `otu_id` to ObservationMatrix, to facilitate setting scope and indexing of multi-entry keys
- `is_public` flag to ObservationMatrix

### Changed

- Revert strict `verbatim_field_number` validation [#4061]
- Renamed CollectingEvent `verbatim_trip_code` to `verbatim_field_number` [#4058]

### Fixed

- DwC `eventDate` should not be populated without an explict year reference [#4053]
- DwC `month` should not be populated when range-provided [#4055]

[#4053]: https://github.com/SpeciesFileGroup/taxonworks/issues/4053
[#4055]: https://github.com/SpeciesFileGroup/taxonworks/issues/4055
[#4058]: https://github.com/SpeciesFileGroup/taxonworks/issues/4058
[#4061]: https://github.com/SpeciesFileGroup/taxonworks/issues/4061

## [0.44.0] - 2024-09-17

### Added
Expand Down Expand Up @@ -4836,7 +4859,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.44.0..development
[unreleased]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.44.1..development
[0.44.1]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.44.0...v0.44.1
[0.44.0]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.43.3...v0.44.0
[0.43.3]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.43.2...v0.43.3
[0.43.2]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.43.1...v0.43.2
Expand Down
11 changes: 6 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ GEM
drb (2.2.1)
dropzonejs-rails (0.8.5)
rails (> 3.1)
dwc_agent (3.1.5.0)
dwc_agent (3.2.0.0)
namae (~> 1)
namecase (~> 2)
erubi (1.13.0)
Expand All @@ -233,8 +233,9 @@ GEM
railties (>= 5.0.0)
faker (3.4.2)
i18n (>= 1.8.11, < 2)
faraday (2.11.0)
faraday (2.12.0)
faraday-net_http (>= 2.0, < 3.4)
json
logger
faraday-excon (2.2.0)
excon (>= 0.109.0)
Expand Down Expand Up @@ -427,7 +428,7 @@ GEM
psych (5.1.2)
stringio
public_suffix (6.0.1)
puma (6.4.2)
puma (6.4.3)
nio4r (~> 2.0)
racc (1.8.1)
rack (2.2.9)
Expand Down Expand Up @@ -577,7 +578,7 @@ GEM
rubocop-performance (1.22.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails (2.26.1)
rubocop-rails (2.26.2)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.52.0, < 2.0)
Expand Down Expand Up @@ -609,7 +610,7 @@ GEM
rdoc (>= 5.0)
seedbank (0.5.0)
rake (>= 10.0)
selenium-webdriver (4.24.0)
selenium-webdriver (4.25.0)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
Expand Down
8 changes: 6 additions & 2 deletions app/controllers/observation_matrices_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,11 @@ def set_observation_matrix
end

def observation_matrix_params
params.require(:observation_matrix).permit(:name)
params.require(:observation_matrix).permit(
:name,
:otu_id,
:is_public
)
end

def nexus_import_options_params
Expand Down Expand Up @@ -468,4 +472,4 @@ def nexus_dimensions_okay(nf)
false
end

end
end
7 changes: 6 additions & 1 deletion app/controllers/otus_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class OtusController < ApplicationController
:show, :edit, :update, :destroy, :collection_objects, :navigation,
:breadcrumbs, :timeline, :coordinate, :distribution,
:api_show, :api_taxonomy_inventory, :api_type_material_inventory,
:api_nomenclature_citations, :api_distribution, :api_content, :api_dwc_inventory, :api_dwc_gallery ]
:api_nomenclature_citations, :api_distribution, :api_content, :api_dwc_inventory, :api_dwc_gallery, :api_key_inventory ]

after_action -> { set_pagination_headers(:otus) }, only: [:index, :api_index], if: :json_request?

Expand Down Expand Up @@ -313,6 +313,11 @@ def api_autocomplete
render '/otus/api/v1/autocomplete'
end

# GET /api/v1/otus/:id/inventory/keys
def api_key_inventory
render json: helpers.otu_key_inventory(@otu)
end

# GET /api/v1/otus/:id/inventory/taxonomy
def api_taxonomy_inventory
render '/otus/api/v1/inventory/taxonomy'
Expand Down
13 changes: 13 additions & 0 deletions app/helpers/otus_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -348,4 +348,17 @@ def dwc_gallery_data(otu)
r
end

def otu_key_inventory(otu, is_public: true)
return {
observation_matrices: {
scoped: otu.in_scope_observation_matrices.where(is_public:).select(:id, :name).inject({}){|hsh, m| hsh[m.id] = m.name; hsh;} || {} ,
in: otu.observation_matrices.where(is_public:).select(:id, :name).inject({}){|hsh, m| hsh[m.id] = m.name; hsh;} || {},
},
leads: {
scoped: otu.leads.where(parent_id: nil, is_public:).select(:id, :text).inject({}){|hsh, m| hsh[m.id] = m.text; hsh;} || {},
in: otu.leads.where.not(parent_id: nil).where(is_public: true).select(:id, :text).inject({}){|hsh, m| hsh[m.id] = m.text; hsh;} || {},
}
}
end

end
2 changes: 1 addition & 1 deletion app/javascript/vue/adapters/makeCollectingEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function makeCollectingEvent (ceData = {}) {
verbatimLongitude: ceData.verbatim_longitude,
verbatimLatitude: ceData.verbatim_latitude,
verbatimGeolocationUncertainty: ceData.verbatim_geolocation_uncertainty,
verbatimTripIdentifier: ceData.verbatim_trip_identifier,
verbatimFieldNumber: ceData.verbatim_field_number,
verbatimCollectors: ceData.verbatim_collectors,
verbatimMethod: ceData.verbatim_method,
verbatimHabitat: ceData.verbatim_habitat,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function makeCollectingEventPayload (ceData) {
verbatim_longitude: ceData.verbatimLongitude,
verbatim_latitude: ceData.verbatimLatitude,
verbatim_geolocation_uncertainty: ceData.verbatimGeolocationUncertainty,
verbatim_trip_identifier: ceData.verbatimTripIdentifier,
verbatim_field_number: ceData.verbatimFieldNumber,
verbatim_collectors: ceData.verbatimCollectors,
verbatim_method: ceData.verbatimMethod,
verbatim_habitat: ceData.verbatimHabitat,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<script setup>
import { computed, ref, onBeforeMount } from 'vue'
import { vTabkey } from '@/directives'
import VToggle from '@/tasks/observation_matrices/new/components/newMatrix/switch.vue'
import VToggle from '@/tasks/observation_matrices/new/components/Matrix/switch.vue'
import FacetContainer from '@/components/Filter/Facets/FacetContainer.vue'
const TYPE_PARAMETERS = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</template>

<script>
import SwitchButtom from '@/tasks/observation_matrices/new/components/newMatrix/switch.vue'
import SwitchButtom from '@/tasks/observation_matrices/new/components/Matrix/switch.vue'
import SmartSelector from '@/components/ui/SmartSelector'
import DisplayList from '@/components/displayList'
import FacetContainer from '@/components/Filter/Facets/FacetContainer.vue'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function generateLabel() {
...generateParsedLabel()
)
const AtStart = ['TripIdentifier', 'TripCode']
const AtStart = ['FieldNumber', 'TripCode']
const sortedObjectLabelKeys = sortArrayByArray(
Object.keys(objectLabels),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
<template>
<div class="field label-above">
<label>Trip identifier</label>
<label>Field number</label>
<textarea
class="full_width"
type="text"
rows="3"
v-model="collectingEvent.verbatim_trip_identifier"
@change="() => { collectingEvent.isUnsaved = true }"
v-model="collectingEvent.verbatim_field_number"
@change="
() => {
collectingEvent.isUnsaved = true
}
"
/>
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Latitude from '../components/verbatim/Latitude.vue'
import Locality from '../components/verbatim/Locality.vue'
import Longitude from '../components/verbatim/Longitude.vue'
import Method from '../components/verbatim/Method.vue'
import TripIdentifier from '../components/verbatim/TripIdentifier.vue'
import FieldNumber from '../components/verbatim/FieldNumber.vue'
import Dates from '../components/parsed/Dates.vue'
import Elevation from '../components/parsed/Elevation.vue'
import GeographicArea from '../components/parsed/GeographicArea.vue'
Expand Down Expand Up @@ -36,7 +36,7 @@ const ComponentVerbatim = {
Datum: 'Datum',
Collectors: 'Collectors',
Method: 'Method',
TripIdentifier: 'TripIdentifier'
FieldNumber: 'FieldNumber'
}

const ComponentParse = {
Expand Down Expand Up @@ -70,7 +70,7 @@ const VueComponents = {
[ComponentVerbatim.VerbatimElevation]: VerbatimElevation,
[ComponentVerbatim.Datum]: Datum,
[ComponentVerbatim.Method]: Method,
[ComponentVerbatim.TripIdentifier]: TripIdentifier,
[ComponentVerbatim.FieldNumber]: FieldNumber,
[ComponentParse.Dates]: Dates,
[ComponentParse.Elevation]: Elevation,
[ComponentParse.GeographicArea]: GeographicArea,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ export const verbatimProperties = {
DateComponent: 'verbatim_date',
Collectors: 'verbatim_collectors',
Method: 'verbatim_method',
TripIdentifier: 'verbatim_trip_identifier'
FieldNumber: 'verbatim_field_number'
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const VERBATIM_FIELDS = {
verbatim_datum: 'input',
verbatim_collectors: 'textarea',
verbatim_method: 'input',
verbatim_trip_identifier: 'input'
verbatim_field_number: 'input'
}
const props = defineProps({
Expand Down
28 changes: 17 additions & 11 deletions app/javascript/vue/components/ui/Autocomplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,27 @@ headers to be used in the call. Using it will override the common headers
<template>
<div class="vue-autocomplete">
<input
:id="inputId"
type="text"
ref="autofocus"
:id="inputId"
:style="inputStyle"
class="vue-autocomplete-input normal-input"
type="text"
:placeholder="placeholder"
@input="checkTime(), sendType()"
:autofocus="autofocus"
:disabled="disabled"
v-model="type"
v-bind="inputAttributes"
autocomplete="off"
:class="[
'vue-autocomplete-input normal-input',
spinner && 'ui-autocomplete-loading',
!spinner && 'vue-autocomplete-input-search',
inputClass
]"
@input="checkTime(), sendType()"
@keydown.down="downKey"
@keydown.up="upKey"
@keydown.enter="enterKey"
@keyup="sendKeyEvent"
autocomplete="off"
:autofocus="autofocus"
:disabled="disabled"
:class="{
'ui-autocomplete-loading': spinner,
'vue-autocomplete-input-search': !spinner
}"
/>
<ul
class="vue-autocomplete-list"
Expand Down Expand Up @@ -166,6 +167,11 @@ export default {
default: 'value'
},
inputClass: {
type: Array,
default: () => []
},
inputStyle: {
type: Object,
default: () => ({})
Expand Down
1 change: 1 addition & 0 deletions app/javascript/vue/constants/modelTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const LOAN = 'Loan'
export const LOT = 'Lot'
export const NOTE = 'Note'
export const OBSERVATION = 'Observation'
export const OBSERVATION_MATRIX = 'ObservationMatrix'
export const OTU = 'Otu'
export const PEOPLE = 'People'
export const PERSON = 'Person'
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/vue/factory/CollectingEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default () => ({
verbatim_longitude: undefined,
verbatim_latitude: undefined,
verbatim_geolocation_uncertainty: undefined,
verbatim_trip_identifier: undefined,
verbatim_field_number: undefined,
verbatim_collectors: undefined,
verbatim_method: undefined,
verbatim_habitat: undefined,
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/vue/routes/endpoints/CollectingEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const permitParams = {
verbatim_longitude: String,
verbatim_latitude: String,
verbatim_geolocation_uncertainty: String,
verbatim_trip_identifier: String,
verbatim_field_number: String,
verbatim_collectors: String,
verbatim_method: String,
geographic_area_id: String,
Expand Down
3 changes: 2 additions & 1 deletion app/javascript/vue/routes/endpoints/ObservationMatrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ const controller = 'observation_matrices'
const permitParams = {
observation_matrix: {
name: String,
otu_id: Array
otu_id: Number,
is_public: Boolean
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import baseCRUD, {annotations} from './base'
import baseCRUD from './base'
import { ajaxCall } from '@/helpers'

const controller = 'observation_matrix_columns'
const permitParams = {
observation_matrix_column: Object
}

export const ObservationMatrixColumn = {
...baseCRUD(controller, permitParams)
...baseCRUD(controller, permitParams),

sort: (ids) => ajaxCall('patch', `/${controller}/sort`, { ids })
}
5 changes: 4 additions & 1 deletion app/javascript/vue/routes/endpoints/ObservationMatrixRow.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import baseCRUD, { annotations } from './base'
import { ajaxCall } from '@/helpers'

const permitParams = {
observation_matrix_row: Object
}

export const ObservationMatrixRow = {
...baseCRUD('observation_matrix_rows', permitParams),
...annotations('observation_matrix_rows')
...annotations('observation_matrix_rows'),

sort: (ids) => ajaxCall('patch', '/observation_matrix_rows/sort', { ids })
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const COLLECTING_EVENT_PROPERTIES = [
'verbatim_longitude',
'verbatim_latitude',
'verbatim_geolocation_uncertainty',
'verbatim_trip_identifier',
'verbatim_field_number',
'verbatim_collectors',
'verbatim_method',
'geographic_area_id',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</template>

<script setup>
import { ref, onMounted } from 'vue'
import { ref, nextTick, onMounted } from 'vue'
import VModal from '@/components/ui/Modal.vue'
import VBtn from '@/components/ui/VBtn/index.vue'
Expand All @@ -47,6 +47,8 @@ function handleUpdateName() {
}
onMounted(() => {
inputName.value.focus()
nextTick(() => {
inputName.value.focus()
})
})
</script>
Loading

0 comments on commit 01ee83d

Please sign in to comment.