Commit 5b1514fd authored by Miguel Rincon's avatar Miguel Rincon

Remove empty state CI help page props

This change removes unnecessary props that take to the following help
page path in the empty state:

help/ci/quick_start/index.md

From the backend. This path can be generated in the frontend.

It also updated the path to the correct location of the page.
parent 00d64e00
......@@ -31,7 +31,6 @@ export default () => {
return createElement(CommitPipelinesTable, {
props: {
endpoint: pipelineTableViewEl.dataset.endpoint,
helpPagePath: pipelineTableViewEl.dataset.helpPagePath,
emptyStateSvgPath: pipelineTableViewEl.dataset.emptyStateSvgPath,
errorStateSvgPath: pipelineTableViewEl.dataset.errorStateSvgPath,
},
......
......@@ -25,10 +25,6 @@ export default {
type: String,
required: true,
},
helpPagePath: {
type: String,
required: true,
},
errorStateSvgPath: {
type: String,
required: true,
......
......@@ -32,7 +32,7 @@ export default {
SafeHtml,
},
computed: {
...mapState(['pipelinesEmptyStateSvgPath', 'links']),
...mapState(['pipelinesEmptyStateSvgPath']),
...mapGetters(['currentProject']),
...mapGetters('pipelines', ['jobsCount', 'failedJobsCount', 'failedStages', 'pipelineFailed']),
...mapState('pipelines', [
......@@ -85,7 +85,6 @@ export default {
</header>
<empty-state
v-if="!latestPipeline"
:help-page-path="links.ciHelpPagePath"
:empty-state-svg-path="pipelinesEmptyStateSvgPath"
:can-set-ci="true"
class="mb-auto mt-auto"
......
......@@ -53,7 +53,6 @@ export function initIde(el, options = {}) {
promotionSvgPath: el.dataset.promotionSvgPath,
});
this.setLinks({
ciHelpPagePath: el.dataset.ciHelpPagePath,
webIDEHelpPagePath: el.dataset.webIdeHelpPagePath,
});
this.setInitialData({
......
......@@ -361,7 +361,6 @@ export default class MergeRequestTabs {
return createElement(CommitPipelinesTable, {
props: {
endpoint: pipelineTableViewEl.dataset.endpoint,
helpPagePath: pipelineTableViewEl.dataset.helpPagePath,
emptyStateSvgPath: pipelineTableViewEl.dataset.emptyStateSvgPath,
errorStateSvgPath: pipelineTableViewEl.dataset.errorStateSvgPath,
canCreatePipelineInTargetProject: Boolean(
......
<script>
import { GlButton } from '@gitlab/ui';
import { helpPagePath } from '~/helpers/help_page_helper';
import { s__ } from '~/locale';
export default {
......@@ -14,10 +15,6 @@ export default {
GlButton,
},
props: {
helpPagePath: {
type: String,
required: true,
},
emptyStateSvgPath: {
type: String,
required: true,
......@@ -27,6 +24,11 @@ export default {
required: true,
},
},
computed: {
ciHelpPagePath() {
return helpPagePath('ci/quick_start/index.md');
},
},
};
</script>
<template>
......@@ -47,7 +49,7 @@ export default {
<div class="gl-text-center">
<gl-button
:href="helpPagePath"
:href="ciHelpPagePath"
variant="info"
category="primary"
data-testid="get-started-pipelines"
......
......@@ -52,10 +52,6 @@ export default {
required: false,
default: '',
},
helpPagePath: {
type: String,
required: true,
},
emptyStateSvgPath: {
type: String,
required: true,
......@@ -333,7 +329,6 @@ export default {
<empty-state
v-else-if="stateToRender === $options.stateMap.emptyState"
:help-page-path="helpPagePath"
:empty-state-svg-path="emptyStateSvgPath"
:can-set-ci="canCreatePipeline"
/>
......
......@@ -23,7 +23,6 @@ export const initPipelinesIndex = (selector = '#pipelines-list-vue') => {
const {
endpoint,
pipelineScheduleUrl,
helpPagePath,
emptyStateSvgPath,
errorStateSvgPath,
noPipelinesSvgPath,
......@@ -55,7 +54,6 @@ export const initPipelinesIndex = (selector = '#pipelines-list-vue') => {
store: this.store,
endpoint,
pipelineScheduleUrl,
helpPagePath,
emptyStateSvgPath,
errorStateSvgPath,
noPipelinesSvgPath,
......
- disable_initialization = local_assigns.fetch(:disable_initialization, false)
#commit-pipeline-table-view{ data: { disable_initialization: disable_initialization,
endpoint: endpoint,
"help-page-path" => help_page_path('ci/quick_start/README'),
"empty-state-svg-path" => image_path('illustrations/pipelines_empty.svg'),
"error-state-svg-path" => image_path('illustrations/pipelines_failed.svg'),
"project-id": @project.id,
......
......@@ -7,7 +7,6 @@
#pipelines-list-vue{ data: { endpoint: project_pipelines_path(@project, format: :json),
project_id: @project.id,
params: params.to_json,
"help-page-path" => help_page_path('ci/quick_start/README'),
"pipeline-schedule-url" => pipeline_schedules_path(@project),
"empty-state-svg-path" => image_path('illustrations/pipelines_empty.svg'),
"error-state-svg-path" => image_path('illustrations/pipelines_failed.svg'),
......
---
title: Update 'Get Started with CI/CD' button with latest URL
merge_request: 54344
author:
type: changed
......@@ -13,7 +13,6 @@ describe('Pipelines table in Commits and Merge requests', () => {
let vm;
const props = {
endpoint: 'endpoint.json',
helpPagePath: 'foo',
emptyStateSvgPath: 'foo',
errorStateSvgPath: 'foo',
};
......
......@@ -10,7 +10,6 @@ exports[`IDE pipelines list when loaded renders empty state when no latestPipeli
cansetci="true"
class="mb-auto mt-auto"
emptystatesvgpath="http://test.host"
helppagepath="http://test.host"
/>
</div>
`;
......@@ -19,7 +19,6 @@ describe('IDE pipelines list', () => {
let wrapper;
const defaultState = {
links: { ciHelpPagePath: TEST_HOST },
pipelinesEmptyStateSvgPath: TEST_HOST,
};
const defaultPipelinesState = {
......
......@@ -9,7 +9,6 @@ describe('Pipelines Empty State', () => {
const createWrapper = () => {
wrapper = shallowMount(EmptyState, {
propsData: {
helpPagePath: 'foo',
emptyStateSvgPath: 'foo',
canSetCi: true,
},
......@@ -35,7 +34,7 @@ describe('Pipelines Empty State', () => {
});
it('should render a link with provided help path', () => {
expect(findGetStartedButton().attributes('href')).toBe('foo');
expect(findGetStartedButton().attributes('href')).toBe('/help/ci/quick_start/index.md');
});
it('should render empty state information', () => {
......
......@@ -34,7 +34,6 @@ describe('Pipelines', () => {
let origWindowLocation;
const paths = {
helpPagePath: '/help/ci/quick_start/README',
emptyStateSvgPath: '/assets/illustrations/pipelines_empty.svg',
errorStateSvgPath: '/assets/illustrations/pipelines_failed.svg',
noPipelinesSvgPath: '/assets/illustrations/pipelines_pending.svg',
......@@ -44,7 +43,6 @@ describe('Pipelines', () => {
};
const noPermissions = {
helpPagePath: '/help/ci/quick_start/README',
emptyStateSvgPath: '/assets/illustrations/pipelines_empty.svg',
errorStateSvgPath: '/assets/illustrations/pipelines_failed.svg',
noPipelinesSvgPath: '/assets/illustrations/pipelines_pending.svg',
......@@ -544,7 +542,9 @@ describe('Pipelines', () => {
'GitLab CI/CD can automatically build, test, and deploy your code.',
);
expect(findEmptyState().find(GlButton).text()).toBe('Get started with CI/CD');
expect(findEmptyState().find(GlButton).attributes('href')).toBe(paths.helpPagePath);
expect(findEmptyState().find(GlButton).attributes('href')).toBe(
'/help/ci/quick_start/index.md',
);
});
it('does not render tabs nor buttons', () => {
......
......@@ -4,7 +4,6 @@ export const IDE_DATASET = {
committedStateSvgPath: '/test/committed_state.svg',
pipelinesEmptyStateSvgPath: '/test/pipelines_empty_state.svg',
promotionSvgPath: '/test/promotion.svg',
ciHelpPagePath: '/test/ci_help_page',
webIDEHelpPagePath: '/test/web_ide_help_page',
clientsidePreviewEnabled: 'true',
renderWhitespaceInCode: 'false',
......
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