Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 01:10:28 +01:00
add router service to controllers to avoid deprecation
Dieser Commit ist enthalten in:
Ursprung
33a320021f
Commit
742239b023
2 geänderte Dateien mit 8 neuen und 3 gelöschten Zeilen
|
@ -7,8 +7,11 @@ import { selectKitContent } from "../lib/wizard";
|
|||
import { underscore } from "@ember/string";
|
||||
import Controller from "@ember/controller";
|
||||
import I18n from "I18n";
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default Controller.extend({
|
||||
router: service(),
|
||||
|
||||
queryParams: ["refresh_list"],
|
||||
loadingSubscriptions: false,
|
||||
notAuthorized: not("api.authorized"),
|
||||
|
@ -248,7 +251,7 @@ export default Controller.extend({
|
|||
.catch(popupAjaxError)
|
||||
.then((result) => {
|
||||
if (result.success) {
|
||||
this.transitionToRoute("adminWizardsApis").then(() => {
|
||||
this.router.transitionToRoute("adminWizardsApis").then(() => {
|
||||
this.send("refreshModel");
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import Controller from "@ember/controller";
|
||||
import getUrl from "discourse-common/lib/get-url";
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default Controller.extend({
|
||||
router: service(),
|
||||
wizard: null,
|
||||
step: null,
|
||||
|
||||
|
@ -15,12 +17,12 @@ export default Controller.extend({
|
|||
const wizardId = this.get("wizard.id");
|
||||
window.location.href = getUrl(`/w/${wizardId}/steps/${nextStepId}`);
|
||||
} else {
|
||||
this.transitionToRoute("customWizardStep", nextStepId);
|
||||
this.router.transitionToRoute("customWizardStep", nextStepId);
|
||||
}
|
||||
},
|
||||
|
||||
goBack() {
|
||||
this.transitionToRoute("customWizardStep", this.get("step.previous"));
|
||||
this.router.transitionToRoute("customWizardStep", this.get("step.previous"));
|
||||
},
|
||||
|
||||
showMessage(message) {
|
||||
|
|
Laden …
In neuem Issue referenzieren