diff --git a/assets/javascripts/discourse/controllers/admin-plugins-explorer.js b/assets/javascripts/discourse/controllers/admin-plugins-explorer.js index 2207c57..da79afe 100644 --- a/assets/javascripts/discourse/controllers/admin-plugins-explorer.js +++ b/assets/javascripts/discourse/controllers/admin-plugins-explorer.js @@ -16,6 +16,7 @@ export default class PluginsExplorerController extends Controller { @service("router") router; @service dialog; @service appEvents; + @service router; @tracked sortByProperty = "last_run_at"; @tracked sortDescending = true; diff --git a/assets/javascripts/discourse/routes/group-reports-index.js b/assets/javascripts/discourse/routes/group-reports-index.js index 8b4d8a8..1aa3961 100644 --- a/assets/javascripts/discourse/routes/group-reports-index.js +++ b/assets/javascripts/discourse/routes/group-reports-index.js @@ -1,7 +1,10 @@ import { ajax } from "discourse/lib/ajax"; import DiscourseRoute from "discourse/routes/discourse"; +import { inject as service } from "@ember/service"; export default class GroupReportsIndexRoute extends DiscourseRoute { + @service router; + model() { const group = this.modelFor("group"); return ajax(`/g/${group.name}/reports`) @@ -11,7 +14,7 @@ export default class GroupReportsIndexRoute extends DiscourseRoute { group, }; }) - .catch(() => this.transitionTo("group.members", group)); + .catch(() => this.router.transitionTo("group.members", group)); } afterModel(model) { @@ -19,7 +22,7 @@ export default class GroupReportsIndexRoute extends DiscourseRoute { !model.group.get("is_group_user") && !(this.currentUser && this.currentUser.admin) ) { - this.transitionTo("group.members", model.group); + this.router.transitionTo("group.members", model.group); } } diff --git a/assets/javascripts/discourse/routes/group-reports-show.js b/assets/javascripts/discourse/routes/group-reports-show.js index 027e445..3b25b12 100644 --- a/assets/javascripts/discourse/routes/group-reports-show.js +++ b/assets/javascripts/discourse/routes/group-reports-show.js @@ -1,7 +1,10 @@ import { ajax } from "discourse/lib/ajax"; import DiscourseRoute from "discourse/routes/discourse"; +import { inject as service } from "@ember/service"; export default class GroupReportsShowRoute extends DiscourseRoute { + @service router; + model(params) { const group = this.modelFor("group"); return ajax(`/g/${group.name}/reports/${params.query_id}`) @@ -24,7 +27,7 @@ export default class GroupReportsShowRoute extends DiscourseRoute { }; }) .catch(() => { - this.transitionTo("group.members", group); + this.router.transitionTo("group.members", group); }); }