Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 09:20:29 +01:00
remove unused warning system
Dieser Commit ist enthalten in:
Ursprung
64b3bc41c5
Commit
1ab2262ca3
3 geänderte Dateien mit 1 neuen und 27 gelöschten Zeilen
|
@ -197,25 +197,7 @@ export default Component.extend({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const step = this.step;
|
this.step.validate();
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (step.get("valid")) {
|
if (step.get("valid")) {
|
||||||
this.advance();
|
this.advance();
|
||||||
|
|
|
@ -25,7 +25,6 @@ export default EmberObject.extend(ValidState, {
|
||||||
type: null,
|
type: null,
|
||||||
value: null,
|
value: null,
|
||||||
required: null,
|
required: null,
|
||||||
warning: null,
|
|
||||||
|
|
||||||
@discourseComputed("wizardId", "stepId", "id")
|
@discourseComputed("wizardId", "stepId", "id")
|
||||||
i18nKey(wizardId, stepId, id) {
|
i18nKey(wizardId, stepId, id) {
|
||||||
|
|
|
@ -35,19 +35,12 @@ export default EmberObject.extend(ValidState, {
|
||||||
|
|
||||||
validate() {
|
validate() {
|
||||||
let allValid = true;
|
let allValid = true;
|
||||||
const result = { warnings: [] };
|
|
||||||
|
|
||||||
this.fields.forEach((field) => {
|
this.fields.forEach((field) => {
|
||||||
allValid = allValid && field.check();
|
allValid = allValid && field.check();
|
||||||
const warning = field.get("warning");
|
|
||||||
if (warning) {
|
|
||||||
result.warnings.push(warning);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.setValid(allValid);
|
this.setValid(allValid);
|
||||||
|
|
||||||
return result;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
fieldError(id, description) {
|
fieldError(id, description) {
|
||||||
|
|
Laden …
In neuem Issue referenzieren