mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 06:30:15 +08:00
f9bdda84ca
1. The events table had broken styling, making each row overflow 2. It had confusing routes: `/:id` for "edit" and `/:id/events` for "show" (now it's `/:id/edit` and `/:id` respectively) 3. There previously was an unused backend action (`#edit`) - now it is used (and `web_hooks/:id/events` route has been removed) 4. There was outdated/misplaced/duplicated CSS 5. And more
37 lines
1.0 KiB
JavaScript
37 lines
1.0 KiB
JavaScript
import Controller, { inject as controller } from "@ember/controller";
|
|
import I18n from "I18n";
|
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
|
import { inject as service } from "@ember/service";
|
|
import { action } from "@ember/object";
|
|
import { alias } from "@ember/object/computed";
|
|
|
|
export default Controller.extend({
|
|
adminWebHooks: controller(),
|
|
dialog: service(),
|
|
contentTypes: alias("adminWebHooks.contentTypes"),
|
|
defaultEventTypes: alias("adminWebHooks.defaultEventTypes"),
|
|
deliveryStatuses: alias("adminWebHooks.deliveryStatuses"),
|
|
eventTypes: alias("adminWebHooks.eventTypes"),
|
|
model: alias("adminWebHooks.model"),
|
|
|
|
@action
|
|
destroy(webhook) {
|
|
return this.dialog.deleteConfirm({
|
|
message: I18n.t("admin.web_hooks.delete_confirm"),
|
|
didConfirm: async () => {
|
|
try {
|
|
await webhook.destroyRecord();
|
|
this.model.removeObject(webhook);
|
|
} catch (e) {
|
|
popupAjaxError(e);
|
|
}
|
|
},
|
|
});
|
|
},
|
|
|
|
@action
|
|
loadMore() {
|
|
this.model.loadMore();
|
|
},
|
|
});
|