Browse Source

Adding error handling for new validations. Fix web ui tests.

tags/archiva-2.2.4
Martin Stockhammer 5 years ago
parent
commit
d4be8968cf

+ 4
- 0
archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties View File

@@ -546,6 +546,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=Groupd ID
fileupload.version=Version
@@ -556,6 +557,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

+ 1
- 0
archiva-modules/archiva-web/archiva-webapp-test/pom.xml View File

@@ -574,6 +574,7 @@
<executions>
<execution>
<id>cleanup-files</id>
<phase>initialize</phase>
<goals>
<goal>run</goal>
</goals>

+ 8
- 5
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/artifacts-management.js View File

@@ -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);
});
}
});

+ 1
- 1
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/utils.js View File

@@ -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;
}

+ 2
- 2
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html View File

@@ -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>

Loading…
Cancel
Save