Skip to content

Commit

Permalink
Added missing fields for collections. #2295
Browse files Browse the repository at this point in the history
  • Loading branch information
knirirr committed Aug 29, 2024
1 parent 670a1f4 commit 082c439
Show file tree
Hide file tree
Showing 7 changed files with 168 additions and 17 deletions.
41 changes: 37 additions & 4 deletions src/components/Records/Record/GeneralInfo/ContactsData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,23 @@
v-if="getField('metadata').contacts && getField('metadata').contacts.length"
class="d-flex align-center flex-wrap"
>
<b class="width-15-percent-flex">Contacts</b>
<span
class="d-flex align-baseline width-15-percent-flex"
>
<v-tooltip bottom>
<template #activator="{ on }">
<v-icon
class="mr-2"
size="15"
v-on="on"
>
fa-question-circle
</v-icon>
</template>
{{ recordTooltips['contacts'] }}
</v-tooltip>
<b class="width-15-percent-flex">Contacts</b>
</span>
<div class="d-flex flex-wrap ml-md-12 ml-13">
<div
v-for="(contact,index) in getField('metadata').contacts"
Expand Down Expand Up @@ -41,20 +57,37 @@
v-else
class="align-center d-flex flex-row mb-2"
>
<b class="width-15-percent-flex">Contacts</b>
<span
class="d-flex align-baseline width-15-percent-flex"
>
<v-tooltip bottom>
<template #activator="{ on }">
<v-icon
class="mr-2"
size="15"
v-on="on"
>
fa-question-circle
</v-icon>
</template>
{{ recordTooltips['contacts'] }}
</v-tooltip>
<b class="width-15-percent-flex">Contacts</b>
</span>
<span class="ma-0 full-width ml-md-12 ml-13">None</span>
</div>
</template>

<script>
import {mapGetters} from "vuex";
import {mapGetters, mapState} from "vuex";
import Icon from "@/components/Icon";
export default {
name: "ContactsData",
components:{Icon},
computed: {
...mapGetters("record", ["getField"])
...mapGetters("record", ["getField"]),
...mapState("editor", ["recordTooltips"])
}
}
</script>
57 changes: 53 additions & 4 deletions src/components/Records/Record/GeneralInfo/ReferenceURL.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,23 @@
v-if="getField('homepage') === getField('metadata').reference_url"
class="d-flex flex-row mt-4 align-center min-height-40"
>
<b class="width-15-percent-flex">Reference URL</b>
<span
class="d-flex align-baseline width-15-percent-flex"
>
<v-tooltip bottom>
<template #activator="{ on }">
<v-icon
class="mr-2"
size="15"
v-on="on"
>
fa-question-circle
</v-icon>
</template>
{{ recordTooltips['reference_url'] }}
</v-tooltip>
<b class="width-15-percent-flex">Reference URL</b>
</span>
<div class="d-flex full-width ml-md-12 ml-13">
As above
</div>
Expand All @@ -12,7 +28,23 @@
v-else-if="getField('metadata').reference_url"
class="d-flex flex-row mt-4 align-center min-height-40"
>
<b class="width-15-percent-flex">Reference URL</b>
<span
class="d-flex align-baseline width-15-percent-flex"
>
<v-tooltip bottom>
<template #activator="{ on }">
<v-icon
class="mr-2"
size="15"
v-on="on"
>
fa-question-circle
</v-icon>
</template>
{{ recordTooltips['reference_url'] }}
</v-tooltip>
<b class="width-15-percent-flex">Reference URL</b>
</span>
<div class="d-flex full-width ml-md-12 ml-13">
<a
v-if="getField('metadata').reference_url"
Expand All @@ -30,22 +62,39 @@
v-else
class="d-flex flex-row mt-4 align-center min-height-40"
>
<b class="width-15-percent-flex">Reference URL</b>
<span
class="d-flex align-baseline width-15-percent-flex"
>
<v-tooltip bottom>
<template #activator="{ on }">
<v-icon
class="mr-2"
size="15"
v-on="on"
>
fa-question-circle
</v-icon>
</template>
{{ recordTooltips['reference_url'] }}
</v-tooltip>
<b class="width-15-percent-flex">Reference URL</b>
</span>
<div class="d-flex full-width ml-md-12 ml-13">
N/A
</div>
</div>
</template>

<script>
import {mapGetters} from "vuex";
import {mapGetters, mapState} from "vuex";
import NoneFound from "@/components/Records/Record/NoneFound";
export default {
name: "ReferenceURL",
components: {NoneFound},
computed: {
...mapGetters("record", ["getField"]),
...mapState("editor", ["recordTooltips"]),
}
}
</script>
39 changes: 36 additions & 3 deletions src/components/Records/Record/Organisations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,23 @@
v-else-if="inlineStyle && getField('organisations') && getField('organisations').length"
class="d-flex flex-row mt-4 align-center"
>
<b class="width-15-percent-flex">Organisations</b>
<span
class="d-flex align-baseline width-15-percent-flex"
>
<v-tooltip bottom>
<template #activator="{ on }">
<v-icon
class="mr-2"
size="15"
v-on="on"
>
fa-question-circle
</v-icon>
</template>
{{ recordTooltips['organisations'] }}
</v-tooltip>
<b class="width-15-percent-flex">Organisations</b>
</span>
<p
v-if="jointOrganisations && jointOrganisations.length"
class="ma-0 full-width ml-md-12 ml-13"
Expand Down Expand Up @@ -151,15 +167,31 @@
v-else
class="d-flex flex-row mt-4 align-center"
>
<b class="width-15-percent-flex">Organisations</b>
<span
class="d-flex align-baseline width-15-percent-flex"
>
<v-tooltip bottom>
<template #activator="{ on }">
<v-icon
class="mr-2"
size="15"
v-on="on"
>
fa-question-circle
</v-icon>
</template>
{{ recordTooltips['organisations'] }}
</v-tooltip>
<b class="width-15-percent-flex">Organisations</b>
</span>
<p class="ma-0 full-width ml-md-12 ml-13">
N/A
</p>
</div>
</template>

