Commit 742f8d64 authored by Phil Hughes's avatar Phil Hughes

Merge branch '53013-duplicate-escape' into 'master'

Removes duplicate escape from job item

Closes #53013

See merge request gitlab-org/gitlab-ce!22536
parents 11a57e4f 20d3c6eb
<script> <script>
import _ from 'underscore';
import CiIcon from '~/vue_shared/components/ci_icon.vue'; import CiIcon from '~/vue_shared/components/ci_icon.vue';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import tooltip from '~/vue_shared/directives/tooltip'; import tooltip from '~/vue_shared/directives/tooltip';
...@@ -9,11 +8,9 @@ export default { ...@@ -9,11 +8,9 @@ export default {
CiIcon, CiIcon,
Icon, Icon,
}, },
directives: { directives: {
tooltip, tooltip,
}, },
props: { props: {
job: { job: {
type: Object, type: Object,
...@@ -24,10 +21,9 @@ export default { ...@@ -24,10 +21,9 @@ export default {
required: true, required: true,
}, },
}, },
computed: { computed: {
tooltipText() { tooltipText() {
return `${_.escape(this.job.name)} - ${this.job.status.tooltip}`; return `${this.job.name} - ${this.job.status.tooltip}`;
}, },
}, },
}; };
...@@ -36,7 +32,10 @@ export default { ...@@ -36,7 +32,10 @@ export default {
<template> <template>
<div <div
class="build-job" class="build-job"
:class="{ retried: job.retried, active: isActive }" :class="{
retried: job.retried,
active: isActive
}"
> >
<a <a
v-tooltip v-tooltip
......
---
title: Remove duplicate escape in job sidebar
merge_request:
author:
type: fixed
...@@ -151,9 +151,8 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do ...@@ -151,9 +151,8 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
end end
it 'renders escaped tooltip name' do it 'renders escaped tooltip name' do
page.within('aside.right-sidebar') do page.find('.active.build-job a').hover
expect(find('.active.build-job a')['data-original-title']).to eq('&lt;img src=x onerror=alert(document.domain)&gt; - passed') expect(page).to have_content('<img src=x onerror=alert(document.domain)> - passed')
end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment