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
bd7b36f6
Commit
bd7b36f6
authored
Jan 19, 2021
by
Kev
Committed by
Kushal Pandya
Jan 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Strip newline from commit description on project overview
parent
ddad0826
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
2 deletions
+21
-2
app/assets/javascripts/repository/components/last_commit.vue
app/assets/javascripts/repository/components/last_commit.vue
+6
-2
changelogs/unreleased/strip-newline-from-commit-description-on-project-overview.yml
...p-newline-from-commit-description-on-project-overview.yml
+5
-0
spec/frontend/repository/components/last_commit_spec.js
spec/frontend/repository/components/last_commit_spec.js
+10
-0
No files found.
app/assets/javascripts/repository/components/last_commit.vue
View file @
bd7b36f6
...
...
@@ -81,6 +81,10 @@ export default {
showCommitId
()
{
return
this
.
commit
?.
sha
?.
substr
(
0
,
8
);
},
commitDescription
()
{
// Strip the newline at the beginning
return
this
.
commit
?.
descriptionHtml
?.
replace
(
/^
/
,
''
);
},
},
watch
:
{
currentPath
()
{
...
...
@@ -146,10 +150,10 @@ export default {
<timeago-tooltip
:time=
"commit.authoredDate"
tooltip-placement=
"bottom"
/>
</div>
<pre
v-if=
"commit
.descriptionHtml
"
v-if=
"commit
Description
"
:class=
"{ 'd-block': showDescription }"
class=
"commit-row-description gl-mb-3"
v-html=
"commit
.descriptionHtml
"
v-html=
"commit
Description
"
></pre>
</div>
<div
class=
"commit-actions flex-row"
>
...
...
changelogs/unreleased/strip-newline-from-commit-description-on-project-overview.yml
0 → 100644
View file @
bd7b36f6
---
title
:
Strip newline from commit description on project overview
merge_request
:
51099
author
:
Kev @KevSlashNull
type
:
fixed
spec/frontend/repository/components/last_commit_spec.js
View file @
bd7b36f6
...
...
@@ -131,6 +131,16 @@ describe('Repository last commit component', () => {
});
});
it
(
'
strips the first newline of the description
'
,
async
()
=>
{
factory
(
createCommitData
({
descriptionHtml
:
'

Update ADOPTERS.md
'
}));
await
vm
.
vm
.
$nextTick
();
expect
(
vm
.
find
(
'
.commit-row-description
'
).
html
()).
toBe
(
'
<pre class="commit-row-description gl-mb-3">Update ADOPTERS.md</pre>
'
,
);
});
it
(
'
renders the signature HTML as returned by the backend
'
,
()
=>
{
factory
(
createCommitData
({
signatureHtml
:
'
<button>Verified</button>
'
}));
...
...
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