From eee742c2e61923f51da100645977a87c16fbb6f4 Mon Sep 17 00:00:00 2001
From: juanf <juanf@public-docking-lee-0822.ethz.ch>
Date: Wed, 25 Apr 2018 11:17:34 +0200
Subject: [PATCH] SSDM-6451 : Bugfix, blank lines added in ELN print mode
 removed for RTF

---
 .../1/as/webapps/eln-lims/html/js/config/Profile.js       | 8 +++++++-
 .../1/as/webapps/eln-lims/html/js/util/PrintUtil.js       | 4 +++-
 2 files changed, 10 insertions(+), 2 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 715945b2854..b47239423dd 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
@@ -118,7 +118,7 @@ $.extend(DefaultProfile.prototype, {
 
 //		BigDataLink EDMs config
 		this.EDMSs = {
-//				"EXAMPLE-BS-MBPR28.D.ETHZ.CH-E96954A7" : "http://localhost:8080/download"
+//				"ADMIN-BS-MBPR28.D.ETHZ.CH-E96954A7" : "http://localhost:8080/download"
 		}
 		
 //		Jupyter integration config
@@ -129,6 +129,12 @@ $.extend(DefaultProfile.prototype, {
 		this.forcedDisableRTF = ["FREEFORM_TABLE_STATE","NAME", "SEQUENCE"];
 		this.forceMonospaceFont = ["SEQUENCE"];
 		
+		this.isRTF = function(propertytype) {
+			return (propertytype && 
+					propertytype.dataType === "MULTILINE_VARCHAR" &&
+					$.inArray(propertytype.code, this.forcedDisableRTF) === -1)
+		}
+		
 		this.isSystemProperty = function(propertytype) {
 			return (propertytype && $.inArray(propertytype.code, this.systemProperties) !== -1);
 		}
diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/PrintUtil.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/PrintUtil.js
index 36a712097a5..eb049157718 100644
--- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/PrintUtil.js
+++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/PrintUtil.js
@@ -144,7 +144,9 @@ var PrintUtil = new function() {
 					var transformerResult = profile.inspectorContentTransformer(entity, propertyCode, propertyContent);
 					isSingleColumn = transformerResult["isSingleColumn"];
 					propertyContent = transformerResult["content"];
-					propertyContent = propertyContent.replace(/\n/g, "<br />");
+					if(!profile.isRTF(propertyType)) {
+						propertyContent = propertyContent.replace(/\n/g, "<br />");
+					}
 				}
 				
 				if(propertyContent && !profile.isSystemProperty(propertyType)) { // Only show non empty properties
-- 
GitLab