diff --git a/app/assets/javascripts/admin/addon/controllers/admin-web-hooks-index.js b/app/assets/javascripts/admin/addon/controllers/admin-web-hooks-index.js
index c7c9420d654..87b53e2ca3c 100644
--- a/app/assets/javascripts/admin/addon/controllers/admin-web-hooks-index.js
+++ b/app/assets/javascripts/admin/addon/controllers/admin-web-hooks-index.js
@@ -16,7 +16,7 @@ export default class AdminWebHooksIndexController extends Controller {
@alias("adminWebHooks.model") model;
@action
- destroy(webhook) {
+ destroyWebhook(webhook) {
return this.dialog.deleteConfirm({
message: I18n.t("admin.web_hooks.delete_confirm"),
didConfirm: async () => {
diff --git a/app/assets/javascripts/admin/addon/controllers/admin-web-hooks-show.js b/app/assets/javascripts/admin/addon/controllers/admin-web-hooks-show.js
index 411f592d0b1..115543d3bab 100644
--- a/app/assets/javascripts/admin/addon/controllers/admin-web-hooks-show.js
+++ b/app/assets/javascripts/admin/addon/controllers/admin-web-hooks-show.js
@@ -15,7 +15,7 @@ export default class AdminWebHooksShowController extends Controller {
}
@action
- destroy() {
+ destroyWebhook() {
return this.dialog.deleteConfirm({
message: I18n.t("admin.web_hooks.delete_confirm"),
didConfirm: async () => {
diff --git a/app/assets/javascripts/admin/addon/templates/web-hooks-index.hbs b/app/assets/javascripts/admin/addon/templates/web-hooks-index.hbs
index 9db001efcbe..2af64ed2a1d 100644
--- a/app/assets/javascripts/admin/addon/templates/web-hooks-index.hbs
+++ b/app/assets/javascripts/admin/addon/templates/web-hooks-index.hbs
@@ -51,7 +51,7 @@
next(resolve));
- element = document.getElementById("dialog-holder");
- }
-
- if (!element) {
- const msg =
- "dialog-holder wrapper element not found. Unable to render dialog";
- // eslint-disable-next-line no-console
- console.error(msg, params);
- throw new Error(msg);
- }
-
this.setProperties({
message,
bodyComponent,
bodyComponentModel,
type,
- dialogInstance: new A11yDialog(element),
title,
titleElementId: title !== null ? "dialog-title" : null,
@@ -88,6 +73,18 @@ export default class DialogService extends Service {
class: params.class,
});
+ await new Promise((resolve) => schedule("afterRender", resolve));
+ const element = document.getElementById("dialog-holder");
+
+ if (!element) {
+ const msg =
+ "dialog-holder wrapper element not found. Unable to render dialog";
+ // eslint-disable-next-line no-console
+ console.error(msg, params);
+ throw new Error(msg);
+ }
+
+ this.dialogInstance = new A11yDialog(element);
this.dialogInstance.show();
this.dialogInstance.on("hide", () => {
diff --git a/app/assets/javascripts/discourse/tests/acceptance/admin-plugins-test.js b/app/assets/javascripts/discourse/tests/acceptance/admin-plugins-test.js
index 357f42b8da4..52155780656 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/admin-plugins-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/admin-plugins-test.js
@@ -33,7 +33,7 @@ acceptance("Admin - Plugins", function (needs) {
);
server.put("/admin/site_settings/testplugin_enabled", () =>
- helper.response()
+ helper.response(200, {})
);
});