From abcfadbad0dd92e9d4f5fbfeb77173fda1330ab2 Mon Sep 17 00:00:00 2001 From: jrmartin Date: Fri, 16 Oct 2020 17:55:46 -0700 Subject: [PATCH 1/5] Fix thumbnail in layers component for neurons, makes clicking on name open the term info and fixes clicking on type link --- components/VFBMain.js | 1 + .../VFBListViewer/listViewerConfiguration.js | 36 +++++++++++++++---- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/components/VFBMain.js b/components/VFBMain.js index e2aaf2e5a..2bdb81794 100644 --- a/components/VFBMain.js +++ b/components/VFBMain.js @@ -1193,6 +1193,7 @@ class VFBMain extends React.Component { window.setTermInfo = function (meta, id) { this.handlerInstanceUpdate(meta); + this.props.setTermInfo(meta, true); }.bind(this); window.fetchVariableThenRun = function (idsList, cb, label) { diff --git a/components/configuration/VFBListViewer/listViewerConfiguration.js b/components/configuration/VFBListViewer/listViewerConfiguration.js index e4291aa27..5487037c2 100644 --- a/components/configuration/VFBListViewer/listViewerConfiguration.js +++ b/components/configuration/VFBListViewer/listViewerConfiguration.js @@ -36,10 +36,24 @@ const conf = [ { id: "name", title: "Name", - source : entity => { - let path = entity.path.split(".")[0]; - return Instances.getInstance(path).getName(); - } + customComponent: component => { + // Retrieve instance path + let path = component.value.get("path").split(".")[0]; + + let instance = Instances.getInstance(path); + var self = this; + + let click = (value) => { + let instance = Instances.getInstance(value.target.id); + window.setTermInfo(Instances.getInstance(path)[path + "_meta"], path); + }; + // Create new HTML string with the Type name and tags only + let typeHTML = '' + instance.getName() + "" ; + + // Set HTML string inside div ready for React + return
click(e)} dangerouslySetInnerHTML={{ __html: typeHTML }} /> + }, + source : entity => entity }, { id: "type", @@ -67,8 +81,10 @@ const conf = [ var matchSpan = /]*>([\s\S]*?)<\/span>/g , tags = html.match(matchSpan); + // Make anchor open in new tab, and fix path by adding 'geppetto?' to href + let textContent = type.join().replace('href="?', 'target="_blank" href="geppetto?'); // Create new HTML string with the Type name and tags only - let typeHTML = "
" + type.join('') + tags.join('') + "
" ; + let typeHTML = "
" + textContent + tags.join('') + "
" ; // Set HTML string inside div ready for React return
@@ -88,8 +104,16 @@ const conf = [ if ( instance === undefined ) { return null; } + + let value = GEPPETTO.ModelFactory.getAllVariablesOfMetaType(instance.getType(), 'ImageType')[0].getInitialValues()[0].value; + let img = ""; + if ( value.elements != undefined ) { + img = value.elements[0].initialValue.data; + } else if ( value.data != undefined ) { + img = value.data; + } // Retrieve thumbnail image from Instance - return GEPPETTO.ModelFactory.getAllVariablesOfMetaType(instance.getType(), 'ImageType')[0].getInitialValues()[0].value.data + return img; } } ]; From 30108ed2032bcb4c425d3e9bab9cd45292904521 Mon Sep 17 00:00:00 2001 From: Dario Del Piano Date: Mon, 19 Oct 2020 14:12:56 +0100 Subject: [PATCH 2/5] filters_expanded added to search configuration --- components/configuration/VFBMain/searchConfiguration.js | 1 + 1 file changed, 1 insertion(+) diff --git a/components/configuration/VFBMain/searchConfiguration.js b/components/configuration/VFBMain/searchConfiguration.js index 2b33818d5..e47d1f464 100644 --- a/components/configuration/VFBMain/searchConfiguration.js +++ b/components/configuration/VFBMain/searchConfiguration.js @@ -109,6 +109,7 @@ var searchConfiguration = { "name": "label", "id": "short_form" }, + "filters_expanded": true, "filters": [ { "key": "facets_annotation", From a0335d3926cec6bd73e944ef2e67d00043dae72a Mon Sep 17 00:00:00 2001 From: jrmartin Date: Mon, 19 Oct 2020 14:19:14 -0700 Subject: [PATCH 3/5] Lint fix --- .../VFBListViewer/listViewerConfiguration.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/configuration/VFBListViewer/listViewerConfiguration.js b/components/configuration/VFBListViewer/listViewerConfiguration.js index 5487037c2..8fd20ff94 100644 --- a/components/configuration/VFBListViewer/listViewerConfiguration.js +++ b/components/configuration/VFBListViewer/listViewerConfiguration.js @@ -41,10 +41,10 @@ const conf = [ let path = component.value.get("path").split(".")[0]; let instance = Instances.getInstance(path); - var self = this; - - let click = (value) => { - let instance = Instances.getInstance(value.target.id); + var self = this; + + let click = value => { + let instance = Instances.getInstance(value.target.id); window.setTermInfo(Instances.getInstance(path)[path + "_meta"], path); }; // Create new HTML string with the Type name and tags only From 965c05350fa340b6b4d1ab29527f249ff62f08d6 Mon Sep 17 00:00:00 2001 From: Dario Del Piano Date: Thu, 22 Oct 2020 15:13:10 +0100 Subject: [PATCH 4/5] check tests --- model/vfb.xmi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/vfb.xmi b/model/vfb.xmi index d78879c05..5b560e390 100644 --- a/model/vfb.xmi +++ b/model/vfb.xmi @@ -146,7 +146,7 @@ id="neo4JDataSourceService" name="neo4j Data Source" dataSourceService="neo4jDataSource" - url="http://pdb.virtualflybrain.org/db/data/transaction" + url="http://pdb.p2.virtualflybrain.org/db/data/transaction" dependenciesLibrary="//@libraries.3" targetLibrary="//@libraries.4"> Date: Thu, 22 Oct 2020 17:23:51 +0100 Subject: [PATCH 5/5] #702 forward ref for focus term in order to get this working with class and individuals --- components/interface/VFBFocusTerm/VFBFocusTerm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/interface/VFBFocusTerm/VFBFocusTerm.js b/components/interface/VFBFocusTerm/VFBFocusTerm.js index 8956d3e10..1711de5fb 100644 --- a/components/interface/VFBFocusTerm/VFBFocusTerm.js +++ b/components/interface/VFBFocusTerm/VFBFocusTerm.js @@ -610,4 +610,4 @@ function mapDispatchToProps (dispatch) { return { showListViewer: type => dispatch({ type : type }) } } -export default connect(mapStateToProps, mapDispatchToProps)(VFBFocusTerm); +export default connect(mapStateToProps, mapDispatchToProps, null, { forwardRef : true } )(VFBFocusTerm);