Commit 10b8d3d3 authored by Sarah Groff Hennigh-Palermo's avatar Sarah Groff Hennigh-Palermo

Merge branch 'hide-pipeline-status-for-blank-projects' into 'master'

Hide pipeline status in pipeline editor for new projects

See merge request gitlab-org/gitlab!57213
parents 23ffad4f a58e010f
......@@ -35,10 +35,14 @@ export default {
type: Object,
required: true,
},
isNewCiConfigFile: {
type: Boolean,
required: true,
},
},
computed: {
showPipelineStatus() {
return this.glFeatures.pipelineStatusForPipelineEditor;
return this.glFeatures.pipelineStatusForPipelineEditor && !this.isNewCiConfigFile;
},
// make sure corners are rounded correctly depending on if
// pipeline status is rendered
......
......@@ -278,6 +278,7 @@ export default {
<pipeline-editor-home
:ci-config-data="ciConfigData"
:ci-file-content="currentCiFileContent"
:is-new-ci-config-file="isNewCiConfigFile"
@commit="updateOnCommit"
@resetContent="resetContent"
@showError="showErrorAlert"
......
......@@ -19,6 +19,10 @@ export default {
type: String,
required: true,
},
isNewCiConfigFile: {
type: Boolean,
required: true,
},
},
data() {
return {
......@@ -40,7 +44,10 @@ export default {
<template>
<div>
<pipeline-editor-header :ci-config-data="ciConfigData" />
<pipeline-editor-header
:ci-config-data="ciConfigData"
:is-new-ci-config-file="isNewCiConfigFile"
/>
<pipeline-editor-tabs
:ci-config-data="ciConfigData"
:ci-file-content="ciFileContent"
......
......@@ -13,7 +13,7 @@ describe('Pipeline editor header', () => {
},
};
const createComponent = ({ provide = {} } = {}) => {
const createComponent = ({ provide = {}, props = {} } = {}) => {
wrapper = shallowMount(PipelineEditorHeader, {
provide: {
...mockProvide,
......@@ -23,6 +23,8 @@ describe('Pipeline editor header', () => {
ciConfigData: mockLintResponse,
ciFileContent: mockCiYml,
isCiConfigDataLoading: false,
isNewCiConfigFile: false,
...props,
},
});
};
......@@ -36,15 +38,21 @@ describe('Pipeline editor header', () => {
});
describe('template', () => {
beforeEach(() => {
createComponent();
it('hides the pipeline status for new projects without a CI file', () => {
createComponent({ props: { isNewCiConfigFile: true } });
expect(findPipelineStatus().exists()).toBe(false);
});
it('renders the pipeline status', () => {
it('renders the pipeline status when CI file exists', () => {
createComponent({ props: { isNewCiConfigFile: false } });
expect(findPipelineStatus().exists()).toBe(true);
});
it('renders the validation segment', () => {
createComponent();
expect(findValidationSegment().exists()).toBe(true);
});
});
......
......@@ -18,6 +18,7 @@ describe('Pipeline editor home wrapper', () => {
ciConfigData: mockLintResponse,
ciFileContent: mockCiYml,
isCiConfigDataLoading: false,
isNewCiConfigFile: false,
...props,
},
});
......
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