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
8caad774
Commit
8caad774
authored
Feb 12, 2018
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix approve button showing closed merge requests
parent
02c15350
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
+19
-3
ee/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals_body.js
...rge_request_widget/components/approvals/approvals_body.js
+1
-1
ee/spec/features/projects/merge_requests/user_approves_merge_request_spec.rb
...ojects/merge_requests/user_approves_merge_request_spec.rb
+15
-1
spec/javascripts/approvals/approvals_body_spec.js
spec/javascripts/approvals/approvals_body_spec.js
+3
-1
No files found.
ee/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals_body.js
View file @
8caad774
...
...
@@ -65,7 +65,7 @@ export default {
};
},
showApproveButton
()
{
return
this
.
userCanApprove
&&
!
this
.
userHasApproved
;
return
this
.
userCanApprove
&&
!
this
.
userHasApproved
&&
this
.
mr
.
isOpen
;
},
showSuggestedApprovers
()
{
return
this
.
suggestedApprovers
&&
this
.
suggestedApprovers
.
length
;
...
...
ee/spec/features/projects/merge_requests/user_approves_merge_request_spec.rb
View file @
8caad774
...
...
@@ -32,10 +32,11 @@ describe 'User approves a merge request', :js do
before
do
project
.
add_developer
(
user2
)
project
.
add_developer
(
user3
)
visit
(
merge_request_path
(
merge_request
))
end
it
'shows multiple approvers beyond the needed count'
do
visit
(
merge_request_path
(
merge_request
))
click_button
(
'Approve'
)
wait_for_requests
...
...
@@ -47,6 +48,19 @@ describe 'User approves a merge request', :js do
expect
(
all
(
'.js-approver-list-member'
).
count
).
to
eq
(
3
)
end
it
"doesn't show the approve additionally when a merge request is closed"
do
merge_request_closed
=
create
(
:merge_request
,
:closed
,
source_project:
project
,
target_project:
project
)
create
(
:approval
,
merge_request:
merge_request_closed
,
user:
user
)
sign_in
(
user2
)
visit
(
merge_request_path
(
merge_request_closed
))
wait_for_requests
expect
(
page
).
not_to
have_button
(
'Approve'
)
expect
(
page
).
not_to
have_button
(
'Approve additionally'
)
end
def
sign_in_visit_merge_request
(
user
)
sign_in
(
user
)
visit
(
merge_request_path
(
merge_request
))
...
...
spec/javascripts/approvals/approvals_body_spec.js
View file @
8caad774
...
...
@@ -20,7 +20,9 @@ import ApprovalsBody from 'ee/vue_merge_request_widget/components/approvals/appr
`
);
this
.
initialData
=
{
mr
:
{},
mr
:
{
isOpen
:
true
,
},
service
:
{},
suggestedApprovers
:
[{
name
:
'
Approver 1
'
}],
userCanApprove
:
false
,
...
...
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