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
d147894b
Commit
d147894b
authored
Jul 29, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hides jump to next button if only one discussion visible
parent
9878356d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
2 deletions
+22
-2
app/assets/javascripts/diff_notes/components/jump_to_discussion.js.es6
...vascripts/diff_notes/components/jump_to_discussion.js.es6
+7
-0
app/assets/javascripts/merge_request.js
app/assets/javascripts/merge_request.js
+1
-1
app/views/discussions/_jump_to_next.html.haml
app/views/discussions/_jump_to_next.html.haml
+2
-1
spec/features/merge_requests/diff_notes_resolve_spec.rb
spec/features/merge_requests/diff_notes_resolve_spec.rb
+12
-0
No files found.
app/assets/javascripts/diff_notes/components/jump_to_discussion.js.es6
View file @
d147894b
...
@@ -12,6 +12,12 @@
...
@@ -12,6 +12,12 @@
allResolved: function () {
allResolved: function () {
const discussion = this.discussions[discussionId];
const discussion = this.discussions[discussionId];
return discussion.isResolved();
return discussion.isResolved();
},
discussionsCount: function () {
return Object.keys(this.discussions).length;
},
showButton: function () {
return this.discussionsCount > 1 || !this.discussionId;
}
}
},
},
methods: {
methods: {
...
@@ -67,6 +73,7 @@
...
@@ -67,6 +73,7 @@
if (nextUnresolvedDiscussionId) {
if (nextUnresolvedDiscussionId) {
$('#notes').addClass('active');
$('#notes').addClass('active');
$('#commits, #builds, #diffs').removeClass('active');
$('#commits, #builds, #diffs').removeClass('active');
mrTabs.setCurrentAction('notes');
$.scrollTo(`.discussion[data-discussion-id="${nextUnresolvedDiscussionId}"]`, {
$.scrollTo(`.discussion[data-discussion-id="${nextUnresolvedDiscussionId}"]`, {
offset: -($('.navbar-gitlab').outerHeight() + $('.layout-nav').outerHeight())
offset: -($('.navbar-gitlab').outerHeight() + $('.layout-nav').outerHeight())
...
...
app/assets/javascripts/merge_request.js
View file @
d147894b
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
MergeRequest
.
prototype
.
initTabs
=
function
()
{
MergeRequest
.
prototype
.
initTabs
=
function
()
{
if
(
this
.
opts
.
action
!==
'
new
'
)
{
if
(
this
.
opts
.
action
!==
'
new
'
)
{
return
new
MergeRequestTabs
(
this
.
opts
);
window
.
mrTabs
=
new
MergeRequestTabs
(
this
.
opts
);
}
else
{
}
else
{
return
$
(
'
.merge-request-tabs a[data-toggle="tab"]:first
'
).
tab
(
'
show
'
);
return
$
(
'
.merge-request-tabs a[data-toggle="tab"]:first
'
).
tab
(
'
show
'
);
}
}
...
...
app/views/discussions/_jump_to_next.html.haml
View file @
d147894b
...
@@ -2,7 +2,8 @@
...
@@ -2,7 +2,8 @@
-
if
current_user
-
if
current_user
%jump-to-discussion
{
"inline-template"
=>
true
,
":discussion-id"
=>
"'#{discussion.try(:id)}'"
}
%jump-to-discussion
{
"inline-template"
=>
true
,
":discussion-id"
=>
"'#{discussion.try(:id)}'"
}
.btn-group
{
role:
"group"
,
.btn-group
{
role:
"group"
,
"v-show"
=>
"!allResolved"
}
"v-show"
=>
"!allResolved"
,
"v-if"
=>
"showButton"
}
%button
.btn.btn-default.discussion-next-btn.has-tooltip
{
"@click"
=>
"jumpToNextUnresolvedDiscussion"
,
%button
.btn.btn-default.discussion-next-btn.has-tooltip
{
"@click"
=>
"jumpToNextUnresolvedDiscussion"
,
title:
"Jump to next unresolved discussion"
,
title:
"Jump to next unresolved discussion"
,
"aria-label"
=>
"Jump to next unresolved discussion"
,
"aria-label"
=>
"Jump to next unresolved discussion"
,
...
...
spec/features/merge_requests/diff_notes_resolve_spec.rb
View file @
d147894b
...
@@ -168,6 +168,12 @@ feature 'Diff notes resolve', feature: true, js: true do
...
@@ -168,6 +168,12 @@ feature 'Diff notes resolve', feature: true, js: true do
expect
(
page
).
to
have_content
(
"Resolved by
#{
user
.
name
}
"
)
expect
(
page
).
to
have_content
(
"Resolved by
#{
user
.
name
}
"
)
end
end
it
'hides jump to next discussion button'
do
page
.
within
'.discussion-reply-holder'
do
expect
(
page
).
not_to
have_selector
(
'.discussion-next-btn'
)
end
end
end
end
context
'multiple notes'
do
context
'multiple notes'
do
...
@@ -265,6 +271,12 @@ feature 'Diff notes resolve', feature: true, js: true do
...
@@ -265,6 +271,12 @@ feature 'Diff notes resolve', feature: true, js: true do
expect
(
page
).
to
have_content
(
"Resolved by
#{
user
.
name
}
"
)
expect
(
page
).
to
have_content
(
"Resolved by
#{
user
.
name
}
"
)
end
end
it
'shows jump to next discussion button'
do
page
.
all
(
'.discussion-reply-holder'
).
each
do
|
holder
|
expect
(
holder
).
to
have_selector
(
'.discussion-next-btn'
)
end
end
end
end
context
'changes tab'
do
context
'changes tab'
do
...
...
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