Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
LocoDelAssembly committed Jul 14, 2020
2 parents 9603cf6 + 157b666 commit 5b736a3
Show file tree
Hide file tree
Showing 12 changed files with 275 additions and 40 deletions.
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ This project <em>does not yet</em> adheres to [Semantic Versioning](https://semv

\-

## [0.12.11] - 2020-07-14

### Changed
- Type material designations are now grouped by collection object in Browse OTUs (refs [#1614])

### Fixed
- Protonym parent priority soft validation [#1613]
- Type specimens count in Browse OTUs task

[#1613]: https://github.com/SpeciesFileGroup/taxonworks/issues/1613
[#1614]: https://github.com/SpeciesFileGroup/taxonworks/issues/1614

## [0.12.10] - 2020-07-07

### Added
Expand Down Expand Up @@ -224,7 +236,8 @@ This project <em>does not yet</em> adheres to [Semantic Versioning](https://semv

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

[unreleased]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.12.10...development
[unreleased]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.12.11...development
[0.12.11]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.12.10...v0.12.11
[0.12.10]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.12.9...v0.12.10
[0.12.9]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.12.8...v0.12.9
[0.12.8]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.12.7...v0.12.8
Expand Down
3 changes: 2 additions & 1 deletion app/javascript/vue/routes/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const RouteNames = {
ImageMatrix: '/tasks/matrix_image/matrix_image/index',
MatrixRowCoder: '/tasks/observation_matrices/row_coder/index',
BrowseNomenclature: '/tasks/nomenclature/browse',
NomenclatureStats: '/tasks/nomenclature/stats'
NomenclatureStats: '/tasks/nomenclature/stats',
TypeMaterial: '/tasks/type_material/edit_type_material'
}

export {
Expand Down
17 changes: 14 additions & 3 deletions app/javascript/vue/tasks/otu/browse/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ import { GetterNames } from './store/getters/getters'
import { MutationNames } from './store/mutations/mutations'
import COMPONENT_NAMES from './const/componentNames'
import showForThisGroup from '../../nomenclature/new_taxon_name/helpers/showForThisGroup'
export default {
components: {
SearchOtu,
Expand Down Expand Up @@ -207,5 +205,18 @@ export default {
color: #888;
font-size: 14px;
}
.expand-box {
width: 18px;
height: 18px;
padding: 0px;
background-size: 10px;
background-position: center;
}
.mark-box {
width: 10px;
height: 10px;
padding: 0px;
}
}
</style>
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
class="inline cursor-pointer">
<div
:data-icon="expand ? 'w_less' : 'w_plus'"
class="expand-box button-default separate-right"/><span v-if="type" class="separate-right" v-html="`[${type.object_tag}]`"/> <span>{{ ceLabel }}</span> (<span v-html="countAndBiocurations" />)</span>
class="expand-box button-default separate-right"/><span v-if="type" class="separate-right" v-html="`[${type.object_tag}]`"/> <span>{{ ceLabel }}</span>
</div>
<div
v-if="expand"
class="content">
<span class="middle">
<span class="mark-box button-default separate-right"/>
<span><a :href="`/tasks/collection_objects/browse?collection_object_id=${specimen.collection_objects_id}`">Specimen</a> | <a :href="`/tasks/accessions/comprehensive?collection_object_id=${specimen.collection_objects_id}`">Edit</a></span>
<span><a :href="`/tasks/collection_objects/browse?collection_object_id=${specimen.collection_objects_id}`">Specimen</a> | <a :href="`/tasks/accessions/comprehensive?collection_object_id=${specimen.collection_objects_id}`">Edit</a></span>
</span>
<ul class="no_bullets">
<li>
Expand Down Expand Up @@ -150,19 +150,3 @@ export default {
}
}
</script>

<style module>
.expand-box {
width: 18px;
height: 18px;
padding: 0px;
background-size: 10px;
background-position: center;
}
.mark-box {
width: 10px;
height: 10px;
padding: 0px;
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<template>
<div class="content">
<span class="middle">
<span class="mark-box button-default separate-right" />
<span><a :href="`/tasks/collection_objects/browse?collection_object_id=${specimen.collection_objects_id}`">Specimen</a> | <a :href="`/tasks/accessions/comprehensive?collection_object_id=${specimen.collection_objects_id}`">Edit</a></span>
</span>
<ul class="no_bullets">
<li>
<span>Counts: <b v-html="countAndBiocurations" /></span>
</li>
<li>
<span>Repository: <b>{{ repositoryLabel }}</b></span>
</li>
<li>
<span>Citation: <b><span v-html="citationsLabel" /></b></span>
</li>
<li>
<span>Collecting event: <b><span v-html="collectingEventLabel" /></b></span>
</li>
</ul>
<div
v-if="depictions.length"
class="horizontal-left-content margin-medium-top">
<span class="middle">
<span class="mark-box button-default separate-right" /> Images
</span>
<image-viewer
v-for="depiction in depictions"
:key="depiction.id"
:depiction="depiction"
/>
</div>
</div>
</template>

<script>
import {
GetBiocurations,
GetDepictions,
GetRepository,
GetCitations
} from '../../request/resources'
import { GetterNames } from '../../store/getters/getters'
export default {
props: {
specimen: {
type: Object,
required: true
}
},
computed: {
citationsLabel () {
return this.citations.length ? this.citations.map(item => { return item.source.cached }).join('; ') : 'not specified'
},
countAndBiocurations () {
return this.biocurations.length ? `${this.specimen.individualCount} ${this.biocurations.map(item => { return item.object_tag.toLowerCase() }).join(', ')}` : this.specimen.individualCount
},
collectingEvents () {
return this.$store.getters[GetterNames.GetCollectingEvents]
},
collectingEventLabel () {
const ce = this.collectingEvents.find(item => {
return this.specimen.collecting_event_id === item.id
})
return ce ? ce.object_tag : 'not specified'
},
repositoryLabel () {
return this.repository ? this.repository.name : 'not specified'
},
ceLabel () {
const levels = ['country', 'stateProvince', 'county', 'verbatimLocality']
let tmp = []
levels.forEach(item => {
if(this.specimen[item]) { tmp.push(this.specimen[item]) }
})
return tmp.join(', ')
}
},
data () {
return {
depictions: [],
biocurations: [],
repository: undefined,
citations: [],
expand: false,
alreadyLoaded: false
}
},
watch: {
expand (newVal) {
if (!this.alreadyLoaded) {
this.alreadyLoaded = true
this.loadData()
}
}
},
mounted () {
GetBiocurations(this.specimen.collection_objects_id).then(response => {
this.biocurations = response.body
})
},
methods: {
loadData () {
GetDepictions('collection_objects', this.specimen.collection_objects_id).then(response => {
this.depictions = response.body
})
GetRepository(this.collectionObject.repository_id).then(response => {
this.repository = response.body
})
GetCitations('collection_objects', this.specimen.collection_objects_id).then(response => {
this.citations = response.body
})
}
}
}
</script>
33 changes: 20 additions & 13 deletions app/javascript/vue/tasks/otu/browse/components/specimens/Type.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<template>
<section-panel
:status="status"
:title="`${title} (${types.length})`">
:title="`${title} (${collectionObjects.length})`">
<a name="type-specimens"/>
<div
v-if="types.length"
class="separate-top">
<ul
class="no_bullets">
<li
v-for="type in types"
:key="type.id">
<specimen-information
v-for="co in collectionObjects"
:key="co.collection_objects_id">
<type-information
:otu="otu"
:type="type"
:specimen="getSpecimen(type.collection_object_id)"/>
:types="types.filter(item => co.collection_objects_id === item.collection_object_id)"
:specimen="co"/>
</li>
</ul>
</div>
Expand All @@ -25,18 +25,29 @@
import SectionPanel from '../shared/sectionPanel'
import { GetTypeMaterials, GetCollectionObjects } from '../../request/resources.js'
import SpecimenInformation from './Information'
import TypeInformation from './TypeInformation'
import extendSection from '../shared/extendSections'
export default {
mixins: [extendSection],
components: {
SectionPanel,
SpecimenInformation
TypeInformation
},
props: {
otu: {
type: Object
type: Object,
required: true
}
},
computed: {
typeMaterialList () {
const output = this.types.reduce((acc, v) => {
acc[v.collection_object_id] = acc[v.collection_object_id] || []
acc[v.collection_object_id].push(v)
return acc
}, {})
return output
}
},
data () {
Expand Down Expand Up @@ -74,7 +85,3 @@ export default {
}
}
</script>

<style>
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<template>
<div class="content">
<span><span v-html="type.object_tag"/> | <a :href="urlType">Edit</a></span>
<ul>
<li>
<span>Citation: <b><span v-html="citationsLabel"/></b></span>
</li>
</ul>
</div>
</template>

<script>
import { RouteNames } from 'routes/routes'
import { GetterNames } from '../../store/getters/getters'
export default {
props: {
type: {
type: Object,
required: true
}
},
computed: {
citationsLabel () {
return this.type.origin_citation ? this.type.origin_citation.source.object_tag : 'not specified'
},
otu () {
return this.$store.getters[GetterNames.GetCurrentOtu]
},
urlType () {
return `${RouteNames.TypeMaterial}?taxon_name_id=${this.otu.taxon_name_id}&type_material_id=${this.type.id}`
}
}
}
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<template>
<div>
<div
@click="expand = !expand"
class="cursor-pointer inline">
<div
:data-icon="expand ? 'w_less' : 'w_plus'"
class="expand-box button-default separate-right"/>
<span>[<span v-html="types.map(type => type.object_tag).join('; ')"/>] <span>{{ ceLabel }}</span></span>
</div>
<template v-if="expand">
<type-data
v-for="type in types"
:key="type.id"
:type="type"/>
<specimen-information
v-if="expand"
:specimen="specimen"/>
</template>
</div>
</template>

<script>
import SpecimenInformation from './SpecimenInformation'
import TypeData from './TypeData'
export default {
components: {
SpecimenInformation,
TypeData
},
props: {
specimen: {
type: Object,
required: true
},
types: {
type: Array,
default: () => []
}
},
computed: {
ceLabel () {
const levels = ['country', 'stateProvince', 'county', 'verbatimLocality']
const tmp = []
levels.forEach(item => {
if (this.specimen[item]) { tmp.push(this.specimen[item]) }
})
return tmp.join(', ')
}
},
data () {
return {
expand: false
}
}
}
</script>
Loading

0 comments on commit 5b736a3

Please sign in to comment.