diff options
author | Phil Hughes <me@iamphill.com> | 2018-10-26 07:49:02 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-10-26 07:49:02 +0000 |
commit | f659f8cf878bcce1e4fbf4763ec8daaeb3300f32 (patch) | |
tree | abf920f074d7cf0ba182ad4546e4cbc52aa8d74b | |
parent | 9b36f52310c5fe0b8e366b8ed5d24e9f5d9a49d4 (diff) | |
parent | 1cc093011f43ca228f441f4228010ba2e0e2eeaf (diff) | |
download | gitlab-ce-f659f8cf878bcce1e4fbf4763ec8daaeb3300f32.tar.gz |
Merge branch '53133-jobs-list' into 'master'
Fix stage dropdown rendering only in English
Closes #53133
See merge request gitlab-org/gitlab-ce!22604
-rw-r--r-- | app/assets/javascripts/jobs/components/sidebar.vue | 11 | ||||
-rw-r--r-- | app/assets/javascripts/jobs/components/stages_dropdown.vue | 1 | ||||
-rw-r--r-- | app/assets/javascripts/jobs/store/mutations.js | 2 | ||||
-rw-r--r-- | app/assets/javascripts/jobs/store/state.js | 4 | ||||
-rw-r--r-- | changelogs/unreleased/53133-jobs-list.yml | 5 | ||||
-rw-r--r-- | spec/javascripts/jobs/components/sidebar_spec.js | 5 | ||||
-rw-r--r-- | spec/javascripts/jobs/store/mutations_spec.js | 4 |
7 files changed, 18 insertions, 14 deletions
diff --git a/app/assets/javascripts/jobs/components/sidebar.vue b/app/assets/javascripts/jobs/components/sidebar.vue index 906769ee6a2..28a02230d89 100644 --- a/app/assets/javascripts/jobs/components/sidebar.vue +++ b/app/assets/javascripts/jobs/components/sidebar.vue @@ -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" diff --git a/app/assets/javascripts/jobs/components/stages_dropdown.vue b/app/assets/javascripts/jobs/components/stages_dropdown.vue index e5e1d56e287..dc26b246d71 100644 --- a/app/assets/javascripts/jobs/components/stages_dropdown.vue +++ b/app/assets/javascripts/jobs/components/stages_dropdown.vue @@ -22,7 +22,6 @@ export default { required: true, }, }, - computed: { hasRef() { return !_.isEmpty(this.pipeline.ref); diff --git a/app/assets/javascripts/jobs/store/mutations.js b/app/assets/javascripts/jobs/store/mutations.js index 4195d787f12..cd440d21c1f 100644 --- a/app/assets/javascripts/jobs/store/mutations.js +++ b/app/assets/javascripts/jobs/store/mutations.js @@ -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; } }, diff --git a/app/assets/javascripts/jobs/store/state.js b/app/assets/javascripts/jobs/store/state.js index 0eb269ca38f..04825187c99 100644 --- a/app/assets/javascripts/jobs/store/state.js +++ b/app/assets/javascripts/jobs/store/state.js @@ -1,5 +1,3 @@ -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: [], }); diff --git a/changelogs/unreleased/53133-jobs-list.yml b/changelogs/unreleased/53133-jobs-list.yml new file mode 100644 index 00000000000..2e13edc0e76 --- /dev/null +++ b/changelogs/unreleased/53133-jobs-list.yml @@ -0,0 +1,5 @@ +--- +title: Fix stage dropdown not rendering in different languages +merge_request: 22604 +author: +type: other diff --git a/spec/javascripts/jobs/components/sidebar_spec.js b/spec/javascripts/jobs/components/sidebar_spec.js index 460a2e1b5da..424092d2d88 100644 --- a/spec/javascripts/jobs/components/sidebar_spec.js +++ b/spec/javascripts/jobs/components/sidebar_spec.js @@ -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(); }); }); diff --git a/spec/javascripts/jobs/store/mutations_spec.js b/spec/javascripts/jobs/store/mutations_spec.js index 4230a7c42cf..d7908efcf13 100644 --- a/spec/javascripts/jobs/store/mutations_spec.js +++ b/spec/javascripts/jobs/store/mutations_spec.js @@ -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'); |