Commit 38b6c77a authored by maxchaza's avatar maxchaza

Merge branch 'hotfix/filterMappingList'

parents 916cde89 68b9ec2f
......@@ -77,7 +77,27 @@ Ext.define('metExploreViz.view.button.buttonImportMapping.ButtonImportMappingCon
* @param mapping : Mapping object
*/
addConditions : function(mapping) {
var biologicalType;
// Launch mapping
switch (mapping.getTargetLabel()) {
case "reactionDBIdentifier":
biologicalType="reaction";
break;
case "reactionId":
biologicalType="reaction";
break;
case "metaboliteId":
biologicalType="metabolite";
break;
case "metaboliteDBIdentifier":
biologicalType="metabolite";
break;
case "inchi":
biologicalType="metabolite";
break;
default:
metExploreD3.displayMessage("Warning", 'The type of node "' + mapping.getTargetLabel() + '" isn\'t know.')
}
var conditions = mapping.getConditions();
var conditionStore = Ext.getStore("conditionStore");
......@@ -95,6 +115,6 @@ Ext.define('metExploreViz.view.button.buttonImportMapping.ButtonImportMappingCon
.filter(function(cond){
return !(cond.includes("PathwayEnrichment") || cond.includes("PathwayCoverage"))
})
.forEach(function (value) { conditionStore.add({name: value, type: 'int'}); });
.forEach(function (value) { conditionStore.add({name: value, type: 'int', biologicalType: biologicalType}); });
}
});
......@@ -398,8 +398,9 @@ Ext.define('metExploreViz.view.form.aStyleForm.AStyleFormController', {
if(view.biologicalType==="link")
styleToUse = metExploreD3.getLinkStyle();
if(!view.default)
view.default = styleToUse[view.access];
// if(!view.default)
view.default = styleToUse[view.access];
// WARNING Header render is executed afterrender view
// As a result, render and afterrender can't be used on header
......
......@@ -37,6 +37,18 @@ Ext.define('metExploreViz.view.form.allStylesByTypeForm.AllStylesByTypeFormContr
view.on(
{
show : function biologicalTypeChange ( sender, value, oldValue, eOpts ) {
var conditionStore = Ext.getStore("conditionStore");
conditionStore.clearFilter();
if(conditionStore)
conditionStore.filter(function(map){
if(view.title==="Metabolite")
return map.get("biologicalType")==="metabolite";
if(view.title==="Reaction" || view.title==="Link")
return map.get("biologicalType")==="reaction";
return false;
})
},
afterStyleLoading : me.updateForm,
updateSelectionSet : me.updateSelection,
afterrender : me.createCaption,
......
......@@ -101,8 +101,19 @@ Ext.define('metExploreViz.view.form.metaboliteStyleForm.MetaboliteStyleForm', {
"min": 0,
"max": 50,
"default": 1
}
,{
},
// {
// "type": "string",
// "target": ["text.metabolite"],
// "attrType": "style",
// "attr": "font-size",
// "access": "fontSize",
// "biologicalType":"metabolite",
// "title": "Label",
// "choices":"",
// "default":"name"
// },
{
"type": "color",
"target": ["text.metabolite"],
"attrType": "attr",
......
......@@ -6,6 +6,9 @@
Ext.define('metExploreViz.view.form.selectCondition.ConditionModel', {
extend: 'Ext.data.Model',
fields: [
{name: 'name', type: 'string'}
{
name: 'name', type: 'string',
name: 'biologicalType', type: 'string',
}
]
});
\ No newline at end of file
......@@ -74,6 +74,10 @@ Ext.define('metExploreViz.view.form.selectConditionForm.SelectConditionFormContr
change : function(that, newVal, old){
this.map(newVal, old, me.getAStyleFormParent());
},
beforerender: function(c) {
var viewAStyleForm = me.getAStyleFormParent();
view.lookupReference('selectCondition').setStore(Ext.getStore("conditionStore"));
},
scope:me
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment