Commit f659f8cf authored by Phil Hughes's avatar Phil Hughes

Merge branch '53133-jobs-list' into 'master'

Fix stage dropdown rendering only in English

Closes #53133

See merge request gitlab-org/gitlab-ce!22604
parents 9b36f523 1cc09301
......@@ -31,7 +31,7 @@ export default {
},
},
computed: {
...mapState(['job', 'stages', 'jobs', 'selectedStage']),
...mapState(['job', 'stages', 'jobs', 'selectedStage', 'isLoadingStages']),
coverage() {
return `${this.job.coverage}%`;
},
......@@ -59,10 +59,10 @@ export default {
return '';
}
let t = this.job.metadata.timeout_human_readable;
if (this.job.metadata.timeout_source !== '') {
t += ` (from ${this.job.metadata.timeout_source})`;
}
let t = this.job.metadata.timeout_human_readable;
if (this.job.metadata.timeout_source !== '') {
t += ` (from ${this.job.metadata.timeout_source})`;
}
return t;
},
......@@ -270,6 +270,7 @@ export default {
/>
<stages-dropdown
v-if="!isLoadingStages"
:stages="stages"
:pipeline="job.pipeline"
:selected-stage="selectedStage"
......
......@@ -22,7 +22,6 @@ export default {
required: true,
},
},
computed: {
hasRef() {
return !_.isEmpty(this.pipeline.ref);
......
......@@ -71,7 +71,7 @@ export default {
* after the first request,
* and we do not want to hijack that
*/
if (state.selectedStage === 'More' && job.stage) {
if (state.selectedStage === '' && job.stage) {
state.selectedStage = job.stage;
}
},
......
import { __ } from '~/locale';
export default () => ({
jobEndpoint: null,
traceEndpoint: null,
......@@ -29,7 +27,7 @@ export default () => ({
// sidebar dropdown & list of jobs
isLoadingStages: false,
isLoadingJobs: false,
selectedStage: __('More'),
selectedStage: '',
stages: [],
jobs: [],
});
---
title: Fix stage dropdown not rendering in different languages
merge_request: 22604
author:
type: other
......@@ -140,10 +140,11 @@ describe('Sidebar details block', () => {
});
describe('while fetching stages', () => {
it('renders dropdown with More label', () => {
it('it does not render dropdown', () => {
store.dispatch('requestStages');
vm = mountComponentWithStore(SidebarComponent, { store });
expect(vm.$el.querySelector('.js-selected-stage').textContent.trim()).toEqual('More');
expect(vm.$el.querySelector('.js-selected-stage')).toBeNull();
});
});
......
......@@ -124,8 +124,8 @@ describe('Jobs Store Mutations', () => {
expect(stateCopy.job).toEqual({ id: 1312321 });
});
it('sets selectedStage when the selectedStage is More', () => {
expect(stateCopy.selectedStage).toEqual('More');
it('sets selectedStage when the selectedStage is empty', () => {
expect(stateCopy.selectedStage).toEqual('');
mutations[types.RECEIVE_JOB_SUCCESS](stateCopy, { id: 1312321, stage: 'deploy' });
expect(stateCopy.selectedStage).toEqual('deploy');
......
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