Skip to content
Snippets Groups Projects
Commit ee5d9923 authored by Isa H's avatar Isa H
Browse files

display mebers

parent 9b2068e2
No related branches found
No related tags found
1 merge request!2Dev2
......@@ -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>
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;
......
<template>
<v-flex>
<v-layout column>
<v-flex>
<template v-for="(l, i) in o['skos:prefLabel']">
......@@ -8,6 +9,7 @@
{{ $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) }}
<template v-if="l['@language']">({{ l['@language'] }})</template>
......
<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>
<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
......
<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>
......
......@@ -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;
},
......
......@@ -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 {
......
......@@ -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",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment