mirror of
https://github.com/discourse/discourse.git
synced 2025-02-12 12:48:29 +08:00
2228f75645
+ native classes + tracked properties - Ember.Object - Ember.Evented - observers - mixins - computed/discourseComputed Also removes unused wizard infrastructure for warnings. It appears that once upon on time, either the server can generate warnings, or some client code can generate them, which requires an extra confirmation from the user before they can continue to the next step. This code is not tested and appears unused and defunct. Nothing generates such warning and the server does not serialize them. Extracted from https://github.com/discourse/discourse/pull/23678
30 lines
732 B
JavaScript
30 lines
732 B
JavaScript
import Controller from "@ember/controller";
|
|
import { action } from "@ember/object";
|
|
import { inject as service } from "@ember/service";
|
|
import getUrl from "discourse-common/lib/get-url";
|
|
|
|
export default Controller.extend({
|
|
router: service(),
|
|
|
|
wizard: null,
|
|
step: null,
|
|
|
|
@action
|
|
goNext(response) {
|
|
const next = this.step.next;
|
|
|
|
if (response?.refresh_required) {
|
|
document.location = getUrl(`/wizard/steps/${next}`);
|
|
} else if (response?.success && next) {
|
|
this.router.transitionTo("wizard.step", next);
|
|
} else if (response?.success) {
|
|
this.router.transitionTo("discovery.latest");
|
|
}
|
|
},
|
|
|
|
@action
|
|
goBack() {
|
|
this.router.transitionTo("wizard.step", this.step.previous);
|
|
},
|
|
});
|