Commit a95cf22b authored by Payton Burdette's avatar Payton Burdette Committed by Paul Slaughter

Remove pending and running tabs

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