From 700ea84f82405867622730350f618d2191a37f81 Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Tue, 5 Jun 2018 07:07:47 +0000 Subject: Merge branch 'osw-ignore-diff-header-when-persisting-diff-hunk' into 'master' Adjust insufficient diff hunks being persisted on NoteDiffFile See merge request gitlab-org/gitlab-ce!19399 --- ...gnore-diff-header-when-persisting-diff-hunk.yml | 5 + lib/gitlab/diff/file.rb | 9 +- lib/gitlab/diff/line.rb | 4 + spec/lib/gitlab/diff/file_spec.rb | 113 ++++++++++++--------- 4 files changed, 78 insertions(+), 53 deletions(-) create mode 100644 changelogs/unreleased/osw-ignore-diff-header-when-persisting-diff-hunk.yml diff --git a/changelogs/unreleased/osw-ignore-diff-header-when-persisting-diff-hunk.yml b/changelogs/unreleased/osw-ignore-diff-header-when-persisting-diff-hunk.yml new file mode 100644 index 00000000000..ef66deaa0ef --- /dev/null +++ b/changelogs/unreleased/osw-ignore-diff-header-when-persisting-diff-hunk.yml @@ -0,0 +1,5 @@ +--- +title: Adjust insufficient diff hunks being persisted on NoteDiffFile +merge_request: +author: +type: fixed diff --git a/lib/gitlab/diff/file.rb b/lib/gitlab/diff/file.rb index 765fb0289a8..2820293ad5c 100644 --- a/lib/gitlab/diff/file.rb +++ b/lib/gitlab/diff/file.rb @@ -78,9 +78,12 @@ module Gitlab # Returns the raw diff content up to the given line index def diff_hunk(diff_line) - # Adding 2 because of the @@ diff header and Enum#take should consider - # an extra line, because we're passing an index. - raw_diff.each_line.take(diff_line.index + 2).join + diff_line_index = diff_line.index + # @@ (match) header is not kept if it's found in the top of the file, + # therefore we should keep an extra line on this scenario. + diff_line_index += 1 unless diff_lines.first.match? + + diff_lines.select { |line| line.index <= diff_line_index }.map(&:text).join("\n") end def old_sha diff --git a/lib/gitlab/diff/line.rb b/lib/gitlab/diff/line.rb index 0603141e441..a1e904cfef4 100644 --- a/lib/gitlab/diff/line.rb +++ b/lib/gitlab/diff/line.rb @@ -53,6 +53,10 @@ module Gitlab %w[match new-nonewline old-nonewline].include?(type) end + def match? + type == :match + end + def discussable? !meta? end diff --git a/spec/lib/gitlab/diff/file_spec.rb b/spec/lib/gitlab/diff/file_spec.rb index 0588fe935c3..f0e83ccfc7a 100644 --- a/spec/lib/gitlab/diff/file_spec.rb +++ b/spec/lib/gitlab/diff/file_spec.rb @@ -470,56 +470,69 @@ describe Gitlab::Diff::File do end describe '#diff_hunk' do - let(:raw_diff) do - < path } -- options = { chdir: path } -+ -+ vars = { -+ "PWD" => path -+ } -+ -+ options = { -+ chdir: path -+ } - - unless File.directory?(path) - FileUtils.mkdir_p(path) -@@ -19,6 +25,7 @@ module Popen - - @cmd_output = "" - @cmd_status = 0 -+ - Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr| - @cmd_output << stdout.read - @cmd_output << stderr.read -EOS - end - - it 'returns raw diff up to given line index' do - allow(diff_file).to receive(:raw_diff) { raw_diff } - diff_line = instance_double(Gitlab::Diff::Line, index: 5) - - diff_hunk = < Date: Mon, 4 Jun 2018 21:52:44 +0000 Subject: Merge branch '47162-styling-of-acceptance-terms-page-is-broken' into 'master' Resolve "Styling of acceptance terms page is broken" Closes #47162 See merge request gitlab-org/gitlab-ce!19371 --- app/assets/stylesheets/framework/terms.scss | 8 +++++--- app/views/layouts/terms.html.haml | 6 +++--- app/views/users/terms/index.html.haml | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/assets/stylesheets/framework/terms.scss b/app/assets/stylesheets/framework/terms.scss index 744fd0ff796..7cda674e5c8 100644 --- a/app/assets/stylesheets/framework/terms.scss +++ b/app/assets/stylesheets/framework/terms.scss @@ -11,15 +11,15 @@ padding-top: $gl-padding; } - .panel { - .panel-heading { + .card { + .card-header { display: -webkit-flex; display: flex; align-items: center; justify-content: space-between; line-height: $line-height-base; - .title { + .card-title { display: flex; align-items: center; @@ -34,6 +34,8 @@ .navbar-collapse { padding-right: 0; + flex-grow: 0; + flex-basis: auto; .navbar-nav { margin: 0; diff --git a/app/views/layouts/terms.html.haml b/app/views/layouts/terms.html.haml index a8964b19ba1..977eb350365 100644 --- a/app/views/layouts/terms.html.haml +++ b/app/views/layouts/terms.html.haml @@ -14,9 +14,9 @@ %div{ class: "#{container_class} limit-container-width" } .content{ id: "content-body" } - .panel.panel-default - .panel-heading - .title + .card + .card-header + .card-title = brand_header_logo - logo_text = brand_header_logo_type - if logo_text.present? diff --git a/app/views/users/terms/index.html.haml b/app/views/users/terms/index.html.haml index e0fe551cf36..b9f25a71170 100644 --- a/app/views/users/terms/index.html.haml +++ b/app/views/users/terms/index.html.haml @@ -1,8 +1,8 @@ - redirect_params = { redirect: @redirect } if @redirect -.panel-content.rendered-terms +.card-body.rendered-terms = markdown_field(@term, :terms) -.row-content-block.footer-block.clearfix +.card-footer.footer-block.clearfix - if can?(current_user, :accept_terms, @term) .float-right = button_to accept_term_path(@term, redirect_params), class: 'btn btn-success prepend-left-8' do -- cgit v1.2.1 From aba8f6493fc3b6faa273c6a625fa6c8a5b31d035 Mon Sep 17 00:00:00 2001 From: Clement Ho Date: Tue, 29 May 2018 15:23:09 +0000 Subject: Merge branch '46885-group-visibility' into 'master' Resolve "Visibility section alignment is broken" Closes #46885 See merge request gitlab-org/gitlab-ce!19204 --- app/views/shared/_visibility_level.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/_visibility_level.html.haml b/app/views/shared/_visibility_level.html.haml index d67409ffe14..38c6f560dc6 100644 --- a/app/views/shared/_visibility_level.html.haml +++ b/app/views/shared/_visibility_level.html.haml @@ -1,6 +1,6 @@ - with_label = local_assigns.fetch(:with_label, true) -.form-group.visibility-level-setting +.form-group.row.visibility-level-setting - if with_label = f.label :visibility_level, class: 'col-form-label col-sm-2' do Visibility Level -- cgit v1.2.1 From f4f9e54ebe85e5eea4cc9cd880c87524f1471b67 Mon Sep 17 00:00:00 2001 From: Clement Ho Date: Tue, 5 Jun 2018 01:39:09 +0000 Subject: Merge branch 'jivl-fix-labels-not-displayed-after-selection' into 'master' Resolve: Labels are not displayed after selection Closes #47250 See merge request gitlab-org/gitlab-ce!19394 --- app/assets/javascripts/labels_select.js | 2 +- spec/javascripts/labels_select_spec.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/labels_select.js b/app/assets/javascripts/labels_select.js index eafdaf4a672..7d0ff53f366 100644 --- a/app/assets/javascripts/labels_select.js +++ b/app/assets/javascripts/labels_select.js @@ -426,7 +426,7 @@ export default class LabelsSelect { const tpl = _.template([ '<% _.each(labels, function(label){ %>', '?label_name[]=<%- encodeURIComponent(label.title) %>">', - '', + '', '<%- label.title %>', '', '', diff --git a/spec/javascripts/labels_select_spec.js b/spec/javascripts/labels_select_spec.js index a2b89c0aef5..386e00bfd0c 100644 --- a/spec/javascripts/labels_select_spec.js +++ b/spec/javascripts/labels_select_spec.js @@ -40,5 +40,9 @@ describe('LabelsSelect', () => { it('generated label item template has correct label styles', () => { expect($labelEl.find('span.label').attr('style')).toBe(`background-color: ${label.color}; color: ${label.text_color};`); }); + + it('generated label item has a badge class', () => { + expect($labelEl.find('span').hasClass('badge')).toEqual(true); + }); }); }); -- cgit v1.2.1 From dcbdfe7ac7106dca801bf08881d768f543f57390 Mon Sep 17 00:00:00 2001 From: Clement Ho Date: Tue, 5 Jun 2018 03:19:24 +0000 Subject: Merge branch '47115-fix-markdown-blockquote' into 'master' Resolve "Markdown blockquote is not displaying properly" Closes #47115 See merge request gitlab-org/gitlab-ce!19395 --- app/assets/stylesheets/framework/typography.scss | 23 +++++++++++----------- .../mailers/highlighted_diff_email.scss | 1 + 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/app/assets/stylesheets/framework/typography.scss b/app/assets/stylesheets/framework/typography.scss index 97b821e0cb9..9e77ea03a24 100644 --- a/app/assets/stylesheets/framework/typography.scss +++ b/app/assets/stylesheets/framework/typography.scss @@ -114,26 +114,27 @@ font-size: 0.95em; } + blockquote, .blockquote { color: $gl-grayish-blue; font-size: inherit; padding: 8px 24px; margin: 16px 0; border-left: 3px solid $white-dark; - } - .blockquote:dir(rtl) { - border-left: 0; - border-right: 3px solid $white-dark; - } + &:dir(rtl) { + border-left: 0; + border-right: 3px solid $white-dark; + } - .blockquote p { - color: $gl-grayish-blue !important; - font-size: inherit; - line-height: 1.5; + p { + color: $gl-grayish-blue !important; + font-size: inherit; + line-height: 1.5; - &:last-child { - margin: 0; + &:last-child { + margin: 0; + } } } diff --git a/app/assets/stylesheets/mailers/highlighted_diff_email.scss b/app/assets/stylesheets/mailers/highlighted_diff_email.scss index b5eda79e5ed..1835c4364d3 100644 --- a/app/assets/stylesheets/mailers/highlighted_diff_email.scss +++ b/app/assets/stylesheets/mailers/highlighted_diff_email.scss @@ -138,6 +138,7 @@ pre { margin: 0; } +blockquote, .blockquote { color: $gl-grayish-blue; padding: 0 0 0 15px; -- cgit v1.2.1 From 6d6ba149451de0390e27b6ad287b68fece67e15e Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Tue, 5 Jun 2018 09:15:08 +0000 Subject: Merge branch 'fix-jobs-log' into 'master' Fix jobs log background color Closes #47261 See merge request gitlab-org/gitlab-ce!19411 --- app/assets/stylesheets/bootstrap_migration.scss | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/assets/stylesheets/bootstrap_migration.scss b/app/assets/stylesheets/bootstrap_migration.scss index e24f8b1d4e8..c83144eb1ef 100644 --- a/app/assets/stylesheets/bootstrap_migration.scss +++ b/app/assets/stylesheets/bootstrap_migration.scss @@ -63,6 +63,20 @@ code { padding: 2px 4px; background-color: $red-100; border-radius: 3px; + + .code & { + background-color: inherit; + padding: unset; + } + + .build-trace & { + background-color: inherit; + padding: inherit; + } +} + +.code { + padding: 9.5px; } table { -- cgit v1.2.1 From d783f79bbb5a10ecb8de03a883ed8ca23bd6c0c5 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Tue, 5 Jun 2018 09:19:49 +0000 Subject: Merge branch 'ide-alignment-fixes' into 'master' Fixed alignment issues with IDE sidebar Closes #47244 See merge request gitlab-org/gitlab-ce!19272 --- .../javascripts/ide/components/activity_bar.vue | 14 +++++++++++--- app/assets/stylesheets/pages/repo.scss | 19 ++++++++++++++++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/ide/components/activity_bar.vue b/app/assets/javascripts/ide/components/activity_bar.vue index 05dbc1410de..6efcad6adea 100644 --- a/app/assets/javascripts/ide/components/activity_bar.vue +++ b/app/assets/javascripts/ide/components/activity_bar.vue @@ -1,4 +1,5 @@