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
423fcb47
Commit
423fcb47
authored
Jun 12, 2018
by
Murat Dogan
Committed by
Phil Hughes
Jun 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mergeError message has been binded using v-html directive
parent
d94b1621
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
6 deletions
+30
-6
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_failed_to_merge.vue
...st_widget/components/states/mr_widget_failed_to_merge.vue
+6
-2
changelogs/unreleased/fix-br-decode.yml
changelogs/unreleased/fix-br-decode.yml
+5
-0
spec/javascripts/vue_mr_widget/components/states/mr_widget_failed_to_merge_spec.js
...idget/components/states/mr_widget_failed_to_merge_spec.js
+19
-4
No files found.
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_failed_to_merge.vue
View file @
423fcb47
<
script
>
import
{
n__
}
from
'
~/locale
'
;
import
{
stripHtml
}
from
'
~/lib/utils/text_utility
'
;
import
statusIcon
from
'
../mr_widget_status_icon.vue
'
;
import
eventHub
from
'
../../event_hub
'
;
...
...
@@ -27,6 +28,9 @@ export default {
},
computed
:
{
mergeError
()
{
return
this
.
mr
.
mergeError
?
stripHtml
(
this
.
mr
.
mergeError
,
'
'
).
trim
()
:
''
;
},
timerText
()
{
return
n__
(
'
Refreshing in a second to show the updated status...
'
,
...
...
@@ -83,9 +87,9 @@ export default {
<span
class=
"bold"
>
<span
class=
"has-error-message"
v-if=
"m
r.m
ergeError"
v-if=
"mergeError"
>
{{
m
r
.
m
ergeError
}}
.
{{
mergeError
}}
.
</span>
<span
v-else
>
{{
s__
(
"
mrWidget|Merge failed.
"
)
}}
...
...
changelogs/unreleased/fix-br-decode.yml
0 → 100644
View file @
423fcb47
---
title
:
mergeError message has been binded using v-html directive
merge_request
:
19058
author
:
Murat Dogan
type
:
fixed
spec/javascripts/vue_mr_widget/components/states/mr_widget_failed_to_merge_spec.js
View file @
423fcb47
...
...
@@ -6,6 +6,7 @@ import mountComponent from 'spec/helpers/vue_mount_component_helper';
describe
(
'
MRWidgetFailedToMerge
'
,
()
=>
{
const
dummyIntervalId
=
1337
;
let
Component
;
let
mr
;
let
vm
;
beforeEach
(()
=>
{
...
...
@@ -13,10 +14,11 @@ describe('MRWidgetFailedToMerge', () => {
spyOn
(
eventHub
,
'
$emit
'
);
spyOn
(
window
,
'
setInterval
'
).
and
.
returnValue
(
dummyIntervalId
);
spyOn
(
window
,
'
clearInterval
'
).
and
.
stub
();
mr
=
{
mergeError
:
'
Merge error happened
'
,
};
vm
=
mountComponent
(
Component
,
{
mr
:
{
mergeError
:
'
Merge error happened.
'
,
},
mr
,
});
});
...
...
@@ -44,6 +46,19 @@ describe('MRWidgetFailedToMerge', () => {
expect
(
vm
.
timerText
).
toEqual
(
'
Refreshing in a second to show the updated status...
'
);
});
});
describe
(
'
mergeError
'
,
()
=>
{
it
(
'
removes forced line breaks
'
,
done
=>
{
mr
.
mergeError
=
'
contains<br />line breaks<br />
'
;
Vue
.
nextTick
()
.
then
(()
=>
{
expect
(
vm
.
mergeError
).
toBe
(
'
contains line breaks
'
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
});
describe
(
'
created
'
,
()
=>
{
...
...
@@ -103,7 +118,7 @@ describe('MRWidgetFailedToMerge', () => {
it
(
'
renders given error
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.has-error-message
'
).
textContent
.
trim
()).
toEqual
(
'
Merge error happened.
.
'
,
'
Merge error happened.
'
,
);
});
...
...
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