diff --git a/src/App.vue b/src/App.vue index 363c6c9831e3acac2ebdc1d1c5bc87df5c55301b..b159e69c7d78efa99576c5b18c2f68e171e6198a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -120,13 +120,47 @@ single-line class="right" color="primary lighten-2" - @click="loadDisplay()" + @click="getPid();loadDisplay()" >Load</v-btn> </v-toolbar> <v-card-text> <v-layout row> - <ph-d-jsonld :form="form" :jsonld="displayjsonld" :pid="pid"></ph-d-jsonld> + members {{fullmembers}} + <ph-d-jsonld :form="form" :jsonld="displayjsonld" :pid="pid"></ph-d-jsonld> </v-layout> + <v-toolbar v-if="members.length>0" dense flat> + + <v-toolbar-title class="font-weight-light">File Members</v-toolbar-title> + + </v-toolbar> + + <v-layout row> + + <v-layout v-for="(mpid,order) in members"> + + <v-flex xs4 class="subheading"> + <a :href="'https://' + instance.baseurl +'/'+mpid.pid" target="_blank">{{'https://' + instance.baseurl +'/'+mpid.pid}}</a> + + + </v-flex> + + <v-flex xs4> + <p-img + + :src="'https://' + instance.baseurl + '/preview/' + mpid.pid + '///120'" + class="elevation-1" + > + <v-layout slot="placeholder" fill-height align-center justify-center ma-0> + <v-progress-circular indeterminate color="grey lighten-5"></v-progress-circular> + </v-layout> + </p-img> + </v-flex> + + + </v-layout> + + </v-layout> + </v-card-text> </v-card> </v-flex> @@ -148,13 +182,7 @@ >Load</v-btn> </v-toolbar> <v-card-text> - <!-- <ph-submit :form="editform" :targetpid="this.pid"></ph-submit>--> - <!-- <ph-submit - :form="editform" - :targetpid="this.pid" - v-on:object-saved="objectSaved($event)" - v-on:load-form="form = $event" - ></ph-submit>--> + </v-card-text> </v-card> </v-flex> @@ -209,6 +237,7 @@ import PSearch from "@/components/search/PSearch"; import { version } from "../package.json"; import fields from "@/utils/fields"; import jsonLd from "@/utils/json-ld"; +import PImg from "@/components/utils/PImg"; import "@/compiled-icons/univie-sprache"; import "@/compiled-icons/material-social-person"; import "@/compiled-icons/material-navigation-menu"; @@ -224,7 +253,7 @@ export default { PMRights, PMRelationships, PMFiles, - PIForm + PIForm,PImg }, computed: { loadedcmodel: function() { @@ -266,6 +295,7 @@ export default { sections: [] }, members: [], +fullmembers:[], pid: "o:589027", piddoc: {}, collection: "", @@ -286,6 +316,10 @@ export default { }; }, methods: { + getPid: function() { + var newpid = this.pid.replace(/\s+/g, ""); + this.pid = newpid; + }, getResourceTypeFromMimeType: function(mime) { switch (mime) { case "image/jpeg": @@ -431,6 +465,31 @@ export default { return promise; }, + getMembers: function(pid) { + this.members = []; + var self = this; + var url = + self.$store.state.settings.instance.api + + "/object/" + + pid + + "/members/order"; + var promise = fetch(url, { + method: "GET", + mode: "cors" + }) + .then(function(response) { + return response.json(); + }) + .then(function(json) { + if (json.metadata["members"]) { + return json.metadata["members"]; + } + }) + .catch(function(error) { + console.log(error); // eslint-disable-line no-console + }); + return promise; + }, loadMembers: function(pid) { var self = this; @@ -456,6 +515,7 @@ export default { }) .then(function(response) { return response.json(); + console.log("in loadMembers response", response.json()) }) .then(function(json) { if (json.response.numFound > 0) { @@ -498,11 +558,20 @@ export default { }, loadDisplay: function() { this.displayjsonld = {}; + let self = this; this.loadMetadata(self.pid).then(function(jsonld) { self.displayjsonld = jsonld; }); + this.getMembers(self.pid).then(function(jsonmembers) { + self.members = jsonmembers; + + }); + this.loadMembers(self.pid).then(function(jsonfullmembers) { + self.fullmembers = jsonfullmembers; + + }); }, loadEdit: function() { let self = this; diff --git a/src/components/display/pharma_display/PDSkosPreflabel.vue b/src/components/display/pharma_display/PDSkosPreflabel.vue index 0a7c1026819287f05b8693581f364b41efaf9542..91a16e49833de10e6c0743cf9429b905669e000e 100644 --- a/src/components/display/pharma_display/PDSkosPreflabel.vue +++ b/src/components/display/pharma_display/PDSkosPreflabel.vue @@ -1,5 +1,6 @@ <template> <v-flex> + <v-layout column> <v-flex> <template v-for="(l, i) in o['skos:prefLabel']"> @@ -8,8 +9,9 @@ {{ $t(o['@type']) }} <template v-if="l['@language']">({{ l['@language'] }})</template> </v-flex> + <v-flex md4 xs12 v-else class="pdlabel primary--text" :key="'l'+i"> - {{ $t(p) }} + {{ $t(p) }} <template v-if="l['@language']">({{ l['@language'] }})</template> </v-flex> <v-flex md8 xs12 v-if="o['skos:exactMatch']" :key="'t-id'+i"> @@ -19,7 +21,7 @@ target="_blank" >{{ l['@value'] }}</a> </v-flex> - <v-flex class="valuefield" md8 xs12 v-else :key="'t'+i">{{ l['@value'] }}</v-flex> + <v-flex class="valuefield" md8 xs12 v-else :key="'t'+i"> {{ l['@value'] }}</v-flex> </v-layout> </template> </v-flex> diff --git a/src/components/display/pharma_display/PhDJsonld.vue b/src/components/display/pharma_display/PhDJsonld.vue index a0a806373e2fa2a21bcbedba49d854a2b265ba92..0e7eaa39b0384f7f3a0b2a1ae63504211443613a 100644 --- a/src/components/display/pharma_display/PhDJsonld.vue +++ b/src/components/display/pharma_display/PhDJsonld.vue @@ -1,15 +1,11 @@ <template> - <ph-d-jsonld-layout v-if="jsonld"> - <template v-if="pid" slot="pid"> - <v-flex> - <v-layout row wrap> - <v-flex md4 xs12 class="pdlabel primary--text">{{ $t('Persistent identifier') }}</v-flex> - <v-flex md8 xs12>https://{{ instance.baseurl }}/{{ pid }}</v-flex> - </v-layout> - </v-flex> - </template> + +<ph-d-jsonld-layout v-if="jsonld"> + <template> <template v-for="(o, p) in jsonld"> + + <template v-if="p==='dcterms:type'" slot="dcterms:type"> <p-d-skos-preflabel :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'type'+j"></p-d-skos-preflabel> </template> @@ -332,7 +328,7 @@ <!-- <v-flex xs2 v-if="inputf.selection">{{getLabel(inputf.data['@type'])}}</v-flex>--> <p-d-skos-preflabel v-if="getSkosexactMatch(l)==undefined" - :p="getLabel(l['@type'])" + :o="l" :key="l+index+'pharmafreesubject'" ></p-d-skos-preflabel> @@ -410,7 +406,10 @@ </v-container> </template> </template> + </template> + </ph-d-jsonld-layout> + </template> <script> @@ -439,6 +438,7 @@ import { vocabulary } from "../../../mixins/vocabulary"; import { parseoutput } from "../../../mixins/parseoutput"; import { matchsubject } from "../../../mixins/matchsubject"; import fields from "../../../utils/fields"; +import PImg from "../../utils/PImg"; export default { name: "ph-d-jsonld", @@ -580,7 +580,7 @@ export default { //filter subjects for only the ones with subjects[i]["@type"]=!= "skos:Concept" //that would be the pharma-related subjects var subjects = s.filter(s => s["@type"] != "skos:Concept"); - console.log("subject1", subjects); + var n_subjects = []; // take all the jsonld["dcterms:subject"] but not the ones which have no skos:prefLabel" @@ -617,6 +617,7 @@ export default { default: null }, pid: String, + form: { type: Object, default: null @@ -643,64 +644,11 @@ export default { PDAdaptation, PDCitation, PIUnknownReadonly, - PhDMetadata + PhDMetadata, + PImg }, data() { - return { - /*pharmaSubjects: [ - { - type: "biologicalMacromolecule", - voc: "biological_macromolecule", - selections: this.getSelectionItems("biological_macromolecule"), - title: "Connection to biological macromolecules" - }, - { - type: "life", - voc: "life", - selections: this.getSelectionItems("life"), - title: "Connection to living organism" - }, - { - type: "assay", - selections: [ - ...fields.getFieldsLabelsbyCateg("assay"), - ...fields.getFieldsLabelsbyCateg("assayOrganism") - ], - title: "Bioassay Content" - }, - { - type: "disease", - title: "Connection to diseases", - id: this.getinfoRef("disease") - }, - { - type: "AnatomEntity", - voc: "anatomical_category", - selections: this.getSelectionItems("anatomical_category"), - title: "Relation to anatomical entity" - }, - { - type: "goTerm", - title: "Matching Gene Ontology Terms", - selections: fields.getFieldsLabelsbyCateg("goTerm") - }, - { - type: "chebi", - title: "Associated CHEBI-terms", - selections: fields.getFieldsLabelsbyCateg("chebi") - }, - { - type: "technique", - title: "Used techniques", - id: this.getinfoRef("technique") - }, - { - type: "discipline", - title: "Involved discipline", - id: this.getinfoRef("discipline") - } - ]*/ - }; + return {}; }, methods: { alert: function(e) { @@ -715,7 +663,6 @@ export default { return elem; }, getSelectionElem: function(categ, selection) { - console.log("categ", categ, "selec", selection); var elem = this.pharmaData.filter( pharmaData => pharmaData.category === categ && pharmaData.selection === selection diff --git a/src/components/display/pharma_display/PhDJsonldLayout.vue b/src/components/display/pharma_display/PhDJsonldLayout.vue index aa3f9b3a0eb82c7dfb1426a4c8b5005e13486429..b9f5858cba0eed6c970ca5e4ecde62cead19560c 100644 --- a/src/components/display/pharma_display/PhDJsonldLayout.vue +++ b/src/components/display/pharma_display/PhDJsonldLayout.vue @@ -1,6 +1,8 @@ <template> <v-container> <v-layout column> + + <slot name="dce:title"></slot> <slot name="role"></slot> <slot name="bf:note"></slot> @@ -76,6 +78,7 @@ <slot name="dcterms:subject"></slot> <slot name="unknown-predicate"></slot> + </v-layout> </v-container> </template> diff --git a/src/components/input/PhSubmit.vue b/src/components/input/PhSubmit.vue index 84190b10fa9c2d9885dd140ea153d8f8b3d6d556..7eed2c33d7b1ae9ec6cfdd0ed546d56ca82f8f63 100644 --- a/src/components/input/PhSubmit.vue +++ b/src/components/input/PhSubmit.vue @@ -19,7 +19,7 @@ :form="form" :loading="loading" :templating="templating" - + :jsondata="getMetadata()" :targetpid="targetpid" v-on:submit="checkWarnings()" ></ph-input-form> @@ -210,7 +210,7 @@ export default { if (this.owner) { md["metadata"]["ownerid"] = this.owner; } - //console.log("md", md); + return md; }, diff --git a/src/components/input/pharma-input-fields/PhInputForm.vue b/src/components/input/pharma-input-fields/PhInputForm.vue index 74ad9bd1c2ef4d33a3e00fd0d8e418cddf001eaf..14aa4fafd4d03839588b28884e1241e61f0315b8 100644 --- a/src/components/input/pharma-input-fields/PhInputForm.vue +++ b/src/components/input/pharma-input-fields/PhInputForm.vue @@ -135,7 +135,7 @@ <v-toolbar dense flat color="white"> <v-toolbar-title class="title"> Fill-in the metadata for the research collection: {{$store.state.metadataInputs.containerTitle}} - {{$store.state.metadataInputs.filesTitle}} + </v-toolbar-title> <v-spacer></v-spacer> </v-toolbar> @@ -247,6 +247,20 @@ </v-layout> </v-flex> <v-flex v-else-if="n== 'submit'"> + <v-layout align-center justify-center fill-height> + <v-flex> + <v-toolbar dense flat color="white"> + <v-toolbar-title class="title"> + Submit your files with the following metadata: + + </v-toolbar-title> + <v-spacer></v-spacer> + </v-toolbar> + </v-flex> + </v-layout> + + <ph-d-jsonld :form="form" :jsonld="jsonDisplay"></ph-d-jsonld> + <v-layout align-center justify-end row class="ma-3"> <v-dialog v-if="templating" v-model="templatedialog" width="500"> <v-btn @@ -327,6 +341,7 @@ import PhSelectionProj from "./PhSelectionProj"; import PhAssaySelection from "./PhAssaySelection"; import PhDate from "./PhDate"; import PISelect from "./PISelect"; +import PhDJsonld from "@/components/display/pharma_display/PhDJsonld"; export default { name: "ph-input-form", @@ -343,6 +358,7 @@ export default { PhDate, PhAssaySelection, PISelect, + PhDJsonld, VueJsonPretty }, props: { @@ -352,6 +368,9 @@ export default { sections: [] } }, + jsondata: { + type: Object + }, loading: { type: Boolean, default: false @@ -414,6 +433,16 @@ export default { }, s: function() { return this.form.sections; + }, + jsonDisplay: function() { + //adapt if something else than container + if (this.jsondata.metadata) { + if (this.jsondata.metadata["json-ld"]) { + if (this.jsondata.metadata["json-ld"]["container"]) { + return this.jsondata.metadata["json-ld"]["container"]; + } + } + } } }, data() { @@ -422,7 +451,6 @@ export default { templatename: "", window: 0, - stepper: 1, stepsTitle: [ "General metadata", @@ -559,7 +587,7 @@ export default { if (mult) { var self = this; var sub = []; - console.log("f value", el.value); + if (el.subcategory) { sub = arr.filter(function(a) { if (a.category) { @@ -582,11 +610,6 @@ export default { ) < 0 && sub[a2].description != "selection" ) { - console.log( - "clearing here ", - - sub[a2].description - ); sub[a2].value = ""; sub[a2].text = ""; //and remove the value of the subfields, if there are some @@ -606,12 +629,6 @@ export default { } } } else { - console.log( - "should keep this ", - - sub[a2].description, - sub[a2].value - ); } } // } else { diff --git a/src/i18n/eng.js b/src/i18n/eng.js index 6bd79fe4934844a5eab1606412c01ed7d4f564bd..05f8c52636c6811998022eaca9c2bd7b474f2cd8 100644 --- a/src/i18n/eng.js +++ b/src/i18n/eng.js @@ -13,8 +13,7 @@ export default { "less 10MB": "< 10MB", "more 1GB": "> 1GB", SEARCH_PLACEHOLDER: "Search", - PHAIDRA_IS: - "Phaidra is the repository for the permanent secure storage of digital assets at the University of Vienna.", + PHAIDRA_IS: "Phaidra is the repository for the permanent secure storage of digital assets at the University of Vienna.", Search: "Search", Edit: "Edit", Delete: "Remove", @@ -23,7 +22,7 @@ export default { "Metadata editor": "Metadata editor", "Metadata preview": "Metadata preview", Templates: "Templates", - + Technique: "Technique", "bf:ParallelTitle": "Parallel title", "bf:Note": "Description", @@ -97,11 +96,9 @@ export default { "vra:material": "Material", "vra:hasInscription": "Inscription", - MEMBERS_DELETE_ALERT_CONTAINER: - "This object is a Container with {nrmembers} members. Only an empty Container can be deleted. If you want to delete this object, you need to remove all members from this Container or delete them first.", + MEMBERS_DELETE_ALERT_CONTAINER: "This object is a Container with {nrmembers} members. Only an empty Container can be deleted. If you want to delete this object, you need to remove all members from this Container or delete them first.", DELETE_OBJECT: "Here you can delete object {pid}.", - DELETE_OBJECT_CONFIRM: - "Are you sure you want to permanently delete object {pid}?", + DELETE_OBJECT_CONFIRM: "Are you sure you want to permanently delete object {pid}?", ORG_PUBLISHER: "Publisher", @@ -206,8 +203,7 @@ export default { uwm_educational_educationals_enduserrole: "Intended End User Role", uwm_educational_educationals_interactivitylevel: "Interactivity Level", uwm_educational_educationals_interactivitytype: "Interactivity Type", - uwm_educational_educationals_learningresourcetype: - "Type of Teaching and Educational Resource", + uwm_educational_educationals_learningresourcetype: "Type of Teaching and Educational Resource", uwm_technical: "Technical Data", uwm_technical_duration: "Duration", uwm_technical_otherrequirements: "Requirements for the Use of the Object", @@ -449,4 +445,4 @@ export default { lang_za: "Zhuang", lang_zh: "Chinese", lang_zu: "Zulu" -}; +}; \ No newline at end of file