From ea0701b4f76db10f4274b37768c270ffe128b762 Mon Sep 17 00:00:00 2001
From: juanf <juanf@ethz.ch>
Date: Wed, 20 Sep 2023 14:42:16 +0200
Subject: [PATCH] SSDM-55: Render calls SHOULD only use constant time
 operations, we need to find a different solution to pretty print multi-value
 propertie

---
 .../js/views/DataGrid/DataGridController.js   | 40 +++++++++----------
 .../js/views/DataGrid/SampleDataGridUtil.js   |  8 ++--
 2 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/DataGridController.js b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/DataGridController.js
index 84b7a98e7c4..1f18e84a0b7 100644
--- a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/DataGridController.js
+++ b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/DataGridController.js
@@ -149,34 +149,34 @@ function DataGridController(
                     var value = null
 
                     if (column.render) {
-                        if(Array.isArray(params.value)) {
-                            var values = params.value.sort();
-                            value = [];
-                            for (var x of values) {
-                                if(value.length > 0) {
-                                    value.push(', ');
-                                }
-                                value.push(column.render(params.row, {
-                                    lastReceivedData: _this.lastReceivedData,
-                                    lastUsedOptions: _this.lastUsedOptions,
-                                    container: params.container,
-                                    value: x
-                                }));
-                            }
-                        } else {
+//                        if(Array.isArray(params.value)) {
+//                            var values = params.value.sort();
+//                            value = [];
+//                            for (var x of values) {
+//                                if(value.length > 0) {
+//                                    value.push(', ');
+//                                }
+//                                value.push(column.render(params.row, {
+//                                    lastReceivedData: _this.lastReceivedData,
+//                                    lastUsedOptions: _this.lastUsedOptions,
+//                                    container: params.container,
+//                                    value: x
+//                                }));
+//                            }
+//                        } else {
                             value = column.render(params.row, {
                                 lastReceivedData: _this.lastReceivedData,
                                 lastUsedOptions: _this.lastUsedOptions,
                                 container: params.container,
                                 value: params.value
                             });
-                        }
+//                        }
                     } else {
-                        if(Array.isArray(params.value)) {
-                            value = params.value.sort().join(', ');
-                        } else {
+//                        if(Array.isArray(params.value)) {
+//                            value = params.value.sort().join(', ');
+//                        } else {
                             value = params.value;
-                        }
+//                        }
                     }
 
                     if (value === null || value === undefined || value === "") {
diff --git a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js
index 8d19f66740d..5d0b89e4be4 100644
--- a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js
+++ b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js
@@ -999,10 +999,10 @@ var SampleDataGridUtil = new function() {
 
     this.getTerm = function(params, propertyType) {
         var value = params.row[propertyType.code]
-        if(Array.isArray(value)) {
-            return value.sort().toString();
-        } else {
+//        if(Array.isArray(value)) {
+//            return value.sort().toString();
+//        } else {
             return value ? value : "";
-        }
+//        }
     }
 }
\ No newline at end of file
-- 
GitLab