Commit 1fadd6f1 authored by Mark Florian's avatar Mark Florian

Merge branch 'djadmin-dast-fix-clipboard-btn' into 'master'

Fix clipboard button for DAST site validation modal

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