Commit facfec4b authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'patch-release' into '7-1-stable'

Patch release

Part of #1470

See merge request !1000
parents 1ddca461 7816360c
v 7.1.1
- Fix cpu usage issue in Firefox
- Fix redirect loop when changing password by new user
- Fix 500 error on new merge request page
v 7.1.0 v 7.1.0
- Remove observers - Remove observers
- Improve MR discussions - Improve MR discussions
......
...@@ -20,6 +20,9 @@ $(document).ready -> ...@@ -20,6 +20,9 @@ $(document).ready ->
$(".div-dropzone-hover").append iconPicture $(".div-dropzone-hover").append iconPicture
$(".div-dropzone").append divSpinner $(".div-dropzone").append divSpinner
$(".div-dropzone-spinner").append iconSpinner $(".div-dropzone-spinner").append iconSpinner
$(".div-dropzone-spinner").css
"opacity": 0
"display": "none"
dropzone = $(".div-dropzone").dropzone( dropzone = $(".div-dropzone").dropzone(
url: project_image_path_upload url: project_image_path_upload
...@@ -66,13 +69,17 @@ $(document).ready -> ...@@ -66,13 +69,17 @@ $(document).ready ->
return return
sending: -> sending: ->
$(".div-dropzone-spinner").css "opacity", 0.7 $(".div-dropzone-spinner").css
"opacity": 0.7
"display": "inherit"
return return
complete: -> complete: ->
$(".dz-preview").remove() $(".dz-preview").remove()
$(".markdown-area").trigger "input" $(".markdown-area").trigger "input"
$(".div-dropzone-spinner").css "opacity", 0 $(".div-dropzone-spinner").css
"opacity": 0
"display": "none"
return return
) )
...@@ -163,10 +170,14 @@ $(document).ready -> ...@@ -163,10 +170,14 @@ $(document).ready ->
val + url + "\n" val + url + "\n"
showSpinner = (e) -> showSpinner = (e) ->
$(".div-dropzone-spinner").css "opacity", 0.7 $(".div-dropzone-spinner").css
"opacity": 0.7
"display": "inherit"
closeSpinner = -> closeSpinner = ->
$(".div-dropzone-spinner").css "opacity", 0 $(".div-dropzone-spinner").css
"opacity": 0
"display": "none"
showError = (message) -> showError = (message) ->
checkIfMsgExists = $(".error-alert").children().length checkIfMsgExists = $(".error-alert").children().length
......
...@@ -70,7 +70,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -70,7 +70,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@target_project = merge_request.target_project @target_project = merge_request.target_project
@source_project = merge_request.source_project @source_project = merge_request.source_project
@commits = @merge_request.compare_commits @commits = @merge_request.compare_commits
@commit = @merge_request.compare_base_commit @commit = @merge_request.compare_commits.last
@diffs = @merge_request.compare_diffs @diffs = @merge_request.compare_diffs
@note_counts = Note.where(commit_id: @commits.map(&:id)). @note_counts = Note.where(commit_id: @commits.map(&:id)).
group(:commit_id).count group(:commit_id).count
......
class SessionsController < Devise::SessionsController class SessionsController < Devise::SessionsController
def new def new
redirect_url = if request.referer.present? redirect_path = if request.referer.present? && (params['redirect_to_referer'] == 'yes')
referer_uri = URI(request.referer) referer_uri = URI(request.referer)
if referer_uri.host == Gitlab.config.gitlab.host if referer_uri.host == Gitlab.config.gitlab.host
referer_uri.path referer_uri.path
...@@ -12,7 +12,11 @@ class SessionsController < Devise::SessionsController ...@@ -12,7 +12,11 @@ class SessionsController < Devise::SessionsController
request.fullpath request.fullpath
end end
store_location_for(:redirect, redirect_url) # Prevent a 'you are already signed in' message directly after signing:
# we should never redirect to '/users/sign_in' after signing in successfully.
unless redirect_path == '/users/sign_in'
store_location_for(:redirect, redirect_path)
end
super super
end end
......
...@@ -44,7 +44,7 @@ class MergeRequest < ActiveRecord::Base ...@@ -44,7 +44,7 @@ class MergeRequest < ActiveRecord::Base
# Temporary fields to store compare vars # Temporary fields to store compare vars
# when creating new merge request # when creating new merge request
attr_accessor :can_be_created, :compare_failed, :compare_base_commit, attr_accessor :can_be_created, :compare_failed,
:compare_commits, :compare_diffs :compare_commits, :compare_diffs
ActsAsTaggableOn.strict_case_match = true ActsAsTaggableOn.strict_case_match = true
......
...@@ -263,4 +263,20 @@ class Repository ...@@ -263,4 +263,20 @@ class Repository
contributor contributor
end end
end end
def blob_for_diff(commit, diff)
file = blob_at(commit.id, diff.new_path)
unless file
file = prev_blob_for_diff(commit, diff)
end
file
end
def prev_blob_for_diff(commit, diff)
if commit.parent_id
blob_at(commit.parent_id, diff.old_path)
end
end
end end
...@@ -34,7 +34,6 @@ module MergeRequests ...@@ -34,7 +34,6 @@ module MergeRequests
# If we have at least one commit to merge -> creation allowed # If we have at least one commit to merge -> creation allowed
if commits.present? if commits.present?
merge_request.compare_commits = Commit.decorate(commits) merge_request.compare_commits = Commit.decorate(commits)
merge_request.compare_base_commit = Commit.new(commits.first)
merge_request.can_be_created = true merge_request.can_be_created = true
merge_request.compare_failed = false merge_request.compare_failed = false
......
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
%i.icon-reorder %i.icon-reorder
.pull-right.hidden-xs .pull-right.hidden-xs
= link_to "Sign in", new_session_path(:user), class: 'btn btn-sign-in btn-new' = link_to "Sign in", new_session_path(:user, redirect_to_referer: 'yes'), class: 'btn btn-sign-in btn-new'
.navbar-collapse.collapse .navbar-collapse.collapse
%ul.nav.navbar-nav %ul.nav.navbar-nav
%li.visible-xs %li.visible-xs
= link_to "Sign in", new_session_path(:user) = link_to "Sign in", new_session_path(:user, redirect_to_referer: 'yes')
- file = project.repository.blob_at(@commit.id, diff.new_path) - file = project.repository.blob_for_diff(@commit, diff)
- file = project.repository.blob_at(@commit.parent_id, diff.old_path) unless file
- return unless file - return unless file
.diff-file{id: "diff-#{i}"} .diff-file{id: "diff-#{i}"}
.diff-header{id: "file-path-#{hexdigest(diff.new_path || diff.old_path)}"} .diff-header{id: "file-path-#{hexdigest(diff.new_path || diff.old_path)}"}
...@@ -41,7 +40,7 @@ ...@@ -41,7 +40,7 @@
- else - else
= render "projects/commits/text_file", diff: diff, index: i = render "projects/commits/text_file", diff: diff, index: i
- elsif file.image? - elsif file.image?
- old_file = project.repository.blob_at(@commit.parent_id, diff.old_path) if @commit.parent_id - old_file = project.repository.prev_blob_for_diff(@commit, diff)
= render "projects/commits/image", diff: diff, old_file: old_file, file: file, index: i = render "projects/commits/image", diff: diff, old_file: old_file, file: file, index: i
- else - else
.nothing-here-block No preview for this file type .nothing-here-block No preview for this file type
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment