Commit 08ab9284 authored by sstern's avatar sstern

Replace underscore with lodash in ancestors_tree

parent 09762c21
<script> <script>
import { GlLoadingIcon, GlLink, GlTooltip } from '@gitlab/ui'; import { GlLoadingIcon, GlLink, GlTooltip } from '@gitlab/ui';
import { escape } from 'underscore'; import { escape as esc } from 'lodash';
import { __ } from '~/locale'; import { __ } from '~/locale';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
// Fallback to None if immediate parent is unavailable. // Fallback to None if immediate parent is unavailable.
let { title } = immediateParent; let { title } = immediateParent;
title = escape(title); title = esc(title);
const { humanReadableEndDate, humanReadableTimestamp } = immediateParent; const { humanReadableEndDate, humanReadableTimestamp } = immediateParent;
......
import Vue from 'vue'; import Vue from 'vue';
import { escape } from 'underscore'; import { escape as esc } from 'lodash';
import ancestorsTree from 'ee/sidebar/components/ancestors_tree/ancestors_tree.vue'; import ancestorsTree from 'ee/sidebar/components/ancestors_tree/ancestors_tree.vue';
import mountComponent from 'helpers/vue_mount_component_helper'; import mountComponent from 'helpers/vue_mount_component_helper';
...@@ -57,7 +57,7 @@ describe('AncestorsTreeContainer', () => { ...@@ -57,7 +57,7 @@ describe('AncestorsTreeContainer', () => {
it('escapes html in the tooltip', () => { it('escapes html in the tooltip', () => {
const title = '<script>alert(1);</script>'; const title = '<script>alert(1);</script>';
const escapedTitle = escape(title); const escapedTitle = esc(title);
vm.$props.ancestors = [{ id: 1, url: '', title, state: 'open' }]; vm.$props.ancestors = [{ id: 1, url: '', title, state: 'open' }];
......
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