FIX: Remove use of InputValidation library (#92)

This was deprecated in e39d89ecd9, and stopped working following the move to Ember CLI
This commit is contained in:
David Taylor 2021-11-09 14:45:50 +00:00 committed by GitHub
parent 8ade892b38
commit 08dd442c1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,7 @@
import I18n from "I18n";
import ModalFunctionality from "discourse/mixins/modal-functionality";
import { popupAjaxError } from "discourse/lib/ajax-error";
import InputValidation from "discourse/models/input-validation";
import EmberObject from "@ember/object";
import {
default as computed,
observes,
@ -49,17 +49,17 @@ export default Ember.Controller.extend(ModalFunctionality, {
if (val === "") {
// Fail silently if field blank
return InputValidation.create({
return EmberObject.create({
failed: true,
});
} else if (!regString) {
// Pass silently if no regex available for provider
return InputValidation.create({
return EmberObject.create({
ok: true,
});
} else if (regex.test(val)) {
// Test against regex
return InputValidation.create({
return EmberObject.create({
ok: true,
reason: I18n.t(
"chat_integration.edit_channel_modal.channel_validation.ok"
@ -67,7 +67,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
});
} else {
// Failed regex
return InputValidation.create({
return EmberObject.create({
failed: true,
reason: I18n.t(
"chat_integration.edit_channel_modal.channel_validation.fail"