From 1ab2262ca341aea4b45600f54acca902619dc9e4 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Fri, 23 Feb 2024 09:22:28 +0200 Subject: [PATCH] remove unused warning system --- .../components/custom-wizard-step.js.es6 | 20 +------------------ .../models/custom-wizard-field.js.es6 | 1 - .../models/custom-wizard-step.js.es6 | 7 ------- 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/assets/javascripts/discourse/components/custom-wizard-step.js.es6 b/assets/javascripts/discourse/components/custom-wizard-step.js.es6 index 250f9140..cb34cd68 100644 --- a/assets/javascripts/discourse/components/custom-wizard-step.js.es6 +++ b/assets/javascripts/discourse/components/custom-wizard-step.js.es6 @@ -197,25 +197,7 @@ export default Component.extend({ return; } - const step = this.step; - const result = step.validate(); - - if (result.warnings.length) { - const unwarned = result.warnings.filter((w) => !alreadyWarned[w]); - if (unwarned.length) { - unwarned.forEach((w) => (alreadyWarned[w] = true)); - return window.bootbox.confirm( - unwarned.map((w) => I18n.t(`wizard.${w}`)).join("\n"), - I18n.t("no_value"), - I18n.t("yes_value"), - (confirmed) => { - if (confirmed) { - this.advance(); - } - } - ); - } - } + this.step.validate(); if (step.get("valid")) { this.advance(); diff --git a/assets/javascripts/discourse/models/custom-wizard-field.js.es6 b/assets/javascripts/discourse/models/custom-wizard-field.js.es6 index 2afe79d9..9dbbb8f4 100644 --- a/assets/javascripts/discourse/models/custom-wizard-field.js.es6 +++ b/assets/javascripts/discourse/models/custom-wizard-field.js.es6 @@ -25,7 +25,6 @@ export default EmberObject.extend(ValidState, { type: null, value: null, required: null, - warning: null, @discourseComputed("wizardId", "stepId", "id") i18nKey(wizardId, stepId, id) { diff --git a/assets/javascripts/discourse/models/custom-wizard-step.js.es6 b/assets/javascripts/discourse/models/custom-wizard-step.js.es6 index f7cdc497..5c3ce3ab 100644 --- a/assets/javascripts/discourse/models/custom-wizard-step.js.es6 +++ b/assets/javascripts/discourse/models/custom-wizard-step.js.es6 @@ -35,19 +35,12 @@ export default EmberObject.extend(ValidState, { validate() { let allValid = true; - const result = { warnings: [] }; this.fields.forEach((field) => { allValid = allValid && field.check(); - const warning = field.get("warning"); - if (warning) { - result.warnings.push(warning); - } }); this.setValid(allValid); - - return result; }, fieldError(id, description) {