diff options
author | Robert Speicher <robert@gitlab.com> | 2017-05-03 14:57:02 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-05-03 14:57:02 +0000 |
commit | 552013b47f3a37e4584f11faa82f5afb60fe8edc (patch) | |
tree | 5b273f2b59063c6b33f742d8da2ad17fdd03e328 | |
parent | 57513512b9d0c92f100db7d438f239a256231c33 (diff) | |
parent | ce5f7008fbd697e1af4a0bcf91b8a0d7c26cb643 (diff) | |
download | gitlab-ce-552013b47f3a37e4584f11faa82f5afb60fe8edc.tar.gz |
Merge branch 'commit-limited-container-width' into 'master'
Commit view correctly spans the full width when parallel view
Closes #30881
See merge request !10851
-rw-r--r-- | app/assets/stylesheets/pages/issuable.scss | 11 | ||||
-rw-r--r-- | app/views/projects/commit/show.html.haml | 4 | ||||
-rw-r--r-- | changelogs/unreleased/commit-limited-container-width.yml | 4 | ||||
-rw-r--r-- | spec/views/projects/commit/show.html.haml_spec.rb | 44 |
4 files changed, 59 insertions, 4 deletions
diff --git a/app/assets/stylesheets/pages/issuable.scss b/app/assets/stylesheets/pages/issuable.scss index 97fab513b01..ad6eb9f6fe0 100644 --- a/app/assets/stylesheets/pages/issuable.scss +++ b/app/assets/stylesheets/pages/issuable.scss @@ -6,7 +6,13 @@ } .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; } @@ -36,8 +42,7 @@ } .diffs { - .mr-version-controls, - .files-changed { + .mr-version-controls { @extend .fixed-width-container; } } diff --git a/app/views/projects/commit/show.html.haml b/app/views/projects/commit/show.html.haml index 0d11da2451a..16d2646cb4e 100644 --- a/app/views/projects/commit/show.html.haml +++ b/app/views/projects/commit/show.html.haml @@ -1,9 +1,11 @@ - @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_description @commit.description = render "projects/commits/head" -%div{ class: container_class } +.container-fluid{ class: [limited_container_width, container_class] } = render "commit_box" - if @commit.status = render "ci_menu" diff --git a/changelogs/unreleased/commit-limited-container-width.yml b/changelogs/unreleased/commit-limited-container-width.yml new file mode 100644 index 00000000000..253646b13da --- /dev/null +++ b/changelogs/unreleased/commit-limited-container-width.yml @@ -0,0 +1,4 @@ +--- +title: Side-by-side view in commits correcly expands full window width +merge_request: +author: diff --git a/spec/views/projects/commit/show.html.haml_spec.rb b/spec/views/projects/commit/show.html.haml_spec.rb new file mode 100644 index 00000000000..122075cc10e --- /dev/null +++ b/spec/views/projects/commit/show.html.haml_spec.rb @@ -0,0 +1,44 @@ +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 |