Commit e14c4962 authored by Dave Pisek's avatar Dave Pisek

Remove unused pipeline-help-path from sec config

This commit removes redundant logic around a help link from the FE.
parent c3935123
......@@ -18,10 +18,6 @@ export default {
type: String,
required: true,
},
pipelinesHelpPagePath: {
type: String,
required: true,
},
autoDevopsHelpPagePath: {
type: String,
required: true,
......@@ -44,15 +40,7 @@ export default {
return sprintf(body, { wordBreakOpportunity }, false);
},
callOutLink() {
if (this.autoDevopsEnabled) {
return this.autoDevopsHelpPagePath;
}
if (this.latestPipelinePath) {
return this.latestPipelinePath;
}
return this.pipelinesHelpPagePath;
return this.autoDevopsEnabled ? this.autoDevopsHelpPagePath : this.latestPipelinePath;
},
calloutContent() {
const bodyDefault = __(`The configuration status of the table below only applies to the default branch and
......
......@@ -9,7 +9,6 @@ export default function init() {
features,
helpPagePath,
latestPipelinePath,
pipelinesHelpPagePath,
} = el.dataset;
return new Vue({
......@@ -25,7 +24,6 @@ export default function init() {
features: JSON.parse(features),
helpPagePath,
latestPipelinePath,
pipelinesHelpPagePath,
},
});
},
......
......@@ -13,7 +13,6 @@ describe('Security Configuration App', () => {
latestPipelinePath: 'http://latestPipelinePath',
autoDevopsHelpPagePath: 'http://autoDevopsHelpPagePath',
helpPagePath: 'http://helpPagePath',
pipelinesHelpPagePath: 'http://pipelineHelpPagePath',
...props,
},
});
......@@ -46,14 +45,13 @@ describe('Security Configuration App', () => {
});
it.each`
autoDevopsEnabled | latestPipelinePath | expectedUrl
${true} | ${'http://latestPipeline'} | ${'http://autoDevopsHelpPagePath'}
${false} | ${'http://latestPipeline'} | ${'http://latestPipeline'}
${false} | ${undefined} | ${'http://pipelineHelpPagePath'}
autoDevopsEnabled | expectedUrl
${true} | ${'http://autoDevopsHelpPagePath'}
${false} | ${'http://latestPipelinePath'}
`(
'displays a link to "$expectedUrl" when autoDevops is "$autoDevopsEnabled" and pipelinesPath is $latestPipelinePath',
({ autoDevopsEnabled, latestPipelinePath, expectedUrl }) => {
createComponent({ autoDevopsEnabled, latestPipelinePath });
'displays a link to "$expectedUrl" when autoDevops is "$autoDevopsEnabled"',
({ autoDevopsEnabled, expectedUrl }) => {
createComponent({ autoDevopsEnabled });
expect(getPipelinesLink().attributes('href')).toBe(expectedUrl);
expect(getPipelinesLink().attributes('rel')).toBe('noopener');
......
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