Commit 552013b4 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'commit-limited-container-width' into 'master'

Commit view correctly spans the full width when parallel view

Closes #30881

See merge request !10851
parents 57513512 ce5f7008
...@@ -6,7 +6,13 @@ ...@@ -6,7 +6,13 @@
} }
.limit-container-width { .limit-container-width {
.detail-page-header { .detail-page-header,
.page-content-header,
.commit-box,
.info-well,
.notes,
.commit-ci-menu,
.files-changed {
@extend .fixed-width-container; @extend .fixed-width-container;
} }
...@@ -36,8 +42,7 @@ ...@@ -36,8 +42,7 @@
} }
.diffs { .diffs {
.mr-version-controls, .mr-version-controls {
.files-changed {
@extend .fixed-width-container; @extend .fixed-width-container;
} }
} }
......
- @no_container = true - @no_container = true
- container_class = !fluid_layout && diff_view == :inline ? 'container-limited' : ''
- limited_container_width = fluid_layout || diff_view == :inline ? '' : 'limit-container-width'
- page_title "#{@commit.title} (#{@commit.short_id})", "Commits" - page_title "#{@commit.title} (#{@commit.short_id})", "Commits"
- page_description @commit.description - page_description @commit.description
= render "projects/commits/head" = render "projects/commits/head"
%div{ class: container_class } .container-fluid{ class: [limited_container_width, container_class] }
= render "commit_box" = render "commit_box"
- if @commit.status - if @commit.status
= render "ci_menu" = render "ci_menu"
......
---
title: Side-by-side view in commits correcly expands full window width
merge_request:
author:
require 'spec_helper'
describe 'projects/commit/show.html.haml', :view do
let(:project) { create(:project, :repository) }
before do
assign(:project, project)
assign(:repository, project.repository)
assign(:commit, project.commit)
assign(:noteable, project.commit)
assign(:notes, [])
assign(:diffs, project.commit.diffs)
allow(view).to receive(:current_user).and_return(nil)
allow(view).to receive(:can?).and_return(false)
allow(view).to receive(:can_collaborate_with_project?).and_return(false)
allow(view).to receive(:current_ref).and_return(project.repository.root_ref)
allow(view).to receive(:diff_btn).and_return('')
end
context 'inline diff view' do
before do
allow(view).to receive(:diff_view).and_return(:inline)
render
end
it 'keeps container-limited' do
expect(rendered).not_to have_selector('.limit-container-width')
end
end
context 'parallel diff view' do
before do
allow(view).to receive(:diff_view).and_return(:parallel)
render
end
it 'spans full width' do
expect(rendered).to have_selector('.limit-container-width')
end
end
end
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