Commit 3f35b8c2 authored by Dheeraj Joshi's avatar Dheeraj Joshi Committed by Jannik Lehmann

Fix clipboard button for DAST validation modal

ClipboardButton doesn't work with GlModal so
it replaces with modal specific clipboard button
parent d5edc1b6
......@@ -11,9 +11,9 @@ import {
GlSkeletonLoader,
GlTruncate,
} from '@gitlab/ui';
import ModalCopyButton from '~/vue_shared/components/modal_copy_button.vue';
import { __, s__ } from '~/locale';
import * as Sentry from '~/sentry/wrapper';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import download from '~/lib/utils/downloader';
import { cleanLeadingSeparator, joinPaths, stripPathTail } from '~/lib/utils/url_utility';
import {
......@@ -31,7 +31,7 @@ export default {
DAST_SITE_VALIDATION_MODAL_ID,
components: {
GlAlert,
ClipboardButton,
ModalCopyButton,
GlButton,
GlFormGroup,
GlFormInput,
......@@ -247,9 +247,10 @@ export default {
:label="s__('DastSiteValidation|Step 2 - Add following HTTP header to your site')"
>
<code class="gl-p-3 gl-bg-black gl-text-white">{{ httpHeader }}</code>
<clipboard-button
<modal-copy-button
:text="httpHeader"
:title="s__('DastSiteValidation|Copy HTTP header to clipboard')"
:modal-id="modalProps.id"
/>
</gl-form-group>
<gl-form-group :label="locationStepLabel" class="mw-460">
......
......@@ -10,7 +10,7 @@ import { GlAlert, GlFormGroup, GlModal, GlSkeletonLoader } from '@gitlab/ui';
import DastSiteValidationModal from 'ee/security_configuration/dast_site_validation/components/dast_site_validation_modal.vue';
import * as responses from '../mock_data/apollo_mock';
import download from '~/lib/utils/downloader';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import ModalCopyButton from '~/vue_shared/components/modal_copy_button.vue';
jest.mock('~/lib/utils/downloader');
......@@ -273,7 +273,7 @@ describe('DastSiteValidationModal', () => {
});
it('shows a button that copies the http-header to the clipboard', () => {
const clipboardButton = wrapper.find(ClipboardButton);
const clipboardButton = wrapper.find(ModalCopyButton);
expect(clipboardButton.exists()).toBe(true);
expect(clipboardButton.props()).toMatchObject({
......
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