Commit a1909444 authored by Frédéric Caplette's avatar Frédéric Caplette Committed by Sarah Groff Hennigh-Palermo

Fix graph not rendering links when updating Ci config

We need to revert back to using the gl-tab for now and avoid
the wrapper that handles keeping the component alive since it
breaks the graph. This also means that for now, the viz component
is mounted every time we click on the tab.
parent 2ea0c5db
<script> <script>
import { GlAlert, GlLoadingIcon, GlTabs } from '@gitlab/ui'; import { GlAlert, GlLoadingIcon, GlTabs, GlTab } from '@gitlab/ui';
import { __, s__, sprintf } from '~/locale'; import { __, s__, sprintf } from '~/locale';
import { mergeUrlParams, redirectTo } from '~/lib/utils/url_utility'; import { mergeUrlParams, redirectTo } from '~/lib/utils/url_utility';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
...@@ -28,12 +28,13 @@ const LOAD_FAILURE_UNKNOWN = 'LOAD_FAILURE_UNKNOWN'; ...@@ -28,12 +28,13 @@ const LOAD_FAILURE_UNKNOWN = 'LOAD_FAILURE_UNKNOWN';
export default { export default {
components: { components: {
CommitForm,
CiLint, CiLint,
CommitForm,
EditorTab, EditorTab,
GlAlert, GlAlert,
GlLoadingIcon, GlLoadingIcon,
GlTabs, GlTabs,
GlTab,
PipelineGraph, PipelineGraph,
TextEditor, TextEditor,
ValidationSegment, ValidationSegment,
...@@ -317,16 +318,15 @@ export default { ...@@ -317,16 +318,15 @@ export default {
:commit-sha="lastCommitSha" :commit-sha="lastCommitSha"
/> />
</editor-tab> </editor-tab>
<editor-tab <gl-tab
v-if="glFeatures.ciConfigVisualizationTab" v-if="glFeatures.ciConfigVisualizationTab"
:lazy="true" :lazy="true"
:title="$options.i18n.tabGraph" :title="$options.i18n.tabGraph"
:title-link-attributes="{ 'data-testid': 'visualization-tab-btn' }"
data-testid="visualization-tab" data-testid="visualization-tab"
> >
<gl-loading-icon v-if="isCiConfigDataLoading" size="lg" class="gl-m-3" /> <gl-loading-icon v-if="isCiConfigDataLoading" size="lg" class="gl-m-3" />
<pipeline-graph v-else :pipeline-data="ciConfigData" /> <pipeline-graph v-else :pipeline-data="ciConfigData" />
</editor-tab> </gl-tab>
<editor-tab :title="$options.i18n.tabLint"> <editor-tab :title="$options.i18n.tabLint">
<gl-loading-icon v-if="isCiConfigDataLoading" size="lg" class="gl-m-3" /> <gl-loading-icon v-if="isCiConfigDataLoading" size="lg" class="gl-m-3" />
......
...@@ -198,21 +198,6 @@ describe('~/pipeline_editor/pipeline_editor_app.vue', () => { ...@@ -198,21 +198,6 @@ describe('~/pipeline_editor/pipeline_editor_app.vue', () => {
expect(findLoadingIcon().exists()).toBe(true); expect(findLoadingIcon().exists()).toBe(true);
expect(findPipelineGraph().exists()).toBe(false); expect(findPipelineGraph().exists()).toBe(false);
}); });
it('displays the graph only after the tab is mounted and selected', async () => {
createComponent({ mountFn: mount });
expect(findTabAt(1).find(PipelineGraph).exists()).toBe(false);
await nextTick();
// Select visualization tab
wrapper.find('[data-testid="visualization-tab-btn"]').trigger('click');
await nextTick();
expect(findTabAt(1).find(PipelineGraph).exists()).toBe(true);
});
}); });
describe('with feature flag off', () => { describe('with feature flag off', () => {
......
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