diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-02-04 02:19:02 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-02-04 02:19:02 +0300 |
commit | 7039d52349610a625efeafa32898a7763b4dbdb6 (patch) | |
tree | 145a995b6f11531e9a70bf977e813f153ea782b6 /app | |
parent | 04dc2b76d7e382a6b6369576753cfc20928c99b8 (diff) | |
parent | aa9e77b7ce5a1ceeff6188e5d12e5fcb2589d2f1 (diff) |
Merge branch 'master' into go-go-gadget-webpack
* master:
Change window size before visiting page, to get correct scroll position
Fix slash commands spec error
Move project services to new location under Integrations
Move webhooks to new a location under Integrations
Fixed eslint test failure
Fixed redirection from http://someproject.git to http://someproject
Add traits for the different Event types to the Event factory
prevent nonewline type diff lines from containing unfolding link
ensure linenumber data attribute is correct for the last line in a diff chunk
ensure last line in diff block is contained within a table row element
ensure click event is bound only once
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/diff.js.es6 | 11 | ||||
-rw-r--r-- | app/assets/javascripts/project.js | 4 | ||||
-rw-r--r-- | app/controllers/projects/application_controller.rb | 2 | ||||
-rw-r--r-- | app/helpers/search_helper.rb | 2 | ||||
-rw-r--r-- | app/views/projects/blob/diff.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/diffs/_parallel_view.html.haml | 20 | ||||
-rw-r--r-- | app/views/projects/diffs/_text_file.html.haml | 8 | ||||
-rw-r--r-- | app/views/shared/web_hooks/_form.html.haml | 2 |
8 files changed, 31 insertions, 20 deletions
diff --git a/app/assets/javascripts/diff.js.es6 b/app/assets/javascripts/diff.js.es6 index 1e5119822d1..c39e30fb7e0 100644 --- a/app/assets/javascripts/diff.js.es6 +++ b/app/assets/javascripts/diff.js.es6 @@ -4,6 +4,7 @@ require('./lib/utils/url_utility'); (() => { const UNFOLD_COUNT = 20; + let isBound = false; class Diff { constructor() { @@ -17,10 +18,12 @@ require('./lib/utils/url_utility'); $('.content-wrapper .container-fluid').removeClass('container-limited'); } - $(document) - .off('click', '.js-unfold, .diff-line-num a') - .on('click', '.js-unfold', this.handleClickUnfold.bind(this)) - .on('click', '.diff-line-num a', this.handleClickLineNum.bind(this)); + if (!isBound) { + $(document) + .on('click', '.js-unfold', this.handleClickUnfold.bind(this)) + .on('click', '.diff-line-num a', this.handleClickLineNum.bind(this)); + isBound = true; + } this.openAnchoredDiff(); } diff --git a/app/assets/javascripts/project.js b/app/assets/javascripts/project.js index 1a657ee6a19..71719917d0c 100644 --- a/app/assets/javascripts/project.js +++ b/app/assets/javascripts/project.js @@ -57,8 +57,8 @@ }; Project.prototype.initRefSwitcher = function() { - var refListItem = document.createElement('li'), - refLink = document.createElement('a'); + var refListItem = document.createElement('li'); + var refLink = document.createElement('a'); refLink.href = '#'; diff --git a/app/controllers/projects/application_controller.rb b/app/controllers/projects/application_controller.rb index ba523b190bf..db33b60b229 100644 --- a/app/controllers/projects/application_controller.rb +++ b/app/controllers/projects/application_controller.rb @@ -18,7 +18,7 @@ class Projects::ApplicationController < ApplicationController # to # localhost/group/project # - if id =~ /\.git\Z/ + if params[:format] == 'git' redirect_to request.original_url.gsub(/\.git\/?\Z/, '') return end diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index 37b69423c97..8ff8db16514 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -56,7 +56,7 @@ module SearchHelper { category: "Help", label: "Rake Tasks Help", url: help_page_path("raketasks/README") }, { category: "Help", label: "SSH Keys Help", url: help_page_path("ssh/README") }, { category: "Help", label: "System Hooks Help", url: help_page_path("system_hooks/system_hooks") }, - { category: "Help", label: "Webhooks Help", url: help_page_path("web_hooks/web_hooks") }, + { category: "Help", label: "Webhooks Help", url: help_page_path("user/project/integrations/webhooks") }, { category: "Help", label: "Workflow Help", url: help_page_path("workflow/README") }, ] end diff --git a/app/views/projects/blob/diff.html.haml b/app/views/projects/blob/diff.html.haml index 538f8591f13..3b1a2e54ec2 100644 --- a/app/views/projects/blob/diff.html.haml +++ b/app/views/projects/blob/diff.html.haml @@ -27,4 +27,4 @@ - if @form.unfold? && @form.bottom? && @form.to < @blob.loc %tr.line_holder{ id: @form.to, class: line_class } - = diff_match_line @form.to, @form.to, text: @match_line, view: diff_view, bottom: true + = diff_match_line @form.to - @form.offset, @form.to, text: @match_line, view: diff_view, bottom: true diff --git a/app/views/projects/diffs/_parallel_view.html.haml b/app/views/projects/diffs/_parallel_view.html.haml index f361204ecac..074f1f634ae 100644 --- a/app/views/projects/diffs/_parallel_view.html.haml +++ b/app/views/projects/diffs/_parallel_view.html.haml @@ -1,15 +1,17 @@ / Side-by-side diff view .text-file.diff-wrap-lines.code.js-syntax-highlight{ data: diff_view_data } %table - - last_line = 0 - diff_file.parallel_diff_lines.each do |line| - left = line[:left] - right = line[:right] - - last_line = right.new_pos if right %tr.line_holder.parallel - if left - - if left.meta? + - case left.type + - when 'match' = diff_match_line left.old_pos, nil, text: left.text, view: :parallel + - when 'nonewline' + %td.old_line.diff-line-num + %td.line_content.match= left.text - else - left_line_code = diff_file.line_code(left) - left_position = diff_file.position(left) @@ -21,8 +23,12 @@ %td.line_content.parallel - if right - - if right.meta? + - case right.type + - when 'match' = diff_match_line nil, right.new_pos, text: left.text, view: :parallel + - when 'nonewline' + %td.new_line.diff-line-num + %td.line_content.match= right.text - else - right_line_code = diff_file.line_code(right) - right_position = diff_file.position(right) @@ -37,5 +43,7 @@ - discussion_left, discussion_right = parallel_diff_discussions(left, right, diff_file) - if discussion_left || discussion_right = render "discussions/parallel_diff_discussion", discussion_left: discussion_left, discussion_right: discussion_right - - if !diff_file.new_file && last_line > 0 - = diff_match_line last_line, last_line, bottom: true, view: :parallel + - if !diff_file.new_file && diff_file.diff_lines.any? + - last_line = diff_file.diff_lines.last + %tr.line_holder.parallel + = diff_match_line last_line.old_pos, last_line.new_pos, bottom: true, view: :parallel diff --git a/app/views/projects/diffs/_text_file.html.haml b/app/views/projects/diffs/_text_file.html.haml index f1d2d4bf268..2eea1db169a 100644 --- a/app/views/projects/diffs/_text_file.html.haml +++ b/app/views/projects/diffs/_text_file.html.haml @@ -4,13 +4,13 @@ %a.show-suppressed-diff.js-show-suppressed-diff Changes suppressed. Click to show. %table.text-file.code.js-syntax-highlight{ data: diff_view_data, class: too_big ? 'hide' : '' } - - last_line = 0 - discussions = @grouped_diff_discussions unless @diff_notes_disabled = render partial: "projects/diffs/line", collection: diff_file.highlighted_diff_lines, as: :line, locals: { diff_file: diff_file, discussions: discussions } - - last_line = diff_file.highlighted_diff_lines.last.new_pos - - if !diff_file.new_file && last_line > 0 - = diff_match_line last_line, last_line, bottom: true + - if !diff_file.new_file && diff_file.highlighted_diff_lines.any? + - last_line = diff_file.highlighted_diff_lines.last + %tr.line_holder + = diff_match_line last_line.old_pos, last_line.new_pos, bottom: true diff --git a/app/views/shared/web_hooks/_form.html.haml b/app/views/shared/web_hooks/_form.html.haml index c212d1c86bf..37e2a377a69 100644 --- a/app/views/shared/web_hooks/_form.html.haml +++ b/app/views/shared/web_hooks/_form.html.haml @@ -3,7 +3,7 @@ %h4.prepend-top-0 = page_title %p - #{link_to "Webhooks", help_page_path("web_hooks/web_hooks")} can be + #{link_to "Webhooks", help_page_path("user/project/integrations/webhooks")} can be used for binding events when something is happening within the project. .col-lg-9.append-bottom-default = form_for hook, as: :hook, url: polymorphic_path(url_components + [:hooks]) do |f| |