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
a591b1c3
Commit
a591b1c3
authored
Nov 13, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't perform a JS request when deleting a membership.
parent
65faebb9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
14 deletions
+26
-14
app/assets/javascripts/members.js
app/assets/javascripts/members.js
+0
-12
app/views/shared/members/_member.html.haml
app/views/shared/members/_member.html.haml
+0
-1
changelogs/unreleased/bvl-refresh-member-listing-on-removal.yml
...logs/unreleased/bvl-refresh-member-listing-on-removal.yml
+5
-0
spec/features/groups/members/manage_members.rb
spec/features/groups/members/manage_members.rb
+5
-1
spec/features/projects/members/list_spec.rb
spec/features/projects/members/list_spec.rb
+16
-0
No files found.
app/assets/javascripts/members.js
View file @
a591b1c3
...
@@ -5,7 +5,6 @@ export default class Members {
...
@@ -5,7 +5,6 @@ export default class Members {
}
}
addListeners
()
{
addListeners
()
{
$
(
'
.project_member, .group_member
'
).
off
(
'
ajax:success
'
).
on
(
'
ajax:success
'
,
this
.
removeRow
);
$
(
'
.js-member-update-control
'
).
off
(
'
change
'
).
on
(
'
change
'
,
this
.
formSubmit
.
bind
(
this
));
$
(
'
.js-member-update-control
'
).
off
(
'
change
'
).
on
(
'
change
'
,
this
.
formSubmit
.
bind
(
this
));
$
(
'
.js-edit-member-form
'
).
off
(
'
ajax:success
'
).
on
(
'
ajax:success
'
,
this
.
formSuccess
.
bind
(
this
));
$
(
'
.js-edit-member-form
'
).
off
(
'
ajax:success
'
).
on
(
'
ajax:success
'
,
this
.
formSuccess
.
bind
(
this
));
gl
.
utils
.
disableButtonIfEmptyField
(
'
#user_ids
'
,
'
input[name=commit]
'
,
'
change
'
);
gl
.
utils
.
disableButtonIfEmptyField
(
'
#user_ids
'
,
'
input[name=commit]
'
,
'
change
'
);
...
@@ -33,17 +32,6 @@ export default class Members {
...
@@ -33,17 +32,6 @@ export default class Members {
});
});
});
});
}
}
// eslint-disable-next-line class-methods-use-this
removeRow
(
e
)
{
const
$target
=
$
(
e
.
target
);
if
(
$target
.
hasClass
(
'
btn-remove
'
))
{
$target
.
closest
(
'
.member
'
)
.
fadeOut
(
function
fadeOutMemberRow
()
{
$
(
this
).
remove
();
});
}
}
formSubmit
(
e
,
$el
=
null
)
{
formSubmit
(
e
,
$el
=
null
)
{
const
$this
=
e
?
$
(
e
.
currentTarget
)
:
$el
;
const
$this
=
e
?
$
(
e
.
currentTarget
)
:
$el
;
...
...
app/views/shared/members/_member.html.haml
View file @
a591b1c3
...
@@ -104,7 +104,6 @@
...
@@ -104,7 +104,6 @@
class:
'btn btn-remove prepend-left-10'
class:
'btn btn-remove prepend-left-10'
-
else
-
else
=
link_to
member
,
=
link_to
member
,
remote:
true
,
method: :delete
,
method: :delete
,
data:
{
confirm:
remove_member_message
(
member
)
},
data:
{
confirm:
remove_member_message
(
member
)
},
class:
'btn btn-remove prepend-left-10'
,
class:
'btn btn-remove prepend-left-10'
,
...
...
changelogs/unreleased/bvl-refresh-member-listing-on-removal.yml
0 → 100644
View file @
a591b1c3
---
title
:
Don't use JS to delete memberships from projects and groups
merge_request
:
15344
author
:
type
:
fixed
spec/features/groups/members/manage_members.rb
View file @
a591b1c3
...
@@ -44,7 +44,11 @@ feature 'Groups > Members > Manage members' do
...
@@ -44,7 +44,11 @@ feature 'Groups > Members > Manage members' do
visit
group_group_members_path
(
group
)
visit
group_group_members_path
(
group
)
accept_confirm
do
find
(
:css
,
'.project-members-page li'
,
text:
user2
.
name
).
find
(
:css
,
'a.btn-remove'
).
click
find
(
:css
,
'.project-members-page li'
,
text:
user2
.
name
).
find
(
:css
,
'a.btn-remove'
).
click
end
wait_for_requests
expect
(
page
).
not_to
have_content
(
user2
.
name
)
expect
(
page
).
not_to
have_content
(
user2
.
name
)
expect
(
group
.
users
).
not_to
include
(
user2
)
expect
(
group
.
users
).
not_to
include
(
user2
)
...
...
spec/features/projects/members/list_spec.rb
View file @
a591b1c3
...
@@ -55,6 +55,22 @@ feature 'Project members list' do
...
@@ -55,6 +55,22 @@ feature 'Project members list' do
end
end
end
end
scenario
'remove user from project'
,
:js
do
other_user
=
create
(
:user
)
project
.
add_developer
(
other_user
)
visit_members_page
accept_confirm
do
find
(
:css
,
'li.project_member'
,
text:
other_user
.
name
).
find
(
:css
,
'a.btn-remove'
).
click
end
wait_for_requests
expect
(
page
).
not_to
have_content
(
other_user
.
name
)
expect
(
project
.
users
).
not_to
include
(
other_user
)
end
scenario
'invite user to project'
,
:js
do
scenario
'invite user to project'
,
:js
do
visit_members_page
visit_members_page
...
...
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