Correct file-header spacing on compare page
Use special classes when is_compare, similar to is_commit. Default expectation is diff is being viewed in MR
This commit is contained in:
parent
a36eccb81d
commit
5218da5759
8 changed files with 40 additions and 19 deletions
|
@ -4,6 +4,7 @@
|
|||
*/
|
||||
.file-holder {
|
||||
border: 1px solid $border-color;
|
||||
border-top: 0;
|
||||
border-radius: $border-radius-default;
|
||||
|
||||
&.file-holder-no-border {
|
||||
|
@ -328,6 +329,7 @@ span.idiff {
|
|||
justify-content: space-between;
|
||||
background-color: $gray-light;
|
||||
border-bottom: 1px solid $border-color;
|
||||
border-top: 1px solid $border-color;
|
||||
padding: 5px $gl-padding;
|
||||
margin: 0;
|
||||
border-radius: $border-radius-default $border-radius-default 0 0;
|
||||
|
|
|
@ -490,6 +490,7 @@ $builds-trace-bg: #111;
|
|||
*/
|
||||
$commit-max-width-marker-color: rgba(0, 0, 0, 0);
|
||||
$commit-message-text-area-bg: rgba(0, 0, 0, 0);
|
||||
$commit-stat-summary-height: 36px;
|
||||
|
||||
/*
|
||||
* Common
|
||||
|
@ -664,8 +665,14 @@ $priority-label-empty-state-width: 114px;
|
|||
Issues Analytics
|
||||
*/
|
||||
$issues-analytics-popover-boarder-color: rgba(0, 0, 0, 0.15);
|
||||
|
||||
/*
|
||||
Merge Requests
|
||||
*/
|
||||
$mr-tabs-height: 51px;
|
||||
$mr-version-controls-height: 56px;
|
||||
|
||||
/*
|
||||
Compare Branches
|
||||
*/
|
||||
$compare-branches-sticky-header-height: 68px;
|
||||
|
|
|
@ -7,22 +7,13 @@
|
|||
cursor: pointer;
|
||||
|
||||
@media (min-width: map-get($grid-breakpoints, md)) {
|
||||
$mr-file-header-top: $mr-version-controls-height + $header-height + $mr-tabs-height;
|
||||
|
||||
position: -webkit-sticky;
|
||||
position: sticky;
|
||||
top: $mr-version-controls-height + $header-height + $mr-tabs-height;
|
||||
margin-left: -1px;
|
||||
border-left: 1px solid $border-color;
|
||||
top: $mr-file-header-top;
|
||||
z-index: 102;
|
||||
|
||||
&.is-commit {
|
||||
top: $header-height + 36px;
|
||||
|
||||
.with-performance-bar & {
|
||||
top: $header-height + 36px + $performance-bar-height;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
|
@ -35,7 +26,23 @@
|
|||
}
|
||||
|
||||
.with-performance-bar & {
|
||||
top: $header-height + $performance-bar-height + $mr-version-controls-height + $mr-tabs-height;
|
||||
top: $mr-file-header-top + $performance-bar-height;
|
||||
}
|
||||
|
||||
&.is-commit {
|
||||
top: $header-height + $commit-stat-summary-height;
|
||||
|
||||
.with-performance-bar & {
|
||||
top: $header-height + $commit-stat-summary-height + $performance-bar-height;
|
||||
}
|
||||
}
|
||||
|
||||
&.is-compare {
|
||||
top: $header-height + $compare-branches-sticky-header-height;
|
||||
|
||||
.with-performance-bar & {
|
||||
top: $performance-bar-height + $header-height + $compare-branches-sticky-header-height;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
.container-fluid{ class: [limited_container_width, container_class] }
|
||||
= render "commit_box"
|
||||
= render "ci_menu"
|
||||
= render "projects/diffs/diffs", diffs: @diffs, environment: @environment, is_commit: true
|
||||
= render "projects/diffs/diffs", diffs: @diffs, environment: @environment, diff_page_context: "is-commit"
|
||||
|
||||
.limited-width-notes
|
||||
= render "shared/notes/notes_with_form", :autocomplete => true
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
- if @commits.present?
|
||||
= render "projects/commits/commit_list"
|
||||
= render "projects/diffs/diffs", diffs: @diffs, environment: @environment
|
||||
= render "projects/diffs/diffs", diffs: @diffs, environment: @environment, diff_page_context: "is-compare"
|
||||
- else
|
||||
.card.bg-light
|
||||
.center
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
- show_whitespace_toggle = local_assigns.fetch(:show_whitespace_toggle, true)
|
||||
- can_create_note = !@diff_notes_disabled && can?(current_user, :create_note, diffs.project)
|
||||
- diff_files = diffs.diff_files
|
||||
- is_commit = local_assigns.fetch(:is_commit, false)
|
||||
- diff_page_context = local_assigns.fetch(:diff_page_context, nil)
|
||||
|
||||
.content-block.oneline-block.files-changed.diff-files-changed.js-diff-files-changed
|
||||
.files-changed-inner
|
||||
|
@ -25,4 +25,4 @@
|
|||
= render 'projects/diffs/warning', diff_files: diffs
|
||||
|
||||
.files{ data: { can_create_note: can_create_note } }
|
||||
= render partial: 'projects/diffs/file', collection: diff_files, as: :diff_file, locals: { project: diffs.project, environment: environment, is_commit: is_commit }
|
||||
= render partial: 'projects/diffs/file', collection: diff_files, as: :diff_file, locals: { project: diffs.project, environment: environment, diff_page_context: diff_page_context }
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
- environment = local_assigns.fetch(:environment, nil)
|
||||
- is_commit = local_assigns.fetch(:is_commit, false)
|
||||
- diff_page_context = local_assigns.fetch(:diff_page_context, nil)
|
||||
- file_hash = hexdigest(diff_file.file_path)
|
||||
- image_diff = diff_file.rich_viewer && diff_file.rich_viewer.partial_name == 'image'
|
||||
- image_replaced = diff_file.old_content_sha && diff_file.old_content_sha != diff_file.content_sha
|
||||
|
||||
.diff-file.file-holder{ id: file_hash, data: diff_file_html_data(project, diff_file.file_path, diff_file.content_sha) }
|
||||
.js-file-title.file-title-flex-parent{ class: is_commit ? "is-commit" : "" }
|
||||
.js-file-title.file-title-flex-parent{ class: diff_page_context }
|
||||
.file-header-content
|
||||
= render "projects/diffs/file_header", diff_file: diff_file, url: "##{file_hash}"
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Correct spacing for comparison page
|
||||
merge_request: !24783
|
||||
author:
|
||||
type: fixed
|
Loading…
Reference in a new issue