Fix stage dropdown rendering only in English
This commit is contained in:
parent
9b36f52310
commit
1cc093011f
7 changed files with 18 additions and 14 deletions
|
@ -31,7 +31,7 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['job', 'stages', 'jobs', 'selectedStage']),
|
...mapState(['job', 'stages', 'jobs', 'selectedStage', 'isLoadingStages']),
|
||||||
coverage() {
|
coverage() {
|
||||||
return `${this.job.coverage}%`;
|
return `${this.job.coverage}%`;
|
||||||
},
|
},
|
||||||
|
@ -59,10 +59,10 @@ export default {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
let t = this.job.metadata.timeout_human_readable;
|
let t = this.job.metadata.timeout_human_readable;
|
||||||
if (this.job.metadata.timeout_source !== '') {
|
if (this.job.metadata.timeout_source !== '') {
|
||||||
t += ` (from ${this.job.metadata.timeout_source})`;
|
t += ` (from ${this.job.metadata.timeout_source})`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
},
|
},
|
||||||
|
@ -270,6 +270,7 @@ export default {
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<stages-dropdown
|
<stages-dropdown
|
||||||
|
v-if="!isLoadingStages"
|
||||||
:stages="stages"
|
:stages="stages"
|
||||||
:pipeline="job.pipeline"
|
:pipeline="job.pipeline"
|
||||||
:selected-stage="selectedStage"
|
:selected-stage="selectedStage"
|
||||||
|
|
|
@ -22,7 +22,6 @@ export default {
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
hasRef() {
|
hasRef() {
|
||||||
return !_.isEmpty(this.pipeline.ref);
|
return !_.isEmpty(this.pipeline.ref);
|
||||||
|
|
|
@ -71,7 +71,7 @@ export default {
|
||||||
* after the first request,
|
* after the first request,
|
||||||
* and we do not want to hijack that
|
* and we do not want to hijack that
|
||||||
*/
|
*/
|
||||||
if (state.selectedStage === 'More' && job.stage) {
|
if (state.selectedStage === '' && job.stage) {
|
||||||
state.selectedStage = job.stage;
|
state.selectedStage = job.stage;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import { __ } from '~/locale';
|
|
||||||
|
|
||||||
export default () => ({
|
export default () => ({
|
||||||
jobEndpoint: null,
|
jobEndpoint: null,
|
||||||
traceEndpoint: null,
|
traceEndpoint: null,
|
||||||
|
@ -29,7 +27,7 @@ export default () => ({
|
||||||
// sidebar dropdown & list of jobs
|
// sidebar dropdown & list of jobs
|
||||||
isLoadingStages: false,
|
isLoadingStages: false,
|
||||||
isLoadingJobs: false,
|
isLoadingJobs: false,
|
||||||
selectedStage: __('More'),
|
selectedStage: '',
|
||||||
stages: [],
|
stages: [],
|
||||||
jobs: [],
|
jobs: [],
|
||||||
});
|
});
|
||||||
|
|
5
changelogs/unreleased/53133-jobs-list.yml
Normal file
5
changelogs/unreleased/53133-jobs-list.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
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', () => {
|
describe('while fetching stages', () => {
|
||||||
it('renders dropdown with More label', () => {
|
it('it does not render dropdown', () => {
|
||||||
|
store.dispatch('requestStages');
|
||||||
vm = mountComponentWithStore(SidebarComponent, { store });
|
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 });
|
expect(stateCopy.job).toEqual({ id: 1312321 });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('sets selectedStage when the selectedStage is More', () => {
|
it('sets selectedStage when the selectedStage is empty', () => {
|
||||||
expect(stateCopy.selectedStage).toEqual('More');
|
expect(stateCopy.selectedStage).toEqual('');
|
||||||
mutations[types.RECEIVE_JOB_SUCCESS](stateCopy, { id: 1312321, stage: 'deploy' });
|
mutations[types.RECEIVE_JOB_SUCCESS](stateCopy, { id: 1312321, stage: 'deploy' });
|
||||||
|
|
||||||
expect(stateCopy.selectedStage).toEqual('deploy');
|
expect(stateCopy.selectedStage).toEqual('deploy');
|
||||||
|
|
Loading…
Reference in a new issue