Commit 3c6b6736 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch...

Merge branch '346354-pipeline-editor-shows-wrong-pipeline-status-immediately-after-committing-the-config' into 'master'

Remove misleading configuration error message in Pipeline Editor

See merge request gitlab-org/gitlab!76267
parents ce272f6b c3cdc2b3
...@@ -21,9 +21,6 @@ export const i18n = { ...@@ -21,9 +21,6 @@ export const i18n = {
), ),
viewBtn: s__('Pipeline|View pipeline'), viewBtn: s__('Pipeline|View pipeline'),
viewCommit: s__('Pipeline|View commit'), viewCommit: s__('Pipeline|View commit'),
pipelineNotTriggeredMsg: s__(
'Pipeline|No pipeline was triggered for the latest changes due to the current CI/CD configuration.',
),
}; };
export default { export default {
...@@ -79,22 +76,16 @@ export default { ...@@ -79,22 +76,16 @@ export default {
result(res) { result(res) {
if (res.data?.project?.pipeline) { if (res.data?.project?.pipeline) {
this.hasError = false; this.hasError = false;
} else {
this.hasError = true;
this.pipelineNotTriggered = true;
} }
}, },
error() { error() {
this.hasError = true; this.hasError = true;
this.networkError = true;
}, },
pollInterval: POLL_INTERVAL, pollInterval: POLL_INTERVAL,
}, },
}, },
data() { data() {
return { return {
networkError: false,
pipelineNotTriggered: false,
hasError: false, hasError: false,
}; };
}, },
...@@ -148,16 +139,8 @@ export default { ...@@ -148,16 +139,8 @@ export default {
</div> </div>
</template> </template>
<template v-else-if="hasError"> <template v-else-if="hasError">
<div v-if="networkError">
<gl-icon class="gl-mr-auto" name="warning-solid" /> <gl-icon class="gl-mr-auto" name="warning-solid" />
<span data-testid="pipeline-error-msg">{{ $options.i18n.fetchError }}</span> <span data-testid="pipeline-error-msg">{{ $options.i18n.fetchError }}</span>
</div>
<div v-else>
<gl-icon class="gl-mr-auto" name="information-o" />
<span data-testid="pipeline-not-triggered-error-msg">
{{ $options.i18n.pipelineNotTriggeredMsg }}
</span>
</div>
</template> </template>
<template v-else> <template v-else>
<div class="gl-text-truncate gl-md-max-w-50p gl-mr-1"> <div class="gl-text-truncate gl-md-max-w-50p gl-mr-1">
......
...@@ -26000,9 +26000,6 @@ msgstr "" ...@@ -26000,9 +26000,6 @@ msgstr ""
msgid "Pipeline|Merged result pipeline" msgid "Pipeline|Merged result pipeline"
msgstr "" msgstr ""
msgid "Pipeline|No pipeline was triggered for the latest changes due to the current CI/CD configuration."
msgstr ""
msgid "Pipeline|Passed" msgid "Pipeline|Passed"
msgstr "" msgstr ""
......
...@@ -39,8 +39,6 @@ describe('Pipeline Status', () => { ...@@ -39,8 +39,6 @@ describe('Pipeline Status', () => {
const findPipelineId = () => wrapper.find('[data-testid="pipeline-id"]'); const findPipelineId = () => wrapper.find('[data-testid="pipeline-id"]');
const findPipelineCommit = () => wrapper.find('[data-testid="pipeline-commit"]'); const findPipelineCommit = () => wrapper.find('[data-testid="pipeline-commit"]');
const findPipelineErrorMsg = () => wrapper.find('[data-testid="pipeline-error-msg"]'); const findPipelineErrorMsg = () => wrapper.find('[data-testid="pipeline-error-msg"]');
const findPipelineNotTriggeredErrorMsg = () =>
wrapper.find('[data-testid="pipeline-not-triggered-error-msg"]');
const findPipelineLoadingMsg = () => wrapper.find('[data-testid="pipeline-loading-msg"]'); const findPipelineLoadingMsg = () => wrapper.find('[data-testid="pipeline-loading-msg"]');
const findPipelineViewBtn = () => wrapper.find('[data-testid="pipeline-view-btn"]'); const findPipelineViewBtn = () => wrapper.find('[data-testid="pipeline-view-btn"]');
const findStatusIcon = () => wrapper.find('[data-testid="pipeline-status-icon"]'); const findStatusIcon = () => wrapper.find('[data-testid="pipeline-status-icon"]');
...@@ -119,8 +117,7 @@ describe('Pipeline Status', () => { ...@@ -119,8 +117,7 @@ describe('Pipeline Status', () => {
await waitForPromises(); await waitForPromises();
}); });
it('renders api error', () => { it('renders error', () => {
expect(findPipelineNotTriggeredErrorMsg().exists()).toBe(false);
expect(findIcon().attributes('name')).toBe('warning-solid'); expect(findIcon().attributes('name')).toBe('warning-solid');
expect(findPipelineErrorMsg().text()).toBe(i18n.fetchError); expect(findPipelineErrorMsg().text()).toBe(i18n.fetchError);
}); });
...@@ -132,22 +129,5 @@ describe('Pipeline Status', () => { ...@@ -132,22 +129,5 @@ describe('Pipeline Status', () => {
expect(findPipelineViewBtn().exists()).toBe(false); expect(findPipelineViewBtn().exists()).toBe(false);
}); });
}); });
describe('when pipeline is null', () => {
beforeEach(() => {
mockPipelineQuery.mockResolvedValue({
data: { project: { id: '1', pipeline: null } },
});
createComponentWithApollo();
waitForPromises();
});
it('renders pipeline not triggered error', () => {
expect(findPipelineErrorMsg().exists()).toBe(false);
expect(findIcon().attributes('name')).toBe('information-o');
expect(findPipelineNotTriggeredErrorMsg().text()).toBe(i18n.pipelineNotTriggeredMsg);
});
});
}); });
}); });
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