From 441620ce61c9906302eb13f06a40018d5b58157d Mon Sep 17 00:00:00 2001 From: Kelv Date: Wed, 12 Feb 2025 09:50:13 +0800 Subject: [PATCH] DEV: delete nameValidation mixin (#31275) This mixin is now ready for deletion, all uses of it has been removed from plugins. --- .../discourse/app/mixins/name-validation.js | 43 ------------------- 1 file changed, 43 deletions(-) delete mode 100644 app/assets/javascripts/discourse/app/mixins/name-validation.js diff --git a/app/assets/javascripts/discourse/app/mixins/name-validation.js b/app/assets/javascripts/discourse/app/mixins/name-validation.js deleted file mode 100644 index 47f1c009f87..00000000000 --- a/app/assets/javascripts/discourse/app/mixins/name-validation.js +++ /dev/null @@ -1,43 +0,0 @@ -import EmberObject, { computed } from "@ember/object"; -import Mixin from "@ember/object/mixin"; -import { isEmpty } from "@ember/utils"; -import deprecated from "discourse/lib/deprecated"; -import { i18n } from "discourse-i18n"; - -export default Mixin.create({ - init() { - this._super(...arguments); - - deprecated( - "NameValidation mixin is deprecated. Use the helper class from discourse/lib/name-validation-helper instead.", - { - id: "discourse.name-validation-mixin", - since: "v3.4.0.beta4-dev", - } - ); - }, - - get nameTitle() { - return i18n( - this.site.full_name_required_for_signup - ? "user.name.title" - : "user.name.title_optional" - ); - }, - - // Validate the name. - nameValidation: computed("accountName", "forceValidationReason", function () { - const { accountName, forceValidationReason } = this; - if (this.site.full_name_required_for_signup && isEmpty(accountName)) { - return EmberObject.create({ - failed: true, - ok: false, - message: i18n("user.name.required"), - reason: forceValidationReason ? i18n("user.name.required") : null, - element: document.querySelector("#new-account-name"), - }); - } - - return EmberObject.create({ ok: true }); - }), -});