aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-web/archiva-webapp
diff options
context:
space:
mode:
authorMartin Stockhammer <martin_s@apache.org>2019-03-03 00:11:52 +0100
committerMartin Stockhammer <martin_s@apache.org>2019-05-03 20:48:31 +0200
commit6160966fa09e3663e0eaa0e5695c08af35c29bbf (patch)
tree8abcf41ad94c06bc721c18315a686296fb804dc8 /archiva-modules/archiva-web/archiva-webapp
parent4fe9a38bea79681223446646002c00ed72d1debb (diff)
downloadarchiva-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/archiva-webapp')
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/artifacts-management.js13
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/utils.js2
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html4
3 files changed, 11 insertions, 8 deletions
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>