DEV: migrate routes to the new @action pattern (#100)
This commit is contained in:
parent
e9522c5f7d
commit
356a1d1a72
|
@ -1,5 +1,6 @@
|
||||||
import DiscourseRoute from "discourse/routes/discourse";
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
import Group from "discourse/models/group";
|
import Group from "discourse/models/group";
|
||||||
|
import { action } from "@ember/object";
|
||||||
|
|
||||||
export default DiscourseRoute.extend({
|
export default DiscourseRoute.extend({
|
||||||
model(params) {
|
model(params) {
|
||||||
|
@ -30,18 +31,18 @@ export default DiscourseRoute.extend({
|
||||||
return { provider: model["provider"].get("id") };
|
return { provider: model["provider"].get("id") };
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
@action
|
||||||
closeModal() {
|
closeModal() {
|
||||||
if (this.get("controller.modalShowing")) {
|
if (this.get("controller.modalShowing")) {
|
||||||
this.refresh();
|
|
||||||
this.set("controller.modalShowing", false);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true; // Continue bubbling up, so the modal actually closes
|
|
||||||
},
|
|
||||||
|
|
||||||
refreshProvider() {
|
|
||||||
this.refresh();
|
this.refresh();
|
||||||
},
|
this.set("controller.modalShowing", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true; // Continue bubbling up, so the modal actually closes
|
||||||
|
},
|
||||||
|
|
||||||
|
@action
|
||||||
|
refreshProvider() {
|
||||||
|
this.refresh();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
import DiscourseRoute from "discourse/routes/discourse";
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
|
import { action } from "@ember/object";
|
||||||
|
|
||||||
export default DiscourseRoute.extend({
|
export default DiscourseRoute.extend({
|
||||||
model() {
|
model() {
|
||||||
return this.store.findAll("provider");
|
return this.store.findAll("provider");
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
@action
|
||||||
showSettings() {
|
showSettings() {
|
||||||
this.transitionTo("adminSiteSettingsCategory", "plugins", {
|
this.transitionTo("adminSiteSettingsCategory", "plugins", {
|
||||||
queryParams: { filter: "chat_integration" },
|
queryParams: { filter: "chat_integration" },
|
||||||
});
|
});
|
||||||
},
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue