Import help page path constant

Remove the help page path provide in favor of importing the constant
where it is needed.
parent aa89052f
<script> <script>
import { GlEmptyState, GlSprintf, GlLink } from '@gitlab/ui'; import { GlEmptyState, GlSprintf, GlLink } from '@gitlab/ui';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import { HELP_PAGE_PATH } from '../constants';
export default { export default {
HELP_PAGE_PATH,
components: { components: {
GlEmptyState, GlEmptyState,
GlSprintf, GlSprintf,
GlLink, GlLink,
}, },
inject: ['newDastScanPath', 'helpPagePath', 'emptyStateSvgPath'], inject: ['newDastScanPath', 'emptyStateSvgPath'],
props: { props: {
title: { title: {
type: String, type: String,
...@@ -54,7 +56,7 @@ export default { ...@@ -54,7 +56,7 @@ export default {
<template #description> <template #description>
<gl-sprintf :message="text"> <gl-sprintf :message="text">
<template #learnMoreLink="{ content }"> <template #learnMoreLink="{ content }">
<gl-link :href="helpPagePath">{{ content }}</gl-link> <gl-link :href="$options.HELP_PAGE_PATH">{{ content }}</gl-link>
</template> </template>
</gl-sprintf> </gl-sprintf>
</template> </template>
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import { GlButton, GlLink, GlSprintf, GlTabs } from '@gitlab/ui'; import { GlButton, GlLink, GlSprintf, GlTabs } from '@gitlab/ui';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import ConfigurationPageLayout from 'ee/security_configuration/components/configuration_page_layout.vue'; import ConfigurationPageLayout from 'ee/security_configuration/components/configuration_page_layout.vue';
import { HELP_PAGE_PATH } from '../constants';
import AllTab from './tabs/all.vue'; import AllTab from './tabs/all.vue';
import RunningTab from './tabs/running.vue'; import RunningTab from './tabs/running.vue';
import FinishedTab from './tabs/finished.vue'; import FinishedTab from './tabs/finished.vue';
...@@ -25,6 +26,7 @@ const TABS = { ...@@ -25,6 +26,7 @@ const TABS = {
export default { export default {
TABS, TABS,
HELP_PAGE_PATH,
components: { components: {
GlButton, GlButton,
GlLink, GlLink,
...@@ -37,7 +39,7 @@ export default { ...@@ -37,7 +39,7 @@ export default {
ScheduledTab, ScheduledTab,
EmptyState, EmptyState,
}, },
inject: ['newDastScanPath', 'helpPagePath'], inject: ['newDastScanPath'],
data() { data() {
return { return {
activeTabIndex: 0, activeTabIndex: 0,
...@@ -87,7 +89,9 @@ export default { ...@@ -87,7 +89,9 @@ export default {
<template #description> <template #description>
<gl-sprintf :message="$options.i18n.description"> <gl-sprintf :message="$options.i18n.description">
<template #learnMoreLink="{ content }"> <template #learnMoreLink="{ content }">
<gl-link :href="helpPagePath" data-testid="help-page-link">{{ content }}</gl-link> <gl-link :href="$options.HELP_PAGE_PATH" data-testid="help-page-link">{{
content
}}</gl-link>
</template> </template>
</gl-sprintf> </gl-sprintf>
</template> </template>
......
import Vue from 'vue'; import Vue from 'vue';
import { createRouter } from './router'; import { createRouter } from './router';
import OnDemandScans from './components/on_demand_scans.vue'; import OnDemandScans from './components/on_demand_scans.vue';
import { HELP_PAGE_PATH } from './constants';
export default () => { export default () => {
const el = document.querySelector('#js-on-demand-scans'); const el = document.querySelector('#js-on-demand-scans');
...@@ -16,7 +15,6 @@ export default () => { ...@@ -16,7 +15,6 @@ export default () => {
router: createRouter(), router: createRouter(),
provide: { provide: {
newDastScanPath, newDastScanPath,
helpPagePath: HELP_PAGE_PATH,
emptyStateSvgPath, emptyStateSvgPath,
}, },
render(h) { render(h) {
......
...@@ -35,7 +35,7 @@ exports[`EmptyState renders properly 1`] = ` ...@@ -35,7 +35,7 @@ exports[`EmptyState renders properly 1`] = `
On-demand scans run outside of DevOps cycle and find vulnerabilities in your projects. On-demand scans run outside of DevOps cycle and find vulnerabilities in your projects.
<a <a
class="gl-link" class="gl-link"
href="/help/page/path" href="/help/user/application_security/dast/index#on-demand-scans"
> >
Learn more Learn more
</a> </a>
......
...@@ -15,7 +15,6 @@ describe('EmptyState', () => { ...@@ -15,7 +15,6 @@ describe('EmptyState', () => {
wrapper = mount(EmptyState, { wrapper = mount(EmptyState, {
provide: { provide: {
newDastScanPath: '/on_demand_scans/new', newDastScanPath: '/on_demand_scans/new',
helpPagePath: '/help/page/path',
emptyStateSvgPath: '/empty/state/svg/path', emptyStateSvgPath: '/empty/state/svg/path',
}, },
propsData, propsData,
......
...@@ -15,7 +15,6 @@ describe('OnDemandScans', () => { ...@@ -15,7 +15,6 @@ describe('OnDemandScans', () => {
// Props // Props
const newDastScanPath = '/on_demand_scans/new'; const newDastScanPath = '/on_demand_scans/new';
const helpPagePath = '/help/page/path';
// Finders // Finders
const findNewScanLink = () => wrapper.findByTestId('new-scan-link'); const findNewScanLink = () => wrapper.findByTestId('new-scan-link');
...@@ -32,7 +31,6 @@ describe('OnDemandScans', () => { ...@@ -32,7 +31,6 @@ describe('OnDemandScans', () => {
router, router,
provide: { provide: {
newDastScanPath, newDastScanPath,
helpPagePath,
}, },
stubs: { stubs: {
ConfigurationPageLayout, ConfigurationPageLayout,
...@@ -65,7 +63,9 @@ describe('OnDemandScans', () => { ...@@ -65,7 +63,9 @@ describe('OnDemandScans', () => {
const link = findHelpPageLink(); const link = findHelpPageLink();
expect(link.exists()).toBe(true); expect(link.exists()).toBe(true);
expect(link.attributes('href')).toBe(helpPagePath); expect(link.attributes('href')).toBe(
'/help/user/application_security/dast/index#on-demand-scans',
);
}); });
it('renders a link to create a new scan', () => { it('renders a link to create a new scan', () => {
......
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