Commit 2c640ee6 authored by Dheeraj Joshi's avatar Dheeraj Joshi

Move constants to a separate file

parent c2d881c2
...@@ -17,6 +17,7 @@ import { ...@@ -17,6 +17,7 @@ import {
SCAN_TYPE_LABEL, SCAN_TYPE_LABEL,
SCAN_TYPE, SCAN_TYPE,
} from 'ee/security_configuration/dast_scanner_profiles/constants'; } from 'ee/security_configuration/dast_scanner_profiles/constants';
import { EXCLUDED_URLS_SEPARATOR } from 'ee/security_configuration/dast_site_profiles_form/constants';
import { DAST_SITE_VALIDATION_STATUS } from 'ee/security_configuration/dast_site_validation/constants'; import { DAST_SITE_VALIDATION_STATUS } from 'ee/security_configuration/dast_site_validation/constants';
import { initFormField } from 'ee/security_configuration/utils'; import { initFormField } from 'ee/security_configuration/utils';
import { convertToGraphQLId } from '~/graphql_shared/utils'; import { convertToGraphQLId } from '~/graphql_shared/utils';
...@@ -319,6 +320,7 @@ export default { ...@@ -319,6 +320,7 @@ export default {
}, },
}, },
ON_DEMAND_SCANS_STORAGE_KEY, ON_DEMAND_SCANS_STORAGE_KEY,
EXCLUDED_URLS_SEPARATOR,
}; };
</script> </script>
...@@ -512,7 +514,7 @@ export default { ...@@ -512,7 +514,7 @@ export default {
<div class="row"> <div class="row">
<profile-selector-summary-cell <profile-selector-summary-cell
:label="s__('DastProfiles|Excluded URLs')" :label="s__('DastProfiles|Excluded URLs')"
:value="selectedSiteProfile.excludedUrls" :value="selectedSiteProfile.excludedUrls.join($options.EXCLUDED_URLS_SEPARATOR)"
/> />
<profile-selector-summary-cell <profile-selector-summary-cell
:label="s__('DastProfiles|Request headers')" :label="s__('DastProfiles|Request headers')"
......
...@@ -18,14 +18,15 @@ import { __, s__, n__, sprintf } from '~/locale'; ...@@ -18,14 +18,15 @@ import { __, s__, n__, sprintf } from '~/locale';
import validation from '~/vue_shared/directives/validation'; import validation from '~/vue_shared/directives/validation';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import tooltipIcon from '../../dast_scanner_profiles/components/tooltip_icon.vue'; import tooltipIcon from '../../dast_scanner_profiles/components/tooltip_icon.vue';
import {
MAX_CHAR_LIMIT_EXCLUDED_URLS,
MAX_CHAR_LIMIT_REQUEST_HEADERS,
EXCLUDED_URLS_SEPARATOR,
} from '../constants';
import dastSiteProfileCreateMutation from '../graphql/dast_site_profile_create.mutation.graphql'; import dastSiteProfileCreateMutation from '../graphql/dast_site_profile_create.mutation.graphql';
import dastSiteProfileUpdateMutation from '../graphql/dast_site_profile_update.mutation.graphql'; import dastSiteProfileUpdateMutation from '../graphql/dast_site_profile_update.mutation.graphql';
import DastSiteAuthSection from './dast_site_auth_section.vue'; import DastSiteAuthSection from './dast_site_auth_section.vue';
const MAX_CHAR_LIMIT_EXCLUDED_URLS = 2048;
const MAX_CHAR_LIMIT_REQUEST_HEADERS = 2048;
const EXCLUDED_URLS_SEPARATOR = ',';
export default { export default {
name: 'DastSiteProfileForm', name: 'DastSiteProfileForm',
components: { components: {
......
export const MAX_CHAR_LIMIT_EXCLUDED_URLS = 2048;
export const MAX_CHAR_LIMIT_REQUEST_HEADERS = 2048;
export const EXCLUDED_URLS_SEPARATOR = ',';
...@@ -536,7 +536,7 @@ describe('OnDemandScansForm', () => { ...@@ -536,7 +536,7 @@ describe('OnDemandScansForm', () => {
const summary = subject.find(SiteProfileSelector).text(); const summary = subject.find(SiteProfileSelector).text();
expect(summary).toMatch(authEnabledProfile.targetUrl); expect(summary).toMatch(authEnabledProfile.targetUrl);
expect(summary).toMatch(authEnabledProfile.excludedUrls); expect(summary).toMatch(authEnabledProfile.excludedUrls.join(','));
expect(summary).toMatch(authEnabledProfile.requestHeaders); expect(summary).toMatch(authEnabledProfile.requestHeaders);
expect(summary).toMatch(authEnabledProfile.auth.url); expect(summary).toMatch(authEnabledProfile.auth.url);
expect(summary).toMatch(authEnabledProfile.auth.username); expect(summary).toMatch(authEnabledProfile.auth.username);
......
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