Skip to content
Snippets Groups Projects
Commit 51c50d1c authored by piotr.kupczyk@id.ethz.ch's avatar piotr.kupczyk@id.ethz.ch Committed by vkovtun
Browse files

SSDM-13720 : when an entity is moved from one entity to another, navigation...

SSDM-13720 : when an entity is moved from one entity to another, navigation menu is not updated - move sample triggered from a table
parent 9772c403
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
...@@ -48,35 +48,29 @@ function MoveSampleController(samplePermIdOrIds, successAction) { ...@@ -48,35 +48,29 @@ function MoveSampleController(samplePermIdOrIds, successAction) {
mainController.serverFacade.moveSample( mainController.serverFacade.moveSample(
_this._moveSampleModel.samples.map(s => s.permId), experimentIdentifier, _this._moveSampleModel.samples.map(s => s.permId), experimentIdentifier,
function() { function() {
var msg = ELNDictionary.Sample + " " + _this._moveSampleModel.samples[0].identifier; mainController.serverFacade.getExperimentOrNull(experimentIdentifier, function(experiment){
if (_this._moveSampleModel.samples.length > 1) { var msg = ELNDictionary.Sample + " " + _this._moveSampleModel.samples[0].identifier;
msg = _this._moveSampleModel.samples.length + " " + ELNDictionary.Samples; if (_this._moveSampleModel.samples.length > 1) {
} msg = _this._moveSampleModel.samples.length + " " + ELNDictionary.Samples;
Util.showSuccess(msg + " moved to " + _this._moveSampleModel.experimentIdentifier, function() { }
Util.unblockUI() Util.showSuccess(msg + " moved to " + _this._moveSampleModel.experimentIdentifier, async function() {
if (_this._moveSampleModel.successAction) { Util.unblockUI()
//Delete Samples from current experiment menu
_this._moveSampleModel.samples.forEach(function(sample) { //Refresh old experiment
mainController.sideMenu.deleteNodeByEntityPermId("SAMPLE", sample.permId, true); await mainController.sideMenu.refreshNodeParentByPermId("SAMPLE", _this._moveSampleModel.samples[0].permId);
});
//Add Experiment to the menu if new
if(_this._moveSampleModel.isNewExperiment) {
var experimentIdentifier = _this._moveSampleModel.experimentIdentifier;
var isInventory = profile.isInventorySpace(IdentifierUtil.getSpaceCodeFromIdentifier(experimentIdentifier));
mainController.sideMenu.refreshExperiment({
identifier: _this._moveSampleModel.experimentIdentifier,
code: IdentifierUtil.getCodeFromIdentifier(experimentIdentifier),
properties : {}
}, isInventory);
}
//Refresh Experiment where sample was moved // Refresh new experiment
mainController.sideMenu.refreshNodeParentByPermId("SAMPLE", _this._moveSampleModel.samples[0].permId); if(_this._moveSampleModel.isNewExperiment){
await mainController.sideMenu.refreshNodeByPermId("PROJECT", experiment.getProject().getPermId().getPermId());
} else {
await mainController.sideMenu.refreshNodeByPermId("EXPERIMENT", experiment.getPermId().getPermId());
}
_this._moveSampleModel.successAction(); if(_this._moveSampleModel.successAction){
} _this._moveSampleModel.successAction();
}); }
});
})
}); });
} }
if (this._moveSampleModel.isNewExperiment) { if (this._moveSampleModel.isNewExperiment) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment