Removes escape from job item
Tooltips aren't using v-html anymore thus causing escape not to be needed
This commit is contained in:
parent
1ad3ce921f
commit
20d3c6eba7
|
@ -1,5 +1,4 @@
|
|||
<script>
|
||||
import _ from 'underscore';
|
||||
import CiIcon from '~/vue_shared/components/ci_icon.vue';
|
||||
import Icon from '~/vue_shared/components/icon.vue';
|
||||
import tooltip from '~/vue_shared/directives/tooltip';
|
||||
|
@ -9,11 +8,9 @@ export default {
|
|||
CiIcon,
|
||||
Icon,
|
||||
},
|
||||
|
||||
directives: {
|
||||
tooltip,
|
||||
},
|
||||
|
||||
props: {
|
||||
job: {
|
||||
type: Object,
|
||||
|
@ -24,10 +21,9 @@ export default {
|
|||
required: true,
|
||||
},
|
||||
},
|
||||
|
||||
computed: {
|
||||
tooltipText() {
|
||||
return `${_.escape(this.job.name)} - ${this.job.status.tooltip}`;
|
||||
return `${this.job.name} - ${this.job.status.tooltip}`;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -36,7 +32,10 @@ export default {
|
|||
<template>
|
||||
<div
|
||||
class="build-job"
|
||||
:class="{ retried: job.retried, active: isActive }"
|
||||
:class="{
|
||||
retried: job.retried,
|
||||
active: isActive
|
||||
}"
|
||||
>
|
||||
<a
|
||||
v-tooltip
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Remove duplicate escape in job sidebar
|
||||
merge_request:
|
||||
author:
|
||||
type: fixed
|
|
@ -151,9 +151,8 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
|
|||
end
|
||||
|
||||
it 'renders escaped tooltip name' do
|
||||
page.within('aside.right-sidebar') do
|
||||
expect(find('.active.build-job a')['data-original-title']).to eq('<img src=x onerror=alert(document.domain)> - passed')
|
||||
end
|
||||
page.find('.active.build-job a').hover
|
||||
expect(page).to have_content('<img src=x onerror=alert(document.domain)> - passed')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue