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
Boxiang Sun
gitlab-ce
Commits
e68f94cd
Commit
e68f94cd
authored
Apr 02, 2019
by
George Tsiolis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename selector for framework notes
parent
e605d8c9
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
21 additions
and
21 deletions
+21
-21
app/assets/javascripts/diffs/components/inline_diff_comment_row.vue
.../javascripts/diffs/components/inline_diff_comment_row.vue
+1
-1
app/assets/javascripts/diffs/components/parallel_diff_comment_row.vue
...avascripts/diffs/components/parallel_diff_comment_row.vue
+2
-2
app/assets/javascripts/merge_request_tabs.js
app/assets/javascripts/merge_request_tabs.js
+1
-1
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+4
-4
app/assets/javascripts/notes/components/diff_with_note.vue
app/assets/javascripts/notes/components/diff_with_note.vue
+1
-1
app/assets/stylesheets/framework/notes.scss
app/assets/stylesheets/framework/notes.scss
+1
-1
app/assets/stylesheets/pages/notes.scss
app/assets/stylesheets/pages/notes.scss
+4
-4
app/views/discussions/_diff_discussion.html.haml
app/views/discussions/_diff_discussion.html.haml
+1
-1
app/views/discussions/_parallel_diff_discussion.html.haml
app/views/discussions/_parallel_diff_discussion.html.haml
+4
-4
spec/features/projects/commit/comments/user_adds_comment_spec.rb
...atures/projects/commit/comments/user_adds_comment_spec.rb
+2
-2
No files found.
app/assets/javascripts/diffs/components/inline_diff_comment_row.vue
View file @
e68f94cd
...
@@ -41,7 +41,7 @@ export default {
...
@@ -41,7 +41,7 @@ export default {
<
template
>
<
template
>
<tr
v-if=
"shouldRender"
:class=
"className"
class=
"notes_holder"
>
<tr
v-if=
"shouldRender"
:class=
"className"
class=
"notes_holder"
>
<td
class=
"notes
_
content"
colspan=
"3"
>
<td
class=
"notes
-
content"
colspan=
"3"
>
<div
class=
"content"
>
<div
class=
"content"
>
<diff-discussions
<diff-discussions
v-if=
"line.discussions.length"
v-if=
"line.discussions.length"
...
...
app/assets/javascripts/diffs/components/parallel_diff_comment_row.vue
View file @
e68f94cd
...
@@ -87,7 +87,7 @@ export default {
...
@@ -87,7 +87,7 @@ export default {
<
template
>
<
template
>
<tr
v-if=
"shouldRender"
:class=
"className"
class=
"notes_holder"
>
<tr
v-if=
"shouldRender"
:class=
"className"
class=
"notes_holder"
>
<td
class=
"notes
_
content parallel old"
colspan=
"2"
>
<td
class=
"notes
-
content parallel old"
colspan=
"2"
>
<div
v-if=
"shouldRenderDiscussionsOnLeft"
class=
"content"
>
<div
v-if=
"shouldRenderDiscussionsOnLeft"
class=
"content"
>
<diff-discussions
<diff-discussions
v-if=
"line.left.discussions.length"
v-if=
"line.left.discussions.length"
...
@@ -105,7 +105,7 @@ export default {
...
@@ -105,7 +105,7 @@ export default {
line-position=
"left"
line-position=
"left"
/>
/>
</td>
</td>
<td
class=
"notes
_
content parallel new"
colspan=
"2"
>
<td
class=
"notes
-
content parallel new"
colspan=
"2"
>
<div
v-if=
"shouldRenderDiscussionsOnRight"
class=
"content"
>
<div
v-if=
"shouldRenderDiscussionsOnRight"
class=
"content"
>
<diff-discussions
<diff-discussions
v-if=
"line.right.discussions.length"
v-if=
"line.right.discussions.length"
...
...
app/assets/javascripts/merge_request_tabs.js
View file @
e68f94cd
...
@@ -398,7 +398,7 @@ export default class MergeRequestTabs {
...
@@ -398,7 +398,7 @@ export default class MergeRequestTabs {
const
hash
=
getLocationHash
();
const
hash
=
getLocationHash
();
const
anchor
=
hash
&&
$container
.
find
(
`.note[id="
${
hash
}
"]`
);
const
anchor
=
hash
&&
$container
.
find
(
`.note[id="
${
hash
}
"]`
);
if
(
anchor
&&
anchor
.
length
>
0
)
{
if
(
anchor
&&
anchor
.
length
>
0
)
{
const
notesContent
=
anchor
.
closest
(
'
.notes
_
content
'
);
const
notesContent
=
anchor
.
closest
(
'
.notes
-
content
'
);
const
lineType
=
notesContent
.
hasClass
(
'
new
'
)
?
'
new
'
:
'
old
'
;
const
lineType
=
notesContent
.
hasClass
(
'
new
'
)
?
'
new
'
:
'
old
'
;
Notes
.
instance
.
toggleDiffNote
({
Notes
.
instance
.
toggleDiffNote
({
target
:
anchor
,
target
:
anchor
,
...
...
app/assets/javascripts/notes.js
View file @
e68f94cd
...
@@ -506,7 +506,7 @@ export default class Notes {
...
@@ -506,7 +506,7 @@ export default class Notes {
var
contentContainerClass
=
var
contentContainerClass
=
'
.
'
+
'
.
'
+
$notes
$notes
.
closest
(
'
.notes
_
content
'
)
.
closest
(
'
.notes
-
content
'
)
.
attr
(
'
class
'
)
.
attr
(
'
class
'
)
.
split
(
'
'
)
.
split
(
'
'
)
.
join
(
'
.
'
);
.
join
(
'
.
'
);
...
@@ -1069,14 +1069,14 @@ export default class Notes {
...
@@ -1069,14 +1069,14 @@ export default class Notes {
addForm
=
false
;
addForm
=
false
;
let
lineTypeSelector
=
''
;
let
lineTypeSelector
=
''
;
rowCssToAdd
=
rowCssToAdd
=
'
<tr class="notes_holder js-temp-notes-holder"><td class="notes
_
content" colspan="3"><div class="content"></div></td></tr>
'
;
'
<tr class="notes_holder js-temp-notes-holder"><td class="notes
-
content" colspan="3"><div class="content"></div></td></tr>
'
;
// In parallel view, look inside the correct left/right pane
// In parallel view, look inside the correct left/right pane
if
(
this
.
isParallelView
())
{
if
(
this
.
isParallelView
())
{
lineTypeSelector
=
`.
${
lineType
}
`
;
lineTypeSelector
=
`.
${
lineType
}
`
;
rowCssToAdd
=
rowCssToAdd
=
'
<tr class="notes_holder js-temp-notes-holder"><td class="notes_line old"></td><td class="notes
_content parallel old"><div class="content"></div></td><td class="notes_line new"></td><td class="notes_
content parallel new"><div class="content"></div></td></tr>
'
;
'
<tr class="notes_holder js-temp-notes-holder"><td class="notes_line old"></td><td class="notes
-content parallel old"><div class="content"></div></td><td class="notes_line new"></td><td class="notes-
content parallel new"><div class="content"></div></td></tr>
'
;
}
}
const
notesContentSelector
=
`.notes
_
content
${
lineTypeSelector
}
.content`
;
const
notesContentSelector
=
`.notes
-
content
${
lineTypeSelector
}
.content`
;
let
notesContent
=
targetRow
.
find
(
notesContentSelector
);
let
notesContent
=
targetRow
.
find
(
notesContentSelector
);
if
(
hasNotes
&&
showReplyInput
)
{
if
(
hasNotes
&&
showReplyInput
)
{
...
...
app/assets/javascripts/notes/components/diff_with_note.vue
View file @
e68f94cd
...
@@ -105,7 +105,7 @@ export default {
...
@@ -105,7 +105,7 @@ export default {
</td>
</td>
</tr>
</tr>
<tr
class=
"notes_holder"
>
<tr
class=
"notes_holder"
>
<td
class=
"notes
_
content"
colspan=
"3"
><slot></slot></td>
<td
class=
"notes
-
content"
colspan=
"3"
><slot></slot></td>
</tr>
</tr>
</table>
</table>
</div>
</div>
...
...
app/assets/stylesheets/framework/notes.scss
View file @
e68f94cd
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
}
}
// Diff is side by side
// Diff is side by side
.notes
_
content.parallel
&
{
.notes
-
content.parallel
&
{
// We hide at double what we normally hide at because
// We hide at double what we normally hide at because
// there are two columns of notes
// there are two columns of notes
@media
(
#{
$condition
}
-
width
:
(
2
*
$breakpoint-width
))
{
@media
(
#{
$condition
}
-
width
:
(
2
*
$breakpoint-width
))
{
...
...
app/assets/stylesheets/pages/notes.scss
View file @
e68f94cd
...
@@ -68,7 +68,7 @@ $note-form-margin-left: 72px;
...
@@ -68,7 +68,7 @@ $note-form-margin-left: 72px;
}
}
}
}
.notes
_
content
{
.notes
-
content
{
border
:
0
;
border
:
0
;
border-top
:
1px
solid
$border-color
;
border-top
:
1px
solid
$border-color
;
}
}
...
@@ -453,7 +453,7 @@ $note-form-margin-left: 72px;
...
@@ -453,7 +453,7 @@ $note-form-margin-left: 72px;
// Merge request notes in diffs
// Merge request notes in diffs
// Diff is inline
// Diff is inline
.notes
_
content
.note-header
.note-headline-light
{
.notes
-
content
.note-header
.note-headline-light
{
display
:
inline-block
;
display
:
inline-block
;
position
:
relative
;
position
:
relative
;
}
}
...
@@ -465,7 +465,7 @@ $note-form-margin-left: 72px;
...
@@ -465,7 +465,7 @@ $note-form-margin-left: 72px;
border
:
1px
solid
$border-color
;
border
:
1px
solid
$border-color
;
border-left
:
0
;
border-left
:
0
;
&
.notes
_
content
{
&
.notes
-
content
{
border-width
:
1px
0
;
border-width
:
1px
0
;
padding
:
0
;
padding
:
0
;
vertical-align
:
top
;
vertical-align
:
top
;
...
@@ -512,7 +512,7 @@ $note-form-margin-left: 72px;
...
@@ -512,7 +512,7 @@ $note-form-margin-left: 72px;
}
}
.commit-diff
{
.commit-diff
{
.notes
_
content
{
.notes
-
content
{
background-color
:
$white-light
;
background-color
:
$white-light
;
}
}
}
}
...
...
app/views/discussions/_diff_discussion.html.haml
View file @
e68f94cd
...
@@ -4,6 +4,6 @@
...
@@ -4,6 +4,6 @@
-# Text diff discussions
-# Text diff discussions
-
expanded
=
local_assigns
.
fetch
(
:expanded
,
true
)
-
expanded
=
local_assigns
.
fetch
(
:expanded
,
true
)
%tr
.notes_holder
{
class:
(
'hide'
unless
expanded
)
}
%tr
.notes_holder
{
class:
(
'hide'
unless
expanded
)
}
%td
.notes
_
content
{
colspan:
3
}
%td
.notes
-
content
{
colspan:
3
}
.content
{
class:
(
'hide'
unless
expanded
)
}
.content
{
class:
(
'hide'
unless
expanded
)
}
=
render
partial:
"discussions/notes"
,
collection:
discussions
,
as: :discussion
,
locals:
{
disable_collapse_class:
true
}
=
render
partial:
"discussions/notes"
,
collection:
discussions
,
as: :discussion
,
locals:
{
disable_collapse_class:
true
}
app/views/discussions/_parallel_diff_discussion.html.haml
View file @
e68f94cd
-
expanded
=
[
*
discussions_left
,
*
discussions_right
].
any?
(
&
:expanded?
)
-
expanded
=
[
*
discussions_left
,
*
discussions_right
].
any?
(
&
:expanded?
)
%tr
.notes_holder
{
class:
(
'hide'
unless
expanded
)
}
%tr
.notes_holder
{
class:
(
'hide'
unless
expanded
)
}
-
if
discussions_left
-
if
discussions_left
%td
.notes
_
content.parallel.old
{
colspan:
2
}
%td
.notes
-
content.parallel.old
{
colspan:
2
}
.content
{
class:
(
'hide'
unless
discussions_left
.
any?
(
&
:expanded?
))
}
.content
{
class:
(
'hide'
unless
discussions_left
.
any?
(
&
:expanded?
))
}
=
render
partial:
"discussions/notes"
,
collection:
discussions_left
,
as: :discussion
,
line_type:
'old'
,
locals:
{
disable_collapse_class:
true
}
=
render
partial:
"discussions/notes"
,
collection:
discussions_left
,
as: :discussion
,
line_type:
'old'
,
locals:
{
disable_collapse_class:
true
}
-
else
-
else
%td
.notes
_
content.parallel.old
{
colspan:
2
}
%td
.notes
-
content.parallel.old
{
colspan:
2
}
.content
.content
-
if
discussions_right
-
if
discussions_right
%td
.notes
_
content.parallel.new
{
colspan:
2
}
%td
.notes
-
content.parallel.new
{
colspan:
2
}
.content
{
class:
(
'hide'
unless
discussions_right
.
any?
(
&
:expanded?
))
}
.content
{
class:
(
'hide'
unless
discussions_right
.
any?
(
&
:expanded?
))
}
=
render
partial:
"discussions/notes"
,
collection:
discussions_right
,
as: :discussion
,
line_type:
'new'
,
locals:
{
disable_collapse_class:
true
}
=
render
partial:
"discussions/notes"
,
collection:
discussions_right
,
as: :discussion
,
line_type:
'new'
,
locals:
{
disable_collapse_class:
true
}
-
else
-
else
%td
.notes
_
content.parallel.new
{
colspan:
2
}
%td
.notes
-
content.parallel.new
{
colspan:
2
}
.content
.content
spec/features/projects/commit/comments/user_adds_comment_spec.rb
View file @
e68f94cd
...
@@ -138,7 +138,7 @@ describe "User adds a comment on a commit", :js do
...
@@ -138,7 +138,7 @@ describe "User adds a comment on a commit", :js do
click_button
(
"Comment"
)
click_button
(
"Comment"
)
end
end
page
.
within
(
".diff-file:nth-of-type(1) .notes
_
content.parallel.old"
)
do
page
.
within
(
".diff-file:nth-of-type(1) .notes
-
content.parallel.old"
)
do
expect
(
page
).
to
have_content
(
old_comment
)
expect
(
page
).
to
have_content
(
old_comment
)
end
end
...
@@ -152,7 +152,7 @@ describe "User adds a comment on a commit", :js do
...
@@ -152,7 +152,7 @@ describe "User adds a comment on a commit", :js do
wait_for_requests
wait_for_requests
expect
(
all
(
".diff-file:nth-of-type(1) .notes
_
content.parallel.new"
)[
1
].
text
).
to
have_content
(
new_comment
)
expect
(
all
(
".diff-file:nth-of-type(1) .notes
-
content.parallel.new"
)[
1
].
text
).
to
have_content
(
new_comment
)
end
end
end
end
...
...
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