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
b4a99f67
Commit
b4a99f67
authored
Jun 28, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
707d2fbc
83ae09ad
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
54 additions
and
22 deletions
+54
-22
app/assets/javascripts/notes/components/discussion_actions.vue
...ssets/javascripts/notes/components/discussion_actions.vue
+19
-12
app/assets/javascripts/notes/components/noteable_discussion.vue
...sets/javascripts/notes/components/noteable_discussion.vue
+1
-4
app/assets/javascripts/notes/stores/getters.js
app/assets/javascripts/notes/stores/getters.js
+2
-4
app/assets/stylesheets/pages/notes.scss
app/assets/stylesheets/pages/notes.scss
+4
-0
changelogs/unreleased/58689-regroup-jump-button-in-discussion.yml
...gs/unreleased/58689-regroup-jump-button-in-discussion.yml
+6
-0
spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb
.../user_resolves_diff_notes_and_discussions_resolve_spec.rb
+2
-2
spec/javascripts/notes/stores/getters_spec.js
spec/javascripts/notes/stores/getters_spec.js
+20
-0
No files found.
app/assets/javascripts/notes/components/discussion_actions.vue
View file @
b4a99f67
...
...
@@ -39,20 +39,27 @@ export default {
</
script
>
<
template
>
<div
class=
"discussion-with-resolve-btn"
>
<div
class=
"discussion-with-resolve-btn
clearfix
"
>
<reply-placeholder
class=
"qa-discussion-reply"
@
onClick=
"$emit('showReplyForm')"
/>
<resolve-discussion-button
v-if=
"discussion.resolvable"
:is-resolving=
"isResolving"
:button-title=
"resolveButtonTit
le"
@
onClick=
"$emit('resolve')
"
/>
<div
v-if=
"discussion.resolvable"
class=
"btn-group discussion-actions ml-sm-2"
role=
"group"
>
<resolve-with-issue-button
v-if=
"resolveWithIssuePath"
:url=
"resolveWithIssuePath"
/>
<
jump-to-next-discussion
-button
v-if=
"
shouldShowJumpToNextDiscussion
"
@
onClick=
"$emit('jumpToNextDiscussion')
"
<div
class=
"btn-group discussion-actions"
role=
"group"
>
<resolve-discussion-button
v-if=
"discussion.resolvab
le"
:is-resolving=
"isResolving
"
:button-title=
"resolveButtonTitle"
@
onClick=
"$emit('resolve')"
/>
<
resolve-with-issue
-button
v-if=
"
discussion.resolvable && resolveWithIssuePath
"
:url=
"resolveWithIssuePath
"
/>
</div>
<div
v-if=
"discussion.resolvable && shouldShowJumpToNextDiscussion"
class=
"btn-group discussion-actions ml-sm-2"
>
<jump-to-next-discussion-button
@
onClick=
"$emit('jumpToNextDiscussion')"
/>
</div>
</div>
</
template
>
app/assets/javascripts/notes/components/noteable_discussion.vue
View file @
b4a99f67
...
...
@@ -126,10 +126,7 @@ export default {
return
this
.
discussion
.
resolved_by_push
?
__
(
'
Automatically resolved
'
)
:
__
(
'
Resolved
'
);
},
shouldShowJumpToNextDiscussion
()
{
return
this
.
showJumpToNextDiscussion
(
this
.
discussion
.
id
,
this
.
discussionsByDiffOrder
?
'
diff
'
:
'
discussion
'
,
);
return
this
.
showJumpToNextDiscussion
(
this
.
discussionsByDiffOrder
?
'
diff
'
:
'
discussion
'
);
},
shouldRenderDiffs
()
{
return
this
.
discussion
.
diff_discussion
&&
this
.
renderDiffFile
;
...
...
app/assets/javascripts/notes/stores/getters.js
View file @
b4a99f67
...
...
@@ -61,15 +61,13 @@ export const unresolvedDiscussionsCount = state => state.unresolvedDiscussionsCo
export
const
resolvableDiscussionsCount
=
state
=>
state
.
resolvableDiscussionsCount
;
export
const
hasUnresolvedDiscussions
=
state
=>
state
.
hasUnresolvedDiscussions
;
export
const
showJumpToNextDiscussion
=
(
state
,
getters
)
=>
(
discussionId
,
mode
=
'
discussion
'
)
=>
{
export
const
showJumpToNextDiscussion
=
(
state
,
getters
)
=>
(
mode
=
'
discussion
'
)
=>
{
const
orderedDiffs
=
mode
!==
'
discussion
'
?
getters
.
unresolvedDiscussionsIdsByDiff
:
getters
.
unresolvedDiscussionsIdsByDate
;
const
indexOf
=
orderedDiffs
.
indexOf
(
discussionId
);
return
indexOf
!==
-
1
&&
indexOf
<
orderedDiffs
.
length
-
1
;
return
orderedDiffs
.
length
>
1
;
};
export
const
isDiscussionResolved
=
(
state
,
getters
)
=>
discussionId
=>
...
...
app/assets/stylesheets/pages/notes.scss
View file @
b4a99f67
...
...
@@ -657,6 +657,10 @@ $note-form-margin-left: 72px;
margin-left
:
-1px
;
}
.btn-group
>
.discussion-create-issue-btn
{
margin-left
:
-2px
;
}
svg
{
height
:
15px
;
}
...
...
changelogs/unreleased/58689-regroup-jump-button-in-discussion.yml
0 → 100644
View file @
b4a99f67
---
title
:
Improve discussion reply buttons layout and how jump to next discussion button
appears
merge_request
:
29779
author
:
type
:
changed
spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb
View file @
b4a99f67
...
...
@@ -362,14 +362,14 @@ describe 'Merge request > User resolves diff notes and discussions', :js do
end
end
it
'shows jump to next discussion button
except on last discussion
'
do
it
'shows jump to next discussion button
on all discussions
'
do
wait_for_requests
all_discussion_replies
=
page
.
all
(
'.discussion-reply-holder'
)
expect
(
all_discussion_replies
.
count
).
to
eq
(
2
)
expect
(
all_discussion_replies
.
first
.
all
(
'.discussion-next-btn'
).
count
).
to
eq
(
1
)
expect
(
all_discussion_replies
.
last
.
all
(
'.discussion-next-btn'
).
count
).
to
eq
(
0
)
expect
(
all_discussion_replies
.
last
.
all
(
'.discussion-next-btn'
).
count
).
to
eq
(
1
)
end
it
'displays next discussion even if hidden'
do
...
...
spec/javascripts/notes/stores/getters_spec.js
View file @
b4a99f67
...
...
@@ -32,6 +32,26 @@ describe('Getters Notes Store', () => {
};
});
describe
(
'
showJumpToNextDiscussion
'
,
()
=>
{
it
(
'
should return true if there are 2 or more unresolved discussions
'
,
()
=>
{
const
localGetters
=
{
unresolvedDiscussionsIdsByDate
:
[
'
123
'
,
'
456
'
],
allResolvableDiscussions
:
[],
};
expect
(
getters
.
showJumpToNextDiscussion
(
state
,
localGetters
)()).
toBe
(
true
);
});
it
(
'
should return false if there are 1 or less unresolved discussions
'
,
()
=>
{
const
localGetters
=
{
unresolvedDiscussionsIdsByDate
:
[
'
123
'
],
allResolvableDiscussions
:
[],
};
expect
(
getters
.
showJumpToNextDiscussion
(
state
,
localGetters
)()).
toBe
(
false
);
});
});
describe
(
'
discussions
'
,
()
=>
{
it
(
'
should return all discussions in the store
'
,
()
=>
{
expect
(
getters
.
discussions
(
state
)).
toEqual
([
individualNote
]);
...
...
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