Skip to content

Commit

Permalink
Merge branch 'development' of github.com:SpeciesFileGroup/taxonworks …
Browse files Browse the repository at this point in the history
…into development
  • Loading branch information
mjy committed Jun 17, 2022
2 parents 1b23dc3 + 63c98bf commit bb33c24
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 26 deletions.
1 change: 1 addition & 0 deletions app/controllers/collecting_events_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ def filter_params
:collection_objects,
:collector_id,
:collector_ids_or,
:determiner_name_regex,
:depictions,
:end_date, # used in date range
:geo_json,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
/>
<filter-determinations
class="margin-large-bottom"
v-model="params.determination"/>
v-model="params.determination"
/>
<filter-identifiers
class="margin-large-bottom"
v-model="params.identifier"
Expand Down Expand Up @@ -201,6 +202,7 @@ export default {
determiner_id_or: [],
determiner_id: [],
otu_ids: [],
determiner_name_regex: undefined,
current_determinations: undefined,
ancestor_id: undefined,
validity: undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ export default {
},
notes: {
note_text: undefined,
note_exact: undefined,
note_exact: undefined
},
relationships: {
biological_relationship_ids: []
Expand Down Expand Up @@ -332,6 +332,7 @@ export default {
determiner_id_or: [],
determiner_id: [],
otu_ids: [],
determiner_name_regex: undefined,
current_determinations: undefined,
ancestor_id: undefined,
validity: undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@
klass="CollectionObject"
param-people="determiner_id"
param-any="determiner_id_or"
v-model="determination"/>
toggle
v-model="determination"
/>
</div>

<div class="field">
Expand Down Expand Up @@ -110,7 +112,7 @@ export default {
props: {
modelValue: {
type: Object,
default: undefined
default: () => ({})
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,52 @@
<template>
<div>
<h4>{{ title }}</h4>
<smart-selector
:autocomplete-params="{'roles[]' : role }"
model="people"
:klass="klass"
pin-section="People"
pin-type="People"
label="cached"
@selected="addPerson"/>
<label>
<div class="flex-separate middle">
<h3>{{ title }}</h3>
<SwitchButtom
v-if="toggle"
v-model="isPeopleView"
:options="switchOptions"
/>
</div>
<div v-if="isPeopleView">
<smart-selector
:autocomplete-params="{'roles[]' : role }"
model="people"
:klass="klass"
pin-section="People"
pin-type="People"
label="cached"
@selected="addPerson"
/>
<label>
<input
v-model="params[paramAny]"
type="checkbox"
>
Any
</label>
<display-list
:list="list"
label="cached"
:delete-warning="false"
@delete-index="removePerson"
/>
</div>
<div v-else>
<label class="display-block">Matches</label>
<i class="display-block">Allows regular expressions</i>
<input
v-model="params[paramAny]"
type="checkbox">
Any
</label>
<display-list
:list="list"
label="object_tag"
:delete-warning="false"
@deleteIndex="removePerson"/>
v-model="params.determiner_name_regex"
class="full_width"
type="text"
>
</div>
</div>
</template>

<script>
import SwitchButtom from 'tasks/observation_matrices/new/components/newMatrix/switch.vue'
import SmartSelector from 'components/ui/SmartSelector'
import DisplayList from 'components/displayList'
import { People } from 'routes/endpoints'
Expand All @@ -33,7 +55,8 @@ import { URLParamsToJSON } from 'helpers/url/parse.js'
export default {
components: {
SmartSelector,
DisplayList
DisplayList,
SwitchButtom
},
props: {
Expand Down Expand Up @@ -65,14 +88,21 @@ export default {
klass: {
type: String,
required: true
},
toggle: {
type: Boolean,
default: false
}
},
emits: ['update:modelValue'],
data () {
return {
list: []
list: [],
switchOptions: ['People', 'Name'],
isPeopleView: true
}
},
Expand All @@ -88,7 +118,7 @@ export default {
},
watch: {
value (newVal) {
modelValue (newVal) {
if (!newVal[this.paramPeople].length && this.list.length) {
this.list = []
}
Expand All @@ -99,6 +129,11 @@ export default {
this.params[this.paramPeople] = this.list.map(item => item.id)
},
deep: true
},
isPeopleView () {
this.list = []
this.params.determiner_name_regex = undefined
}
},
Expand Down

0 comments on commit bb33c24

Please sign in to comment.