Commit 284d320f authored by Vitaly Slobodin's avatar Vitaly Slobodin

Merge branch '320949-ci-help-path-remove-prop' into 'master'

Reduce prop drilling of URL for CI Quick Start page button

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