Skip to content
Snippets Groups Projects

Updated merge request header

Merged Phil Hughes requested to merge ph/updatedMergeRequestHeader into master
All threads resolved!

What does this MR do and why?

Updates the merge request header by moving the branch information from the widget into the header.

Screenshots or screen recordings

Screenshot_2022-05-05_at_15.23.20

How to set up and validate locally

Enable updated_mr_header

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #356703 (closed)

Edited by Phil Hughes

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Phil Hughes added 1 commit

    added 1 commit

    • cb9723c6 - Updated merge request header

    Compare with previous version

  • Phil Hughes changed the description

    changed the description

  • Phil Hughes added 1 commit

    added 1 commit

    • 12a1f631 - Updated merge request header

    Compare with previous version

  • Phil Hughes added 1 commit

    added 1 commit

    • 20fbbe64 - Updated merge request header

    Compare with previous version

  • Phil Hughes changed the description

    changed the description

  • Phil Hughes added 1 commit

    added 1 commit

    • 92dbeb95 - Updated merge request header

    Compare with previous version

  • Phil Hughes added 1 commit

    added 1 commit

    • 4250246b - Updated merge request header

    Compare with previous version

  • @iamphill This looks amazing! :rocket: I just had a few small comments, mostly about alignment.

    I guess the biggest thing right now is that I couldn't see the commits behind info on the current merge widget. Is that going to be enabled at the same time? I know we discussed this somewhere but I can't find it at the moment :sweat_smile:

  • removed review request for @annabeldunstone

  • Phil Hughes added 318 commits

    added 318 commits

    Compare with previous version

  • Marcel van Remmerden
  • Phil Hughes added 1 commit

    added 1 commit

    • 659fcb05 - Updated merge request header

    Compare with previous version

  • requested review from @annabeldunstone

    • Resolved by Phil Hughes

      @annabeldunstone @iamphill The branch names keep throwing me off because they are now part of a longer sentence, so I tried to solve it in a different way by copying the style from when a user gets mentioned in a system note:

      image

      Before After
      image image

      If you want to test it out yourself, here is the diff:

      diff --git a/app/assets/stylesheets/pages/detail_page.scss b/app/assets/stylesheets/pages/detail_page.scss
      index bc9975ea17a..d676d26961e 100644
      --- a/app/assets/stylesheets/pages/detail_page.scss
      +++ b/app/assets/stylesheets/pages/detail_page.scss
      @@ -70,4 +70,11 @@
         .author-link {
           color: $gl-text-color;
         }
      +
      +  .branch-name {
      +    padding: 2px $gl-padding-4;
      +    background-color: $blue-50;
      +    border-radius: $border-radius-default;
      +    font-size: $gl-font-size-small;
      +  }
       }
      diff --git a/app/helpers/merge_requests_helper.rb b/app/helpers/merge_requests_helper.rb
      index f24338e8f27..d6143b02269 100644
      --- a/app/helpers/merge_requests_helper.rb
      +++ b/app/helpers/merge_requests_helper.rb
      @@ -245,13 +245,13 @@ def merge_request_source_branch(merge_request)
                           ''
                         end
       
      -    link_to branch, branch_path, class: 'gl-link gl-font-monospace'
      +    link_to branch, branch_path, class: 'gl-link gl-font-monospace branch-name'
         end
       
         def merge_request_header(project, merge_request)
           link_to_author = link_to_member(project, merge_request.author, size: 24, extra_class: 'gl-font-weight-bold', avatar: false)
           copy_button = clipboard_button(text: merge_request.source_branch, title: _('Copy branch name'), class: 'btn btn-default btn-sm gl-button btn-default-tertiary btn-icon gl-display-none! gl-md-display-inline-block! js-source-branch-copy')
      -    target_branch = link_to merge_request.target_branch, project_tree_path(merge_request.target_project, merge_request.target_branch), class: 'gl-link gl-font-monospace'
      +    target_branch = link_to merge_request.target_branch, project_tree_path(merge_request.target_project, merge_request.target_branch), class: 'gl-link gl-font-monospace branch-name'
       
           _('%{author} requested to merge %{span_start}%{source_branch} %{copy_button}%{span_end} into %{target_branch} %{created_at}').html_safe % { author: link_to_author.html_safe, source_branch: merge_request_source_branch(merge_request).html_safe, copy_button: copy_button.html_safe, target_branch: target_branch.html_safe, created_at: time_ago_with_tooltip(merge_request.created_at, html_class: 'gl-display-inline-block').html_safe, span_start: '<span class="gl-display-inline-block">'.html_safe, span_end: '</span>'.html_safe }
         end
      

      What do you two think?

  • Phil Hughes added 100 commits

    added 100 commits

    Compare with previous version

  • This looks so great! I'm so so so excited to see this live :rocket:

    I think this is in a good state for frontend review now. @kushalpandya Can you please review?

  • requested review from @kushalpandya

  • Phil Hughes resolved all threads

    resolved all threads

  • Phil Hughes added 1 commit

    added 1 commit

    • ab527c26 - Updated merge request header

    Compare with previous version

  • Annabel Dunstone Gray approved this merge request

    approved this merge request

  • :wave: @annabeldunstone, thanks for approving this merge request.

    This is the first time the merge request is approved. To ensure full test coverage, a new pipeline has been started.

    For more info, please refer to the following links:

  • Kushal Pandya approved this merge request

    approved this merge request

  • Kushal Pandya requested review from @dbalexandre and removed review request for @kushalpandya

    requested review from @dbalexandre and removed review request for @kushalpandya

  • removed review request for @dbalexandre

  • Phil Hughes added 1 commit

    added 1 commit

    • 9967a1b6 - Updated merge request header

    Compare with previous version

  • Phil Hughes requested review from @dbalexandre

    requested review from @dbalexandre

  • Douglas Barbosa Alexandre approved this merge request

    approved this merge request

  • Thanks, @iamphill! The backend changes look good to me. Is this ready to merge, or is it pending a review from @mvanremmerden?

  • removed review request for @dbalexandre

  • resolved all threads

  • Douglas Barbosa Alexandre enabled an automatic merge when the pipeline for f9086b11 succeeds

    enabled an automatic merge when the pipeline for f9086b11 succeeds

  • resolved all threads

  • removed review request for @mvanremmerden

  • mentioned in commit 39359005

  • added workflowstaging label and removed workflowcanary label

  • Kushal Pandya mentioned in merge request !86772 (merged)

    mentioned in merge request !86772 (merged)

  • Kushal Pandya resolved all threads

    resolved all threads

  • mentioned in merge request !87595 (merged)

  • Thomas Randolph mentioned in merge request !138822 (merged)

    mentioned in merge request !138822 (merged)

  • Please register or sign in to reply
    Loading