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
603b647f
Commit
603b647f
authored
Jul 20, 2020
by
Gilang Gumilar
Committed by
Phil Hughes
Jul 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Show full commit message by default in merge request diff"
parent
99d9728a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
49 additions
and
11 deletions
+49
-11
app/assets/javascripts/diffs/components/app.vue
app/assets/javascripts/diffs/components/app.vue
+1
-1
app/assets/javascripts/diffs/components/commit_item.vue
app/assets/javascripts/diffs/components/commit_item.vue
+9
-3
app/assets/javascripts/diffs/components/commit_widget.vue
app/assets/javascripts/diffs/components/commit_widget.vue
+7
-2
app/views/projects/commits/_commit.html.haml
app/views/projects/commits/_commit.html.haml
+4
-3
app/views/projects/merge_requests/diffs/_commit_widget.html.haml
...ws/projects/merge_requests/diffs/_commit_widget.html.haml
+4
-2
changelogs/unreleased/211762-show-full-commit-message-by-default-in-merge-request-diff.yml
...-full-commit-message-by-default-in-merge-request-diff.yml
+5
-0
spec/features/merge_requests/user_views_diffs_commit_spec.rb
spec/features/merge_requests/user_views_diffs_commit_spec.rb
+19
-0
No files found.
app/assets/javascripts/diffs/components/app.vue
View file @
603b647f
...
@@ -441,7 +441,7 @@ export default {
...
@@ -441,7 +441,7 @@ export default {
[CENTERED_LIMITED_CONTAINER_CLASSES]: isLimitedContainer,
[CENTERED_LIMITED_CONTAINER_CLASSES]: isLimitedContainer,
}"
}"
>
>
<commit-widget
v-if=
"commit"
:commit=
"commit"
/>
<commit-widget
v-if=
"commit"
:commit=
"commit"
:collapsible=
"false"
/>
<div
v-if=
"isBatchLoading"
class=
"loading"
><gl-loading-icon
size=
"lg"
/></div>
<div
v-if=
"isBatchLoading"
class=
"loading"
><gl-loading-icon
size=
"lg"
/></div>
<template
v-else-if=
"renderDiffFiles"
>
<template
v-else-if=
"renderDiffFiles"
>
<diff-file
<diff-file
...
...
app/assets/javascripts/diffs/components/commit_item.vue
View file @
603b647f
...
@@ -56,6 +56,11 @@ export default {
...
@@ -56,6 +56,11 @@ export default {
type
:
Object
,
type
:
Object
,
required
:
true
,
required
:
true
,
},
},
collapsible
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
,
},
},
},
computed
:
{
computed
:
{
author
()
{
author
()
{
...
@@ -104,7 +109,7 @@ export default {
...
@@ -104,7 +109,7 @@ export default {
</
script
>
</
script
>
<
template
>
<
template
>
<li
class=
"commit flex-row js-toggle-container
"
>
<li
:class=
"
{ 'js-toggle-container': collapsible }" class="commit flex-row
">
<user-avatar-link
<user-avatar-link
:link-href=
"authorUrl"
:link-href=
"authorUrl"
:img-src=
"authorAvatar"
:img-src=
"authorAvatar"
...
@@ -123,7 +128,7 @@ export default {
...
@@ -123,7 +128,7 @@ export default {
<span
class=
"commit-row-message d-block d-sm-none"
>
·
{{
commit
.
short_id
}}
</span>
<span
class=
"commit-row-message d-block d-sm-none"
>
·
{{
commit
.
short_id
}}
</span>
<button
<button
v-if=
"commit.description_html"
v-if=
"commit.description_html
&& collapsible
"
class=
"text-expander js-toggle-button"
class=
"text-expander js-toggle-button"
type=
"button"
type=
"button"
:aria-label=
"__('Toggle commit description')"
:aria-label=
"__('Toggle commit description')"
...
@@ -144,7 +149,8 @@ export default {
...
@@ -144,7 +149,8 @@ export default {
<pre
<pre
v-if=
"commit.description_html"
v-if=
"commit.description_html"
class=
"commit-row-description js-toggle-content gl-mb-3"
:class=
"
{ 'js-toggle-content': collapsible, 'd-block': !collapsible }"
class="commit-row-description gl-mb-3 text-dark"
v-html="commit.description_html"
v-html="commit.description_html"
>
</pre>
>
</pre>
</div>
</div>
...
...
app/assets/javascripts/diffs/components/commit_widget.vue
View file @
603b647f
...
@@ -23,15 +23,20 @@ export default {
...
@@ -23,15 +23,20 @@ export default {
type
:
Object
,
type
:
Object
,
required
:
true
,
required
:
true
,
},
},
collapsible
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
,
},
},
},
};
};
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"info-well
w-10
0"
>
<div
class=
"info-well
mw-100 mx-
0"
>
<div
class=
"well-segment"
>
<div
class=
"well-segment"
>
<ul
class=
"blob-commit-info"
>
<ul
class=
"blob-commit-info"
>
<commit-item
:commit=
"commit"
/>
<commit-item
:commit=
"commit"
:collapsible=
"collapsible"
/>
</ul>
</ul>
</div>
</div>
</div>
</div>
...
...
app/views/projects/commits/_commit.html.haml
View file @
603b647f
...
@@ -10,12 +10,13 @@
...
@@ -10,12 +10,13 @@
-
ref
=
local_assigns
.
fetch
(
:ref
)
{
merge_request
&
.
source_branch
}
-
ref
=
local_assigns
.
fetch
(
:ref
)
{
merge_request
&
.
source_branch
}
-
commit
=
commit
.
present
(
current_user:
current_user
)
-
commit
=
commit
.
present
(
current_user:
current_user
)
-
commit_status
=
commit
.
status_for
(
ref
)
-
commit_status
=
commit
.
status_for
(
ref
)
-
collapsible
=
local_assigns
.
fetch
(
:collapsible
,
true
)
-
link
=
commit_path
(
project
,
commit
,
merge_request:
merge_request
)
-
link
=
commit_path
(
project
,
commit
,
merge_request:
merge_request
)
-
show_project_name
=
local_assigns
.
fetch
(
:show_project_name
,
false
)
-
show_project_name
=
local_assigns
.
fetch
(
:show_project_name
,
false
)
%li
.commit.flex-row.js-toggle-container
{
id:
"commit-#{commit.short_id}"
}
%li
{
class:
[
"commit flex-row"
,
(
"js-toggle-container"
if
collapsible
)],
id:
"commit-#{commit.short_id}"
}
.avatar-cell.d-none.d-sm-block
.avatar-cell.d-none.d-sm-block
=
author_avatar
(
commit
,
size:
40
,
has_tooltip:
false
)
=
author_avatar
(
commit
,
size:
40
,
has_tooltip:
false
)
...
@@ -29,7 +30,7 @@
...
@@ -29,7 +30,7 @@
%span
.commit-row-message.d-inline.d-sm-none
%span
.commit-row-message.d-inline.d-sm-none
·
·
=
commit
.
short_id
=
commit
.
short_id
-
if
commit
.
description?
-
if
commit
.
description?
&&
collapsible
%button
.text-expander.js-toggle-button
%button
.text-expander.js-toggle-button
=
sprite_icon
(
'ellipsis_h'
,
size:
12
)
=
sprite_icon
(
'ellipsis_h'
,
size:
12
)
...
@@ -41,7 +42,7 @@
...
@@ -41,7 +42,7 @@
=
render_if_exists
'projects/commits/project_namespace'
,
show_project_name:
show_project_name
,
project:
project
=
render_if_exists
'projects/commits/project_namespace'
,
show_project_name:
show_project_name
,
project:
project
-
if
commit
.
description?
-
if
commit
.
description?
%pre
.commit-row-description.js-toggle-content.gl-mb-3
%pre
{
class:
[
"commit-row-description gl-mb-3"
,
(
collapsible
?
"js-toggle-content"
:
"d-block"
)]
}
=
preserve
(
markdown_field
(
commit
,
:description
))
=
preserve
(
markdown_field
(
commit
,
:description
))
.commit-actions.flex-row
.commit-actions.flex-row
...
...
app/views/projects/merge_requests/diffs/_commit_widget.html.haml
View file @
603b647f
...
@@ -2,8 +2,10 @@
...
@@ -2,8 +2,10 @@
WARNING: Please keep changes up-to-date with the following files:
WARNING: Please keep changes up-to-date with the following files:
- `assets/javascripts/diffs/components/commit_widget.vue`
- `assets/javascripts/diffs/components/commit_widget.vue`
-#-----------------------------------------------------------------
-#-----------------------------------------------------------------
-
collapsible
=
local_assigns
.
fetch
(
:collapsible
,
true
)
-
if
@commit
-
if
@commit
.info-well.
d-none.d-sm-block.gl-mt-3
.info-well.
mw-100.mx-0
.well-segment
.well-segment
%ul
.blob-commit-info
%ul
.blob-commit-info
=
render
'projects/commits/commit'
,
commit:
@commit
,
merge_request:
@merge_request
,
view_details:
true
=
render
'projects/commits/commit'
,
commit:
@commit
,
merge_request:
@merge_request
,
view_details:
true
,
collapsible:
collapsible
changelogs/unreleased/211762-show-full-commit-message-by-default-in-merge-request-diff.yml
0 → 100644
View file @
603b647f
---
title
:
Show full commit message by default in merge request diff
merge_request
:
27981
author
:
Gilang Gumilar
type
:
changed
spec/features/merge_requests/user_views_diffs_commit_spec.rb
0 → 100644
View file @
603b647f
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'User views diff by commit'
,
:js
do
let
(
:merge_request
)
do
create
(
:merge_request_with_diffs
,
source_project:
project
,
target_project:
project
,
source_branch:
'merge-test'
)
end
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
before
do
stub_feature_flags
(
diffs_batch_load:
false
)
visit
(
diffs_project_merge_request_path
(
project
,
merge_request
,
commit_id:
merge_request
.
diff_head_sha
))
end
it
'shows full commit description by default'
do
expect
(
page
).
to
have_selector
(
'.commit-row-description'
,
visible:
true
)
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