]> source.dussan.org Git - archiva.git/commitdiff
use remote validation for id already exists check for remote repo form
authorOlivier Lamy <olamy@apache.org>
Fri, 3 Feb 2012 18:07:51 +0000 (18:07 +0000)
committerOlivier Lamy <olamy@apache.org>
Fri, 3 Feb 2012 18:07:51 +0000 (18:07 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1240273 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js

index 5f9eb9e78319dbda56a5cc45e23c491b6357e27b..098e863cba8b9846be8df099a243050960b96f1f 100644 (file)
@@ -681,22 +681,21 @@ $(function() {
   activateRemoteRepositoryFormValidation=function(){
     // FIXME find a way to activate cronExpression validation only if downloadRemote is activated !
     var validator = $("#main-content #remote-repository-edit-form").validate({
-      /*rules: {
-        daysOlder : {
-          digits: true,
-          min: 1
-        },
-        retentionCount : {
-          digits: true,
-          min: 1,
-          max: 100
+      rules: {
+        id: {
+          required: true,
+          remote: {
+            url: "restServices/archivaUiServices/dataValidatorService/remoteRepositoryIdNotExists",
+            type: "get"
+          }
         }
-      },*/
+      },
       showErrors: function(validator, errorMap, errorList) {
         customShowError("#main-content #remote-repository-edit-form",validator,errorMap,errorMap);
       }
     });
     validator.settings.messages["cronExpression"]=$.i18n.prop("cronExpression.notvalid");
+    validator.settings.messages["id"]=$.i18n.prop("id.required.or.alreadyexists");
   }
 
   activateRemoteRepositoriesGridTab=function(){