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
988c107e
Commit
988c107e
authored
Nov 30, 2021
by
KunQian
Committed by
Vitaly Slobodin
Dec 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add note error handler as entries for JH overriding
parent
c1a020ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
12 deletions
+18
-12
app/assets/javascripts/notes/components/noteable_discussion.vue
...sets/javascripts/notes/components/noteable_discussion.vue
+10
-7
app/assets/javascripts/notes/components/noteable_note.vue
app/assets/javascripts/notes/components/noteable_note.vue
+8
-5
No files found.
app/assets/javascripts/notes/components/noteable_discussion.vue
View file @
988c107e
...
@@ -223,17 +223,20 @@ export default {
...
@@ -223,17 +223,20 @@ export default {
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
this
.
removePlaceholderNotes
();
this
.
removePlaceholderNotes
();
const
msg
=
__
(
this
.
handleSaveError
(
err
);
// The 'err' parameter is being used in JH, don't remove it
'
Your comment could not be submitted! Please check your network connection and try again.
'
,
);
createFlash
({
message
:
msg
,
parent
:
this
.
$el
,
});
this
.
$refs
.
noteForm
.
note
=
noteText
;
this
.
$refs
.
noteForm
.
note
=
noteText
;
callback
(
err
);
callback
(
err
);
});
});
},
},
handleSaveError
()
{
const
msg
=
__
(
'
Your comment could not be submitted! Please check your network connection and try again.
'
,
);
createFlash
({
message
:
msg
,
parent
:
this
.
$el
,
});
},
deleteNoteHandler
(
note
)
{
deleteNoteHandler
(
note
)
{
this
.
$emit
(
'
noteDeleted
'
,
this
.
discussion
,
note
);
this
.
$emit
(
'
noteDeleted
'
,
this
.
discussion
,
note
);
},
},
...
...
app/assets/javascripts/notes/components/noteable_note.vue
View file @
988c107e
...
@@ -331,17 +331,20 @@ export default {
...
@@ -331,17 +331,20 @@ export default {
this
.
isEditing
=
true
;
this
.
isEditing
=
true
;
this
.
setSelectedCommentPositionHover
();
this
.
setSelectedCommentPositionHover
();
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
const
msg
=
__
(
'
Something went wrong while editing your comment. Please try again.
'
);
this
.
handleUpdateError
(
response
);
// The 'response' parameter is being used in JH, don't remove it
createFlash
({
message
:
msg
,
parent
:
this
.
$el
,
});
this
.
recoverNoteContent
(
noteText
);
this
.
recoverNoteContent
(
noteText
);
callback
();
callback
();
});
});
}
}
});
});
},
},
handleUpdateError
()
{
const
msg
=
__
(
'
Something went wrong while editing your comment. Please try again.
'
);
createFlash
({
message
:
msg
,
parent
:
this
.
$el
,
});
},
formCancelHandler
({
shouldConfirm
,
isDirty
})
{
formCancelHandler
({
shouldConfirm
,
isDirty
})
{
if
(
shouldConfirm
&&
isDirty
)
{
if
(
shouldConfirm
&&
isDirty
)
{
// eslint-disable-next-line no-alert
// eslint-disable-next-line no-alert
...
...
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