diff options
author | Martin Stockhammer <martin_s@apache.org> | 2019-03-03 00:11:52 +0100 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2019-05-03 20:48:31 +0200 |
commit | 6160966fa09e3663e0eaa0e5695c08af35c29bbf (patch) | |
tree | 8abcf41ad94c06bc721c18315a686296fb804dc8 /archiva-modules/archiva-web | |
parent | 4fe9a38bea79681223446646002c00ed72d1debb (diff) | |
download | archiva-6160966fa09e3663e0eaa0e5695c08af35c29bbf.tar.gz archiva-6160966fa09e3663e0eaa0e5695c08af35c29bbf.zip |
Adding error handling for new validations. Fix web ui tests.
(cherry picked from commit d4be8968cfb9910f335009e1538292671aa67853)
Diffstat (limited to 'archiva-modules/archiva-web')
5 files changed, 16 insertions, 9 deletions
diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties index e6261909b..a2c8e0c38 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties @@ -545,6 +545,7 @@ fileupload.errors.acceptFileTypes=Filetype not allowed fileupload.errors.maxNumberOfFiles=Max number of files exceeded fileupload.errors.uploadedBytes=Uploaded bytes exceed file size fileupload.errors.emptyResult=Empty file upload result +fileupload.errors.Unprocessable_Entity=There were illegal characters in the parameters fileupload.artifactId=Artifact ID fileupload.groupId=Group ID fileupload.version=Version @@ -555,6 +556,9 @@ fileupload.save=Save Files fileupload.upload.required=You must upload your files first. fileupload.artifacts.saved=Artifacts for ''{0}:{1}:{2}'', packaged as ''{3}'', with {4} POM Generated, were uploaded and saved on Server side to ''{5}'' repository. fileupload.deleteAll=Select All +fileupload.malformed.param=The field contains illegal characters. +fileupload.malformed.filename=The filename contains illegal characters. +fileupload.malformed.pomFile=The field pomFile has no boolean value. #reports report.title = Reports diff --git a/archiva-modules/archiva-web/archiva-webapp-test/pom.xml b/archiva-modules/archiva-web/archiva-webapp-test/pom.xml index 61a586c6d..11db3d143 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/pom.xml +++ b/archiva-modules/archiva-web/archiva-webapp-test/pom.xml @@ -811,7 +811,7 @@ <executions> <execution> <id>cleanup-files</id> - <phase>clean</phase> + <phase>initialize</phase> <goals> <goal>run</goal> </goals> diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/artifacts-management.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/artifacts-management.js index aa96a8339..ab8b307d7 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/artifacts-management.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/artifacts-management.js @@ -47,8 +47,11 @@ define("archiva.artifacts-management",["jquery","i18n","utils","jquery.tmpl","kn displayErrorMessage( $.i18n.prop("fileupload.upload.required")); return; } - var url="restServices/archivaUiServices/fileUploadService/save/"+this.repositoryId()+"/"+this.groupId()+"/"+this.artifactId(); - url+="/"+this.version()+"/"+this.packaging(); + var url="restServices/archivaUiServices/fileUploadService/save/"+encodeURI(this.repositoryId()) + +"/"+encodeURIComponent(this.groupId()) + +"/"+encodeURIComponent(this.artifactId()) + +"/"+encodeURIComponent(this.version()) + +"/"+encodeURIComponent(this.packaging()); $.log("this.generatePom():'"+this.generatePom()+"'"); if (this.generatePom()==true){ url+="?generatePom=true"; @@ -117,9 +120,9 @@ define("archiva.artifacts-management",["jquery","i18n","utils","jquery.tmpl","kn if (!data.formData){ data.formData={}; } - data.formData.pomFile = pomFile; - data.formData.classifier = classifier; - data.formData.packaging = packaging; + data.formData.pomFile = encodeURIComponent(pomFile); + data.formData.classifier = encodeURIComponent(classifier); + data.formData.packaging = encodeURIComponent(packaging); }); } }); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/utils.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/utils.js index 7c0db1ce4..5802adcd5 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/utils.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/utils.js @@ -284,7 +284,7 @@ require(["jquery","jquery.tmpl","i18n","knockout"], function(jquery,jqueryTmpl,i if (mainContent.find("#"+data.fieldName)){ var message=null; if (data.errorKey) { - message=$.i18n.prop('data.errorKey'); + message=$.i18n.prop(data.errorKey); } else { message=data.errorMessage; } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html index b377fbb96..dc6e7672c 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html @@ -653,7 +653,7 @@ {% if (file.error) { %} <td class="error" colspan="2"> <span class="label label-important">{%=$.i18n.prop('fileupload.error')%}</span> - {%=$.i18n.prop('fileupload.errors.'+[file.error]) || file.error%} + {%=$.i18n.prop('fileupload.errors.'+file.error.replace(/\s+/,'_')) || file.error%} </td> {% } else if (o.files.valid && !i) { %} <td> @@ -692,7 +692,7 @@ {% if (file.error) { %} <td class="error" colspan="2"> <span class="label label-important">{%=$.i18n.prop('fileupload.error')%}</span> - {%=$.i18n.prop('fileupload.errors.'+[file.error]) || file.error%} + {%=$.i18n.prop('fileupload.errors.'+file.error.replace(/\s+/,'_')) || file.error%} </td> {% } else { %} <td colspan="2"></td> |