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:
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;
|
||||
}
|
||||
|
||||
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();
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Laden …
In neuem Issue referenzieren