Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
8e1cf6544ae8
Commit
5604348f
authored
Aug 16, 2017
by
Fatih Acet
Browse files
IssueNotesRefactor: Implement missing attachment image.
parent
6d2737ddf7cc
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/assets/javascripts/notes/components/issue_note_attachment.vue
0 → 100644
View file @
8e1cf654
<
script
>
export
default
{
name
:
'
issueNoteAttachment
'
,
props
:
{
attachment
:
{
type
:
Object
,
required
:
true
,
},
},
};
</
script
>
<
template
>
<div
class=
"note-attachment"
>
<a
v-if=
"attachment.image"
:href=
"attachment.url"
target=
"_blank"
rel=
"noopener noreferrer"
>
<img
:src=
"attachment.url"
class=
"note-image-attach"
/>
</a>
<div
class=
"attachment"
>
<a
v-if=
"attachment.url"
:href=
"attachment.url"
target=
"_blank"
rel=
"noopener noreferrer"
>
<i
class=
"fa fa-paperclip"
aria-hidden=
"true"
></i>
{{
attachment
.
filename
}}
</a>
</div>
</div>
</
template
>
app/assets/javascripts/notes/components/issue_note_body.vue
View file @
8e1cf654
<
script
>
import
issueNoteEditedText
from
'
./issue_note_edited_text.vue
'
;
import
issueNoteAwardsList
from
'
./issue_note_awards_list.vue
'
;
import
issueNoteAttachment
from
'
./issue_note_attachment.vue
'
;
import
issueNoteForm
from
'
./issue_note_form.vue
'
;
import
TaskList
from
'
../../task_list
'
;
import
autosave
from
'
../mixins/autosave
'
;
...
...
@@ -27,6 +28,7 @@
components
:
{
issueNoteEditedText
,
issueNoteAwardsList
,
issueNoteAttachment
,
issueNoteForm
,
},
computed
:
{
...
...
@@ -109,5 +111,9 @@
:awards=
"note.award_emoji"
:toggle-award-path=
"note.toggle_award_path"
/>
<issue-note-attachment
v-if=
"note.attachment.url"
:attachment=
"note.attachment"
/>
</div>
</
template
>
spec/javascripts/notes/components/issue_note_attachment_spec.js
0 → 100644
View file @
8e1cf654
import
Vue
from
'
vue
'
;
import
issueNoteAttachment
from
'
~/notes/components/issue_note_attachment.vue
'
;
describe
(
'
issue note attachment
'
,
()
=>
{
it
(
'
should render properly
'
,
()
=>
{
const
props
=
{
attachment
:
{
filename
:
'
dk.png
'
,
image
:
true
,
url
:
'
/dk.png
'
,
},
};
const
Component
=
Vue
.
extend
(
issueNoteAttachment
);
const
vm
=
new
Component
({
propsData
:
props
,
}).
$mount
();
expect
(
vm
.
$el
.
classList
.
contains
(
'
note-attachment
'
)).
toBeTruthy
();
expect
(
vm
.
$el
.
querySelector
(
'
img
'
).
src
).
toContain
(
props
.
attachment
.
url
);
expect
(
vm
.
$el
.
querySelector
(
'
a
'
).
href
).
toContain
(
props
.
attachment
.
url
);
});
});
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