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
03ea267f
Commit
03ea267f
authored
Jul 29, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests for hidden jump to button
parent
d147894b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
10 deletions
+34
-10
app/assets/javascripts/diff_notes/components/jump_to_discussion.js.es6
...vascripts/diff_notes/components/jump_to_discussion.js.es6
+1
-1
app/assets/javascripts/diff_notes/components/resolve_btn.js.es6
...sets/javascripts/diff_notes/components/resolve_btn.js.es6
+2
-0
app/assets/javascripts/diff_notes/services/resolve.js.es6
app/assets/javascripts/diff_notes/services/resolve.js.es6
+17
-9
spec/features/merge_requests/diff_notes_resolve_spec.rb
spec/features/merge_requests/diff_notes_resolve_spec.rb
+14
-0
No files found.
app/assets/javascripts/diff_notes/components/jump_to_discussion.js.es6
View file @
03ea267f
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
return Object.keys(this.discussions).length;
return Object.keys(this.discussions).length;
},
},
showButton: function () {
showButton: function () {
return this.discussionsCount >
1 || !this.discussionId
;
return this.discussionsCount >
0 && (this.discussionsCount > 1 || !this.discussionId)
;
}
}
},
},
methods: {
methods: {
...
...
app/assets/javascripts/diff_notes/components/resolve_btn.js.es6
View file @
03ea267f
...
@@ -71,6 +71,8 @@
...
@@ -71,6 +71,8 @@
CommentsStore.update(this.discussionId, this.noteId, !this.isResolved, user);
CommentsStore.update(this.discussionId, this.noteId, !this.isResolved, user);
ResolveService.updateUpdatedHtml(this.discussionId, data);
ResolveService.updateUpdatedHtml(this.discussionId, data);
} else {
new Flash('An error occurred when trying to resolve a comment. Please try again.', 'alert');
}
}
this.$nextTick(this.updateTooltip);
this.$nextTick(this.updateTooltip);
...
...
app/assets/javascripts/diff_notes/services/resolve.js.es6
View file @
03ea267f
...
@@ -45,12 +45,16 @@
...
@@ -45,12 +45,16 @@
mergeRequestId,
mergeRequestId,
discussionId
discussionId
}, {}).then((response) => {
}, {}).then((response) => {
if (response.status === 200) {
const data = response.data;
const data = response.data;
const user = data ? data.resolved_by : null;
const user = data ? data.resolved_by : null;
discussion.resolveAllNotes(user);
discussion.resolveAllNotes(user);
discussion.loading = false;
discussion.loading = false;
this.updateUpdatedHtml(discussionId, data);
this.updateUpdatedHtml(discussionId, data);
} else {
new Flash('An error occurred when trying to resolve a discussion. Please try again.', 'alert');
}
});
});
}
}
...
@@ -66,11 +70,15 @@
...
@@ -66,11 +70,15 @@
mergeRequestId,
mergeRequestId,
discussionId
discussionId
}, {}).then((response) => {
}, {}).then((response) => {
if (response.status === 200) {
const data = response.data;
const data = response.data;
discussion.unResolveAllNotes();
discussion.unResolveAllNotes();
discussion.loading = false;
discussion.loading = false;
this.updateUpdatedHtml(discussionId, data);
this.updateUpdatedHtml(discussionId, data);
} else {
new Flash('An error occurred when trying to unresolve a discussion. Please try again.', 'alert');
}
});
});
}
}
...
...
spec/features/merge_requests/diff_notes_resolve_spec.rb
View file @
03ea267f
...
@@ -16,6 +16,20 @@ feature 'Diff notes resolve', feature: true, js: true do
...
@@ -16,6 +16,20 @@ feature 'Diff notes resolve', feature: true, js: true do
)
)
end
end
context
'no discussions'
do
before
do
project
.
team
<<
[
user
,
:master
]
login_as
user
note
.
destroy
visit_merge_request
end
it
'displays no discussion resolved data'
do
expect
(
page
).
not_to
have_content
(
'discussion resolved'
)
expect
(
page
).
not_to
have_selector
(
'.discussion-next-btn'
)
end
end
context
'as authorized user'
do
context
'as authorized user'
do
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
...
...
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