mirror of
https://github.com/discourse/discourse.git
synced 2025-05-10 20:44:40 +08:00
UX: Always show confirmation dialog when converting themes/components (#11953)
This commit is contained in:
parent
93c25070fa
commit
04dd4a75af
@ -369,14 +369,21 @@ export default Controller.extend({
|
|||||||
|
|
||||||
switchType() {
|
switchType() {
|
||||||
const relatives = this.get("model.component")
|
const relatives = this.get("model.component")
|
||||||
? this.parentThemes
|
? this.get("model.parentThemes")
|
||||||
: this.get("model.childThemes");
|
: this.get("model.childThemes");
|
||||||
|
|
||||||
|
let message = I18n.t(`${this.convertKey}_alert_generic`);
|
||||||
|
|
||||||
if (relatives && relatives.length > 0) {
|
if (relatives && relatives.length > 0) {
|
||||||
const names = relatives.map((relative) => relative.get("name"));
|
message = I18n.t(`${this.convertKey}_alert`, {
|
||||||
|
relatives: relatives
|
||||||
|
.map((relative) => relative.get("name"))
|
||||||
|
.join(", "),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
bootbox.confirm(
|
bootbox.confirm(
|
||||||
I18n.t(`${this.convertKey}_alert`, {
|
message,
|
||||||
relatives: names.join(", "),
|
|
||||||
}),
|
|
||||||
I18n.t("no_value"),
|
I18n.t("no_value"),
|
||||||
I18n.t("yes_value"),
|
I18n.t("yes_value"),
|
||||||
(result) => {
|
(result) => {
|
||||||
@ -385,9 +392,6 @@ export default Controller.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
this.commitSwitchType();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
enableComponent() {
|
enableComponent() {
|
||||||
|
@ -4127,7 +4127,9 @@ en:
|
|||||||
convert: "Convert"
|
convert: "Convert"
|
||||||
convert_component_alert: "Are you sure you want to convert this component to theme? It will be removed as a component from %{relatives}."
|
convert_component_alert: "Are you sure you want to convert this component to theme? It will be removed as a component from %{relatives}."
|
||||||
convert_component_tooltip: "Convert this component to theme"
|
convert_component_tooltip: "Convert this component to theme"
|
||||||
|
convert_component_alert_generic: "Are you sure you want to convert this component to theme?"
|
||||||
convert_theme_alert: "Are you sure you want to convert this theme to component? It will be removed as a parent from %{relatives}."
|
convert_theme_alert: "Are you sure you want to convert this theme to component? It will be removed as a parent from %{relatives}."
|
||||||
|
convert_theme_alert_generic: "Are you sure you want to convert this theme to component?"
|
||||||
convert_theme_tooltip: "Convert this theme to component"
|
convert_theme_tooltip: "Convert this theme to component"
|
||||||
inactive_themes: "Inactive themes:"
|
inactive_themes: "Inactive themes:"
|
||||||
inactive_components: "Unused components:"
|
inactive_components: "Unused components:"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user