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
47bfd841
Commit
47bfd841
authored
Jul 23, 2019
by
Eugenia Grieff
Committed by
Robert Speicher
Jul 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix haml lints
- Remove interpolation from translated string - Update PO file - Prettify index.js
parent
be6db81e
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
114 additions
and
1 deletion
+114
-1
ee/app/controllers/groups/merge_requests_controller.rb
ee/app/controllers/groups/merge_requests_controller.rb
+4
-0
ee/app/policies/ee/group_policy.rb
ee/app/policies/ee/group_policy.rb
+1
-0
ee/app/views/shared/issuable/_bulk_update_button.html.haml
ee/app/views/shared/issuable/_bulk_update_button.html.haml
+3
-1
ee/changelogs/unreleased/12719-group-bulk-edit-merge-requests-change-milestone.yml
...12719-group-bulk-edit-merge-requests-change-milestone.yml
+5
-0
ee/config/routes/group.rb
ee/config/routes/group.rb
+6
-0
ee/spec/controllers/groups/merge_requests_controller_spec.rb
ee/spec/controllers/groups/merge_requests_controller_spec.rb
+84
-0
ee/spec/routing/group_routing_spec.rb
ee/spec/routing/group_routing_spec.rb
+8
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
No files found.
ee/app/controllers/groups/merge_requests_controller.rb
0 → 100644
View file @
47bfd841
# frozen_string_literal: true
class
Groups::MergeRequestsController
<
Groups
::
BulkUpdateController
end
ee/app/policies/ee/group_policy.rb
View file @
47bfd841
...
...
@@ -97,6 +97,7 @@ module EE
rule
{
developer
}.
policy
do
enable
:read_group_security_dashboard
enable
:admin_merge_request
end
rule
{
security_dashboard_feature_disabled
}.
policy
do
...
...
ee/app/views/shared/issuable/_bulk_update_button.html.haml
View file @
47bfd841
=
button_tag
_
(
'Edit issues'
),
class:
'btn btn-default append-right-10 js-bulk-update-toggle'
-
type
=
local_assigns
.
fetch
(
:type
)
=
button_tag
_
(
"Edit %{issuable}"
)
%
{
issuable:
type
.
to_s
.
humanize
(
capitalize:
false
)},
class:
'btn btn-default append-right-10 js-bulk-update-toggle'
ee/changelogs/unreleased/12719-group-bulk-edit-merge-requests-change-milestone.yml
0 → 100644
View file @
47bfd841
---
title
:
Allow bulk editing group merge request milestones
merge_request
:
14616
author
:
type
:
added
ee/config/routes/group.rb
View file @
47bfd841
...
...
@@ -78,6 +78,12 @@ constraints(::Constraints::GroupUrlConstrainer.new) do
end
end
resources
:merge_requests
,
only:
[]
do
collection
do
post
:bulk_update
end
end
resources
:todos
,
only:
[
:create
]
resources
:boards
,
only:
[
:create
,
:update
,
:destroy
]
do
collection
do
...
...
ee/spec/controllers/groups/merge_requests_controller_spec.rb
0 → 100644
View file @
47bfd841
# frozen_string_literal: true
require
'spec_helper'
describe
Groups
::
MergeRequestsController
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
,
:public
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
group:
group
)
}
let
(
:milestone
)
{
create
(
:milestone
,
group:
group
)
}
let
(
:merge_request1
)
{
create
(
:merge_request
,
source_project:
project
,
source_branch:
'branch-1'
)
}
let
(
:merge_request2
)
{
create
(
:merge_request
,
source_project:
project
,
source_branch:
'branch-2'
)
}
describe
'POST #bulk_update'
do
subject
{
post
:bulk_update
,
params:
params
,
format: :json
}
let
(
:params
)
do
{
update:
{
milestone_id:
milestone
.
id
,
issuable_ids:
"
#{
merge_request1
.
id
}
,
#{
merge_request2
.
id
}
"
},
group_id:
group
}
end
before
do
sign_in
(
user
)
end
context
'when group bulk edit feature is not enabled'
do
before
do
stub_licensed_features
(
group_bulk_edit:
false
)
end
it
'returns 404 status'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
404
)
end
end
context
'when group bulk edit feature is enabled'
do
before
do
stub_licensed_features
(
group_bulk_edit:
true
)
end
context
'when user has permissions to bulk update merge requests'
do
before
do
group
.
add_developer
(
user
)
end
it
'returns status 200'
do
subject
expect
(
response
.
status
).
to
eq
(
200
)
end
it
'updates merge requests milestone'
do
expect
{
subject
}
.
to
change
{
merge_request1
.
reload
.
milestone
}.
from
(
nil
).
to
(
milestone
)
.
and
change
{
merge_request2
.
reload
.
milestone
}.
from
(
nil
).
to
(
milestone
)
end
end
context
'when user does not have permissions to bulk update merge requests'
do
before
do
group
.
add_reporter
(
user
)
end
it
'returns status 404'
do
subject
expect
(
response
.
status
).
to
eq
(
404
)
end
it
'does not update merge requests milestone'
do
expect
{
subject
}
.
to
not_change
{
merge_request1
.
reload
.
milestone
}
.
and
not_change
{
merge_request2
.
reload
.
milestone
}
end
end
end
end
end
ee/spec/routing/group_routing_spec.rb
View file @
47bfd841
...
...
@@ -88,4 +88,12 @@ describe 'Group routing', "routing" do
expect
(
post
(
'/groups/gitlabhq/-/issues/bulk_update'
)).
to
route_to
(
'groups/issues#bulk_update'
,
group_id:
'gitlabhq'
)
end
end
describe
'merge_requests'
do
it
'routes post to #bulk_update'
do
allow
(
Group
).
to
receive
(
:find_by_full_path
).
with
(
'gitlabhq'
,
any_args
).
and_return
(
true
)
expect
(
post
(
'/groups/gitlabhq/-/merge_requests/bulk_update'
)).
to
route_to
(
'groups/merge_requests#bulk_update'
,
group_id:
'gitlabhq'
)
end
end
end
locale/gitlab.pot
View file @
47bfd841
...
...
@@ -4797,6 +4797,9 @@ msgstr ""
msgid "Edit"
msgstr ""
msgid "Edit %{issuable}"
msgstr ""
msgid "Edit %{name}"
msgstr ""
...
...
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