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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
5ec7a40b
Commit
5ec7a40b
authored
Jul 26, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added jump to next discussion button
parent
f4746d01
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
4 deletions
+42
-4
app/assets/javascripts/diff_notes/components/jump_to_discussion.js.es6
...vascripts/diff_notes/components/jump_to_discussion.js.es6
+35
-0
app/assets/javascripts/diff_notes/components/resolve_count.js.es6
...ts/javascripts/diff_notes/components/resolve_count.js.es6
+3
-3
app/views/projects/merge_requests/_show.html.haml
app/views/projects/merge_requests/_show.html.haml
+4
-1
No files found.
app/assets/javascripts/diff_notes/components/jump_to_discussion.js.es6
0 → 100644
View file @
5ec7a40b
(() => {
JumpToDiscussion = Vue.extend({
data: function () {
return {
discussions: CommentsStore.state,
};
},
methods: {
jumpToNextUnresolvedDiscussion: function () {
let nextUnresolvedDiscussionId;
for (const discussionId in this.discussions) {
const discussion = this.discussions[discussionId];
for (const noteId in discussion) {
const note = discussion[noteId];
if (!note.resolved) {
nextUnresolvedDiscussionId = discussionId;
break;
}
}
if (nextUnresolvedDiscussionId) break;
}
$.scrollTo(`.${nextUnresolvedDiscussionId}`, {
offset: -($('.navbar-gitlab').outerHeight() + $('.layout-nav').outerHeight())
});
},
}
});
Vue.component('jump-to-discussion', JumpToDiscussion);
}());
app/assets/javascripts/diff_notes/components/resolve_count.js.es6
View file @
5ec7a40b
...
@@ -10,8 +10,8 @@
...
@@ -10,8 +10,8 @@
resolved: function () {
resolved: function () {
let resolvedCount = 0;
let resolvedCount = 0;
for (const discussionId in this.
comment
s) {
for (const discussionId in this.
discussion
s) {
const comments = this.
comment
s[discussionId];
const comments = this.
discussion
s[discussionId];
let resolved = true;
let resolved = true;
for (const noteId in comments) {
for (const noteId in comments) {
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
return Object.keys(this.discussions).length;
return Object.keys(this.discussions).length;
},
},
allResolved: function () {
allResolved: function () {
return this.resolved === this.
comments
Count;
return this.resolved === this.
discussion
Count;
}
}
}
}
});
});
...
...
app/views/projects/merge_requests/_show.html.haml
View file @
5ec7a40b
...
@@ -47,9 +47,12 @@
...
@@ -47,9 +47,12 @@
-
if
current_user
-
if
current_user
#resolve-count-app
{
"v-cloak"
=>
true
}
#resolve-count-app
{
"v-cloak"
=>
true
}
%resolve-count
{
"inline-template"
=>
true
}
%resolve-count
{
"inline-template"
=>
true
}
.line-resolve-all
{
"v-show"
=>
"
comments
Count > 0"
}
.line-resolve-all
{
"v-show"
=>
"
discussion
Count > 0"
}
%span
.line-resolve-text
%span
.line-resolve-text
{{ resolved }}/{{ discussionCount }} discussions resolved
{{ resolved }}/{{ discussionCount }} discussions resolved
%jump-to-discussion
{
"inline-template"
=>
true
}
%button
.btn.btn-default.has-tooltip
{
"@click"
=>
"jumpToNextUnresolvedDiscussion"
,
title:
"Jump to next unresolved discussion"
,
data:
{
container:
"body"
}
}
=
icon
(
"caret-down"
)
-
if
@commits_count
.
nonzero?
-
if
@commits_count
.
nonzero?
%ul
.merge-request-tabs.nav-links.no-top.no-bottom
%ul
.merge-request-tabs.nav-links.no-top.no-bottom
...
...
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