Skip to content

Commit

Permalink
Removed logging and commented-out code
Browse files Browse the repository at this point in the history
This now appears to work; I have not been able to reproduce the failures seen earlier (though the code should be functionally equivalent).
So I believe this change fixes #405.
  • Loading branch information
brianritchie1312 committed Apr 23, 2019
1 parent 4801200 commit 8b335da
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions yo/app/scripts/controllers/meta-panel.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
return;
};

console.log("MetaPanel: entity type: " + entity.type);

// Initialise the query for the metatab fields
var queryBuilder = facility.icat().queryBuilder(entity.type).where(entity.type + ".id = " + entity.id);
var entityType = entity.type;
Expand All @@ -61,7 +59,6 @@
// For a compound expression, we need to extract the corresponding entity type (e.g. "investigationUser" maps to "user")
var variableName = matches[1];
entityType = icatSchema.variableEntityTypes[variableName];
console.log("MetaPanel: var: " + variableName + "; type: " + entityType);
if(!entityType){
console.error("Unknown variableName: " + variableName, item)
}
Expand Down Expand Up @@ -89,36 +86,6 @@
});
});

// var queryBuilder = facility.icat().queryBuilder(entity.type).where(entity.type + ".id = " + entity.id);

/*
* TEST
*
if(entity.type == 'instrument'){
queryBuilder.include('instrumentScientist');
}
if(entity.type == 'investigation'){
queryBuilder.include('user');
queryBuilder.include('investigationParameterType');
queryBuilder.include('sample');
queryBuilder.include('publication');
queryBuilder.include('study');
queryBuilder.include('investigationUser');
}
if(entity.type == 'dataset'){
queryBuilder.include('datasetParameterType');
queryBuilder.include('sample');
queryBuilder.include('datasetType');
}
if(entity.type == 'datafile'){
queryBuilder.include('datafileParameterType');
queryBuilder.include('datafileFormat');
}
*/

queryBuilder.run(timeout.promise).then(function(entity){
entity = entity[0];

Expand All @@ -131,18 +98,14 @@
_.each(tabConfig.items, function(itemConfig){
var find = entity.entityType;
var field = itemConfig.field;
console.log("MP 1: find=" + find + ", field=" + field);
var matches;
if(matches = itemConfig.field.replace(/\|.+$/, '').match(/^(.*)?\.([^\.\[\]]+)$/)){
find = matches[1];
field = matches[2]
console.log("MP 2: find=" + find + ", field=" + field);
}
if(!find.match(/\]$/)) find = find + '[]';
console.log("MP 3: find=" + find);
_.each(entity.find(find), function(entity){
var value = entity.find(field)[0];
console.log("MP 4: value=" + value);
if(value !== undefined || field == 'size'){
tab.items.push({
label: itemConfig.label ? $translate.instant(itemConfig.label) : null,
Expand Down

0 comments on commit 8b335da

Please sign in to comment.