Merge pull request #3316 from alchemy-fr/PHRAS-2894_Quarantine_allow_to_substitute_without_selecting_target-Record

PHRAS-2894  #comment merge Quarantine: allow to substitute without selecting target record, (when match only one record).
This commit is contained in:
Nicolas Maillat
2020-01-31 16:09:37 +01:00
committed by GitHub

View File

@@ -356,15 +356,20 @@
var elements = [];
var nbElement = 0;
if (nbProposals >= 1) {
if (nbProposals > 1) {
elements = $(".selected", container);
nbElement = elements.length;
} else {
return false;
} else if (nbProposals == 1) {
elements = $(".records-subititution > div", container);
} else {
return false;
}
if (nbElement === 0) {
if (nbElement === 0 && nbProposals > 1) {
alert(language.selectOneRecord);
return false;
} else if (nbElement > 1) {
alert(language.onlyOneRecord);