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
Léo-Paul Géneau
gitlab-ce
Commits
73d3cb8c
Commit
73d3cb8c
authored
Nov 13, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed image commenting on moved files
parent
9f5dfd59
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
app/assets/javascripts/vue_shared/components/diff_viewer/viewers/image_diff_viewer.vue
...ared/components/diff_viewer/viewers/image_diff_viewer.vue
+5
-2
spec/javascripts/vue_shared/components/diff_viewer/viewers/image_diff_viewer_spec.js
.../components/diff_viewer/viewers/image_diff_viewer_spec.js
+20
-0
No files found.
app/assets/javascripts/vue_shared/components/diff_viewer/viewers/image_diff_viewer.vue
View file @
73d3cb8c
...
...
@@ -44,8 +44,11 @@ export default {
isNew
()
{
return
this
.
diffMode
===
diffModes
.
new
;
},
isRenamed
()
{
return
this
.
diffMode
===
diffModes
.
renamed
;
},
imagePath
()
{
return
this
.
isNew
?
this
.
newPath
:
this
.
oldPath
;
return
this
.
isNew
||
this
.
isRenamed
?
this
.
newPath
:
this
.
oldPath
;
},
},
methods
:
{
...
...
@@ -114,7 +117,7 @@ export default {
}]"
>
<slot
v-if=
"isNew"
v-if=
"isNew
|| isRenamed
"
slot=
"image-overlay"
name=
"image-overlay"
>
...
...
spec/javascripts/vue_shared/components/diff_viewer/viewers/image_diff_viewer_spec.js
View file @
73d3cb8c
...
...
@@ -97,6 +97,26 @@ describe('ImageDiffViewer', () => {
});
});
it
(
'
renders image diff for renamed
'
,
done
=>
{
vm
=
new
Vue
({
components
:
{
imageDiffViewer
,
},
template
:
`
<image-diff-viewer diff-mode="renamed" new-path="
${
GREEN_BOX_IMAGE_URL
}
" old-path="">
<span slot="image-overlay" class="overlay">test</span>
</image-diff-viewer>
`
,
}).
$mount
();
setTimeout
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
img
'
).
getAttribute
(
'
src
'
)).
toBe
(
GREEN_BOX_IMAGE_URL
);
expect
(
vm
.
$el
.
querySelector
(
'
.overlay
'
)).
not
.
toBe
(
null
);
done
();
});
});
describe
(
'
swipeMode
'
,
()
=>
{
beforeEach
(
done
=>
{
createComponent
({
...
...
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