diff options
author | Paul Slaughter <pslaughter@gitlab.com> | 2019-08-02 02:25:14 +0000 |
---|---|---|
committer | Paul Slaughter <pslaughter@gitlab.com> | 2019-08-02 02:25:14 +0000 |
commit | 3077c3569bc8569d7875b8fa6eda3346016334ed (patch) | |
tree | c22d263e51f3b66d1f334f7fd5052894dc46af06 | |
parent | 040eb078e992321a35d7870dfe2efeaf51158e36 (diff) | |
parent | 144268daa87ed2680db2d4c01b121598de91291c (diff) | |
download | gitlab-ce-3077c3569bc8569d7875b8fa6eda3346016334ed.tar.gz |
Merge branch '59521-job-sidebar-has-a-blank-block' into 'master'
Remove blank block from job sidebar
Closes #59521
See merge request gitlab-org/gitlab-ce!30754
-rw-r--r-- | app/assets/javascripts/jobs/components/sidebar.vue | 9 | ||||
-rw-r--r-- | changelogs/unreleased/59521-job-sidebar-has-a-blank-block.yml | 5 | ||||
-rw-r--r-- | spec/javascripts/jobs/components/job_app_spec.js | 25 |
3 files changed, 34 insertions, 5 deletions
diff --git a/app/assets/javascripts/jobs/components/sidebar.vue b/app/assets/javascripts/jobs/components/sidebar.vue index e9704584c9f..06477477aad 100644 --- a/app/assets/javascripts/jobs/components/sidebar.vue +++ b/app/assets/javascripts/jobs/components/sidebar.vue @@ -73,15 +73,14 @@ export default { }, renderBlock() { return ( - this.job.merge_request || this.job.duration || - this.job.finished_data || + this.job.finished_at || this.job.erased_at || this.job.queued || + this.hasTimeout || this.job.runner || this.job.coverage || - this.job.tags.length || - this.job.cancel_path + this.job.tags.length ); }, hasArtifact() { @@ -160,7 +159,7 @@ export default { </gl-link> </div> - <div :class="{ block: renderBlock }"> + <div v-if="renderBlock" class="block"> <detail-row v-if="job.duration" :value="duration" diff --git a/changelogs/unreleased/59521-job-sidebar-has-a-blank-block.yml b/changelogs/unreleased/59521-job-sidebar-has-a-blank-block.yml new file mode 100644 index 00000000000..4c93a108f2b --- /dev/null +++ b/changelogs/unreleased/59521-job-sidebar-has-a-blank-block.yml @@ -0,0 +1,5 @@ +--- +title: Remove blank block from job sidebar +merge_request: 30754 +author: +type: fixed diff --git a/spec/javascripts/jobs/components/job_app_spec.js b/spec/javascripts/jobs/components/job_app_spec.js index c58d59b4b16..40decbb5643 100644 --- a/spec/javascripts/jobs/components/job_app_spec.js +++ b/spec/javascripts/jobs/components/job_app_spec.js @@ -486,6 +486,31 @@ describe('Job App ', () => { }); }); }); + + describe('sidebar', () => { + it('has no blank blocks', done => { + mock.onGet(props.endpoint).replyOnce( + 200, + Object.assign({}, job, { + duration: null, + finished_at: null, + erased_at: null, + queued: null, + runner: null, + coverage: null, + tags: [], + cancel_path: null, + }), + ); + + vm.$nextTick(() => { + vm.$el.querySelectorAll('.blocks-container > *').forEach(block => { + expect(block.textContent.trim()).not.toBe(''); + }); + done(); + }); + }); + }); }); describe('archived job', () => { |