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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
0bef4b97
Commit
0bef4b97
authored
Apr 05, 2016
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement review suggestions
parent
32c7e42b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
7 deletions
+6
-7
CHANGELOG
CHANGELOG
+1
-0
app/controllers/groups/milestones_controller.rb
app/controllers/groups/milestones_controller.rb
+3
-5
app/services/milestones/create_service.rb
app/services/milestones/create_service.rb
+1
-1
spec/controllers/groups/milestones_controller_spec.rb
spec/controllers/groups/milestones_controller_spec.rb
+1
-1
No files found.
CHANGELOG
View file @
0bef4b97
...
@@ -14,6 +14,7 @@ v 8.7.0 (unreleased)
...
@@ -14,6 +14,7 @@ v 8.7.0 (unreleased)
- Handle nil descriptions in Slack issue messages (Stan Hu)
- Handle nil descriptions in Slack issue messages (Stan Hu)
- Add default scope to projects to exclude projects pending deletion
- Add default scope to projects to exclude projects pending deletion
- Implement 'Groups View' as an option for dashboard preferences !3379 (Elias W.)
- Implement 'Groups View' as an option for dashboard preferences !3379 (Elias W.)
- Better errors handling when creating milestones inside groups
- Implement 'TODOs View' as an option for dashboard preferences !3379 (Elias W.)
- Implement 'TODOs View' as an option for dashboard preferences !3379 (Elias W.)
- Gracefully handle notes on deleted commits in merge requests (Stan Hu)
- Gracefully handle notes on deleted commits in merge requests (Stan Hu)
- Fix creation of merge requests for orphaned branches (Stan Hu)
- Fix creation of merge requests for orphaned branches (Stan Hu)
...
...
app/controllers/groups/milestones_controller.rb
View file @
0bef4b97
...
@@ -21,7 +21,7 @@ class Groups::MilestonesController < Groups::ApplicationController
...
@@ -21,7 +21,7 @@ class Groups::MilestonesController < Groups::ApplicationController
project_ids
=
params
[
:milestone
][
:project_ids
].
reject
(
&
:blank?
)
project_ids
=
params
[
:milestone
][
:project_ids
].
reject
(
&
:blank?
)
title
=
milestone_params
[
:title
]
title
=
milestone_params
[
:title
]
if
create_milestones
(
project_ids
,
title
)
if
create_milestones
(
project_ids
)
redirect_to
milestone_path
(
title
)
redirect_to
milestone_path
(
title
)
else
else
render_new_with_error
(
project_ids
.
empty?
)
render_new_with_error
(
project_ids
.
empty?
)
...
@@ -41,7 +41,7 @@ class Groups::MilestonesController < Groups::ApplicationController
...
@@ -41,7 +41,7 @@ class Groups::MilestonesController < Groups::ApplicationController
private
private
def
create_milestones
(
project_ids
,
title
)
def
create_milestones
(
project_ids
)
return
false
unless
project_ids
.
present?
return
false
unless
project_ids
.
present?
ActiveRecord
::
Base
.
transaction
do
ActiveRecord
::
Base
.
transaction
do
...
@@ -51,9 +51,7 @@ class Groups::MilestonesController < Groups::ApplicationController
...
@@ -51,9 +51,7 @@ class Groups::MilestonesController < Groups::ApplicationController
end
end
true
true
rescue
ActiveRecord
::
ActiveRecordError
=>
e
rescue
=>
e
flash
.
now
[
:alert
]
=
"An error occurred while creating the milestone:
#{
e
.
message
}
"
flash
.
now
[
:alert
]
=
"An error occurred while creating the milestone:
#{
e
.
message
}
"
false
false
end
end
...
...
app/services/milestones/create_service.rb
View file @
0bef4b97
...
@@ -3,7 +3,7 @@ module Milestones
...
@@ -3,7 +3,7 @@ module Milestones
def
execute
def
execute
milestone
=
project
.
milestones
.
new
(
params
)
milestone
=
project
.
milestones
.
new
(
params
)
if
milestone
.
save
if
milestone
.
save
!
event_service
.
open_milestone
(
milestone
,
current_user
)
event_service
.
open_milestone
(
milestone
,
current_user
)
end
end
...
...
spec/controllers/groups/milestones_controller_spec.rb
View file @
0bef4b97
...
@@ -27,7 +27,7 @@ describe Groups::MilestonesController do
...
@@ -27,7 +27,7 @@ describe Groups::MilestonesController do
it
"redirects to new when there are no project ids"
do
it
"redirects to new when there are no project ids"
do
post
:create
,
group_id:
group
.
id
,
milestone:
{
title:
title
,
project_ids:
[
""
]
}
post
:create
,
group_id:
group
.
id
,
milestone:
{
title:
title
,
project_ids:
[
""
]
}
expect
(
response
).
to
render_template
:new
expect
(
response
).
to
render_template
:new
expect
(
assigns
(
:milestone
).
errors
).
to_not
be_nil
expect
(
assigns
(
:milestone
).
errors
).
not_to
be_nil
end
end
end
end
end
end
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