Commit 6b479b6c authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce

parents c4202554 36537c65
......@@ -19,7 +19,6 @@ v 7.10.0 (unreleased)
- Disable reference creation for comments surrounded by code/preformatted blocks (Stan Hu)
- Reduce Rack Attack false positives causing 403 errors during HTTP authentication (Stan Hu)
- enable line wrapping per default and remove the checkbox to toggle it (Hannes Rosenögger)
- extend the commit calendar to show the actual commits made on a date (Hannes Rosenögger)
- Fix a link in the patch update guide
- Add a service to support external wikis (Hannes Rosenögger)
- Omit the "email patches" link and fix plain diff view for merge commits
......@@ -73,6 +72,8 @@ v 7.10.0 (unreleased)
- Fix git over ssh errors 'fatal: protocol error: bad line length character'
- Automatically setup GitLab CI project for forks if origin project has GitLab CI enabled
- Bust group page project list cache when namespace name or path changes.
- Explicitly set image alt-attribute to prevent graphical glitches if gravatars could not be loaded
- Fix stuck Merge Request merging events from old installations (Ben Bodenmiller)
v 7.9.3
- Contains no changes
......@@ -80,9 +81,11 @@ v 7.9.3
- Allow admin to create public deploy keys that are accessible to any project.
- Warn when gitlab-shell version doesn't match requirement.
- Skip email confirmation when set by admin or via LDAP.
- Only allow users to reference groups, projects, issues, MRs, commits they have access to.
v 7.9.3
- Contains no changes
v 7.9.2
- Contains no changes
......
require 'html/pipeline'
require 'html/pipeline/gitlab'
module EmailsHelper
# Google Actions
......@@ -38,26 +35,4 @@ module EmailsHelper
lexer = Rugments::Lexers::Diff.new
raw formatter.format(lexer.lex(diffcontent))
end
def replace_image_links_with_base64(text, project)
# Used pipelines in GitLab:
# GitlabEmailImageFilter - replaces images that have been uploaded as attachments with inline images in emails.
#
# see https://gitlab.com/gitlab-org/html-pipeline-gitlab for more filters
filters = [
HTML::Pipeline::Gitlab::GitlabEmailImageFilter
]
context = {
base_url: File.join(Gitlab.config.gitlab.url, project.path_with_namespace, 'uploads'),
upload_path: File.join(Rails.root, 'public', 'uploads', project.path_with_namespace),
}
pipeline = HTML::Pipeline::Gitlab.new(filters).pipeline
result = pipeline.call(text, context)
text = result[:output].to_html(save_with: 0)
text.html_safe
end
end
......@@ -361,6 +361,6 @@ class MergeRequest < ActiveRecord::Base
end
def locked_long_ago?
locked_at && locked_at < (Time.now - 1.day)
locked_at.nil? || locked_at < (Time.now - 1.day)
end
end
......@@ -4,7 +4,7 @@
%li{class: "#{dom_class(member)} js-toggle-container", id: dom_id(member)}
%span{class: ("list-item-name" if show_controls)}
= image_tag avatar_icon(user.email, 16), class: "avatar s16"
= image_tag avatar_icon(user.email, 16), class: "avatar s16", alt: ''
%strong= user.name
%span.cgray= user.username
- if user == current_user
......
......@@ -7,4 +7,4 @@
= link_to_gfm issue.title, [project.namespace.becomes(Namespace), project, issue], title: issue.title
.pull-right.assignee-icon
- if issue.assignee
= image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16"
= image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16", alt: ''
......@@ -7,4 +7,4 @@
= link_to_gfm merge_request.title, [project.namespace.becomes(Namespace), project, merge_request], title: merge_request.title
.pull-right.assignee-icon
- if merge_request.assignee
= image_tag avatar_icon(merge_request.assignee.email, 16), class: "avatar s16"
= image_tag avatar_icon(merge_request.assignee.email, 16), class: "avatar s16", alt: ''
......@@ -31,8 +31,3 @@
%span
Merge Requests
%span.count= current_user.assigned_merge_requests.opened.count
= nav_link(controller: :help) do
= link_to help_path, title: 'Help' do
%i.fa.fa-question-circle
%span
Help
%div
= replace_image_links_with_base64(markdown(@note.note, reference_only_path: false), @note.project)
= markdown(@note.note, reference_only_path: false)
-if @issue.description
= replace_image_links_with_base64(markdown(@issue.description, reference_only_path: false), @issue.project)
= markdown(@issue.description, reference_only_path: false)
- if @issue.assignee_id.present?
%p
......
......@@ -6,4 +6,4 @@
Assignee: #{@merge_request.author_name} &rarr; #{@merge_request.assignee_name}
-if @merge_request.description
= replace_image_links_with_base64(markdown(@merge_request.description, reference_only_path: false), @merge_request.project)
= markdown(@merge_request.description, reference_only_path: false)
......@@ -5,5 +5,5 @@
= link_to_gfm issue.title, [@project.namespace.becomes(Namespace), @project, issue], title: issue.title
.pull-right.assignee-icon
- if issue.assignee
= image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16"
= image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16", alt: ''
......@@ -5,4 +5,4 @@
= link_to_gfm merge_request.title, [@project.namespace.becomes(Namespace), @project, merge_request], title: merge_request.title
.pull-right.assignee-icon
- if merge_request.assignee
= image_tag avatar_icon(merge_request.assignee.email, 16), class: "avatar s16"
= image_tag avatar_icon(merge_request.assignee.email, 16), class: "avatar s16", alt: ''
......@@ -5,7 +5,7 @@
%span.fa.fa-circle
- else
= link_to user_path(note.author) do
= image_tag avatar_icon(note.author_email), class: "avatar s40"
= image_tag avatar_icon(note.author_email), class: "avatar s40", alt: ''
.timeline-content
.note-header
.note-actions
......@@ -23,7 +23,7 @@
Remove
- if note.system
= link_to user_path(note.author) do
= image_tag avatar_icon(note.author_email), class: "avatar s16"
= image_tag avatar_icon(note.author_email), class: "avatar s16", alt: ''
= link_to_member(@project, note.author, avatar: false)
%span.author-username
= '@' + note.author.username
......
......@@ -3,7 +3,7 @@
%li{class: "#{dom_class(member)} js-toggle-container project_member_row access-#{member.human_access.downcase}", id: dom_id(member)}
%span.list-item-name
= image_tag avatar_icon(user.email, 16), class: "avatar s16"
= image_tag avatar_icon(user.email, 16), class: "avatar s16", alt: ''
%strong= user.name
%span.cgray= user.username
- if user == current_user
......
......@@ -17,7 +17,7 @@
%span.light
by
= link_to user_snippets_path(@snippet.author) do
= image_tag avatar_icon(@snippet.author_email), class: "avatar avatar-inline s16"
= image_tag avatar_icon(@snippet.author_email), class: "avatar avatar-inline s16", alt: ''
= @snippet.author_name
.back-link
......
......@@ -11,7 +11,7 @@ RUN apt-get update -q \
# If the Omnibus package version below is outdated please contribute a merge request to update it.
# If you run GitLab Enterprise Edition point it to a location where you have downloaded it.
RUN TMP_FILE=$(mktemp); \
wget -q -O $TMP_FILE https://downloads-packages.s3.amazonaws.com/ubuntu-14.04/gitlab_7.9.1-omnibus.1-1_amd64.deb \
wget -q -O $TMP_FILE https://downloads-packages.s3.amazonaws.com/ubuntu-14.04/gitlab_7.9.2-omnibus-1_amd64.deb \
&& dpkg -i $TMP_FILE \
&& rm -f $TMP_FILE
......
......@@ -17,8 +17,3 @@ Feature: Dashboard Active Tab
Given I visit dashboard merge requests page
Then the active main tab should be Merge Requests
And no other main tabs should be active
Scenario: On Dashboard Help
Given I visit dashboard help page
Then the active main tab should be Help
And no other main tabs should be active
......@@ -3,7 +3,4 @@ class Spinach::Features::DashboardActiveTab < Spinach::FeatureSteps
include SharedPaths
include SharedActiveTab
step 'the active main tab should be Help' do
ensure_active_main_tab('Help')
end
end
......@@ -83,10 +83,6 @@ module SharedPaths
visit search_path
end
step 'I visit dashboard help page' do
visit help_path
end
step 'I visit dashboard groups page' do
visit dashboard_groups_path
end
......
......@@ -191,13 +191,6 @@ describe Notify do
context 'for issues' do
let(:issue) { create(:issue, author: current_user, assignee: assignee, project: project) }
let(:issue_with_description) { create(:issue, author: current_user, assignee: assignee, project: project, description: Faker::Lorem.sentence) }
let(:issue_with_image) do
create(:issue,
author: current_user,
assignee: assignee,
project: project,
description: "![test](#{Gitlab.config.gitlab.url}/#{project.path_with_namespace}/uploads/12345/test.jpg)")
end
describe 'that are new' do
subject { Notify.new_issue_email(issue.assignee_id, issue.id) }
......@@ -222,22 +215,6 @@ describe Notify do
end
end
describe 'that contain images' do
let(:png) { File.read("#{Rails.root}/spec/fixtures/dk.png") }
let(:png_encoded) { Base64::encode64(png) }
before :each do
file_path = File.join(Rails.root, 'public', 'uploads', issue_with_image.project.path_with_namespace, '12345/test.jpg')
allow(File).to receive(:file?).with(file_path).and_return(true)
allow(File).to receive(:read).with(file_path).and_return(png)
end
subject { Notify.new_issue_email(issue_with_image.assignee_id, issue_with_image.id) }
it 'replaces attached images with inline images' do
is_expected.to have_body_text URI.encode(png_encoded)
end
end
describe 'that have been reassigned' do
subject { Notify.reassigned_issue_email(recipient.id, issue.id, previous_assignee.id, current_user) }
......@@ -302,14 +279,6 @@ describe Notify do
let(:merge_author) { create(:user) }
let(:merge_request) { create(:merge_request, author: current_user, assignee: assignee, source_project: project, target_project: project) }
let(:merge_request_with_description) { create(:merge_request, author: current_user, assignee: assignee, source_project: project, target_project: project, description: Faker::Lorem.sentence) }
let(:merge_request_with_image) do
create(:merge_request,
author: current_user,
assignee: assignee,
source_project: project,
target_project: project,
description: "![test](#{Gitlab.config.gitlab.url}/#{project.path_with_namespace}/uploads/12345/test.jpg)")
end
describe 'that are new' do
subject { Notify.new_merge_request_email(merge_request.assignee_id, merge_request.id) }
......@@ -346,22 +315,6 @@ describe Notify do
end
end
describe 'that are new and contain contain images in the description' do
let(:png) {File.read("#{Rails.root}/spec/fixtures/dk.png")}
let(:png_encoded) { Base64::encode64(png) }
before :each do
file_path = File.join(Rails.root, 'public', 'uploads', merge_request_with_image.project.path_with_namespace, '/12345/test.jpg')
allow(File).to receive(:file?).with(file_path).and_return(true)
allow(File).to receive(:read).with(file_path).and_return(png)
end
subject { Notify.new_merge_request_email(merge_request_with_image.assignee_id, merge_request_with_image.id) }
it 'replaces attached images with inline images' do
is_expected.to have_body_text URI.encode(png_encoded)
end
end
describe 'that are reassigned' do
subject { Notify.reassigned_merge_request_email(recipient.id, merge_request.id, previous_assignee.id, current_user.id) }
......@@ -470,12 +423,9 @@ describe Notify do
describe 'project access changed' do
let(:project) { create(:project) }
let(:user) { create(:user) }
let(:project_member) do
create(:project_member,
project: project,
user: user)
end
let(:project_member) { create(:project_member,
project: project,
user: user) }
subject { Notify.project_access_granted_email(project_member.id) }
it_behaves_like 'an email sent from GitLab'
......@@ -515,32 +465,6 @@ describe Notify do
end
end
describe 'on a commit that contains an image' do
let(:commit) { project.repository.commit }
let(:note_with_image) do
create(:note,
project: project,
author: note_author,
note: "![test](#{Gitlab.config.gitlab.url}/#{project.path_with_namespace}/uploads/12345/test.jpg)")
end
let(:png) {File.read("#{Rails.root}/spec/fixtures/dk.png")}
let(:png_encoded) { Base64::encode64(png) }
before :each do
file_path = File.join(Rails.root, 'public', 'uploads', note_with_image.project.path_with_namespace, '12345/test.jpg')
allow(File).to receive(:file?).with(file_path).and_return(true)
allow(File).to receive(:read).with(file_path).and_return(png)
allow(Note).to receive(:find).with(note_with_image.id).and_return(note_with_image)
allow(note_with_image).to receive(:noteable).and_return(commit)
end
subject { Notify.note_commit_email(recipient.id, note_with_image.id) }
it 'replaces attached images with inline images' do
is_expected.to have_body_text URI.encode(png_encoded)
end
end
describe 'on a commit' do
let(:commit) { project.repository.commit }
......
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