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
Jérome Perrin
gitlab-ce
Commits
696de46a
Commit
696de46a
authored
Jun 16, 2017
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IssueNotesRefactor: Implement note delete.
parent
96ede7f7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
21 deletions
+25
-21
app/assets/javascripts/notes/components/issue_discussion.vue
app/assets/javascripts/notes/components/issue_discussion.vue
+4
-4
app/assets/javascripts/notes/components/issue_note.vue
app/assets/javascripts/notes/components/issue_note.vue
+18
-13
app/assets/javascripts/notes/components/issue_note_actions.vue
...ssets/javascripts/notes/components/issue_note_actions.vue
+1
-0
app/assets/javascripts/notes/services/issue_notes_service.js
app/assets/javascripts/notes/services/issue_notes_service.js
+1
-1
app/assets/javascripts/notes/stores/issue_notes_store.js
app/assets/javascripts/notes/stores/issue_notes_store.js
+1
-3
No files found.
app/assets/javascripts/notes/components/issue_discussion.vue
View file @
696de46a
...
...
@@ -58,10 +58,10 @@ export default {
<div
class=
"timeline-entry-inner"
>
<div
class=
"timeline-icon"
>
<user-avatar-link
:link
-h
ref=
"author.path"
:img
-s
rc=
"author.avatar_url"
:img
-a
lt=
"author.name"
:img
-s
ize=
"40"
/>
:link
H
ref=
"author.path"
:img
S
rc=
"author.avatar_url"
:img
A
lt=
"author.name"
:img
S
ize=
"40"
/>
</div>
<div
class=
"timeline-content"
>
<div
class=
"discussion"
>
...
...
app/assets/javascripts/notes/components/issue_note.vue
View file @
696de46a
...
...
@@ -39,15 +39,20 @@ export default {
this
.
isEditing
=
true
;
},
deleteHandler
()
{
this
.
isDeleting
=
true
;
this
.
$store
.
dispatch
(
'
deleteNote
'
,
this
.
note
)
.
then
(()
=>
{
this
.
isDeleting
=
false
;
})
.
catch
(()
=>
{
this
.
isDeleting
=
false
;
});
const
msg
=
'
Are you sure you want to delete this list?
'
;
const
isConfirmed
=
confirm
(
msg
);
// eslint-disable-line
if
(
isConfirmed
)
{
this
.
isDeleting
=
true
;
this
.
$store
.
dispatch
(
'
deleteNote
'
,
this
.
note
)
.
then
(()
=>
{
this
.
isDeleting
=
false
;
})
.
catch
(()
=>
{
this
.
isDeleting
=
false
;
});
}
},
formUpdateHandler
()
{
// console.log('update requested', data);
...
...
@@ -66,10 +71,10 @@ export default {
<div
class=
"timeline-entry-inner"
>
<div
class=
"timeline-icon"
>
<user-avatar-link
:link
-h
ref=
"author.path"
:img
-s
rc=
"author.avatar_url"
:img
-a
lt=
"author.name"
:img
-s
ize=
"40"
/>
:link
H
ref=
"author.path"
:img
S
rc=
"author.avatar_url"
:img
A
lt=
"author.name"
:img
S
ize=
"40"
/>
</div>
<div
class=
"timeline-content"
>
<div
class=
"note-header"
>
...
...
app/assets/javascripts/notes/components/issue_note_actions.vue
View file @
696de46a
...
...
@@ -97,6 +97,7 @@ export default {
</li>
<li>
<a
v-if=
"canEdit"
@
click.prevent=
"deleteHandler"
class=
"js-note-delete"
href=
"#"
>
...
...
app/assets/javascripts/notes/services/issue_notes_service.js
View file @
696de46a
...
...
@@ -8,6 +8,6 @@ export default {
return
Vue
.
http
.
get
(
endpoint
);
},
deleteNote
(
endpoint
)
{
return
Vue
.
http
.
get
(
endpoint
);
return
Vue
.
http
.
delete
(
endpoint
);
},
};
app/assets/javascripts/notes/stores/issue_notes_store.js
View file @
696de46a
...
...
@@ -53,10 +53,8 @@ const actions = {
});
},
deleteNote
(
context
,
note
)
{
// FIXME: Implement request, remove fake delete timer...
return
service
.
deleteNote
(
`
${
document
.
location
.
href
}
.json`
)
.
then
(
res
=>
res
.
json
)
.
deleteNote
(
note
.
path
)
.
then
(()
=>
{
context
.
commit
(
'
deleteNote
'
,
note
);
})
...
...
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