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
2cd8fda6
Commit
2cd8fda6
authored
Nov 04, 2019
by
Donald Cook
Committed by
Natalia Tepluhina
Nov 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Used correct backend error message for related issues
parent
a38176d7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
ee/app/assets/javascripts/related_issues/components/related_issues_root.vue
...scripts/related_issues/components/related_issues_root.vue
+3
-3
ee/spec/javascripts/issuable/related_issues/components/related_issues_root_spec.js
...ble/related_issues/components/related_issues_root_spec.js
+16
-0
No files found.
ee/app/assets/javascripts/related_issues/components/related_issues_root.vue
View file @
2cd8fda6
...
@@ -149,11 +149,11 @@ export default {
...
@@ -149,11 +149,11 @@ export default {
// Close the form on submission
// Close the form on submission
this
.
isFormVisible
=
false
;
this
.
isFormVisible
=
false
;
})
})
.
catch
(
res
=>
{
.
catch
(
({
response
})
=>
{
this
.
isSubmitting
=
false
;
this
.
isSubmitting
=
false
;
let
errorMessage
=
addRelatedIssueErrorMap
[
this
.
issuableType
];
let
errorMessage
=
addRelatedIssueErrorMap
[
this
.
issuableType
];
if
(
res
.
data
&&
res
.
data
.
message
)
{
if
(
res
ponse
&&
response
.
data
&&
response
.
data
.
message
)
{
errorMessage
=
res
.
data
.
message
;
errorMessage
=
res
ponse
.
data
.
message
;
}
}
Flash
(
errorMessage
);
Flash
(
errorMessage
);
});
});
...
...
ee/spec/javascripts/issuable/related_issues/components/related_issues_root_spec.js
View file @
2cd8fda6
...
@@ -184,6 +184,22 @@ describe('RelatedIssuesRoot', () => {
...
@@ -184,6 +184,22 @@ describe('RelatedIssuesRoot', () => {
done
();
done
();
});
});
});
});
it
(
'
displays a message from the backend upon error
'
,
done
=>
{
const
input
=
'
#123
'
;
const
message
=
'
error
'
;
mock
.
onAny
().
reply
(
409
,
{
message
});
document
.
body
.
innerHTML
+=
'
<div class="flash-container"></div>
'
;
vm
.
onPendingFormSubmit
(
input
);
setTimeout
(()
=>
{
expect
(
document
.
querySelector
(
'
.flash-text
'
).
innerText
.
trim
()).
toContain
(
message
);
document
.
querySelector
(
'
.flash-container
'
).
remove
();
done
();
});
});
});
});
describe
(
'
onPendingFormCancel
'
,
()
=>
{
describe
(
'
onPendingFormCancel
'
,
()
=>
{
...
...
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