Commit f9fd6b55 authored by Paul Slaughter's avatar Paul Slaughter

Merge branch 'remove-some-tabs-from-pipelines-list' into 'master'

Remove pending and running tabs from pipelines list

See merge request gitlab-org/gitlab!35062
parents 04b53261 a95cf22b
<script>
import { isEqual } from 'lodash';
import { __, sprintf, s__ } from '~/locale';
import { __, s__ } from '~/locale';
import createFlash from '~/flash';
import PipelinesService from '../../services/pipelines_service';
import pipelinesMixin from '../../mixins/pipelines';
......@@ -117,8 +117,6 @@ export default {
},
scopes: {
all: 'all',
pending: 'pending',
running: 'running',
finished: 'finished',
branches: 'branches',
tags: 'tags',
......@@ -171,13 +169,8 @@ export default {
},
emptyTabMessage() {
const { scopes } = this.$options;
const possibleScopes = [scopes.pending, scopes.running, scopes.finished];
if (possibleScopes.includes(this.scope)) {
return sprintf(s__('Pipelines|There are currently no %{scope} pipelines.'), {
scope: this.scope,
});
if (this.scope === this.$options.scopes.finished) {
return s__('Pipelines|There are currently no finished pipelines.');
}
return s__('Pipelines|There are currently no pipelines.');
......@@ -194,22 +187,9 @@ export default {
count: count.all,
isActive: this.scope === 'all',
},
{
name: __('Pending'),
scope: scopes.pending,
count: count.pending,
isActive: this.scope === 'pending',
},
{
name: __('Running'),
scope: scopes.running,
count: count.running,
isActive: this.scope === 'running',
},
{
name: __('Finished'),
scope: scopes.finished,
count: count.finished,
isActive: this.scope === 'finished',
},
{
......
---
title: Remove pending and running tabs from pipelines list and remove count from finished tab
merge_request: 35062
author:
type: changed
......@@ -16465,7 +16465,7 @@ msgstr ""
msgid "Pipelines|Something went wrong while cleaning runners cache."
msgstr ""
msgid "Pipelines|There are currently no %{scope} pipelines."
msgid "Pipelines|There are currently no finished pipelines."
msgstr ""
msgid "Pipelines|There are currently no pipelines."
......
......@@ -65,19 +65,8 @@ RSpec.describe 'Pipelines', :js do
expect(page.find('.js-pipelines-tab-all .badge').text).to include('1')
end
it 'shows a tab for Pending pipelines and count' do
expect(page.find('.js-pipelines-tab-pending').text).to include('Pending')
expect(page.find('.js-pipelines-tab-pending .badge').text).to include('0')
end
it 'shows a tab for Running pipelines and count' do
expect(page.find('.js-pipelines-tab-running').text).to include('Running')
expect(page.find('.js-pipelines-tab-running .badge').text).to include('1')
end
it 'shows a tab for Finished pipelines and count' do
expect(page.find('.js-pipelines-tab-finished').text).to include('Finished')
expect(page.find('.js-pipelines-tab-finished .badge').text).to include('0')
end
it 'shows a tab for Branches' do
......@@ -89,9 +78,9 @@ RSpec.describe 'Pipelines', :js do
end
it 'updates content when tab is clicked' do
page.find('.js-pipelines-tab-pending').click
page.find('.js-pipelines-tab-finished').click
wait_for_requests
expect(page).to have_content('There are currently no pending pipelines.')
expect(page).to have_content('There are currently no finished pipelines.')
end
end
......
......@@ -343,12 +343,8 @@ describe('Pipelines', () => {
});
it('should render navigation tabs', () => {
expect(wrapper.find('.js-pipelines-tab-pending').text()).toContain('Pending');
expect(wrapper.find('.js-pipelines-tab-all').text()).toContain('All');
expect(wrapper.find('.js-pipelines-tab-running').text()).toContain('Running');
expect(wrapper.find('.js-pipelines-tab-finished').text()).toContain('Finished');
expect(wrapper.find('.js-pipelines-tab-branches').text()).toContain('Branches');
......@@ -452,8 +448,6 @@ describe('Pipelines', () => {
it('returns default tabs', () => {
expect(wrapper.vm.tabs).toEqual([
{ name: 'All', scope: 'all', count: undefined, isActive: true },
{ name: 'Pending', scope: 'pending', count: undefined, isActive: false },
{ name: 'Running', scope: 'running', count: undefined, isActive: false },
{ name: 'Finished', scope: 'finished', count: undefined, isActive: false },
{ name: 'Branches', scope: 'branches', isActive: false },
{ name: 'Tags', scope: 'tags', isActive: false },
......@@ -462,11 +456,11 @@ describe('Pipelines', () => {
});
describe('emptyTabMessage', () => {
it('returns message with scope', () => {
wrapper.vm.scope = 'pending';
it('returns message with finished scope', () => {
wrapper.vm.scope = 'finished';
return wrapper.vm.$nextTick().then(() => {
expect(wrapper.vm.emptyTabMessage).toEqual('There are currently no pending pipelines.');
expect(wrapper.vm.emptyTabMessage).toEqual('There are currently no finished pipelines.');
});
});
......
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