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
3eba988c
Commit
3eba988c
authored
Oct 22, 2021
by
Coung Ngo
Committed by
Kushal Pandya
Oct 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve related merge requests markup
parent
55f670f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
58 deletions
+44
-58
app/assets/javascripts/related_merge_requests/components/related_merge_requests.vue
...ated_merge_requests/components/related_merge_requests.vue
+38
-45
spec/features/issuables/markdown_references/internal_references_spec.rb
...issuables/markdown_references/internal_references_spec.rb
+4
-11
spec/frontend/related_merge_requests/components/related_merge_requests_spec.js
..._merge_requests/components/related_merge_requests_spec.js
+2
-2
No files found.
app/assets/javascripts/related_merge_requests/components/related_merge_requests.vue
View file @
3eba988c
...
@@ -64,58 +64,51 @@ export default {
...
@@ -64,58 +64,51 @@ export default {
</
script
>
</
script
>
<
template
>
<
template
>
<div
<div
v-if=
"isFetchingMergeRequests || (!isFetchingMergeRequests && totalCount)"
>
v-if=
"isFetchingMergeRequests || (!isFetchingMergeRequests && totalCount)"
<div
class=
"card card-slim gl-mt-5"
>
id=
"related-merge-requests"
>
<div
id=
"merge-requests"
class=
"card card-slim mt-3"
>
<div
class=
"card-header"
>
<div
class=
"card-header"
>
<div
class=
"card-title mt-0 mb-0 h5 merge-requests-title position-relative"
>
<div
class=
"card-title gl-relative gl-display-flex gl-align-items-center gl-line-height-20 gl-font-weight-bold gl-m-0"
>
<gl-link
<gl-link
id=
"user-content-related-merge-requests"
class=
"anchor gl-absolute gl-text-decoration-none"
class=
"anchor position-absolute text-decoration-none"
href=
"#related-merge-requests"
href=
"#related-merge-requests"
aria-
hidden=
"true
"
aria-
labelledby=
"related-merge-requests
"
/>
/>
<
span
class=
"mr-1
"
>
<
h3
id=
"related-merge-requests"
class=
"gl-font-base gl-m-0
"
>
{{
__
(
'
Related merge requests
'
)
}}
{{
__
(
'
Related merge requests
'
)
}}
</span>
</h3>
<div
v-if=
"totalCount"
class=
"d-inline-flex lh-100 align-middle"
>
<template
v-if=
"totalCount"
>
<div
<gl-icon
name=
"merge-request"
class=
"gl-ml-5 gl-mr-2 gl-text-gray-500"
/>
class=
"mr-count-badge gl-display-inline-flex gl-align-items-center gl-py-2 gl-px-3"
<span
data-testid=
"count"
>
{{
totalCount
}}
</span>
>
</
template
>
<svg
class=
"s16 mr-1 text-secondary"
>
<gl-icon
name=
"merge-request"
class=
"mr-1 text-secondary"
/>
</svg>
<span
class=
"js-items-count"
>
{{
totalCount
}}
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<gl-loading-icon
<div
v-if=
"isFetchingMergeRequests"
class=
"qa-related-merge-requests-loading-icon"
>
v-if=
"isFetchingMergeRequests"
<gl-loading-icon
size=
"sm"
label=
"Fetching related merge requests"
class=
"py-2"
/>
size=
"sm"
</div>
label=
"Fetching related merge requests"
<ul
v-else
class=
"content-list related-items-list"
>
class=
"gl-py-3"
<li
v-for=
"mr in mergeRequests"
:key=
"mr.id"
class=
"list-item pt-0 pb-0"
>
/>
<related-issuable-item
<ul
v-else
class=
"content-list related-items-list"
>
:id-key=
"mr.id"
<li
v-for=
"mr in mergeRequests"
:key=
"mr.id"
class=
"list-item gl-m-0! gl-p-0!"
>
:display-reference=
"mr.reference"
<related-issuable-item
:title=
"mr.title"
:id-key=
"mr.id"
:milestone=
"mr.milestone"
:display-reference=
"mr.reference"
:assignees=
"getAssignees(mr)"
:title=
"mr.title"
:created-at=
"mr.created_at"
:milestone=
"mr.milestone"
:closed-at=
"mr.closed_at"
:assignees=
"getAssignees(mr)"
:merged-at=
"mr.merged_at"
:created-at=
"mr.created_at"
:path=
"mr.web_url"
:closed-at=
"mr.closed_at"
:state=
"mr.state"
:merged-at=
"mr.merged_at"
:is-merge-request=
"true"
:path=
"mr.web_url"
:pipeline-status=
"mr.head_pipeline && mr.head_pipeline.detailed_status"
:state=
"mr.state"
path-id-separator=
"!"
:is-merge-request=
"true"
/>
:pipeline-status=
"mr.head_pipeline && mr.head_pipeline.detailed_status"
</li>
path-id-separator=
"!"
</ul>
/>
</div>
</li>
</ul>
</div>
</div>
<div
<div
v-if=
"hasClosingMergeRequest && !isFetchingMergeRequests"
v-if=
"hasClosingMergeRequest && !isFetchingMergeRequests"
...
...
spec/features/issuables/markdown_references/internal_references_spec.rb
View file @
3eba988c
...
@@ -53,9 +53,7 @@ RSpec.describe "Internal references", :js do
...
@@ -53,9 +53,7 @@ RSpec.describe "Internal references", :js do
end
end
it
"doesn't show any references"
,
quarantine:
'https://gitlab.com/gitlab-org/gitlab/-/issues/257832'
do
it
"doesn't show any references"
,
quarantine:
'https://gitlab.com/gitlab-org/gitlab/-/issues/257832'
do
page
.
within
(
".issue-details"
)
do
expect
(
page
).
not_to
have_text
'Related merge requests'
expect
(
page
).
not_to
have_content
(
"#merge-requests .merge-requests-title"
)
end
end
end
end
end
...
@@ -65,12 +63,9 @@ RSpec.describe "Internal references", :js do
...
@@ -65,12 +63,9 @@ RSpec.describe "Internal references", :js do
end
end
it
"shows references"
,
:sidekiq_might_not_need_inline
do
it
"shows references"
,
:sidekiq_might_not_need_inline
do
page
.
within
(
"#merge-requests .merge-requests-title"
)
do
expect
(
page
).
to
have_text
'Related merge requests 1'
expect
(
page
).
to
have_content
(
"Related merge requests"
)
expect
(
page
).
to
have_css
(
".mr-count-badge"
)
end
page
.
within
(
"#merge-requests ul"
)
do
page
.
within
(
'.related-items-list'
)
do
expect
(
page
).
to
have_content
(
private_project_merge_request
.
title
)
expect
(
page
).
to
have_content
(
private_project_merge_request
.
title
)
expect
(
page
).
to
have_css
(
".ic-issue-open-m"
)
expect
(
page
).
to
have_css
(
".ic-issue-open-m"
)
end
end
...
@@ -122,9 +117,7 @@ RSpec.describe "Internal references", :js do
...
@@ -122,9 +117,7 @@ RSpec.describe "Internal references", :js do
end
end
it
"doesn't show any references"
,
quarantine:
'https://gitlab.com/gitlab-org/gitlab/-/issues/257832'
do
it
"doesn't show any references"
,
quarantine:
'https://gitlab.com/gitlab-org/gitlab/-/issues/257832'
do
page
.
within
(
".merge-request-details"
)
do
expect
(
page
).
not_to
have_text
'Related merge requests'
expect
(
page
).
not_to
have_content
(
"#merge-requests .merge-requests-title"
)
end
end
end
end
end
...
...
spec/frontend/related_merge_requests/components/related_merge_requests_spec.js
View file @
3eba988c
...
@@ -66,8 +66,8 @@ describe('RelatedMergeRequests', () => {
...
@@ -66,8 +66,8 @@ describe('RelatedMergeRequests', () => {
describe
(
'
template
'
,
()
=>
{
describe
(
'
template
'
,
()
=>
{
it
(
'
should render related merge request items
'
,
()
=>
{
it
(
'
should render related merge request items
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.js-items-count
'
).
text
()).
toEqual
(
'
2
'
);
expect
(
wrapper
.
find
(
'
[data-testid="count"]
'
).
text
()).
toBe
(
'
2
'
);
expect
(
wrapper
.
findAll
(
RelatedIssuableItem
)
.
length
).
toEqual
(
2
);
expect
(
wrapper
.
findAll
(
RelatedIssuableItem
)
).
toHaveLength
(
2
);
const
props
=
wrapper
.
findAll
(
RelatedIssuableItem
).
at
(
1
).
props
();
const
props
=
wrapper
.
findAll
(
RelatedIssuableItem
).
at
(
1
).
props
();
const
data
=
mockData
[
1
];
const
data
=
mockData
[
1
];
...
...
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