From 385b90e1a33400ede0ef7091e1e772e749e87457 Mon Sep 17 00:00:00 2001
From: juanf <juanf@bsse-bs-dock-dhcp-447.ethz.ch>
Date: Wed, 22 Aug 2018 14:51:39 +0200
Subject: [PATCH] SSDM-6971 : tweaks

---
 .../Shared/widgets/MoveEntityController.js    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/Shared/widgets/MoveEntityController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/Shared/widgets/MoveEntityController.js
index 4640e379346..5ca79c7a5e5 100644
--- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/Shared/widgets/MoveEntityController.js
+++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/Shared/widgets/MoveEntityController.js
@@ -24,6 +24,13 @@ function MoveEntityController(entityType, entityPermId) {
 	}
 	
 	this.move = function() {
+		var done = function() {
+			Util.showSuccess("Move successfull", function() { Util.unblockUI(); });
+		};
+		var fail = function(error) {
+			Util.showError("Move failed: " + JSON.stringify(error));
+		};
+		
 		switch(entityType) {
 			case "EXPERIMENT":
 				require([ "as/dto/experiment/update/ExperimentUpdate"], 
@@ -31,9 +38,7 @@ function MoveEntityController(entityType, entityPermId) {
 			            var experimentUpdate = new ExperimentUpdate();
 			            experimentUpdate.setExperimentId(moveEntityModel.entity.getIdentifier());
 			 			experimentUpdate.setProjectId(moveEntityModel.selected.getIdentifier());
-			            mainController.openbisV3.updateExperiments([ experimentUpdate ]).done(function() {
-			                Util.showSuccess("Entity successfully moved.", function() { Util.unblockUI(); });
-			            });
+			            mainController.openbisV3.updateExperiments([ experimentUpdate ]).done(done).fail(fail);
         			});
 				break;
 			case "SAMPLE":
@@ -42,9 +47,7 @@ function MoveEntityController(entityType, entityPermId) {
 			            var sampleUpdate = new SampleUpdate();
 			            sampleUpdate.setSampleId(moveEntityModel.entity.getIdentifier());
 			 			sampleUpdate.setExperimentId(moveEntityModel.selected.getIdentifier());
-			            mainController.openbisV3.updateSamples([ sampleUpdate ]).done(function() {
-			            		Util.showSuccess("Entity successfully moved.", function() { Util.unblockUI(); });
-			            });
+			            mainController.openbisV3.updateSamples([ sampleUpdate ]).done(done).fail(fail);
         			});
 				break;
 			case "DATASET":
@@ -62,9 +65,7 @@ function MoveEntityController(entityType, entityPermId) {
 							break;
 						}
 						
-			            mainController.openbisV3.updateDataSets([ datasetUpdate ]).done(function() {
-			            		Util.showSuccess("Entity successfully moved.", function() { Util.unblockUI(); });
-			            });
+			            mainController.openbisV3.updateDataSets([ datasetUpdate ]).done(done).fail(fail);
         			});
 				break;
 		}
-- 
GitLab