Skip to content

Commit

Permalink
Remove function validation, full json schema validation in Settings.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
stephdl committed Apr 9, 2024
1 parent 00afea3 commit ff355ca
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions ui/src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -381,29 +381,6 @@ export default {
this.enroll_instance = config.enroll_instance;
this.mail_configured = config.mail_configured;
},
validateConfigureModule() {
this.clearErrors(this);
let isValidationOk = true;

function validateEmail(email) {
var re = /\S+@\S+\.\S+/;
return re.test(email);
}

if (this.receiver_emails) {
const array = this.receiver_emails.split("\n");
array.forEach((element) => {
var email = validateEmail(element.trim());
if (!email) {
this.error.receiver_emails =
this.$t("settings.bad_email_address") + " ' " + element + " '";
this.focusElement("receiver_emails");
isValidationOk = false;
}
});
}
return isValidationOk;
},
configureModuleValidationFailed(validationErrors) {
this.loading.configureModule = false;

Expand All @@ -415,11 +392,7 @@ export default {
}
},
async configureModule() {
const isValidationOk = this.validateConfigureModule();
if (!isValidationOk) {
return;
}

this.clearErrors(this);
this.loading.configureModule = true;
const taskAction = "configure-module";
const eventId = this.getUuid();
Expand Down

0 comments on commit ff355ca

Please sign in to comment.