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
4685ef7f
Commit
4685ef7f
authored
Dec 20, 2016
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly enable/disable merge button, fix tests.
parent
925d5df7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
5 deletions
+14
-5
app/assets/javascripts/merge_request_widget/widget_store.js.es6
...sets/javascripts/merge_request_widget/widget_store.js.es6
+1
-1
app/views/projects/merge_requests/widget/_open.html.haml
app/views/projects/merge_requests/widget/_open.html.haml
+3
-1
features/project/merge_requests.feature
features/project/merge_requests.feature
+2
-2
features/steps/project/merge_requests.rb
features/steps/project/merge_requests.rb
+8
-1
No files found.
app/assets/javascripts/merge_request_widget/widget_store.js.es6
View file @
4685ef7f
...
...
@@ -23,7 +23,7 @@
initWidgetState() {
this.assignToData('showApprovals', false);
this.assignToData('disableAcceptance',
false
);
this.assignToData('disableAcceptance',
Boolean(this.rootEl.dataset.approvalPending)
);
}
initApprovals() {
...
...
app/views/projects/merge_requests/widget/_open.html.haml
View file @
4685ef7f
-
content_for
:page_specific_javascripts
do
=
page_specific_javascript_tag
(
'merge_request_widget/widget_bundle.js'
)
#merge-request-widget-app
.mr-state-widget
{
'data-endpoint'
=>
merge_request_path
(
@merge_request
)
}
-
approval_pending
=
@merge_request
.
requires_approve?
&&
!
@merge_request
.
approved?
#merge-request-widget-app
.mr-state-widget
{
'data-endpoint'
=>
merge_request_path
(
@merge_request
),
'data-approval-pending'
=>
approval_pending
}
=
render
'projects/merge_requests/widget/heading'
.mr-widget-body
-# After conflicts are resolved, the user is redirected back to the MR page.
...
...
features/project/merge_requests.feature
View file @
4685ef7f
...
...
@@ -334,14 +334,14 @@ Feature: Project Merge Requests
And
I visit project
"Shop"
merge requests page
And
merge request 'Bug NS-04' must be approved
And
I click link
"Bug NS-04"
And
I should
not see merge button
And
I should
see merge button disabled
When
I click link
"Approve"
Then
I should see approved merge request
"Bug NS-04"
Scenario
:
I
can not approve merge request if I am not an approver
Given
merge request 'Bug NS-04' must be approved by some user
And
I click link
"Bug NS-04"
And
I should
not see merge button
And
I should
see the merge button disabled
When
I should not see Approve button
And
I should see message that MR require an approval
...
...
features/steps/project/merge_requests.rb
View file @
4685ef7f
...
...
@@ -608,12 +608,19 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
step
'I should
not see merge button
'
do
step
'I should
see the merge button disabled
'
do
page
.
within
'.mr-state-widget'
do
wait_for_ajax
expect
(
page
).
to
have_button
(
'Accept Merge Request'
,
disabled:
true
)
end
end
step
'I should not see merge button'
do
page
.
within
'.mr-state-widget'
do
expect
(
page
).
not_to
have_button
(
'Accept Merge Request'
)
end
end
step
'I should not see Approve button'
do
page
.
within
'.mr-state-widget'
do
expect
(
page
).
not_to
have_button
(
"Approve"
)
...
...
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