<script>
import {mapGetters} from 'vuex';
import {mapGetters, mapState} from 'vuex';
import Icon from "@/components/Icon";
import SectionTitle from '@/components/Records/Record/SectionTitle';
Expand All @@ -185,6 +217,7 @@ export default {
},
computed: {
...mapGetters("record", ["getField"]),
...mapState("editor", ["recordTooltips"]),
jointOrganisations(){
return this.getRelations('maintains').concat(this.getRelations('collaborates_on').concat(this.getRelations('associated_with')));
}
Expand Down
9 changes: 6 additions & 3 deletions src/data/recordTooltips.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
{
"descriptions": {
"abbreviation": "An official or commonly-used abbreviation for the resource.",
"countries": " The country or countries in which the resource was developed and/or is currently maintained.",
"contacts": "Contact details for the resource",
"countries": "The country or countries in which the resource was developed and/or is currently maintained.",
"deprecation_reason": "An explanation as to why this resource is no longer considered suitable for use.",
"description": "Free text summary of the resource and its purpose.",
"domains": "The domains for this record; domains tend to be more fine-grained terms relating to the scope of the resource.",
"fairsharing_registry": "The name of the registry to which this record belongs; one of Standards, Policies, or Databases.",
"homepage": "The homepage of the resource. If there is no official homepage, a related URL may be used. For policies, the resource homepage must be the policy document itself.",
"how_to_cite": "How to cite this FAIRsharing record.",
"maintainers": "A list of developers of this resource who have claimed ownership of the record both for attribution and to perform updates the record.",
"maintainers": "A list of developers of this resource who have claimed ownership of the record both for attribution and to perform updates to the record.",
"name": "The full name of this resource.",
"organisations": "Any organisations related to this resource, e.g. funders or maintainers.",
"publication_for_citation": "How to cite the resource described by this record.",
"record_type": "The type of resource this record describes; each FAIRsharing registry is composed of several types.",
"taxonomies": "The organismal taxonomies covered by this resource. ",
"reference_url": "A direct link to the standards, policies or databases on the homepage of the organisation or group with which the collection is associated.",
"taxonomies": "The organismal taxonomies covered by this resource. This is only applicable to life sciences records.",
"subjects": "The broad subject area / academic disciplines for this record.",
"tools": "The tools associated with or maintained by this resource.",
"user_defined_tags": "The user-defined tags relevant to this resource; such tags are created by our users but are not yet incorporated into the FAIRsharing vocabularies.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ const localVue = createLocalVue();
localVue.use(Vuex);
const vuetify = new Vuetify();

let editor = {
namespaced: true,
state: {
recordTooltips: {
contacts: "contacts tooltip.",
}
}
}


Record.state.currentRecord["fairsharingRecord"] = {
doi: 'FAIRsharing.wibble',
subjects:[],
Expand All @@ -19,7 +29,8 @@ Record.state.currentRecord["fairsharingRecord"] = {
};
const $store = new Vuex.Store({
modules: {
record:Record
record:Record,
editor: editor
}});

describe("ContactsData.vue", function(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ const localVue = createLocalVue();
localVue.use(Vuex);
const vuetify = new Vuetify();

let editor = {
namespaced: true,
state: {
recordTooltips: {
reference_url: "description tooltip.",
}
}
}


Record.state.currentRecord["fairsharingRecord"] = {
doi: 'FAIRsharing.wibble',
metadata: {
Expand All @@ -21,7 +31,8 @@ Record.state.currentRecord["fairsharingRecord"] = {
};
const $store = new Vuex.Store({
modules: {
record:Record
record: Record,
editor: editor
}});

describe("ReferenceURL.vue", function(){
Expand Down
13 changes: 12 additions & 1 deletion tests/unit/components/Records/Record/Organisations.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ const localVue = createLocalVue();
localVue.use(Vuex);
const vuetify = new Vuetify();

let editor = {
namespaced: true,
state: {
recordTooltips: {
organisations: "description tooltip.",
}
}
}


Record.state.currentRecord["fairsharingRecord"] = {
organisationLinks: [
{
Expand Down Expand Up @@ -49,7 +59,8 @@ Record.state.currentRecord["fairsharingRecord"] = {
};
const $store = new Vuex.Store({
modules: {
record: Record
record: Record,
editor: editor
}
});

Expand Down

0 comments on commit 082c439

Please sign in to comment.