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
0d08ba3d
Commit
0d08ba3d
authored
Aug 23, 2017
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IssueNotesRefactor: Fix error messages of edit/reply failure for discussions.
parent
704ec994
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
10 deletions
+20
-10
app/assets/javascripts/notes/components/issue_comment_form.vue
...ssets/javascripts/notes/components/issue_comment_form.vue
+7
-0
app/assets/javascripts/notes/components/issue_discussion.vue
app/assets/javascripts/notes/components/issue_discussion.vue
+10
-2
app/assets/javascripts/notes/stores/actions.js
app/assets/javascripts/notes/stores/actions.js
+3
-8
No files found.
app/assets/javascripts/notes/components/issue_comment_form.vue
View file @
0d08ba3d
...
...
@@ -96,6 +96,7 @@
methods
:
{
...
mapActions
([
'
saveNote
'
,
'
removePlaceholderNotes
'
,
]),
setIsSubmitButtonDisabled
(
note
,
isSubmitting
)
{
if
(
!
_
.
isEmpty
(
note
)
&&
!
isSubmitting
)
{
...
...
@@ -147,6 +148,12 @@
.
catch
(()
=>
{
this
.
isSubmitting
=
false
;
this
.
discard
(
false
);
Flash
(
'
Your comment could not be submitted! Please check your network connection and try again.
'
,
'
alert
'
,
$
(
this
.
$el
),
);
this
.
removePlaceholderNotes
();
});
}
else
{
this
.
toggleIssueState
();
...
...
app/assets/javascripts/notes/components/issue_discussion.vue
View file @
0d08ba3d
...
...
@@ -78,6 +78,7 @@
...
mapActions
([
'
saveNote
'
,
'
toggleDiscussion
'
,
'
removePlaceholderNotes
'
,
]),
componentName
(
note
)
{
if
(
note
.
isPlaceholderNote
)
{
...
...
@@ -126,7 +127,15 @@
this
.
isReplying
=
false
;
this
.
resetAutoSave
();
})
.
catch
(()
=>
Flash
(
'
Something went wrong while adding your reply. Please try again.
'
));
.
catch
(()
=>
{
Flash
(
'
Your comment could not be submitted! Please check your network connection and try again.
'
,
'
alert
'
,
$
(
this
.
$el
),
);
this
.
removePlaceholderNotes
();
this
.
$refs
.
noteForm
.
isSubmitting
=
false
;
});
},
},
mounted
()
{
...
...
@@ -191,7 +200,6 @@
:key=
"note.id"
/>
</ul>
<div
class=
"flash-container"
></div>
<div
:class=
"
{ 'is-replying': isReplying }"
class="discussion-reply-holder">
...
...
app/assets/javascripts/notes/stores/actions.js
View file @
0d08ba3d
...
...
@@ -57,6 +57,9 @@ export const createNewNote = ({ commit }, { endpoint, data }) => service
return
res
;
});
export
const
removePlaceholderNotes
=
({
commit
})
=>
commit
(
types
.
REMOVE_PLACEHOLDER_NOTES
);
export
const
saveNote
=
({
commit
,
dispatch
},
noteData
)
=>
{
const
{
note
}
=
noteData
.
data
.
note
;
let
placeholderText
=
note
;
...
...
@@ -127,14 +130,6 @@ export const saveNote = ({ commit, dispatch }, noteData) => {
commit
(
types
.
REMOVE_PLACEHOLDER_NOTES
);
return
res
;
})
.
catch
(()
=>
{
Flash
(
'
Your comment could not be submitted! Please check your network connection and try again.
'
,
'
alert
'
,
$
(
noteData
.
flashContainer
),
);
commit
(
types
.
REMOVE_PLACEHOLDER_NOTES
);
});
};
...
...
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