Commit 1227c620 authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch 'dast-modal-truncation' into 'master'

Smartly truncate URLs in DAST Modal

See merge request gitlab-org/gitlab!37078
parents a6e27643 a34fe472
<script> <script>
import { GlModal, GlIcon, GlSprintf } from '@gitlab/ui'; import { GlModal, GlIcon, GlSprintf, GlTruncate } from '@gitlab/ui';
import { n__, __ } from '~/locale'; import { n__, __ } from '~/locale';
export default { export default {
components: { GlModal, GlIcon, GlSprintf }, components: { GlModal, GlIcon, GlSprintf, GlTruncate },
props: { props: {
scannedUrls: { scannedUrls: {
required: true, required: true,
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
variant: 'success', variant: 'success',
class: 'btn-secondary gl-button', class: 'btn-secondary gl-button',
href: this.downloadLink, href: this.downloadLink,
download: true, download: '',
'data-testid': 'download-button', 'data-testid': 'download-button',
}, },
}; };
...@@ -56,43 +56,38 @@ export default { ...@@ -56,43 +56,38 @@ export default {
v-bind="$options.modal" v-bind="$options.modal"
:action-secondary="downloadButton" :action-secondary="downloadButton"
> >
<div class="gl-px-3"> <!-- heading -->
<!-- heading --> <div class="row gl-text-gray-600">
<div class="gl-display-flex gl-text-gray-600"> <div class="col-1">{{ __('Method') }}</div>
<div class="gl-w-11">{{ __('Method') }}</div> <div class="col-11">{{ __('URL') }}</div>
<div class="gl-flex-fill-1">{{ __('URL') }}</div> </div>
</div> <hr class="gl-my-3" />
<hr class="gl-my-3" />
<!-- rows --> <!-- rows -->
<div v-for="(url, index) in limitedScannedUrls" :key="index" class="gl-display-flex gl-my-2"> <div v-for="(url, index) in limitedScannedUrls" :key="index" class="row gl-my-2">
<div class="gl-w-11">{{ url.requestMethod.toUpperCase() }}</div> <div class="col-1">{{ url.requestMethod.toUpperCase() }}</div>
<div <div class="col-11" data-testid="dast-scanned-url">
class="gl-flex-fill-1 gl-overflow-hidden gl-white-space-nowrap gl-text-overflow-ellipsis" <gl-truncate :text="url.url" position="middle" />
data-testid="dast-scanned-url"
>
{{ url.url }}
</div>
</div> </div>
</div>
<!-- banner --> <!-- banner -->
<div <div
v-if="downloadLink" v-if="downloadLink"
class="gl-display-inline-block gl-bg-gray-50 gl-my-3 gl-pl-3 gl-pr-7 gl-py-5" class="gl-display-inline-block gl-bg-gray-50 gl-my-3 gl-pl-3 gl-pr-7 gl-py-5"
> >
<gl-icon name="bulb" class="gl-vertical-align-middle gl-mr-5" /> <gl-icon name="bulb" class="gl-vertical-align-middle gl-mr-5" />
<b class="gl-vertical-align-middle"> <b class="gl-vertical-align-middle">
<gl-sprintf <gl-sprintf
:message=" :message="
__('To view all %{scannedResourcesCount} scanned URLs, please download the CSV file') __('To view all %{scannedResourcesCount} scanned URLs, please download the CSV file')
" "
> >
<template #scannedResourcesCount> <template #scannedResourcesCount>
{{ scannedResourcesCount }} {{ scannedResourcesCount }}
</template> </template>
</gl-sprintf> </gl-sprintf>
</b> </b>
</div>
</div> </div>
</gl-modal> </gl-modal>
</template> </template>
---
title: Smartly truncate URLs in DAST Modal
merge_request: 37078
author:
type: changed
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