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
9af1e26d
Commit
9af1e26d
authored
Dec 19, 2017
by
Clement Ho
Committed by
Jacob Schatz
Dec 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix onion-skin re-entering state
parent
35ff75b6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
13 deletions
+35
-13
app/assets/javascripts/commit/image_file.js
app/assets/javascripts/commit/image_file.js
+1
-0
changelogs/unreleased/fix-onion-skin-reenter.yml
changelogs/unreleased/fix-onion-skin-reenter.yml
+5
-0
spec/features/merge_requests/image_diff_notes_spec.rb
spec/features/merge_requests/image_diff_notes_spec.rb
+29
-13
No files found.
app/assets/javascripts/commit/image_file.js
View file @
9af1e26d
...
@@ -176,6 +176,7 @@ export default class ImageFile {
...
@@ -176,6 +176,7 @@ export default class ImageFile {
left
:
dragTrackWidth
left
:
dragTrackWidth
});
});
$frameAdded
.
css
(
'
opacity
'
,
1
);
framePadding
=
parseInt
(
$frameAdded
.
css
(
'
right
'
).
replace
(
'
px
'
,
''
),
10
);
framePadding
=
parseInt
(
$frameAdded
.
css
(
'
right
'
).
replace
(
'
px
'
,
''
),
10
);
_this
.
initDraggable
(
$dragger
,
framePadding
,
function
(
e
,
left
)
{
_this
.
initDraggable
(
$dragger
,
framePadding
,
function
(
e
,
left
)
{
...
...
changelogs/unreleased/fix-onion-skin-reenter.yml
0 → 100644
View file @
9af1e26d
---
title
:
Fix onion-skin re-entering state
merge_request
:
author
:
type
:
fixed
spec/features/merge_requests/image_diff_notes.rb
→
spec/features/merge_requests/image_diff_notes
_spec
.rb
View file @
9af1e26d
...
@@ -10,8 +10,6 @@ feature 'image diff notes', :js do
...
@@ -10,8 +10,6 @@ feature 'image diff notes', :js do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
sign_in
user
sign_in
user
page
.
driver
.
set_cookie
(
'sidebar_collapsed'
,
'true'
)
# Stub helper to return any blob file as image from public app folder.
# Stub helper to return any blob file as image from public app folder.
# This is necessary to run this specs since we don't display repo images in capybara.
# This is necessary to run this specs since we don't display repo images in capybara.
allow_any_instance_of
(
DiffHelper
).
to
receive
(
:diff_file_blob_raw_path
).
and_return
(
'/apple-touch-icon.png'
)
allow_any_instance_of
(
DiffHelper
).
to
receive
(
:diff_file_blob_raw_path
).
and_return
(
'/apple-touch-icon.png'
)
...
@@ -141,13 +139,13 @@ feature 'image diff notes', :js do
...
@@ -141,13 +139,13 @@ feature 'image diff notes', :js do
end
end
it
'allows expanding/collapsing the discussion notes'
do
it
'allows expanding/collapsing the discussion notes'
do
page
.
all
(
'.js-diff-notes-toggle'
)[
0
].
trigger
(
'click'
)
page
.
all
(
'.js-diff-notes-toggle'
)[
0
].
click
page
.
all
(
'.js-diff-notes-toggle'
)[
1
].
trigger
(
'click'
)
page
.
all
(
'.js-diff-notes-toggle'
)[
1
].
click
expect
(
page
).
not_to
have_content
(
'image diff test comment'
)
expect
(
page
).
not_to
have_content
(
'image diff test comment'
)
page
.
all
(
'.js-diff-notes-toggle'
)[
0
].
trigger
(
'click'
)
page
.
all
(
'.js-diff-notes-toggle'
)[
0
].
click
page
.
all
(
'.js-diff-notes-toggle'
)[
1
].
trigger
(
'click'
)
page
.
all
(
'.js-diff-notes-toggle'
)[
1
].
click
expect
(
page
).
to
have_content
(
'image diff test comment'
)
expect
(
page
).
to
have_content
(
'image diff test comment'
)
end
end
...
@@ -196,13 +194,31 @@ feature 'image diff notes', :js do
...
@@ -196,13 +194,31 @@ feature 'image diff notes', :js do
expect
(
find
(
'.onion-skin-frame'
)[
'style'
]).
to
match
(
'width: 228px; height: 240px;'
)
expect
(
find
(
'.onion-skin-frame'
)[
'style'
]).
to
match
(
'width: 228px; height: 240px;'
)
end
end
it
'resets onion skin view mode opacity when toggling between view modes'
do
find
(
'.view-modes-menu .onion-skin'
).
click
# Simulate dragging onion-skin slider
drag_and_drop_by
(
find
(
'.dragger'
),
-
30
,
0
)
expect
(
find
(
'.onion-skin-frame .frame.added'
,
visible:
false
)[
'style'
]).
not_to
match
(
'opacity: 1;'
)
find
(
'.view-modes-menu .swipe'
).
click
find
(
'.view-modes-menu .onion-skin'
).
click
expect
(
find
(
'.onion-skin-frame .frame.added'
,
visible:
false
)[
'style'
]).
to
match
(
'opacity: 1;'
)
end
end
end
end
def
create_image_diff_note
def
drag_and_drop_by
(
element
,
right_by
,
down_by
)
find
(
'.js-add-image-diff-note-button'
,
match: :first
).
click
page
.
driver
.
browser
.
action
.
drag_and_drop_by
(
element
.
native
,
right_by
,
down_by
).
perform
page
.
all
(
'.js-add-image-diff-note-button'
)[
0
].
trigger
(
'click'
)
end
find
(
'.diff-content .note-textarea'
).
native
.
send_keys
(
'image diff test comment'
)
click_button
'Comment'
def
create_image_diff_note
wait_for_requests
find
(
'.js-add-image-diff-note-button'
,
match: :first
).
click
page
.
all
(
'.js-add-image-diff-note-button'
)[
0
].
click
find
(
'.diff-content .note-textarea'
).
native
.
send_keys
(
'image diff test comment'
)
click_button
'Comment'
wait_for_requests
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