From 236be762deb6523824e7ae2a567f3c2a6ac3ebd1 Mon Sep 17 00:00:00 2001 From: juanf <juanf> Date: Wed, 18 Jan 2017 13:32:35 +0000 Subject: [PATCH] SSDM-4595 : Don't show folders with dataset names SVN: 37603 --- .../eln-lims/html/js/config/Profile.js | 28 +++++++++++++++++-- .../DataSetForm/widgets/DatasetViewerView.js | 4 ++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/Profile.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/Profile.js index 376d581efb2..4567e9ad34b 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/Profile.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/Profile.js @@ -160,6 +160,7 @@ $.extend(DefaultProfile.prototype, { this.allVocabularies = []; this.allDataStores = []; this.allPropertyTypes = []; + this.allDatasetTypeCodes = []; this.displaySettings = {}; this.typePropertiesForSmallTable = {}; @@ -168,6 +169,9 @@ $.extend(DefaultProfile.prototype, { "isEnabled" : false }; + this.isDatasetTypeCode = function(datasetTypeCode) { + return ($.inArray(datasetTypeCode, this.allDatasetTypeCodes) !== -1); + } this.isSampleTypeProtocol = function(sampleTypeCode) { return ($.inArray(sampleTypeCode, this.sampleTypeProtocols) !== -1); } @@ -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 // this.init = function(callbackWhenDone) { var _this = this; - this.initPropertyTypes(function(){ _this.initVocabulariesForSampleTypes(function() { _this.initSearchDomains(function() { _this.initDirectLinkURL(function() { _this.initIsAdmin(function() { - callbackWhenDone(); + _this.initDatasetTypeCodes(function() { + callbackWhenDone(); + }); }); }); }); diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/widgets/DatasetViewerView.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/widgets/DatasetViewerView.js index 81fd431e98f..b35955afd5c 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/widgets/DatasetViewerView.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/widgets/DatasetViewerView.js @@ -232,7 +232,9 @@ function DataSetViewerView(dataSetViewerController, dataSetViewerModel) { return false; } 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 currentLevel < this._level -- GitLab