feat: Regulären Ausdruck zur Überprüfung der Stadt im Frontend hinzugefügt.
This commit is contained in:
@@ -170,6 +170,8 @@ class App {
|
||||
async handleFinish(event) {
|
||||
const iJSON = await this.Instance.exportInstantJSON()
|
||||
const iFormFieldValues = await iJSON.formFieldValues;
|
||||
|
||||
//check required
|
||||
const iReqFields = iFormFieldValues.filter(f => Annotation.isFieldRequired(f))
|
||||
const hasEmptyReq = iReqFields.some(f => (f.value === undefined || f.value === null || f.value === ""))
|
||||
|
||||
@@ -182,6 +184,20 @@ class App {
|
||||
return false;
|
||||
}
|
||||
|
||||
//check city
|
||||
const city_regex = new RegExp("^[a-zA-Z\\u0080-\\u024F]+(?:([\\ \\-\\']|(\\.\\ ))[a-zA-Z\\u0080-\\u024F]+)*$")
|
||||
const iCityFields = iFormFieldValues.filter(f => Annotation.isCityField(f))
|
||||
for(var f of iCityFields)
|
||||
if(!city_regex.test(f.value)){
|
||||
Swal.fire({
|
||||
title: 'Warnung',
|
||||
text: `Bitte überprüfen Sie die eingegebene Ortsangabe "${f.value}" auf korrekte Formatierung. Beispiele für richtige Formate sind: München, Île-de-France, Sauðárkrókur, San Francisco, St. Catharines usw.`,
|
||||
icon: 'warning',
|
||||
})
|
||||
return false;
|
||||
}
|
||||
|
||||
//check # of signature
|
||||
const validationResult = await this.validateAnnotations(this.signatureCount)
|
||||
if (validationResult === false) {
|
||||
Swal.fire({
|
||||
|
||||
Reference in New Issue
Block a user