0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-21 17:00:29 +01:00

remove unused warning system

Dieser Commit ist enthalten in:
Angus McLeod 2024-02-23 09:22:28 +02:00
Ursprung 64b3bc41c5
Commit 1ab2262ca3
3 geänderte Dateien mit 1 neuen und 27 gelöschten Zeilen

Datei anzeigen

@ -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();

Datei anzeigen

@ -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) {

Datei anzeigen

@ -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) {