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
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
Show 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 {
...
@@ -58,10 +58,10 @@ export default {
<div
class=
"timeline-entry-inner"
>
<div
class=
"timeline-entry-inner"
>
<div
class=
"timeline-icon"
>
<div
class=
"timeline-icon"
>
<user-avatar-link
<user-avatar-link
:link
-h
ref=
"author.path"
:link
H
ref=
"author.path"
:img
-s
rc=
"author.avatar_url"
:img
S
rc=
"author.avatar_url"
:img
-a
lt=
"author.name"
:img
A
lt=
"author.name"
:img
-s
ize=
"40"
/>
:img
S
ize=
"40"
/>
</div>
</div>
<div
class=
"timeline-content"
>
<div
class=
"timeline-content"
>
<div
class=
"discussion"
>
<div
class=
"discussion"
>
...
...
app/assets/javascripts/notes/components/issue_note.vue
View file @
696de46a
...
@@ -39,6 +39,10 @@ export default {
...
@@ -39,6 +39,10 @@ export default {
this
.
isEditing
=
true
;
this
.
isEditing
=
true
;
},
},
deleteHandler
()
{
deleteHandler
()
{
const
msg
=
'
Are you sure you want to delete this list?
'
;
const
isConfirmed
=
confirm
(
msg
);
// eslint-disable-line
if
(
isConfirmed
)
{
this
.
isDeleting
=
true
;
this
.
isDeleting
=
true
;
this
.
$store
this
.
$store
.
dispatch
(
'
deleteNote
'
,
this
.
note
)
.
dispatch
(
'
deleteNote
'
,
this
.
note
)
...
@@ -48,6 +52,7 @@ export default {
...
@@ -48,6 +52,7 @@ export default {
.
catch
(()
=>
{
.
catch
(()
=>
{
this
.
isDeleting
=
false
;
this
.
isDeleting
=
false
;
});
});
}
},
},
formUpdateHandler
()
{
formUpdateHandler
()
{
// console.log('update requested', data);
// console.log('update requested', data);
...
@@ -66,10 +71,10 @@ export default {
...
@@ -66,10 +71,10 @@ export default {
<div
class=
"timeline-entry-inner"
>
<div
class=
"timeline-entry-inner"
>
<div
class=
"timeline-icon"
>
<div
class=
"timeline-icon"
>
<user-avatar-link
<user-avatar-link
:link
-h
ref=
"author.path"
:link
H
ref=
"author.path"
:img
-s
rc=
"author.avatar_url"
:img
S
rc=
"author.avatar_url"
:img
-a
lt=
"author.name"
:img
A
lt=
"author.name"
:img
-s
ize=
"40"
/>
:img
S
ize=
"40"
/>
</div>
</div>
<div
class=
"timeline-content"
>
<div
class=
"timeline-content"
>
<div
class=
"note-header"
>
<div
class=
"note-header"
>
...
...
app/assets/javascripts/notes/components/issue_note_actions.vue
View file @
696de46a
...
@@ -97,6 +97,7 @@ export default {
...
@@ -97,6 +97,7 @@ export default {
</li>
</li>
<li>
<li>
<a
<a
v-if=
"canEdit"
@
click.prevent=
"deleteHandler"
@
click.prevent=
"deleteHandler"
class=
"js-note-delete"
class=
"js-note-delete"
href=
"#"
>
href=
"#"
>
...
...
app/assets/javascripts/notes/services/issue_notes_service.js
View file @
696de46a
...
@@ -8,6 +8,6 @@ export default {
...
@@ -8,6 +8,6 @@ export default {
return
Vue
.
http
.
get
(
endpoint
);
return
Vue
.
http
.
get
(
endpoint
);
},
},
deleteNote
(
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 = {
...
@@ -53,10 +53,8 @@ const actions = {
});
});
},
},
deleteNote
(
context
,
note
)
{
deleteNote
(
context
,
note
)
{
// FIXME: Implement request, remove fake delete timer...
return
service
return
service
.
deleteNote
(
`
${
document
.
location
.
href
}
.json`
)
.
deleteNote
(
note
.
path
)
.
then
(
res
=>
res
.
json
)
.
then
(()
=>
{
.
then
(()
=>
{
context
.
commit
(
'
deleteNote
'
,
note
);
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