Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2a2e2906
Commit
2a2e2906
authored
Oct 29, 2016
by
Ruben Davila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ability to set or overwrite a time estimate for Issues/MergeRequests.
parent
6eeba418
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
3 deletions
+41
-3
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+2
-1
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+1
-0
app/services/slash_commands/interpret_service.rb
app/services/slash_commands/interpret_service.rb
+6
-2
db/migrate/20161030005533_add_estimate_to_issuables.rb
db/migrate/20161030005533_add_estimate_to_issuables.rb
+30
-0
db/schema.rb
db/schema.rb
+2
-0
No files found.
app/controllers/projects/issues_controller.rb
View file @
2a2e2906
...
...
@@ -221,7 +221,8 @@ class Projects::IssuesController < Projects::ApplicationController
def
issue_params
params
.
require
(
:issue
).
permit
(
:title
,
:assignee_id
,
:position
,
:description
,
:confidential
,
:weight
,
:milestone_id
,
:due_date
,
:state_event
,
:task_num
,
:lock_version
,
label_ids:
[]
:milestone_id
,
:due_date
,
:state_event
,
:task_num
,
:lock_version
,
:time_estimate
,
label_ids:
[],
)
end
end
app/controllers/projects/merge_requests_controller.rb
View file @
2a2e2906
...
...
@@ -674,6 +674,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
approvals_before_merge
approver_group_ids
approver_ids
time_estimate
]
end
...
...
app/services/slash_commands/interpret_service.rb
View file @
2a2e2906
...
...
@@ -251,10 +251,14 @@ module SlashCommands
desc
'Set estimate'
params
'e.g: 3h 30m'
condition
do
issuable
.
persisted?
&&
current_user
.
can?
(
:"update_
#{
issuable
.
to_ability_name
}
"
,
issuable
)
current_user
.
can?
(
:"admin_
#{
issuable
.
to_ability_name
}
"
,
project
)
end
command
:estimate
do
|
raw_duration
|
begin
@updates
[
:estimate
]
=
ChronicDuration
.
parse
(
raw_duration
,
default_unit:
'hours'
)
rescue
ChronicDuration
::
DurationParseError
# do nothing
end
end
def
find_label_ids
(
labels_param
)
...
...
db/migrate/20161030005533_add_estimate_to_issuables.rb
0 → 100644
View file @
2a2e2906
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
AddEstimateToIssuables
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# migration requires downtime.
# DOWNTIME_REASON = ''
# When using the methods "add_concurrent_index" or "add_column_with_default"
# you must disable the use of transactions as these methods can not run in an
# existing transaction. When using "add_concurrent_index" make sure that this
# method is the _only_ method called in the migration, any other changes
# should go in a separate migration. This ensures that upon failure _only_ the
# index creation fails and can be retried or reverted easily.
#
# To disable transactions uncomment the following line and remove these
# comments:
# disable_ddl_transaction!
def
change
add_column
:issues
,
:time_estimate
,
:integer
add_column
:merge_requests
,
:time_estimate
,
:integer
end
end
db/schema.rb
View file @
2a2e2906
...
...
@@ -560,6 +560,7 @@ ActiveRecord::Schema.define(version: 20161106185620) do
t
.
integer
"lock_version"
t
.
text
"title_html"
t
.
text
"description_html"
t
.
integer
"time_estimate"
end
add_index
"issues"
,
[
"assignee_id"
],
name:
"index_issues_on_assignee_id"
,
using: :btree
...
...
@@ -756,6 +757,7 @@ ActiveRecord::Schema.define(version: 20161106185620) do
t
.
integer
"lock_version"
t
.
text
"title_html"
t
.
text
"description_html"
t
.
integer
"time_estimate"
end
add_index
"merge_requests"
,
[
"assignee_id"
],
name:
"index_merge_requests_on_assignee_id"
,
using: :btree
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment