Merge "Yangman - fix parameters duplicity validation"
authorMaxime Millette-Coulombe <mmcoulombe@inocybe.com>
Thu, 11 Aug 2016 22:27:10 +0000 (22:27 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 11 Aug 2016 22:27:10 +0000 (22:27 +0000)
modules/yangman-resources/src/main/resources/yangman/models/parameterslist.model.js

index b304bf9ee45bcbd48bd6af436b672fde877922df..bcbd560cf3d6af201d8f7687cfaea9e3f2d27c7e 100644 (file)
@@ -32,7 +32,7 @@ define(['app/yangman/models/baselist.model'], function (BaseListModel){
          * @returns {boolean}
          */
         function isNameUnique(nameValue) {
-            return self.list.filter(function (item) {
+            return nameValue.length === 0 || self.list.filter(function (item) {
                 return item.name === nameValue;
             }).length === 1;
         }