From e125f77006bf490454a38943a8a94aa1c8522310 Mon Sep 17 00:00:00 2001
From: juanf <juanf>
Date: Wed, 14 Dec 2016 10:42:37 +0000
Subject: [PATCH] SSDM-4530 : Small tweaks to increase performance on tables

SVN: 37492
---
 .../eln-lims/html/js/server/ServerFacade.js   | 50 ++++++++++++-------
 .../js/views/DataGrid/SampleDataGridUtil.js   | 18 ++++---
 2 files changed, 41 insertions(+), 27 deletions(-)

diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js
index a75a8a9402a..309d35d35d7 100644
--- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js
+++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js
@@ -743,40 +743,50 @@ function ServerFacade(openbisServer) {
 			
 				//Setting the fetchOptions given standard settings
 				var fetchOptions = new EntityFetchOptions();
-				if(fetchOptions.withTags) {
-					fetchOptions.withTags();
-				}
 				if(fetchOptions.withType) {
 					fetchOptions.withType();
 				}
 				if(fetchOptions.withSpace) {
 					fetchOptions.withSpace();
 				}
-				if(fetchOptions.withExperiment) {
-					fetchOptions.withExperiment();
-				}
-				if(fetchOptions.withSample) {
-					fetchOptions.withSample();
-				}
 				if(fetchOptions.withRegistrator) {
 					fetchOptions.withRegistrator();
 				}
 				if(fetchOptions.withModifier) {
 					fetchOptions.withModifier();
 				}
-				if(fetchOptions.withParents) {
-					fetchOptions.withParentsUsing(fetchOptions);
-				}
-				if(fetchOptions.withChildren) {
-					fetchOptions.withChildrenUsing(fetchOptions);
-				}
-				if(fetchOptions.withProjects) {
-					fetchOptions.withProjects();
-				}
 				if(fetchOptions.withProperties) {
 					fetchOptions.withProperties();
 				}
 				
+				//Optional fetchOptions
+				if(!advancedFetchOptions || !advancedFetchOptions.minTableInfo) {
+					if(fetchOptions.withProjects) {
+						fetchOptions.withProjects();
+					}
+					if(fetchOptions.withSample) {
+						fetchOptions.withSample();
+					}
+					if(fetchOptions.withExperiment) {
+						fetchOptions.withExperiment();
+					}
+					if(fetchOptions.withTags) {
+						fetchOptions.withTags();
+					}
+					if(fetchOptions.withParents) {
+						fetchOptions.withParentsUsing(fetchOptions);
+					}
+					if(fetchOptions.withChildren) {
+						fetchOptions.withChildrenUsing(fetchOptions);
+					}
+				} else if(advancedFetchOptions.minTableInfo) {
+					if(fetchOptions.withParents) {
+						fetchOptions.withParents();
+					}
+				}
+				
+				
+				
 				if(advancedFetchOptions && advancedFetchOptions.cache) {
 					fetchOptions.cacheMode(advancedFetchOptions.cache);
 				}
@@ -877,7 +887,9 @@ function ServerFacade(openbisServer) {
 				
 					switch(fieldType) {
 						case "All":
-							searchCriteria.withAnyField().thatContains(fieldValue);
+							if(fieldValue !== "*") {
+								searchCriteria.withAnyField().thatContains(fieldValue);
+							}
 							break;
 						case "Property":
 							setPropertyCriteria(setOperator(searchCriteria, advancedSearchCriteria.logicalOperator), fieldName, fieldValue);
diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js
index 5cc618a8c2f..6ea1c53d43e 100644
--- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js
+++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js
@@ -65,12 +65,12 @@ var SampleDataGridUtil = new function() {
 			sortable : false
 		});
 		
-		columnsFirst.push({
-			label : ELNDictionary.ExperimentELN + '/' + ELNDictionary.ExperimentInventory,
-			property : 'experiment',
-			isExportable: true,
-			sortable : false
-		});
+//		columnsFirst.push({
+//			label : ELNDictionary.ExperimentELN + '/' + ELNDictionary.ExperimentInventory,
+//			property : 'experiment',
+//			isExportable: true,
+//			sortable : false
+//		});
 		
 		columnsFirst.push({
 			label : 'Preview',
@@ -257,7 +257,7 @@ var SampleDataGridUtil = new function() {
 										'sampleTypeCode' : sample.sampleTypeCode,
 										'default_space' : sample.spaceCode,
 										'permId' : sample.permId,
-										'experiment' : sample.experimentIdentifierOrNull,
+//										'experiment' : sample.experimentIdentifierOrNull,
 										'registrationDate' : registrationDate,
 										'modificationDate' : modificationDate
 									};
@@ -289,7 +289,9 @@ var SampleDataGridUtil = new function() {
 				});
 			}
 			
-			var fetchOptions = {};
+			var fetchOptions = {
+					minTableInfo : true
+			};
 			
 			if(options) {
 				fetchOptions.count = options.pageSize;
-- 
GitLab