BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
6f94f62f
Commit
6f94f62f
authored
Jul 29, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly cycles the unresolved discussions
Switches back to discussion tab when clicking jump to next unresolved button
parent
4e679819
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
8 deletions
+27
-8
comment_resolve_btn.es6
...javascripts/diff_notes/components/comment_resolve_btn.es6
+1
-1
jump_to_discussion.js.es6
...vascripts/diff_notes/components/jump_to_discussion.js.es6
+16
-2
diff_notes_bundle.js.es6
app/assets/javascripts/diff_notes/diff_notes_bundle.js.es6
+1
-1
disucssion.js.es6
app/assets/javascripts/diff_notes/models/disucssion.js.es6
+2
-2
note.js.es6
app/assets/javascripts/diff_notes/models/note.js.es6
+1
-1
_discussion.html.haml
app/views/projects/merge_requests/_discussion.html.haml
+1
-1
diff_notes_resolve_spec.rb
spec/features/merge_requests/diff_notes_resolve_spec.rb
+5
-0
No files found.
app/assets/javascripts/diff_notes/components/
resolve_comment_btn.js
.es6
→
app/assets/javascripts/diff_notes/components/
comment_resolve_btn
.es6
View file @
6f94f62f
((w) => {
w.
ResolveComment
Btn = Vue.extend({
w.
CommentAndResolve
Btn = Vue.extend({
props: {
discussionId: String
},
...
...
app/assets/javascripts/diff_notes/components/jump_to_discussion.js.es6
View file @
6f94f62f
...
...
@@ -37,9 +37,20 @@
i++;
}
} else {
let nextDiscussionId;
const discussionKeys = Object.keys(this.discussions),
indexOfDiscussion = discussionKeys.indexOf(this.discussionId),
nextDiscussionId = discussionKeys[indexOfDiscussion + 1];
indexOfDiscussion = discussionKeys.indexOf(this.discussionId);
nextDiscussionIds = discussionKeys.splice(indexOfDiscussion);
nextDiscussionIds.forEach((discussionId) => {
if (discussionId !== this.discussionId) {
const discussion = this.discussions[discussionId];
if (!discussion.isResolved()) {
nextDiscussionId = discussion.id;
}
}
});
if (nextDiscussionId) {
nextUnresolvedDiscussionId = nextDiscussionId;
...
...
@@ -54,6 +65,9 @@
}
if (nextUnresolvedDiscussionId) {
$('#notes').addClass('active');
$('#commits, #builds, #diffs').removeClass('active');
$.scrollTo(`.discussion[data-discussion-id="${nextUnresolvedDiscussionId}"]`, {
offset: -($('.navbar-gitlab').outerHeight() + $('.layout-nav').outerHeight())
});
...
...
app/assets/javascripts/diff_notes/diff_notes_bundle.js.es6
View file @
6f94f62f
...
...
@@ -12,7 +12,7 @@ $(() => {
components: {
'resolve-btn': ResolveBtn,
'resolve-discussion-btn': ResolveDiscussionBtn,
'
resolve-comment-btn': ResolveComment
Btn
'
comment-and-resolve-btn': CommentAndResolve
Btn
}
});
...
...
app/assets/javascripts/diff_notes/models/disucssion.js.es6
View file @
6f94f62f
class DiscussionModel {
constructor (discussionId) {
this.
discussionI
d = discussionId;
this.
i
d = discussionId;
this.notes = {};
this.loading = false;
}
createNote (noteId, resolved, user) {
Vue.set(this.notes, noteId, new NoteModel(this.
discussionI
d, noteId, resolved, user));
Vue.set(this.notes, noteId, new NoteModel(this.
i
d, noteId, resolved, user));
}
deleteNote (noteId) {
...
...
app/assets/javascripts/diff_notes/models/note.js.es6
View file @
6f94f62f
class NoteModel {
constructor (discussionId, noteId, resolved, user) {
this.discussionId = discussionId;
this.
noteI
d = noteId;
this.
i
d = noteId;
this.resolved = resolved;
this.user = user;
}
...
...
app/views/projects/merge_requests/_discussion.html.haml
View file @
6f94f62f
...
...
@@ -4,7 +4,7 @@
=
link_to
'Close merge request'
,
merge_request_path
(
@merge_request
,
merge_request:
{
state_event: :close
}),
method: :put
,
class:
"btn btn-nr btn-comment btn-close close-mr-link js-note-target-close"
,
title:
"Close merge request"
,
data:
{
original_text:
"Close merge request"
,
alternative_text:
"Comment & close merge request"
}
-
if
@merge_request
.
closed?
=
link_to
'Reopen merge request'
,
merge_request_path
(
@merge_request
,
merge_request:
{
state_event: :reopen
}),
method: :put
,
class:
"btn btn-nr btn-comment btn-reopen reopen-mr-link js-note-target-reopen"
,
title:
"Reopen merge request"
,
data:
{
original_text:
"Reopen merge request"
,
alternative_text:
"Comment & reopen merge request"
}
%
resolve-comment
-btn
{
"inline-template"
=>
true
,
":discussion-id"
=>
""
}
%
comment-and-resolve
-btn
{
"inline-template"
=>
true
,
":discussion-id"
=>
""
}
%button
.btn.btn-nr.btn-default.append-right-10.js-comment-resolve-button
{
type:
"submit"
,
data:
{
namespace_path:
"#{@merge_request.project.namespace.path}"
,
project_path:
"#{@merge_request.project.path}"
}
}
{{ buttonText }}
...
...
spec/features/merge_requests/diff_notes_resolve_spec.rb
View file @
6f94f62f
...
...
@@ -35,6 +35,7 @@ feature 'Diff notes resolve', feature: true, js: true do
find
(
'.line-resolve-btn'
).
click
expect
(
page
).
to
have_selector
(
'.line-resolve-btn.is-active'
)
expect
(
find
(
'.line-resolve-btn'
)[
'data-original-title'
]).
to
eq
(
"Resolved by
#{
user
.
name
}
"
)
end
page
.
within
'.diff-content'
do
...
...
@@ -54,6 +55,8 @@ feature 'Diff notes resolve', feature: true, js: true do
page
.
within
'.diff-content .note'
do
expect
(
page
).
to
have_selector
(
'.line-resolve-btn.is-active'
)
expect
(
find
(
'.line-resolve-btn'
)[
'data-original-title'
]).
to
eq
(
"Resolved by
#{
user
.
name
}
"
)
end
page
.
within
'.line-resolve-all-container'
do
...
...
@@ -147,6 +150,8 @@ feature 'Diff notes resolve', feature: true, js: true do
it
'does not mark discussion as resolved when resolving single note'
do
page
.
within
'.diff-content .note'
do
first
(
'.line-resolve-btn'
).
click
sleep
1
expect
(
first
(
'.line-resolve-btn'
)[
'data-original-title'
]).
to
eq
(
"Resolved by
#{
user
.
name
}
"
)
end
expect
(
page
).
to
have_content
(
'Last updated'
)
...
...
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