Skip to content

Commit

Permalink
Merge pull request #716 from VirtualFlyBrain/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
Robbie1977 authored Oct 23, 2020
2 parents 34ac451 + 30bc333 commit ae37ec6
Show file tree
Hide file tree
Showing 10 changed files with 94 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
stages:
- build
- name: debug
if: branch = debug OR branch = pipeline2 OR branch =~ ^(fix|feature).*
if: branch = debug OR branch = vfb_geppetto_application OR branch = pipeline2 OR branch =~ ^(fix|feature).*
- test
- deploy
- name: review
Expand Down
8 changes: 7 additions & 1 deletion components/VFBMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -912,8 +912,9 @@ class VFBMain extends React.Component {
}}
focusTermRef={this.focusTermReference}
exclude={["ClassQueriesFrom", "Debug"]}
order={['Name',
order={['Symbol',
'Title',
'Name',
'Label',
'Alternative Names',
'Types',
Expand Down Expand Up @@ -1193,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 Expand Up @@ -1238,6 +1240,10 @@ class VFBMain extends React.Component {
idsList = idList[list].replace("i=","") + idsList;
} else if (idList[list].indexOf("q=") > -1) {
this.urlQueryLoader = idList[list].replace("q=","").replace("%20", " ").split(",");
// if no other ids are loaded the query target is added.
if (idsList.length == 0 && this.urlQueryLoader.length > 1) {
idsList = this.urlQueryLoader[0];
}
}
}

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
34 changes: 26 additions & 8 deletions components/configuration/VFBMain/queryBuilderConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ var queryResultsColMeta = [
"sortDirectionCycle": ['asc', 'desc', null]
},
{
"columnName": "type",
"columnName": "gross_type",
"order": 6,
"locked": false,
"visible": true,
"displayName": "Type",
"cssClassName": "query-results-type-column",
"displayName": "Gross_Type",
"cssClassName": "query-results-grosstype-column",
"sortDirectionCycle": ['asc', 'desc', null]
},
{
Expand All @@ -106,9 +106,27 @@ var queryResultsColMeta = [
"sortDirectionCycle": ['asc', 'desc', null]
},
{
"columnName": "controls",
"columnName": "template",
"order": 9,
"locked": false,
"visible": true,
"displayName": "Template_Space",
"cssClassName": "query-results-template-column",
"sortDirectionCycle": ['asc', 'desc', null]
},
{
"columnName": "technique",
"order": 10,
"locked": false,
"visible": true,
"displayName": "Imaging_Technique",
"cssClassName": "query-results-technique-column",
"sortDirectionCycle": ['asc', 'desc', null]
},
{
"columnName": "controls",
"order": 11,
"locked": false,
"visible": false,
"customComponent": QueryResultsControlsComponent,
"displayName": "Controls",
Expand All @@ -118,7 +136,7 @@ var queryResultsColMeta = [
},
{
"columnName": "images",
"order": 10,
"order": 12,
"locked": false,
"visible": true,
"customComponent": SlideshowImageComponent,
Expand All @@ -129,7 +147,7 @@ var queryResultsColMeta = [
},
{
"columnName": "score",
"order": 11,
"order": 13,
"locked": false,
"visible": true,
"displayName": "Score",
Expand All @@ -138,7 +156,7 @@ var queryResultsColMeta = [
},
{
"columnName": "image_count",
"order": 12,
"order": 14,
"locked": false,
"visible": true,
"displayName": "Image_count",
Expand All @@ -148,7 +166,7 @@ var queryResultsColMeta = [
];

// which columns to display in the results
var queryResultsColumns = ['name', 'expressed_in', 'description', 'reference', 'type', 'stage', 'license', 'images', 'score','image_count'];
var queryResultsColumns = ['name', 'type', 'expressed_in', 'description', 'reference', 'gross_type', 'stage', 'license', 'template', 'technique', 'controls', 'images', 'score','image_count'];

var queryResultsControlConfig = {
"Common": {
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
10 changes: 5 additions & 5 deletions components/configuration/VFBOverview/quickHelp.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"height": "575",
"width": "900",
"steps": [{
"title": "This is the Slice Viewer frame",
"title": "This is the Slice Viewer tab",
"image" : "geppetto/build/slice-viewer.png",
"instructions": [{
"icon" : "",
Expand All @@ -28,7 +28,7 @@
"label" : "Toggles the slice position on the 3D Viewer on/off"
}]
},{
"title": "This is the 3D Viewer frame",
"title": "This is the 3D Viewer tab",
"image" : "geppetto/build/3d-viewer.png",
"instructions": [{
"icon" : "",
Expand All @@ -47,17 +47,17 @@
"label" : "Home resets your view"
},{
"icon" : "fa fa-video-camera",
"label" : "The camera icon starts/stops a rotation animation the scene"
"label" : "The camera icon starts/stops a rotation animation of the scene"
},{
"icon" : "gpt-sphere_wireframe-jpg",
"label" : "The sphere icon toggles wireframes on/off"
}]
},{
"title": "This is the Term Info frame",
"title": "This is the Term Info tab",
"image" : "geppetto/build/term-info.png",
"instructions": [{
"icon" : "",
"label" : "Term Info displays information on the currently selected painted anatomy region, neuron or expression pattern"
"label" : "Term Info displays information on the currently selected painted anatomy region, neuron, expression pattern or non-image term definitions"
},{
"icon" : "fa fa-hand-pointer-o",
"label" : "Click on thumbnails to add that image to the viewer"
Expand Down
4 changes: 2 additions & 2 deletions components/configuration/VFBToolbar/vfbtoolbarHTML.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ var feedback
+ "[<a href='https://github.com/VirtualFlyBrain/VFB2' target='_blank'>VirtualFlyBrain/VFB2</a>].</p>"
+ "<p>If you have a GitHub account you can easily raise a new issue: "
+ "<form id='GitHubIssue' method='get' action='https://github.com/VirtualFlyBrain/VFB2/issues/new' target='_blank'>"
+ "<input type='hidden' name='body' value=%0A%0A%0A%0A%0A%0ASupport%20info%3A%0A$DATE$%0A$BROWSER$%20$VERSION$%20%5B$SCREEN$%5D%0A$URL$%0A%0A%60%60%60diff%0A$LOG$%0A%60%60%60%0A' />"
+ "<input type='submit' value='Create GitHub Issue'></form>"
+ "<input type='hidden' name='body' value='%0A%0A%0A%0A%0A%0ASupport%20info%3A%0A$DATE$%0A$BROWSER$%20$VERSION$%20%5B$SCREEN$%5D%0A$URL$%0A%0A%60%60%60diff%0A$LOG$%0A%60%60%60%0A' />"
+ "<input type='submit' value='Create GitHub Issue' style='color: black; border-color: darkcyan;'></form>"
+ "</p>"
+ "<p> This could simply be a question or a new feature request, but if you have found a bug we missed please copy in "
+ "the page address and system details listed below to help us resolve any issue as quickly as possible."
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);
Loading

0 comments on commit ae37ec6

Please sign in to comment.