Skip to content
Snippets Groups Projects
Commit 87f15c94 authored by juanf's avatar juanf
Browse files

SSDM-1980 : Strict validation, the user needs to select all storage properties to the system.

SVN: 34142
parent dd41e73a
No related branches found
No related tags found
No related merge requests found
......@@ -277,23 +277,44 @@ function StorageController(configOverride) {
//
this.isValid = function(callback) {
var _this = this;
this._isUserTypingExistingBox(function(error1) {
if(error1) {
Util.showError(error1, function() {}, true);
this._isValidState(function(error0) {
if(error0) {
Util.showError(error0, function() {}, true);
callback(false);
} else {
_this._isPositionAlreadyUsed(function(error2) {
if(error2) {
Util.showError(error2, function() {}, true);
_this._isUserTypingExistingBox(function(error1) {
if(error1) {
Util.showError(error1, function() {}, true);
callback(false);
} else {
callback(true);
_this._isPositionAlreadyUsed(function(error2) {
if(error2) {
Util.showError(error2, function() {}, true);
callback(false);
} else {
callback(true);
}
});
}
});
}
});
}
this._isValidState = function(callback) {
if(!this._storageModel.row || !this._storageModel.column) {
callback("Select a rack please.");
} else if(!this._storageModel.boxName) {
callback("Select a box please.");
} else if(!this._storageModel.boxSize) {
callback("Select a box size please.");
} else if(!this._storageModel.boxPosition) {
callback("Select a box position please.");
} else {
callback(null);
}
}
this._isPositionAlreadyUsed = function(callback) {
var _this = this;
// Check user don't selects a position already selected by a sample that is not the binded one
......
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