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
a3040249
Commit
a3040249
authored
Sep 06, 2021
by
Jonas Wälter
Committed by
Patrick Bajao
Sep 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix 'New merge request' button
parent
2d558d25
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
4 deletions
+25
-4
app/views/projects/merge_requests/_merge_requests.html.haml
app/views/projects/merge_requests/_merge_requests.html.haml
+1
-1
app/views/projects/merge_requests/index.html.haml
app/views/projects/merge_requests/index.html.haml
+1
-1
app/views/shared/empty_states/_merge_requests.html.haml
app/views/shared/empty_states/_merge_requests.html.haml
+2
-2
spec/features/merge_requests/user_sees_empty_state_spec.rb
spec/features/merge_requests/user_sees_empty_state_spec.rb
+21
-0
No files found.
app/views/projects/merge_requests/_merge_requests.html.haml
View file @
a3040249
...
...
@@ -2,7 +2,7 @@
-
if
@merge_requests
.
present?
=
render
@merge_requests
-
else
=
render
'shared/empty_states/merge_requests'
=
render
'shared/empty_states/merge_requests'
,
button_path:
new_merge_request_path
-
if
@merge_requests
.
present?
=
paginate_collection
@merge_requests
,
total_pages:
@total_pages
app/views/projects/merge_requests/index.html.haml
View file @
a3040249
...
...
@@ -23,7 +23,7 @@
=
render
'shared/issuable/bulk_update_sidebar'
,
type: :merge_requests
.merge-requests-holder
=
render
'merge_requests'
=
render
'merge_requests'
,
new_merge_request_path:
new_merge_request_path
-
if
new_merge_request_email
.gl-text-center.gl-pt-5.gl-pb-7
.js-issueable-by-email
{
data:
{
initial_email:
new_merge_request_email
,
issuable_type:
issuable_type
,
emails_help_page_path:
help_page_path
(
'development/emails'
,
anchor:
'email-namespace'
),
quick_actions_help_path:
help_page_path
(
'user/project/quick_actions'
),
markdown_help_path:
help_page_path
(
'user/markdown'
),
reset_path:
new_issuable_address_project_path
(
@project
,
issuable_type:
issuable_type
)
}
}
...
...
app/views/shared/empty_states/_merge_requests.html.haml
View file @
a3040249
...
...
@@ -20,7 +20,7 @@
=
_
(
"To widen your search, change or remove filters above"
)
.text-center
-
if
can_create_merge_request
=
link_to
_
(
"New merge request"
),
project_new_merge_request_path
(
@project
),
class:
"gl-button btn btn-confirm"
,
title:
_
(
"New merge request"
)
=
link_to
_
(
"New merge request"
),
button_path
||
project_new_merge_request_path
(
@project
),
class:
"gl-button btn btn-confirm"
,
title:
_
(
"New merge request"
)
-
elsif
is_opened_state
&&
opened_merged_count
==
0
&&
closed_merged_count
>
0
%h4
.text-center
=
_
(
"There are no open merge requests"
)
...
...
@@ -28,7 +28,7 @@
=
_
(
"To keep this project going, create a new merge request"
)
.text-center
-
if
can_create_merge_request
=
link_to
_
(
"New merge request"
),
project_new_merge_request_path
(
@project
),
class:
"gl-button btn btn-confirm"
,
title:
_
(
"New merge request"
)
=
link_to
_
(
"New merge request"
),
button_path
||
project_new_merge_request_path
(
@project
),
class:
"gl-button btn btn-confirm"
,
title:
_
(
"New merge request"
)
-
elsif
is_closed_state
&&
opened_merged_count
>
0
&&
closed_merged_count
==
0
%h4
.text-center
=
_
(
"There are no closed merge requests"
)
...
...
spec/features/merge_requests/user_sees_empty_state_spec.rb
View file @
a3040249
...
...
@@ -3,6 +3,8 @@
require
'spec_helper'
RSpec
.
describe
'Merge request > User sees empty state'
do
include
ProjectForksHelper
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:user
)
{
project
.
creator
}
...
...
@@ -37,4 +39,23 @@ RSpec.describe 'Merge request > User sees empty state' do
expect
(
page
).
to
have_content
(
'To widen your search, change or remove filters above'
)
end
end
context
'as member of a fork'
do
let
(
:fork_user
)
{
create
(
:user
)
}
let
(
:forked_project
)
{
fork_project
(
project
,
fork_user
,
namespace:
fork_user
.
namespace
,
repository:
true
)
}
before
do
forked_project
.
add_maintainer
(
fork_user
)
sign_in
(
fork_user
)
end
it
'shows an empty state and a "New merge request" button'
do
visit
project_merge_requests_path
(
project
,
search:
'foo'
)
expect
(
page
).
to
have_selector
(
'.empty-state'
)
within
(
'.empty-state'
)
do
expect
(
page
).
to
have_link
'New merge request'
,
href:
project_new_merge_request_path
(
forked_project
)
end
end
end
end
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