Skip to content

Commit

Permalink
Merge pull request #335 from phyloref/fix-references-to-defaultNomenc…
Browse files Browse the repository at this point in the history
…laturalCodeURI

I fixed some references to defaultNomenclaturalCodeURI as part of PR #278, but I also missed others. This PR replaces those with `defaultNomenclaturalCodeIRI` as per the Phyx.js paper: https://doi.org/10.7717/peerj.12618/table-1
  • Loading branch information
gaurav authored Sep 23, 2024
2 parents 238344b + a3d5d12 commit f397d02
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/components/phylogeny/PhylogenyView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ export default {
nodeLabel,
tunit: TaxonomicUnitWrapper.fromLabel(
"",
this.$store.getters.getDefaultNomenCodeURI
this.$store.getters.getDefaultNomenCodeIRI
),
});
},
Expand Down
6 changes: 3 additions & 3 deletions src/components/phyx/PhyxView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@
<div class="col-md-10">
<select
id="nomen-code"
:value="$store.getters.getDefaultNomenCodeURI"
:value="$store.getters.getDefaultNomenCodeIRI"
class="form-control"
@change="
$store.commit('setDefaultNomenCodeURI', {
defaultNomenclaturalCodeURI: $event.target.value,
$store.commit('setDefaultNomenCodeIRI', {
defaultNomenclaturalCodeIRI: $event.target.value,
})
"
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/specifiers/Specifier.vue
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ export default {
specifierClass: undefined,
specimenWrapped: undefined,
taxonNameWrapped: undefined,
enteredNomenclaturalCode: this.$store.getters.getDefaultNomenCodeURI,
enteredNomenclaturalCode: this.$store.getters.getDefaultNomenCodeIRI,
enteredVerbatimLabel: undefined,
externalReference: undefined,
};
Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const COOKIE_EXPIRY = '30d'; // Expire cookies in 30 days
// to store their information in cookies.
export const COOKIE_ALLOWED = 'kladosCookieAllowed';
// - the default nomenclatural code
export const COOKIE_DEFAULT_NOMEN_CODE_URI = 'kladosDefaultNomenclaturalCodeURI';
export const COOKIE_DEFAULT_NOMEN_CODE_IRI = 'kladosDefaultNomenclaturalCodeIRI';
// - curator name
export const COOKIE_CURATOR_NAME = 'kladosCuratorName';
// - curator e-mail address
Expand Down
16 changes: 8 additions & 8 deletions src/store/modules/phyx.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
OPEN_TREE_INDUCED_SUBTREE_URL,

COOKIE_EXPIRY,
COOKIE_ALLOWED, COOKIE_DEFAULT_NOMEN_CODE_URI, COOKIE_CURATOR_NAME, COOKIE_CURATOR_EMAIL, COOKIE_CURATOR_ORCID,
COOKIE_ALLOWED, COOKIE_DEFAULT_NOMEN_CODE_IRI, COOKIE_CURATOR_NAME, COOKIE_CURATOR_EMAIL, COOKIE_CURATOR_ORCID,
} from '@/config';

// Shared code for reading and writing cookies.
Expand Down Expand Up @@ -61,11 +61,11 @@ export default {
loadedPhyxChanged(state) {
return !isEqual(state.currentPhyx, state.loadedPhyx);
},
getDefaultNomenCodeURI(state) {
getDefaultNomenCodeIRI(state) {
// If no default nomenclatural code is set in the Phyx file, we will attempt to look up that information
// using a cookie.
return state.currentPhyx.defaultNomenclaturalCodeIRI
|| getKladosCookie(COOKIE_DEFAULT_NOMEN_CODE_URI, TaxonNameWrapper.UNKNOWN_CODE);
|| getKladosCookie(COOKIE_DEFAULT_NOMEN_CODE_IRI, TaxonNameWrapper.UNKNOWN_CODE);
},
getDownloadFilenameForPhyx(state) {
// Return a filename to be used to name downloads of this Phyx document.
Expand Down Expand Up @@ -174,15 +174,15 @@ export default {

state.currentPhyx.phylogenies.splice(indexOf, 1);
},
setDefaultNomenCodeURI(state, payload) {
if (!has(payload, 'defaultNomenclaturalCodeURI')) {
throw new Error('No default nomenclatural code URI provided to setDefaultNomenCodeURI');
setDefaultNomenCodeIRI(state, payload) {
if (!has(payload, 'defaultNomenclaturalCodeIRI')) {
throw new Error('No default nomenclatural code IRI provided to setDefaultNomenCodeIRI');
}

// Overwrite the current default nomenclatural code cookie.
setKladosCookie(COOKIE_DEFAULT_NOMEN_CODE_URI, payload.defaultNomenclaturalCodeURI);
setKladosCookie(COOKIE_DEFAULT_NOMEN_CODE_IRI, payload.defaultNomenclaturalCodeIRI);

Vue.set(state.currentPhyx, 'defaultNomenclaturalCodeURI', payload.defaultNomenclaturalCodeURI);
Vue.set(state.currentPhyx, 'defaultNomenclaturalCodeIRI', payload.defaultNomenclaturalCodeIRI);
},
duplicatePhyloref(state, payload) {
if (!has(payload, 'phyloref')) {
Expand Down

0 comments on commit f397d02

Please sign in to comment.