From 7c4063bb0cb55e3059879bb27fce3db93976cdb3 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 3 Feb 2012 18:07:51 +0000 Subject: [PATCH] use remote validation for id already exists check for remote repo form git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1240273 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/webapp/js/archiva/repositories.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js index 5f9eb9e78..098e863cb 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js @@ -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(){ -- 2.39.5