Skip to content
Snippets Groups Projects
Commit 236be762 authored by juanf's avatar juanf
Browse files

SSDM-4595 : Don't show folders with dataset names

SVN: 37603
parent 95a3f911
No related branches found
No related tags found
No related merge requests found
...@@ -160,6 +160,7 @@ $.extend(DefaultProfile.prototype, { ...@@ -160,6 +160,7 @@ $.extend(DefaultProfile.prototype, {
this.allVocabularies = []; this.allVocabularies = [];
this.allDataStores = []; this.allDataStores = [];
this.allPropertyTypes = []; this.allPropertyTypes = [];
this.allDatasetTypeCodes = [];
this.displaySettings = {}; this.displaySettings = {};
this.typePropertiesForSmallTable = {}; this.typePropertiesForSmallTable = {};
...@@ -168,6 +169,9 @@ $.extend(DefaultProfile.prototype, { ...@@ -168,6 +169,9 @@ $.extend(DefaultProfile.prototype, {
"isEnabled" : false "isEnabled" : false
}; };
this.isDatasetTypeCode = function(datasetTypeCode) {
return ($.inArray(datasetTypeCode, this.allDatasetTypeCodes) !== -1);
}
this.isSampleTypeProtocol = function(sampleTypeCode) { this.isSampleTypeProtocol = function(sampleTypeCode) {
return ($.inArray(sampleTypeCode, this.sampleTypeProtocols) !== -1); return ($.inArray(sampleTypeCode, this.sampleTypeProtocols) !== -1);
} }
...@@ -759,18 +763,38 @@ $.extend(DefaultProfile.prototype, { ...@@ -759,18 +763,38 @@ $.extend(DefaultProfile.prototype, {
}); });
} }
this.initDatasetTypeCodes = function(callback) {
var _this = this;
this.serverFacade.listDataSetTypes(function(data) {
var dataSetTypes = data.result;
for(var i = 0; i < dataSetTypes.length; i++) {
var datasetType = dataSetTypes[i];
_this.allDatasetTypeCodes.push(datasetType.code);
}
_this.allDatasetTypeCodes.sort(function(a, b){
if(a < b) return -1;
if(a > b) return 1;
return 0;
});
callback();
});
}
// //
// Initializes // Initializes
// //
this.init = function(callbackWhenDone) { this.init = function(callbackWhenDone) {
var _this = this; var _this = this;
this.initPropertyTypes(function(){ this.initPropertyTypes(function(){
_this.initVocabulariesForSampleTypes(function() { _this.initVocabulariesForSampleTypes(function() {
_this.initSearchDomains(function() { _this.initSearchDomains(function() {
_this.initDirectLinkURL(function() { _this.initDirectLinkURL(function() {
_this.initIsAdmin(function() { _this.initIsAdmin(function() {
callbackWhenDone(); _this.initDatasetTypeCodes(function() {
callbackWhenDone();
});
}); });
}); });
}); });
......
...@@ -232,7 +232,9 @@ function DataSetViewerView(dataSetViewerController, dataSetViewerModel) { ...@@ -232,7 +232,9 @@ function DataSetViewerView(dataSetViewerController, dataSetViewerModel) {
return false; return false;
} }
var currentLevel = file.pathInDataSet.split('/').length; var currentLevel = file.pathInDataSet.split('/').length;
if(currentLevel === 2 && file.pathInListing.toUpperCase() !== "DEFAULT") { if(currentLevel === 2 &&
file.pathInListing.toUpperCase() !== "DEFAULT" &&
!profile.isDatasetTypeCode(file.pathInListing.toUpperCase())) {
return false; return false;
} }
return currentLevel < this._level return currentLevel < this._level
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment