Commit e6a6e15e authored by Tim Zallmann's avatar Tim Zallmann

Merge branch '52608-sidebar' into 'master'

Hide job sidebar on mobile

Closes #52608

See merge request gitlab-org/gitlab-ce!22314
parents 8d9f4670 a9d91ed2
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
}; };
</script> </script>
<template> <template>
<div class="top-bar"> <div class="top-bar affix js-top-bar">
<!-- truncate information --> <!-- truncate information -->
<div class="js-truncated-info truncated-info d-none d-sm-block float-left"> <div class="js-truncated-info truncated-info d-none d-sm-block float-left">
<template v-if="isTraceSizeVisible"> <template v-if="isTraceSizeVisible">
......
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
</script> </script>
<template> <template>
<aside <aside
class="right-sidebar right-sidebar-expanded build-sidebar" class="js-build-sidebar right-sidebar right-sidebar-expanded build-sidebar"
data-offset-top="101" data-offset-top="101"
data-spy="affix" data-spy="affix"
> >
......
...@@ -9,8 +9,7 @@ import createStore from './store'; ...@@ -9,8 +9,7 @@ import createStore from './store';
export default () => { export default () => {
const { dataset } = document.getElementById('js-job-details-vue'); const { dataset } = document.getElementById('js-job-details-vue');
// eslint-disable-next-line no-new
new Job();
const store = createStore(); const store = createStore();
store.dispatch('setJobEndpoint', dataset.endpoint); store.dispatch('setJobEndpoint', dataset.endpoint);
...@@ -71,4 +70,7 @@ export default () => { ...@@ -71,4 +70,7 @@ export default () => {
}); });
}, },
}); });
// eslint-disable-next-line no-new
new Job();
}; };
---
title: Hides sidebar for job page in mobile
merge_request:
author:
type: fixed
...@@ -667,7 +667,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do ...@@ -667,7 +667,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
context 'with erased job', :js do context 'with erased job', :js do
let(:job) { create(:ci_build, :erased, pipeline: pipeline) } let(:job) { create(:ci_build, :erased, pipeline: pipeline) }
it'renders erased job warning' do it 'renders erased job warning' do
visit project_job_path(project, job) visit project_job_path(project, job)
wait_for_requests wait_for_requests
...@@ -676,6 +676,43 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do ...@@ -676,6 +676,43 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
end end
end end
end end
context 'without erased job', :js do
let(:job) { create(:ci_build, pipeline: pipeline) }
it 'does not render erased job warning' do
visit project_job_path(project, job)
wait_for_requests
expect(page).not_to have_css('.js-job-erased-block')
end
end
context 'on mobile', :js do
let(:job) { create(:ci_build, pipeline: pipeline) }
it 'renders collpased sidebar' do
page.current_window.resize_to(600, 800)
visit project_job_path(project, job)
wait_for_requests
expect(page).to have_css('.js-build-sidebar.right-sidebar-collapsed', visible: false)
expect(page).not_to have_css('.js-build-sidebar.right-sidebar-expanded', visible: false)
end
end
context 'on desktop', :js do
let(:job) { create(:ci_build, pipeline: pipeline) }
it 'renders expanded sidebar' do
visit project_job_path(project, job)
wait_for_requests
expect(page).to have_css('.js-build-sidebar.right-sidebar-expanded')
expect(page).not_to have_css('.js-build-sidebar.right-sidebar-collpased')
end
end
end end
describe "POST /:project/jobs/:id/cancel", :js do describe "POST /:project/jobs/:id/cancel", :js do
......
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