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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
9cd5ca2f
Commit
9cd5ca2f
authored
Jul 12, 2018
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix autosave in noteable discussion.
parent
5f7a81c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
18 deletions
+16
-18
app/assets/javascripts/diffs/components/diff_line_note_form.vue
...sets/javascripts/diffs/components/diff_line_note_form.vue
+5
-6
app/assets/javascripts/notes/components/noteable_discussion.vue
...sets/javascripts/notes/components/noteable_discussion.vue
+11
-12
No files found.
app/assets/javascripts/diffs/components/diff_line_note_form.vue
View file @
9cd5ca2f
<
script
>
<
script
>
import
$
from
'
jquery
'
;
import
{
mapState
,
mapGetters
,
mapActions
}
from
'
vuex
'
;
import
{
mapState
,
mapGetters
,
mapActions
}
from
'
vuex
'
;
import
createFlash
from
'
~/flash
'
;
import
createFlash
from
'
~/flash
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
s__
}
from
'
~/locale
'
;
import
noteForm
from
'
../../notes/components/note_form.vue
'
;
import
noteForm
from
'
../../notes/components/note_form.vue
'
;
import
{
getNoteFormData
}
from
'
../store/utils
'
;
import
{
getNoteFormData
}
from
'
../store/utils
'
;
import
autosave
from
'
../../notes/mixins/autosave
'
;
import
autosave
from
'
../../notes/mixins/autosave
'
;
import
{
DIFF_NOTE_TYPE
,
NOTE_TYPE
}
from
'
../constants
'
;
import
{
DIFF_NOTE_TYPE
}
from
'
../constants
'
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -42,21 +41,21 @@ export default {
...
@@ -42,21 +41,21 @@ export default {
},
},
mounted
()
{
mounted
()
{
if
(
this
.
isLoggedIn
)
{
if
(
this
.
isLoggedIn
)
{
const
noteableData
=
this
.
noteableData
;
const
keys
=
[
const
keys
=
[
noteableData
.
diff_head_sha
,
this
.
noteableData
.
diff_head_sha
,
DIFF_NOTE_TYPE
,
DIFF_NOTE_TYPE
,
noteableData
.
source_project_id
,
this
.
noteableData
.
source_project_id
,
this
.
line
.
lineCode
,
this
.
line
.
lineCode
,
];
];
this
.
initAutoSave
(
noteableData
,
keys
);
this
.
initAutoSave
(
this
.
noteableData
,
keys
);
}
}
},
},
methods
:
{
methods
:
{
...
mapActions
(
'
diffs
'
,
[
'
cancelCommentForm
'
]),
...
mapActions
(
'
diffs
'
,
[
'
cancelCommentForm
'
]),
...
mapActions
([
'
saveNote
'
,
'
refetchDiscussionById
'
]),
...
mapActions
([
'
saveNote
'
,
'
refetchDiscussionById
'
]),
handleCancelCommentForm
()
{
handleCancelCommentForm
()
{
// eslint-disable-next-line no-alert
if
(
!
window
.
confirm
(
'
Are you sure you want to cancel creating this comment?
'
))
{
if
(
!
window
.
confirm
(
'
Are you sure you want to cancel creating this comment?
'
))
{
return
;
return
;
}
}
...
...
app/assets/javascripts/notes/components/noteable_discussion.vue
View file @
9cd5ca2f
...
@@ -144,19 +144,17 @@ export default {
...
@@ -144,19 +144,17 @@ export default {
return
this
.
isDiffDiscussion
?
''
:
'
card discussion-wrapper
'
;
return
this
.
isDiffDiscussion
?
''
:
'
card discussion-wrapper
'
;
},
},
},
},
mounted
()
{
watch
:
{
if
(
this
.
isReplying
)
{
isReplying
()
{
this
.
initAutoSave
(
this
.
transformedDiscussion
);
if
(
this
.
isReplying
)
{
}
this
.
$nextTick
(()
=>
{
},
// Pass an extra key to separate reply and note edit forms
updated
()
{
this
.
initAutoSave
(
this
.
transformedDiscussion
,
[
'
Reply
'
]);
if
(
this
.
isReplying
)
{
});
if
(
!
this
.
autosave
)
{
this
.
initAutoSave
(
this
.
transformedDiscussion
);
}
else
{
}
else
{
this
.
setAutoSav
e
();
this
.
autosave
.
dispos
e
();
}
}
}
}
,
},
},
created
()
{
created
()
{
this
.
resolveDiscussionsSvg
=
resolveDiscussionsSvg
;
this
.
resolveDiscussionsSvg
=
resolveDiscussionsSvg
;
...
@@ -420,7 +418,8 @@ Please check your network connection and try again.`;
...
@@ -420,7 +418,8 @@ Please check your network connection and try again.`;
:is-editing=
"false"
:is-editing=
"false"
save-button-title=
"Comment"
save-button-title=
"Comment"
@
handleFormUpdate=
"saveReply"
@
handleFormUpdate=
"saveReply"
@
cancelForm=
"cancelReplyForm"
/>
@
cancelForm=
"cancelReplyForm"
/>
<note-signed-out-widget
v-if=
"!canReply"
/>
<note-signed-out-widget
v-if=
"!canReply"
/>
</div>
</div>
</div>
</div>
...
...
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