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
9db385ed
Commit
9db385ed
authored
Dec 21, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
07e60a3b
80ff142c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
27 deletions
+93
-27
app/assets/javascripts/notes/components/noteable_discussion.vue
...sets/javascripts/notes/components/noteable_discussion.vue
+20
-19
changelogs/unreleased/winh-merge-request-commit-context.yml
changelogs/unreleased/winh-merge-request-commit-context.yml
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/javascripts/notes/components/noteable_discussion_spec.js
.../javascripts/notes/components/noteable_discussion_spec.js
+65
-8
No files found.
app/assets/javascripts/notes/components/noteable_discussion.vue
View file @
9db385ed
...
...
@@ -188,31 +188,32 @@ export default {
commitId
=
`<span class="commit-sha">
${
truncateSha
(
commitId
)}
</span>`
;
}
let
text
=
s__
(
'
MergeRequests|started a discussion
'
);
const
{
for_commit
:
isForCommit
,
diff_discussion
:
isDiffDiscussion
,
active
:
isActive
,
}
=
this
.
discussion
;
if
(
this
.
discussion
.
for_commit
)
{
let
text
=
s__
(
'
MergeRequests|started a discussion
'
);
if
(
isForCommit
)
{
text
=
s__
(
'
MergeRequests|started a discussion on commit %{linkStart}%{commitId}%{linkEnd}
'
,
);
}
else
if
(
this
.
discussion
.
diff_discussion
)
{
if
(
this
.
discussion
.
active
)
{
text
=
s__
(
'
MergeRequests|started a discussion on %{linkStart}the diff%{linkEnd}
'
);
}
else
{
text
=
s__
(
'
MergeRequests|started a discussion on %{linkStart}an old version of the diff%{linkEnd}
'
,
);
}
}
else
if
(
isDiffDiscussion
&&
commitId
)
{
text
=
isActive
?
s__
(
'
MergeRequests|started a discussion on commit %{linkStart}%{commitId}%{linkEnd}
'
)
:
s__
(
'
MergeRequests|started a discussion on an outdated change in commit %{linkStart}%{commitId}%{linkEnd}
'
,
);
}
else
if
(
isDiffDiscussion
)
{
text
=
isActive
?
s__
(
'
MergeRequests|started a discussion on %{linkStart}the diff%{linkEnd}
'
)
:
s__
(
'
MergeRequests|started a discussion on %{linkStart}an old version of the diff%{linkEnd}
'
,
);
}
return
sprintf
(
text
,
{
commitId
,
linkStart
,
linkEnd
,
},
false
,
);
return
sprintf
(
text
,
{
commitId
,
linkStart
,
linkEnd
},
false
);
},
diffLine
()
{
if
(
this
.
discussion
.
diff_discussion
&&
this
.
discussion
.
truncated_diff_lines
)
{
...
...
changelogs/unreleased/winh-merge-request-commit-context.yml
0 → 100644
View file @
9db385ed
---
title
:
Display commit ID for discussions made on merge request commits
merge_request
:
23837
author
:
type
:
fixed
locale/gitlab.pot
View file @
9db385ed
...
...
@@ -5438,6 +5438,9 @@ msgstr ""
msgid "MergeRequests|started a discussion on %{linkStart}the diff%{linkEnd}"
msgstr ""
msgid "MergeRequests|started a discussion on an outdated change in commit %{linkStart}%{commitId}%{linkEnd}"
msgstr ""
msgid "MergeRequests|started a discussion on commit %{linkStart}%{commitId}%{linkEnd}"
msgstr ""
...
...
spec/javascripts/notes/components/noteable_discussion_spec.js
View file @
9db385ed
...
...
@@ -133,8 +133,10 @@ describe('noteable_discussion component', () => {
});
});
describe
(
'
commit discussion
'
,
()
=>
{
describe
(
'
action text
'
,
()
=>
{
const
commitId
=
'
razupaltuff
'
;
const
truncatedCommitId
=
commitId
.
substr
(
0
,
8
);
let
commitElement
;
beforeEach
(()
=>
{
vm
.
$destroy
();
...
...
@@ -143,7 +145,6 @@ describe('noteable_discussion component', () => {
projectPath
:
'
something
'
,
};
vm
.
$destroy
();
vm
=
new
Component
({
propsData
:
{
discussion
:
{
...
...
@@ -159,17 +160,73 @@ describe('noteable_discussion component', () => {
},
store
,
}).
$mount
();
commitElement
=
vm
.
$el
.
querySelector
(
'
.commit-sha
'
);
});
describe
(
'
for commit discussions
'
,
()
=>
{
it
(
'
should display a monospace started a discussion on commit
'
,
()
=>
{
expect
(
vm
.
$el
).
toContainText
(
`started a discussion on commit
${
truncatedCommitId
}
`
);
expect
(
commitElement
).
not
.
toBe
(
null
);
expect
(
commitElement
).
toHaveText
(
truncatedCommitId
);
});
});
it
(
'
displays a monospace started a discussion on commit
'
,
()
=>
{
const
truncatedCommitId
=
commitId
.
substr
(
0
,
8
);
describe
(
'
for diff discussion with a commit id
'
,
()
=>
{
it
(
'
should display started discussion on commit header
'
,
done
=>
{
vm
.
discussion
.
for_commit
=
false
;
expect
(
vm
.
$el
).
toContainText
(
`started a discussion on commit
${
truncatedCommitId
}
`
);
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
$el
).
toContainText
(
`started a discussion on commit
${
truncatedCommitId
}
`
);
expect
(
commitElement
).
not
.
toBe
(
null
);
const
commitElement
=
vm
.
$el
.
querySelector
(
'
.commit-sha
'
);
done
();
});
});
expect
(
commitElement
).
not
.
toBe
(
null
);
expect
(
commitElement
).
toHaveText
(
truncatedCommitId
);
it
(
'
should display outdated change on commit header
'
,
done
=>
{
vm
.
discussion
.
for_commit
=
false
;
vm
.
discussion
.
active
=
false
;
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
$el
).
toContainText
(
`started a discussion on an outdated change in commit
${
truncatedCommitId
}
`
,
);
expect
(
commitElement
).
not
.
toBe
(
null
);
done
();
});
});
});
describe
(
'
for diff discussions without a commit id
'
,
()
=>
{
it
(
'
should show started a discussion on the diff text
'
,
done
=>
{
Object
.
assign
(
vm
.
discussion
,
{
for_commit
:
false
,
commit_id
:
null
,
});
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
$el
).
toContainText
(
'
started a discussion on the diff
'
);
done
();
});
});
it
(
'
should show discussion on older version text
'
,
done
=>
{
Object
.
assign
(
vm
.
discussion
,
{
for_commit
:
false
,
commit_id
:
null
,
active
:
false
,
});
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
$el
).
toContainText
(
'
started a discussion on an old version of the diff
'
);
done
();
});
});
});
});
});
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