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
e82f629b
Commit
e82f629b
authored
Feb 16, 2018
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the #update action from Project/Member controllers to the MembershipActions concern
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
bf410636
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
24 deletions
+16
-24
app/controllers/concerns/membership_actions.rb
app/controllers/concerns/membership_actions.rb
+12
-0
app/controllers/groups/group_members_controller.rb
app/controllers/groups/group_members_controller.rb
+0
-8
app/controllers/projects/project_members_controller.rb
app/controllers/projects/project_members_controller.rb
+0
-8
app/views/groups/group_members/update.js.haml
app/views/groups/group_members/update.js.haml
+0
-4
app/views/projects/project_members/update.js.haml
app/views/projects/project_members/update.js.haml
+0
-4
app/views/shared/members/update.js.haml
app/views/shared/members/update.js.haml
+4
-0
spec/features/groups/members/manage_members_spec.rb
spec/features/groups/members/manage_members_spec.rb
+0
-0
No files found.
app/controllers/concerns/membership_actions.rb
View file @
e82f629b
...
...
@@ -14,6 +14,18 @@ module MembershipActions
end
end
def
update
member
=
membershipable
.
members_and_requesters
.
find
(
params
[
:id
])
@member
=
Members
::
UpdateService
.
new
(
membershipable
,
current_user
,
member_params
)
.
execute
(
member
)
.
present
(
current_user:
current_user
)
respond_to
do
|
format
|
format
.
js
{
render
'shared/members/update'
}
end
end
def
destroy
member
=
membershipable
.
members_and_requesters
.
find
(
params
[
:id
])
Members
::
DestroyService
.
new
(
membershipable
,
current_user
,
params
)
...
...
app/controllers/groups/group_members_controller.rb
View file @
e82f629b
...
...
@@ -27,14 +27,6 @@ class Groups::GroupMembersController < Groups::ApplicationController
@group_member
=
@group
.
group_members
.
new
end
def
update
member
=
@group
.
members_and_requesters
.
find
(
params
[
:id
])
@group_member
=
Members
::
UpdateService
.
new
(
@group
,
current_user
,
member_params
)
.
execute
(
member
)
.
present
(
current_user:
current_user
)
end
def
resend_invite
redirect_path
=
group_group_members_path
(
@group
)
...
...
app/controllers/projects/project_members_controller.rb
View file @
e82f629b
...
...
@@ -26,14 +26,6 @@ class Projects::ProjectMembersController < Projects::ApplicationController
@project_member
=
@project
.
project_members
.
new
end
def
update
member
=
@project
.
members_and_requesters
.
find
(
params
[
:id
])
@project_member
=
Members
::
UpdateService
.
new
(
@project
,
current_user
,
member_params
)
.
execute
(
member
)
.
present
(
current_user:
current_user
)
end
def
resend_invite
redirect_path
=
project_project_members_path
(
@project
)
...
...
app/views/groups/group_members/update.js.haml
deleted
100644 → 0
View file @
bf410636
:plain
var $listItem = $('
#{
escape_javascript
(
render
(
'shared/members/member'
,
member:
@group_member
))
}
');
$("##{dom_id(@group_member)} .list-item-name").replaceWith($listItem.find('.list-item-name'));
gl.utils.localTimeAgo($('.js-timeago'), $("##{dom_id(@group_member)}"));
app/views/projects/project_members/update.js.haml
deleted
100644 → 0
View file @
bf410636
:plain
var $listItem = $('
#{
escape_javascript
(
render
(
'shared/members/member'
,
member:
@project_member
))
}
');
$("##{dom_id(@project_member)} .list-item-name").replaceWith($listItem.find('.list-item-name'));
gl.utils.localTimeAgo($('.js-timeago'), $("##{dom_id(@project_member)}"));
app/views/shared/members/update.js.haml
0 → 100644
View file @
e82f629b
:plain
var $listItem = $('
#{
escape_javascript
(
render
(
'shared/members/member'
,
member:
@member
))
}
');
$("##{dom_id(@member)} .list-item-name").replaceWith($listItem.find('.list-item-name'));
gl.utils.localTimeAgo($('.js-timeago'), $("##{dom_id(@member)}"));
spec/features/groups/members/manage_members.rb
→
spec/features/groups/members/manage_members
_spec
.rb
View file @
e82f629b
File moved
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