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
1272b5fa
Commit
1272b5fa
authored
Dec 11, 2018
by
Winnie Hellmann
Committed by
Fatih Acet
Dec 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make commit IDs in merge request discussion header monospace
parent
51300f76
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
3 deletions
+54
-3
app/assets/javascripts/notes/components/noteable_discussion.vue
...sets/javascripts/notes/components/noteable_discussion.vue
+5
-1
changelogs/unreleased/winh-princess-mononospace.yml
changelogs/unreleased/winh-princess-mononospace.yml
+5
-0
spec/javascripts/notes/components/noteable_discussion_spec.js
.../javascripts/notes/components/noteable_discussion_spec.js
+44
-2
No files found.
app/assets/javascripts/notes/components/noteable_discussion.vue
View file @
1272b5fa
...
...
@@ -160,10 +160,14 @@ export default {
return
expanded
||
this
.
alwaysExpanded
||
isResolvedNonDiffDiscussion
;
},
actionText
()
{
const
commitId
=
this
.
discussion
.
commit_id
?
truncateSha
(
this
.
discussion
.
commit_id
)
:
''
;
const
linkStart
=
`<a href="
${
_
.
escape
(
this
.
discussion
.
discussion_path
)}
">`
;
const
linkEnd
=
'
</a>
'
;
let
{
commit_id
:
commitId
}
=
this
.
discussion
;
if
(
commitId
)
{
commitId
=
`<span class="commit-sha">
${
truncateSha
(
commitId
)}
</span>`
;
}
let
text
=
s__
(
'
MergeRequests|started a discussion
'
);
if
(
this
.
discussion
.
for_commit
)
{
...
...
changelogs/unreleased/winh-princess-mononospace.yml
0 → 100644
View file @
1272b5fa
---
title
:
Make commit IDs in merge request discussion header monospace
merge_request
:
23562
author
:
type
:
changed
spec/javascripts/notes/components/noteable_discussion_spec.js
View file @
1272b5fa
...
...
@@ -42,12 +42,14 @@ describe('noteable_discussion component', () => {
const
discussion
=
{
...
discussionMock
};
discussion
.
diff_file
=
mockDiffFile
;
discussion
.
diff_discussion
=
true
;
const
diffDiscussionVm
=
new
Component
({
vm
.
$destroy
();
vm
=
new
Component
({
store
,
propsData
:
{
discussion
},
}).
$mount
();
expect
(
diffDiscussionV
m
.
$el
.
querySelector
(
'
.discussion-header
'
)).
not
.
toBeNull
();
expect
(
v
m
.
$el
.
querySelector
(
'
.discussion-header
'
)).
not
.
toBeNull
();
});
describe
(
'
actions
'
,
()
=>
{
...
...
@@ -130,4 +132,44 @@ describe('noteable_discussion component', () => {
expect
(
note
).
toEqual
(
data
);
});
});
describe
(
'
commit discussion
'
,
()
=>
{
const
commitId
=
'
razupaltuff
'
;
beforeEach
(()
=>
{
vm
.
$destroy
();
store
.
state
.
diffs
=
{
projectPath
:
'
something
'
,
};
vm
.
$destroy
();
vm
=
new
Component
({
propsData
:
{
discussion
:
{
...
discussionMock
,
for_commit
:
true
,
commit_id
:
commitId
,
diff_discussion
:
true
,
diff_file
:
{
...
mockDiffFile
,
},
},
renderDiffFile
:
true
,
},
store
,
}).
$mount
();
});
it
(
'
displays a monospace started a discussion on commit
'
,
()
=>
{
const
truncatedCommitId
=
commitId
.
substr
(
0
,
8
);
expect
(
vm
.
$el
).
toContainText
(
`started a discussion on commit
${
truncatedCommitId
}
`
);
const
commitElement
=
vm
.
$el
.
querySelector
(
'
.commit-sha
'
);
expect
(
commitElement
).
not
.
toBe
(
null
);
expect
(
commitElement
).
toHaveText
(
truncatedCommitId
);
});
});
});
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