Commit a18c12f6 authored by Savas Vedova's avatar Savas Vedova

Merge branch...

Merge branch '341050-long-urls-in-the-evidence-section-of-vulnerability-popup-does-not-wrap' into 'master'

Vulnerability Modal: Fix issue with long URLs

See merge request gitlab-org/gitlab!73713
parents d0f5be4b 5258a998
<script>
import { GlLink } from '@gitlab/ui';
import { GlFriendlyWrap, GlLink } from '@gitlab/ui';
export default {
components: {
GlLink,
GlFriendlyWrap,
},
inheritAttrs: false,
props: {
......@@ -12,8 +13,11 @@ export default {
required: true,
},
},
wrapSymbols: ['/', '?', '&', '='],
};
</script>
<template>
<gl-link :href="href">{{ href }}</gl-link>
<gl-link :href="href">
<gl-friendly-wrap :text="href" :symbols="$options.wrapSymbols" />
</gl-link>
</template>
......@@ -35,7 +35,12 @@
li {
@include gl-ml-0;
@include gl-mb-2;
@include gl-list-style-none;
&:last-child {
@include gl-mb-0;
}
}
&.generic-report-list-nested li {
......
import { GlLink } from '@gitlab/ui';
import { GlFriendlyWrap, GlLink } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import Url from 'ee/vulnerabilities/components/generic_report/types/url.vue';
......@@ -35,7 +35,8 @@ describe('ee/vulnerabilities/components/generic_report/types/url.vue', () => {
expect(findLink().attributes('href')).toBe(TEST_DATA.href);
});
it('shows the href as the link-text', () => {
expect(findLink().text()).toBe(TEST_DATA.href);
it('shows the href as the link-text and makes it wrap if needed', () => {
// `GlFriendlyWrap` is a functional component, so we have to use `attributes` instead of `props`
expect(findLink().findComponent(GlFriendlyWrap).attributes('text')).toBe(TEST_DATA.href);
});
});
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