Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
author🙈 jacopo beschi 🙉 <intrip@gmail.com>2019-09-04 23:13:39 +0300
committerMayra Cabrera <mcabrera@gitlab.com>2019-09-04 23:13:39 +0300
commit9c87275f6ef0b40d905929ce5bcd5480a6dfd369 (patch)
tree91c8f480de432496ff117dc86319ff98e067c28b /lib
parent1961fd1f06d8028a971fed4adea38180999d70e9 (diff)
Show meaningful message on /due quick action with invalid date
When using /due quick action with an invalid date a meaninful error message is shown.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/quick_actions/issue_actions.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/quick_actions/issue_actions.rb b/lib/gitlab/quick_actions/issue_actions.rb
index da28fbf5be0..869627ac585 100644
--- a/lib/gitlab/quick_actions/issue_actions.rb
+++ b/lib/gitlab/quick_actions/issue_actions.rb
@@ -25,7 +25,11 @@ module Gitlab
Chronic.parse(due_date_param).try(:to_date)
end
command :due do |due_date|
- @updates[:due_date] = due_date if due_date
+ if due_date
+ @updates[:due_date] = due_date
+ else
+ @execution_message[:due] = _('Failed to set due date because the date format is invalid.')
+ end
end
desc _('Remove due date')