From b749cc9462e40e727b1b7a29a4895fe4b15ff4a6 Mon Sep 17 00:00:00 2001 From: isaherbauts <isabelle.herbauts@univie.ac.at> Date: Thu, 5 Mar 2020 17:32:15 +0100 Subject: [PATCH] display bioassay --- src/components/display/pharma_display/PhDJsonld.vue | 3 ++- src/components/input/PhSubmit.vue | 8 +++----- .../pharma-input-fields/PhExtServiceTreeview.vue | 6 ++---- src/components/input/pharma-input-fields/PhFiles.vue | 2 +- .../input/pharma-input-fields/PhInputForm.vue | 10 +++++----- src/store/modules/vocabulary.js | 12 ++++++------ src/utils/fields.js | 4 ++-- src/utils/json-ld.js | 10 +++++----- 8 files changed, 26 insertions(+), 29 deletions(-) diff --git a/src/components/display/pharma_display/PhDJsonld.vue b/src/components/display/pharma_display/PhDJsonld.vue index 72082eb..5484757 100644 --- a/src/components/display/pharma_display/PhDJsonld.vue +++ b/src/components/display/pharma_display/PhDJsonld.vue @@ -320,7 +320,7 @@ <template v-if="sec.selections"> <v-card v-for="s in sec.selections" :key="s.label+'t'"> - s {{s}} {{sec.type}} {{s.label}} + s {{s}} {{sec.type}} {{s.label}} if{{getSelectionElem(sec.type,s.label)}} <v-layout v-if="getSelectionElem(sec.type,s.label).length>0"> <v-flex xs1 class="subheading"> <a :href="s.id" target="_blank">{{s.label}}</a> @@ -563,6 +563,7 @@ export default { return elem; }, getSelectionElem: function(categ, selection) { + console.log("categ", categ, selection); var elem = this.pharmaData.filter( pharmaData => pharmaData.category === categ && pharmaData.selection === selection diff --git a/src/components/input/PhSubmit.vue b/src/components/input/PhSubmit.vue index 93d0e93..677e497 100644 --- a/src/components/input/PhSubmit.vue +++ b/src/components/input/PhSubmit.vue @@ -171,7 +171,7 @@ export default { }, getMetadata: function() { let jsonlds; - //console.log("this.form", this.form); + if (!this.targetpid && this.submittype === "container") { jsonlds = jsonLd.containerForm2json(this.form); } else { @@ -210,7 +210,7 @@ export default { if (this.owner) { md["metadata"]["ownerid"] = this.owner; } - console.log("md", md); + //console.log("md", md); return md; }, @@ -236,7 +236,7 @@ export default { var httpFormData = new FormData(); httpFormData.append("metadata", JSON.stringify(self.getMetadata())); - console.log("httpFormData", self.getMetadata()); + //console.log("httpFormData", self.getMetadata()); if (this.submittype === "container") { for (var i = 0; i < this.form.sections.length; i++) { var s = this.form.sections[i]; @@ -299,7 +299,6 @@ export default { ) .then(response => response.json()) .then(function(json) { - console.log("failed 1", json); if (json.alerts && json.alerts.length > 0) { self.$store.commit("setAlerts", json.alerts); } @@ -312,7 +311,6 @@ export default { self.$vuetify.goTo(0); }) .catch(function(error) { - console.log("failed 2", error); self.$store.commit("setAlerts", [{ type: "danger", msg: error }]); self.loading = false; self.$vuetify.goTo(0); diff --git a/src/components/input/pharma-input-fields/PhExtServiceTreeview.vue b/src/components/input/pharma-input-fields/PhExtServiceTreeview.vue index 67f7818..a69ee05 100644 --- a/src/components/input/pharma-input-fields/PhExtServiceTreeview.vue +++ b/src/components/input/pharma-input-fields/PhExtServiceTreeview.vue @@ -233,14 +233,12 @@ export default { }, deselect: function(item, tree) { //push it to selected items but first check if it's there first - console.log("in deselect", item, tree.items); if (this.selectedItems.indexOf(item) > -1) { //item has been selected; var index = this.selectedItems.indexOf(item); - console.log("in deselect2", this.selectedItems); + this.selectedItems.splice(index, 1); - console.log("in deselect3", this.selectedItems); } else { //console.log("item ", item); } @@ -304,7 +302,7 @@ export default { } } //alphabetical sorting: if (item.children) { - console.log(item.children); + //console.log(item.children); item.children.sort((a, b) => (a.text > b.text ? 1 : -1)); } }) diff --git a/src/components/input/pharma-input-fields/PhFiles.vue b/src/components/input/pharma-input-fields/PhFiles.vue index 7493483..3c8b243 100644 --- a/src/components/input/pharma-input-fields/PhFiles.vue +++ b/src/components/input/pharma-input-fields/PhFiles.vue @@ -200,7 +200,7 @@ export default { }, setExt: function(index, val) { this.FileExtFreefield[index] = val; - console.log("in set elem", this.FileExtFreefield); + //console.log("in set elem", this.FileExtFreefield); }, // http://scratch99.com/web-development/javascript/convert-bytes-to-mb-kb/ diff --git a/src/components/input/pharma-input-fields/PhInputForm.vue b/src/components/input/pharma-input-fields/PhInputForm.vue index aaa0045..755c6a7 100644 --- a/src/components/input/pharma-input-fields/PhInputForm.vue +++ b/src/components/input/pharma-input-fields/PhInputForm.vue @@ -451,7 +451,7 @@ export default { changeFieldToText: function(arr, f) { var newField = arrays.duplicate(arr, f); - console.log("newField", newField); + //console.log("newField", newField); if (newField) { newField.id = new Date().getTime(); newField.removable = true; @@ -625,10 +625,10 @@ export default { warning: function(section) { console.log("in warning", section); if (typeof section === "undefined") { - console.log("undefined"); + //console.log("undefined"); } else { var w = false; - console.log("section", section); + //console.log("section", section); if (section.fields) { var fields = section.fields; @@ -636,11 +636,11 @@ export default { //console.log("field w", fields[f]); if (fields[f].warning === true) { w = true; - console.log("field", fields[f].label, "is missing"); + //console.log("field", fields[f].label, "is missing"); } } } else if (section.categories) { - console.log("cat", section.categories); + //console.log("cat", section.categories); for (var c in section.categories) { if (section.categories[c].fields) { var fields = section.categories[c].fields; diff --git a/src/store/modules/vocabulary.js b/src/store/modules/vocabulary.js index bfd1fe8..a057247 100644 --- a/src/store/modules/vocabulary.js +++ b/src/store/modules/vocabulary.js @@ -180,7 +180,7 @@ const state = { bioassay_type: { terms: [ { - "@type": "pharmaWien:assaytype", + "@type": "pharmaWien:assayType", "skos:prefLabel": [ { "@value": "ADMET", @@ -190,7 +190,7 @@ const state = { "skos:exactMatch": ["http://www.bioassayontology.org/bao#BAO_0000009"] }, { - "@type": "pharmaWien:assaytype", + "@type": "pharmaWien:assayType", "skos:prefLabel": [ { "@value": "Binding type", @@ -200,7 +200,7 @@ const state = { "skos:exactMatch": ["http://www.bioassayontology.org/bao#BAO_0000041"] }, { - "@type": "pharmaWien:assaytype", + "@type": "pharmaWien:assayType", "skos:prefLabel": [ { "@value": "Functional", @@ -210,7 +210,7 @@ const state = { "skos:exactMatch": ["http://www.bioassayontology.org/bao#BAO_0000010"] }, { - "@type": "pharmaWien:assaytype", + "@type": "pharmaWien:assayType", "skos:prefLabel": [ { "@value": "Physicochemical", @@ -220,7 +220,7 @@ const state = { "skos:exactMatch": ["http://www.bioassayontology.org/bao#BAO_0002810"] }, { - "@type": "pharmaWien:assaytype", + "@type": "pharmaWien:assayType", "skos:prefLabel": [ { "@value": "Phenotype characterization", @@ -528,7 +528,7 @@ const state = { } ], loaded: true - }, + }, assayTarget_organism: { terms: [ { diff --git a/src/utils/fields.js b/src/utils/fields.js index a19219b..d39f7af 100644 --- a/src/utils/fields.js +++ b/src/utils/fields.js @@ -1118,12 +1118,12 @@ const fields = [ info: "This includes the methodology used to perform a particular bioassay and is found on the PubChem website associated with each assay ID (AID). It includes the assay components and the order in which they were added, the incubation times, detection method and the kit used, etc.", infoRef: "http://www.bioassayontology.org/bao#BAO_0000523", - description: "Assay target:" + description: "Assay target abstract:" }, { id: "0-Bioassay-type", predicate: "dcterms:subject", - type: "pharmaWien:BioassayType", + type: "pharmaWien:assayType", //subjectType: "Bioassay_type", label: "Bioassay type:", visible: true, diff --git a/src/utils/json-ld.js b/src/utils/json-ld.js index 60d5e1c..637c389 100644 --- a/src/utils/json-ld.js +++ b/src/utils/json-ld.js @@ -7,7 +7,7 @@ export default { // all dce:subjects in the same language are handled by 1 component let keywords = {}; Object.entries(jsonld).forEach(([key, value]) => { - console.log("in here", key); + //console.log("in here", key); if (key === "dce:subject") { for (let v of value) { if (v["@type"] === "skos:Concept") { @@ -37,7 +37,7 @@ export default { var j; for (i = 0; i < value.length; i++) { var f; - console.log("value", value[i]); + //console.log("value", value[i]); switch (key) { // rdam:P30004 case "rdam:P30004": @@ -101,7 +101,7 @@ export default { value[i]["@type"] === "bf:ParallelTitle" ) { f = fields.getField("pharma-title"); - console.log("value[i]['@type']", f); + //console.log("value[i]['@type']", f); f.type = value[i]["@type"]; if (value[i]["bf:mainTitle"]) { for (j = 0; j < value[i]["bf:mainTitle"].length; j++) { @@ -214,7 +214,7 @@ export default { } else if (value[i]["@type"] === "phaidra:Subject") { // ignore, handled elsewhere } else { - console.log("here else"); + //console.log("here else"); } break; @@ -1944,7 +1944,7 @@ export default { //console.log("selection", f.value); this.push_object(jsonld, f.predicate, f.value[0]); } else { - console.log("else", f); + //console.log("else", f); this.push_object( jsonld, f.predicate, -- GitLab