Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plazi issue 105 #71

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/components/CurationElement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<td><a :href="'https://www.gbif.org/occurrence/'+curation.object.key" target="_blank">{{ curation.object.key }}</a></td>
<td :class="cellColor(scores.$global)">{{ scores.$global }}</td>
<template>
<td v-for="char in curation_characteristics" :key="char.score+'sp-td'"
<td v-for="char in get_characteristics_curation" :key="char.score+'sp-td'"
:class="cellColor(scores[char.score])">
{{ display_content(curation.object, char.value) }}
</td>
Expand Down Expand Up @@ -91,6 +91,22 @@ export default {
get_curation_name() {
return this.fields[this.format_selection].format_curation.name
},
get_characteristics_curation(){
var characteristics= JSON.parse(JSON.stringify(this.curation_characteristics))
if (this.curation.object['basisOfRecord'] == "MATERIAL_CITATION"){
for (var c=0; c<characteristics.length; c++){
if (characteristics[c]['name'] == "Institution code"){
characteristics[c]['score'] = 'collectionCode'
characteristics[c]['value'] = ['collectionCode']
}
else if (characteristics[c]['name'] == "Collection code"){
characteristics[c]['score'] = 'institutionCode'
characteristics[c]['value'] = ['institutionCode']
}
}
}
return characteristics
},
is_yes_selected() {
if (this.status == "yes") {
return true
Expand Down
18 changes: 17 additions & 1 deletion src/components/CurationList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<td><a :href="'https://www.gbif.org/occurrence/'+occurrences_selection.key" target="_blank">{{
occurrences_selection.key}}</a></td>
<td></td>
<template v-for="char in curation_characteristics">
<template v-for="char in get_characteristics_occurrence">
<td v-if="char.value" :key="char.score+'mc_td'">{{ display_content(occurrences_selection,
char.value) }}</td>
</template>
Expand Down Expand Up @@ -228,6 +228,22 @@ export default {
'--color-secondary': this.theme_color.secondary,
}
},
get_characteristics_occurrence(){
var characteristics= JSON.parse(JSON.stringify(this.curation_characteristics))
if (this.occurrences_selection['basisOfRecord'] == "MATERIAL_CITATION"){
for (var c=0; c<characteristics.length; c++){
if (characteristics[c]['name'] == "Institution code"){
characteristics[c]['score'] = 'collectionCode'
characteristics[c]['value'] = ['collectionCode']
}
else if (characteristics[c]['name'] == "Collection code"){
characteristics[c]['score'] = 'institutionCode'
characteristics[c]['value'] = ['institutionCode']
}
}
}
return characteristics
},
get_occurrence_name() {
return this.fields[this.format_selection].format_occurrence.name
},
Expand Down
18 changes: 17 additions & 1 deletion src/components/EmptyElement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</td>
<td class="cell-color-na">manual</td>
<template v-if="in_progress == false">
<td v-for="char in curation_characteristics" class="cell-color-na" :key="char.score+'sp-td-em'">
<td v-for="char in get_characteristics_curation" class="cell-color-na" :key="char.score+'sp-td-em'">
{{ display_content(curation.object, char.value) }}
</td>
</template>
Expand Down Expand Up @@ -97,6 +97,22 @@ var PulseLoader = require('vue-spinner/src/PulseLoader.vue').default;
get_curation_name(){
return this.fields[this.format_selection].format_curation.name
},
get_characteristics_curation(){
var characteristics= JSON.parse(JSON.stringify(this.curation_characteristics))
if (this.curation.object['basisOfRecord'] == "MATERIAL_CITATION"){
for (var c=0; c<characteristics.length; c++){
if (characteristics[c]['name'] == "Institution code"){
characteristics[c]['score'] = 'collectionCode'
characteristics[c]['value'] = ['collectionCode']
}
else if (characteristics[c]['name'] == "Collection code"){
characteristics[c]['score'] = 'institutionCode'
characteristics[c]['value'] = ['institutionCode']
}
}
}
return characteristics
},
is_yes_selected(){
if (this.status == "yes"){
return true
Expand Down
1 change: 1 addition & 0 deletions src/components/OccurrencesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ export default {
this.updateInitMcDateFilter([min_date, max_date])
return occ
},

goToTop() {
// this.$router.push({ name: 'HomePage', query: this.$route.query }).catch(() => { });
// this.$router.push({ name: 'HomePage', hash: '#occurrences', query: this.$route.query }).catch(() => { });
Expand Down
4 changes: 3 additions & 1 deletion src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export default new Vuex.Store({
{title: 'Dataset', short: 'datasetName', multi: true},
{title: 'Curation status', short: 'status', multi: true},
{title: 'Country', short: 'country', multi: true},
{title: 'Institution code', short: 'institutionCode', multi: true},
{title: 'Collection code', short: 'collectionCode', multi: true},
{title: 'Collector', short: 'recordedBy', multi: true},
{title: 'Type', short: 'typeStatus', multi: true},
Expand All @@ -106,7 +107,8 @@ export default new Vuex.Store({
{name: 'Locality', score: 'locality', value: ['locality']},
{name: 'Country', score: 'country', value: ['country']},
{name: 'Date', score: 'year', value: ['day', 'month', 'year']},
{name: 'Coll code', score: 'collectionCode', value: ['collectionCode']},
{name: 'Institution code', score: 'institutionCode', value: ['institutionCode']},
{name: 'Collection code', score: 'collectionCode', value: ['collectionCode']},
{name: 'Catalog nb', score: 'catalogNumber', value: ['catalogNumber']},
{name: 'Individual nb', score: 'individualCount', value: ['individualCount']},
{name: 'Collector (recorded by)', score: 'recordedBy', value: ['recordedBy']},
Expand Down