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 Group from "discourse/models/group";
|
||||
import { action } from "@ember/object";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
model(params) {
|
||||
|
@ -30,18 +31,18 @@ export default DiscourseRoute.extend({
|
|||
return { provider: model["provider"].get("id") };
|
||||
},
|
||||
|
||||
actions: {
|
||||
closeModal() {
|
||||
if (this.get("controller.modalShowing")) {
|
||||
this.refresh();
|
||||
this.set("controller.modalShowing", false);
|
||||
}
|
||||
|
||||
return true; // Continue bubbling up, so the modal actually closes
|
||||
},
|
||||
|
||||
refreshProvider() {
|
||||
@action
|
||||
closeModal() {
|
||||
if (this.get("controller.modalShowing")) {
|
||||
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 { action } from "@ember/object";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
model() {
|
||||
return this.store.findAll("provider");
|
||||
},
|
||||
|
||||
actions: {
|
||||
showSettings() {
|
||||
this.transitionTo("adminSiteSettingsCategory", "plugins", {
|
||||
queryParams: { filter: "chat_integration" },
|
||||
});
|
||||
},
|
||||
@action
|
||||
showSettings() {
|
||||
this.transitionTo("adminSiteSettingsCategory", "plugins", {
|
||||
queryParams: { filter: "chat_integration" },
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue