Commit a31f5a05 authored by Miguel Rincon's avatar Miguel Rincon

Merge branch '230724-matej-tabs-migration-ide-pipelines-list' into 'master'

Replace tabs with new component on IDE pipelines panel

See merge request gitlab-org/gitlab!45007
parents 68ff9957 b5c9af39
<script> <script>
import { mapActions, mapGetters, mapState } from 'vuex'; import { mapActions, mapGetters, mapState } from 'vuex';
import { escape } from 'lodash'; import { escape } from 'lodash';
import { GlLoadingIcon, GlIcon, GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui'; import {
GlLoadingIcon,
GlIcon,
GlSafeHtmlDirective as SafeHtml,
GlTabs,
GlTab,
GlBadge,
} from '@gitlab/ui';
import { sprintf, __ } from '../../../locale'; import { sprintf, __ } from '../../../locale';
import CiIcon from '../../../vue_shared/components/ci_icon.vue'; import CiIcon from '../../../vue_shared/components/ci_icon.vue';
import Tabs from '../../../vue_shared/components/tabs/tabs';
import Tab from '../../../vue_shared/components/tabs/tab.vue';
import EmptyState from '../../../pipelines/components/pipelines_list/empty_state.vue'; import EmptyState from '../../../pipelines/components/pipelines_list/empty_state.vue';
import JobsList from '../jobs/list.vue'; import JobsList from '../jobs/list.vue';
...@@ -15,11 +20,12 @@ export default { ...@@ -15,11 +20,12 @@ export default {
components: { components: {
GlIcon, GlIcon,
CiIcon, CiIcon,
Tabs,
Tab,
JobsList, JobsList,
EmptyState, EmptyState,
GlLoadingIcon, GlLoadingIcon,
GlTabs,
GlTab,
GlBadge,
}, },
directives: { directives: {
SafeHtml, SafeHtml,
...@@ -88,22 +94,26 @@ export default { ...@@ -88,22 +94,26 @@ export default {
<p class="gl-mb-0 break-word">{{ latestPipeline.yamlError }}</p> <p class="gl-mb-0 break-word">{{ latestPipeline.yamlError }}</p>
<p v-safe-html="ciLintText" class="gl-mb-0"></p> <p v-safe-html="ciLintText" class="gl-mb-0"></p>
</div> </div>
<tabs v-else class="ide-pipeline-list"> <gl-tabs v-else>
<tab :active="!pipelineFailed"> <gl-tab :active="!pipelineFailed">
<template #title> <template #title>
{{ __('Jobs') }} {{ __('Jobs') }}
<span v-if="jobsCount" class="badge badge-pill"> {{ jobsCount }} </span> <gl-badge v-if="jobsCount" size="sm" class="gl-tab-counter-badge">{{
jobsCount
}}</gl-badge>
</template> </template>
<jobs-list :loading="isLoadingJobs" :stages="stages" /> <jobs-list :loading="isLoadingJobs" :stages="stages" />
</tab> </gl-tab>
<tab :active="pipelineFailed"> <gl-tab :active="pipelineFailed">
<template #title> <template #title>
{{ __('Failed Jobs') }} {{ __('Failed Jobs') }}
<span v-if="failedJobsCount" class="badge badge-pill"> {{ failedJobsCount }} </span> <gl-badge v-if="failedJobsCount" size="sm" class="gl-tab-counter-badge">{{
failedJobsCount
}}</gl-badge>
</template> </template>
<jobs-list :loading="isLoadingJobs" :stages="failedStages" /> <jobs-list :loading="isLoadingJobs" :stages="failedStages" />
</tab> </gl-tab>
</tabs> </gl-tabs>
</template> </template>
</div> </div>
</template> </template>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
$bs-input-focus-border: #80bdff; $bs-input-focus-border: #80bdff;
$bs-input-focus-box-shadow: rgba(0, 123, 255, 0.25); $bs-input-focus-box-shadow: rgba(0, 123, 255, 0.25);
a:not(.btn), a:not(.btn):not(.gl-tab-nav-item),
.gl-button.btn-link, .gl-button.btn-link,
.gl-button.btn-link:hover, .gl-button.btn-link:hover,
.gl-button.btn-link:focus, .gl-button.btn-link:focus,
......
...@@ -915,12 +915,6 @@ $ide-commit-header-height: 48px; ...@@ -915,12 +915,6 @@ $ide-commit-header-height: 48px;
} }
} }
.ide-pipeline-list {
flex: 1;
overflow: auto;
padding: 0 $gl-padding;
}
.ide-pipeline-header { .ide-pipeline-header {
min-height: 55px; min-height: 55px;
padding-left: $gl-padding; padding-left: $gl-padding;
......
---
title: Update Web IDE pipelines panel to use our design system component
merge_request: 45007
author: matejlatin
type: other
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { GlLoadingIcon } from '@gitlab/ui'; import { GlLoadingIcon, GlTab } from '@gitlab/ui';
import { TEST_HOST } from 'helpers/test_constants'; import { TEST_HOST } from 'helpers/test_constants';
import { pipelines } from 'jest/ide/mock_data'; import { pipelines } from 'jest/ide/mock_data';
import List from '~/ide/components/pipelines/list.vue'; import List from '~/ide/components/pipelines/list.vue';
import JobsList from '~/ide/components/jobs/list.vue'; import JobsList from '~/ide/components/jobs/list.vue';
import Tab from '~/vue_shared/components/tabs/tab.vue';
import CiIcon from '~/vue_shared/components/ci_icon.vue'; import CiIcon from '~/vue_shared/components/ci_icon.vue';
import IDEServices from '~/ide/services'; import IDEServices from '~/ide/services';
...@@ -167,7 +166,7 @@ describe('IDE pipelines list', () => { ...@@ -167,7 +166,7 @@ describe('IDE pipelines list', () => {
createComponent({}, { ...withLatestPipelineState, stages, isLoadingJobs }); createComponent({}, { ...withLatestPipelineState, stages, isLoadingJobs });
const jobProps = wrapper const jobProps = wrapper
.findAll(Tab) .findAll(GlTab)
.at(0) .at(0)
.find(JobsList) .find(JobsList)
.props(); .props();
...@@ -182,7 +181,7 @@ describe('IDE pipelines list', () => { ...@@ -182,7 +181,7 @@ describe('IDE pipelines list', () => {
createComponent({}, { ...withLatestPipelineState, isLoadingJobs }); createComponent({}, { ...withLatestPipelineState, isLoadingJobs });
const jobProps = wrapper const jobProps = wrapper
.findAll(Tab) .findAll(GlTab)
.at(1) .at(1)
.find(JobsList) .find(JobsList)
.props(); .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