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
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-01-18 21:18:13 +0300
committerSean McGivern <sean@mcgivern.me.uk>2017-01-18 21:18:13 +0300
commitcc1e43da3993b6839b4dbe03ae1b8bfb81066666 (patch)
tree50a10f227bd8f08776ab5acd2e40a04f4cc8c42f /app/services/slash_commands
parentc739005849dcaecc54214fe403b4c7e8c9ab151f (diff)
parent0f3c9355c1b57a56b4027df4deb78a2520596b15 (diff)
Merge branch 'time-tracking-api' into 'master'
Time tracking API Closes #25861 See merge request !8483
Diffstat (limited to 'app/services/slash_commands')
-rw-r--r--app/services/slash_commands/interpret_service.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/app/services/slash_commands/interpret_service.rb b/app/services/slash_commands/interpret_service.rb
index a6e35d340e9..3566a8ba92f 100644
--- a/app/services/slash_commands/interpret_service.rb
+++ b/app/services/slash_commands/interpret_service.rb
@@ -274,13 +274,10 @@ module SlashCommands
current_user.can?(:"admin_#{issuable.to_ability_name}", issuable)
end
command :spend do |raw_duration|
- reduce_time = raw_duration.sub!(/\A-/, '')
time_spent = Gitlab::TimeTrackingFormatter.parse(raw_duration)
if time_spent
- time_spent *= -1 if reduce_time
-
- @updates[:spend_time] = time_spent
+ @updates[:spend_time] = { duration: time_spent, user: current_user }
end
end
@@ -299,7 +296,7 @@ module SlashCommands
current_user.can?(:"admin_#{issuable.to_ability_name}", project)
end
command :remove_time_spent do
- @updates[:spend_time] = :reset
+ @updates[:spend_time] = { duration: :reset, user: current_user }
end
# This is a dummy command, so that it appears in the autocomplete commands