Revert "DEV: Remove usage of {{action}} modifiers (#18333)" (#18469)

This reverts commit ba27ee16376c961c93a4e3854b038a42f9577613.

We found some issues with handling of cmd/ctrl/shift + click on `<a` elements
This commit is contained in:
David Taylor
2022-10-04 12:27:26 +01:00
committed by GitHub
parent ba27ee1637
commit 585c584fdb
135 changed files with 730 additions and 929 deletions

View File

@ -1,6 +1,5 @@
import Controller from "@ember/controller";
import { ajax } from "discourse/lib/ajax";
import { action } from "@ember/object";
import { alias } from "@ember/object/computed";
import discourseComputed from "discourse-common/utils/decorators";
import { popupAjaxError } from "discourse/lib/ajax-error";
@ -44,23 +43,6 @@ export default Controller.extend({
}
},
@action
showInserted(event) {
event?.preventDefault();
const webHookId = this.get("model.extras.web_hook_id");
ajax(`/admin/api/web_hooks/${webHookId}/events/bulk`, {
type: "GET",
data: { ids: this.incomingEventIds },
}).then((data) => {
const objects = data.map((webHookEvent) =>
this.store.createRecord("web-hook-event", webHookEvent)
);
this.model.unshiftObjects(objects);
this.set("incomingEventIds", []);
});
},
actions: {
loadMore() {
this.model.loadMore();
@ -79,5 +61,20 @@ export default Controller.extend({
popupAjaxError(error);
});
},
showInserted() {
const webHookId = this.get("model.extras.web_hook_id");
ajax(`/admin/api/web_hooks/${webHookId}/events/bulk`, {
type: "GET",
data: { ids: this.incomingEventIds },
}).then((data) => {
const objects = data.map((event) =>
this.store.createRecord("web-hook-event", event)
);
this.model.unshiftObjects(objects);
this.set("incomingEventIds", []);
});
},
},
});