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
5604348f
Commit
5604348f
authored
Aug 16, 2017
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IssueNotesRefactor: Implement missing attachment image.
parent
772e5603
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
0 deletions
+66
-0
app/assets/javascripts/notes/components/issue_note_attachment.vue
...ts/javascripts/notes/components/issue_note_attachment.vue
+37
-0
app/assets/javascripts/notes/components/issue_note_body.vue
app/assets/javascripts/notes/components/issue_note_body.vue
+6
-0
spec/javascripts/notes/components/issue_note_attachment_spec.js
...avascripts/notes/components/issue_note_attachment_spec.js
+23
-0
No files found.
app/assets/javascripts/notes/components/issue_note_attachment.vue
0 → 100644
View file @
5604348f
<
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 @
5604348f
<
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 @
5604348f
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