diff options
author | Vlad <vlad.bilanchuk@teamvoy.com> | 2017-09-22 19:20:44 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-10-13 11:41:49 +0100 |
commit | 945e0684afc3c22ac658dbb68005cb2ebf5ac51c (patch) | |
tree | 90cb7fdd46b13735002d0ecd4e8ae5d75c94201d /app/services/quick_actions | |
parent | 5843a43c16e007193f5e26522d1e7368a0bdb2d7 (diff) | |
download | gitlab-ce-945e0684afc3c22ac658dbb68005cb2ebf5ac51c.tar.gz |
added date parameter for time trackinggitlab-ee-1312-time-spent-at
Diffstat (limited to 'app/services/quick_actions')
-rw-r--r-- | app/services/quick_actions/interpret_service.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/app/services/quick_actions/interpret_service.rb b/app/services/quick_actions/interpret_service.rb index 955d934838b..06ac86cd5a9 100644 --- a/app/services/quick_actions/interpret_service.rb +++ b/app/services/quick_actions/interpret_service.rb @@ -381,7 +381,7 @@ module QuickActions end desc 'Add or substract spent time' - explanation do |time_spent| + explanation do |time_spent, time_spent_date| if time_spent if time_spent > 0 verb = 'Adds' @@ -394,16 +394,20 @@ module QuickActions "#{verb} #{Gitlab::TimeTrackingFormatter.output(value)} spent time." end end - params '<1h 30m | -1h 30m>' + params '<time(1h30m | -1h30m)> <date(YYYY-MM-DD)>' condition do current_user.can?(:"admin_#{issuable.to_ability_name}", issuable) end - parse_params do |raw_duration| - Gitlab::TimeTrackingFormatter.parse(raw_duration) + parse_params do |raw_time_date| + Gitlab::QuickActions::SpendTimeAndDateSeparator.new(raw_time_date).execute end - command :spend do |time_spent| + command :spend do |time_spent, time_spent_date| if time_spent - @updates[:spend_time] = { duration: time_spent, user: current_user } + @updates[:spend_time] = { + duration: time_spent, + user: current_user, + spent_at: time_spent_date + } end end |