diff --git a/app/assets/javascripts/dialog-holder/addon/components/dialog-holder.hbs b/app/assets/javascripts/dialog-holder/addon/components/dialog-holder.hbs
index 7a1faaa0db9..52e9808bcd7 100644
--- a/app/assets/javascripts/dialog-holder/addon/components/dialog-holder.hbs
+++ b/app/assets/javascripts/dialog-holder/addon/components/dialog-holder.hbs
@@ -20,19 +20,14 @@
{{/if}}
- {{#if (or this.dialog.message this.dialog.confirmPhrase)}}
+ {{#if (or this.dialog.message this.dialog.bodyComponent)}}
- {{#if this.dialog.message}}
-
{{this.dialog.message}}
- {{/if}}
- {{#if this.dialog.confirmPhrase}}
-
+ {{else if this.dialog.message}}
+
{{this.dialog.message}}
{{/if}}
{{/if}}
diff --git a/app/assets/javascripts/dialog-holder/addon/services/dialog.js b/app/assets/javascripts/dialog-holder/addon/services/dialog.js
index 3fed4080757..0724bbe81ca 100644
--- a/app/assets/javascripts/dialog-holder/addon/services/dialog.js
+++ b/app/assets/javascripts/dialog-holder/addon/services/dialog.js
@@ -1,21 +1,21 @@
import Service from "@ember/service";
import A11yDialog from "a11y-dialog";
import { bind } from "discourse-common/utils/decorators";
-import { isBlank } from "@ember/utils";
export default Service.extend({
- message: null,
- type: null,
dialogInstance: null,
-
+ message: null,
title: null,
titleElementId: null,
+ type: null,
+
+ bodyComponent: null,
+ bodyComponentModel: null,
confirmButtonIcon: null,
confirmButtonLabel: null,
confirmButtonClass: null,
- confirmPhrase: null,
- confirmPhraseInput: null,
+ confirmButtonDisabled: false,
cancelButtonLabel: null,
cancelButtonClass: null,
shouldDisplayCancel: null,
@@ -29,15 +29,18 @@ export default Service.extend({
dialog(params) {
const {
message,
+ bodyComponent,
+ bodyComponentModel,
type,
title,
+ confirmButtonClass = "btn-primary",
confirmButtonIcon,
confirmButtonLabel = "ok_value",
- confirmButtonClass = "btn-primary",
- cancelButtonLabel = "cancel_value",
+ confirmButtonDisabled = false,
+
cancelButtonClass = "btn-default",
- confirmPhrase,
+ cancelButtonLabel = "cancel_value",
shouldDisplayCancel,
didConfirm,
@@ -45,25 +48,25 @@ export default Service.extend({
buttons,
} = params;
- let confirmButtonDisabled = !isBlank(confirmPhrase);
-
const element = document.getElementById("dialog-holder");
this.setProperties({
message,
+ bodyComponent,
+ bodyComponentModel,
type,
dialogInstance: new A11yDialog(element),
title,
titleElementId: title !== null ? "dialog-title" : null,
- confirmButtonDisabled,
confirmButtonClass,
- confirmButtonLabel,
+ confirmButtonDisabled,
confirmButtonIcon,
- confirmPhrase,
- cancelButtonLabel,
+ confirmButtonLabel,
+
cancelButtonClass,
+ cancelButtonLabel,
shouldDisplayCancel,
didConfirm,
@@ -133,19 +136,21 @@ export default Service.extend({
reset() {
this.setProperties({
message: null,
+ bodyComponent: null,
+ bodyComponentModel: null,
type: null,
dialogInstance: null,
title: null,
titleElementId: null,
- confirmButtonLabel: null,
+ confirmButtonDisabled: false,
confirmButtonIcon: null,
- cancelButtonLabel: null,
+ confirmButtonLabel: null,
+
cancelButtonClass: null,
+ cancelButtonLabel: null,
shouldDisplayCancel: null,
- confirmPhrase: null,
- confirmPhraseInput: null,
didConfirm: null,
didCancel: null,
@@ -176,10 +181,7 @@ export default Service.extend({
},
@bind
- onConfirmPhraseInput() {
- this.set(
- "confirmButtonDisabled",
- this.confirmPhrase && this.confirmPhraseInput !== this.confirmPhrase
- );
+ enableConfirmButton() {
+ this.set("confirmButtonDisabled", false);
},
});
diff --git a/app/assets/javascripts/discourse/app/components/dialog-messages/group-delete.hbs b/app/assets/javascripts/discourse/app/components/dialog-messages/group-delete.hbs
new file mode 100644
index 00000000000..40e56d0fb87
--- /dev/null
+++ b/app/assets/javascripts/discourse/app/components/dialog-messages/group-delete.hbs
@@ -0,0 +1 @@
+{{i18n "admin.groups.delete_with_messages_confirm" count=@model.message_count}}
\ No newline at end of file
diff --git a/app/assets/javascripts/discourse/app/components/dialog-messages/second-factor-confirm-phrase.hbs b/app/assets/javascripts/discourse/app/components/dialog-messages/second-factor-confirm-phrase.hbs
new file mode 100644
index 00000000000..47faec691fc
--- /dev/null
+++ b/app/assets/javascripts/discourse/app/components/dialog-messages/second-factor-confirm-phrase.hbs
@@ -0,0 +1,32 @@
+{{i18n "user.second_factor.delete_confirm_header"}}
+
+
+ {{html-safe
+ (i18n
+ "user.second_factor.delete_confirm_instruction"
+ confirm=this.disabledString
+ )
+ }}
+
+
+