提交 1cc09301 编写于 作者: F Filipa Lacerda 提交者: Phil Hughes

Fix stage dropdown rendering only in English

上级 9b36f523
......@@ -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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册