From 5ba2ef42743bbe2ad78ad016dc0f8d7acf2b2d94 Mon Sep 17 00:00:00 2001 From: Vinoth Kannan Date: Thu, 7 Mar 2019 02:17:29 +0530 Subject: [PATCH] UX: Display error message if no time frame selected in topic status update --- .../discourse/controllers/edit-topic-timer.js.es6 | 8 ++++++++ config/locales/client.en.yml | 1 + 2 files changed, 9 insertions(+) diff --git a/app/assets/javascripts/discourse/controllers/edit-topic-timer.js.es6 b/app/assets/javascripts/discourse/controllers/edit-topic-timer.js.es6 index 07d6cb83fc3..b710c5feb5d 100644 --- a/app/assets/javascripts/discourse/controllers/edit-topic-timer.js.es6 +++ b/app/assets/javascripts/discourse/controllers/edit-topic-timer.js.es6 @@ -103,6 +103,14 @@ export default Ember.Controller.extend(ModalFunctionality, { actions: { saveTimer() { + if (!this.get("topicTimer.updateTime")) { + this.flash( + I18n.t("topic.topic_status_update.time_frame_required"), + "alert-error" + ); + return; + } + this._setTimer( this.get("topicTimer.updateTime"), this.get("topicTimer.status_type") diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index e2dfc29843d..5ae7ddc8626 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1809,6 +1809,7 @@ en: when: "When:" public_timer_types: Topic Timers private_timer_types: User Topic Timers + time_frame_required: Please select a time frame auto_update_input: none: "Select a timeframe" later_today: "Later today"