mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 16:24:17 +08:00
c34f8b65cb
As of #23867 this is now a real package, so updating the imports to use the real package name, rather than relying on the alias. The name change in the package name is because `I18n` is not a valid name as NPM packages must be all lowercase. This commit also introduces an eslint rule to prevent importing from the old I18n path. For themes/plugins, the old 'i18n' name remains functional.
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
import Controller, { inject as controller } from "@ember/controller";
|
|
import { action } from "@ember/object";
|
|
import { alias } from "@ember/object/computed";
|
|
import { inject as service } from "@ember/service";
|
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
|
import I18n from "discourse-i18n";
|
|
|
|
export default class AdminWebHooksIndexController extends Controller {
|
|
@service dialog;
|
|
@controller adminWebHooks;
|
|
|
|
@alias("adminWebHooks.contentTypes") contentTypes;
|
|
@alias("adminWebHooks.defaultEventTypes") defaultEventTypes;
|
|
@alias("adminWebHooks.deliveryStatuses") deliveryStatuses;
|
|
@alias("adminWebHooks.eventTypes") eventTypes;
|
|
@alias("adminWebHooks.model") 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();
|
|
}
|
|
}
|