FEATURE: In the slow mode dialog make "Enabled Until" mandatory (#12701)

FEATURE: In the slow mode dialog make “Enabled Until” mandatory (#12701)

diff --git a/app/assets/javascripts/discourse/app/controllers/edit-slow-mode.js b/app/assets/javascripts/discourse/app/controllers/edit-slow-mode.js
index 65493ed..66a0a0a 100644
--- a/app/assets/javascripts/discourse/app/controllers/edit-slow-mode.js
+++ b/app/assets/javascripts/discourse/app/controllers/edit-slow-mode.js
@@ -5,7 +5,7 @@ import ModalFunctionality from "discourse/mixins/modal-functionality";
 import Topic from "discourse/models/topic";
 import { action } from "@ember/object";
 import discourseComputed from "discourse-common/utils/decorators";
-import { equal } from "@ember/object/computed";
+import { equal, or } from "@ember/object/computed";
 import { popupAjaxError } from "discourse/lib/ajax-error";
 
 export default Controller.extend(ModalFunctionality, {
@@ -16,6 +16,7 @@ export default Controller.extend(ModalFunctionality, {
   saveDisabled: false,
   enabledUntil: null,
   showCustomSelect: equal("selectedSlowMode", "custom"),
+  durationIsSet: or("hours", "minutes", "seconds"),
 
   init() {
     this._super(...arguments);
@@ -86,9 +87,9 @@ export default Controller.extend(ModalFunctionality, {
     }
   },
 
-  @discourseComputed("hours", "minutes", "seconds")
-  submitDisabled(hours, minutes, seconds) {
-    return this.saveDisabled || !(hours || minutes || seconds);
+  @discourseComputed("saveDisabled", "durationIsSet", "enabledUntil")
+  submitDisabled(saveDisabled, durationIsSet, enabledUntil) {
+    return saveDisabled || !durationIsSet || !enabledUntil;
   },
 
   _setFromSeconds(seconds) {
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index cd0b16c..3b41ff7 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -2480,7 +2480,7 @@ en:
         select: "Users may only post in this topic once every:"
         description: "To promote thoughtful discussion in fast moving or contentious discussions, users must wait before posting again in this topic."
         save: "Enable"
-        enabled_until: "(Optional) Enabled until:"
+        enabled_until: "Enabled until:"
         remove: "Disable"
         hours: "Hours:"
         minutes: "Minutes:"

GitHub sha: eb99ecf1

This commit appears in #12701 which was approved by eviltrout and jjaffeux. It was merged by AndrewPrigorshnev.