Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #714

Merged
merged 9 commits into from
Oct 23, 2020
1 change: 1 addition & 0 deletions components/VFBMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,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) {
Expand Down
36 changes: 30 additions & 6 deletions components/configuration/VFBListViewer/listViewerConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<a id="' + instance.id + '" style="color:white;text-decoration: none;">' + instance.getName() + "</a>" ;

// Set HTML string inside div ready for React
return <div onClick={e => click(e)} dangerouslySetInnerHTML={{ __html: typeHTML }} />
},
source : entity => entity
},
{
id: "type",
Expand Down Expand Up @@ -67,8 +81,10 @@ const conf = [
var matchSpan = /<span[^>]*>([\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 = "<div>" + type.join('') + tags.join('') + "</div>" ;
let typeHTML = "<div>" + textContent + tags.join('') + "</div>" ;

// Set HTML string inside div ready for React
return <div dangerouslySetInnerHTML={{ __html: typeHTML }} />
Expand All @@ -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;
}
}
];
Expand Down
1 change: 1 addition & 0 deletions components/configuration/VFBMain/searchConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ var searchConfiguration = {
"name": "label",
"id": "short_form"
},
"filters_expanded": true,
"filters": [
{
"key": "facets_annotation",
Expand Down
2 changes: 1 addition & 1 deletion components/interface/VFBFocusTerm/VFBFocusTerm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
2 changes: 1 addition & 1 deletion model/vfb.xmi
Original file line number Diff line number Diff line change
Expand Up @@ -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">
<libraryConfigurations
Expand Down