Commit 3a421996 authored by Marco Cortella's avatar Marco Cortella
Browse files

FIX: error when saving metamodel (caused by license profilation of some...

FIX: error when saving metamodel (caused by license profilation of some properties), aka https://production.eng.it/jira/browse/KNOWAGE-2929
parent 7b296309
......@@ -272,16 +272,19 @@ angular.module('metaManager').filter('filterByMainCategory', function(sbiModule_
var showDataProfiling = sbiModule_user.functionalities.indexOf("MetaModelDataProfiling")>-1;
return function(items, prop) {
angular.forEach(items, function(item) {
var toReturn = [];
angular.copy(items,toReturn);
angular.forEach(toReturn, function(item) {
if(item == "behavioural" && !showDataProfiling){
//remove behavioural category
var sdInd = items.indexOf("behavioural");
var sdInd = toReturn.indexOf("behavioural");
if(sdInd != -1){
items.splice(sdInd,1);
toReturn.splice(sdInd,1);
}
}
});
return items;
return toReturn;
};
});
......@@ -311,37 +314,39 @@ angular.module('metaManager').filter('filterByProductType', function(sbiModule_c
var showSpatialDimension = sbiModule_user.functionalities.indexOf("SpatialDimension")>-1;
var showTemporalDimension = sbiModule_user.functionalities.indexOf("TemporalDimension")>-1;
var toReturn = [];
angular.copy(items,toReturn);
var key = Object.keys(prop)[0];
if(angular.equals(prop[key].propertyType.name,"Type")){
if(sbiModule_config.productTypes.indexOf("KnowageLI")==-1 || !showSpatialDimension){
//remove spatial dimension
var sdInd=items.indexOf("geographic dimension");
var sdInd=toReturn.indexOf("geographic dimension");
if(sdInd!=-1){
items.splice(sdInd,1);
toReturn.splice(sdInd,1);
}
}
if(sbiModule_config.productTypes.indexOf("KnowageSI")==-1 || !showTemporalDimension){
//remove temporal dimension
var tdInd=items.indexOf("temporal dimension");
var tdInd=toReturn.indexOf("temporal dimension");
if(tdInd!=-1){
items.splice(tdInd,1);
toReturn.splice(tdInd,1);
}
var tdInd=items.indexOf("time dimension");
var tdInd=toReturn.indexOf("time dimension");
if(tdInd!=-1){
items.splice(tdInd,1);
toReturn.splice(tdInd,1);
}
var tdInd=items.indexOf("calendar");
var tdInd=toReturn.indexOf("calendar");
if(tdInd!=-1){
items.splice(tdInd,1);
toReturn.splice(tdInd,1);
}
}
}
return items;
return toReturn;
};
});
......
Supports Markdown
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