Commit 50dc89f3 authored by GitLab Bot's avatar GitLab Bot

Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-10-01

# Conflicts:
#	app/views/help/index.html.haml
#	spec/views/help/index.html.haml_spec.rb

[ci skip]
parents 1408bb30 39d2f186
# frozen_string_literal: true # frozen_string_literal: true
module AvatarsHelper module AvatarsHelper
def project_icon(project_id, options = {}) def project_icon(project, options = {})
source_icon(Project, project_id, options) source_icon(project, options)
end end
def group_icon(group_id, options = {}) def group_icon(group, options = {})
source_icon(Group, group_id, options) source_icon(group, options)
end end
# Takes both user and email and returns the avatar_icon by # Takes both user and email and returns the avatar_icon by
...@@ -110,16 +110,11 @@ module AvatarsHelper ...@@ -110,16 +110,11 @@ module AvatarsHelper
private private
def source_icon(klass, source_id, options = {}) def source_icon(source, options = {})
source = avatar_url = source.try(:avatar_url)
if source_id.respond_to?(:avatar_url)
source_id
else
klass.find_by_full_path(source_id)
end
if source.avatar_url if avatar_url
image_tag source.avatar_url, options image_tag avatar_url, options
else else
source_identicon(source, options) source_identicon(source, options)
end end
......
...@@ -7,7 +7,11 @@ ...@@ -7,7 +7,11 @@
GitLab GitLab
Enterprise Edition Enterprise Edition
- if user_signed_in? - if user_signed_in?
<<<<<<< HEAD
%span= link_to Gitlab::VERSION, Gitlab::COM_URL + namespace_project_tag_path('gitlab-org', 'gitlab-ee', "v#{Gitlab::VERSION}") %span= link_to Gitlab::VERSION, Gitlab::COM_URL + namespace_project_tag_path('gitlab-org', 'gitlab-ee', "v#{Gitlab::VERSION}")
=======
%span= link_to Gitlab::VERSION, Gitlab::COM_URL + namespace_project_tag_path('gitlab-org', 'gitlab-ce', "v#{Gitlab::VERSION}")
>>>>>>> upstream/master
= version_status_badge = version_status_badge
%hr %hr
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
.form-group .form-group
- if @project.avatar? - if @project.avatar?
.avatar-container.s160.append-bottom-15 .avatar-container.s160.append-bottom-15
= project_icon(@project.full_path, alt: '', class: 'avatar project-avatar s160', width: 160, height: 160) = project_icon(@project, alt: '', class: 'avatar project-avatar s160', width: 160, height: 160)
- if @project.avatar_in_git - if @project.avatar_in_git
%p.light %p.light
= _("Project avatar in repository: %{link}").html_safe % { link: @project.avatar_in_git } = _("Project avatar in repository: %{link}").html_safe % { link: @project.avatar_in_git }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
.bordered-box.fork-thumbnail.text-center.prepend-left-default.append-right-default.prepend-top-default.append-bottom-default.forked .bordered-box.fork-thumbnail.text-center.prepend-left-default.append-right-default.prepend-top-default.append-bottom-default.forked
= link_to project_path(forked_project) do = link_to project_path(forked_project) do
- if /no_((\w*)_)*avatar/.match(avatar) - if /no_((\w*)_)*avatar/.match(avatar)
= project_icon(namespace, class: "avatar s100 identicon") = group_icon(namespace, class: "avatar s100 identicon")
- else - else
.avatar-container.s100 .avatar-container.s100
= image_tag(avatar, class: "avatar s100") = image_tag(avatar, class: "avatar s100")
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
class: ("disabled has-tooltip" unless can_create_project), class: ("disabled has-tooltip" unless can_create_project),
title: (_('You have reached your project limit') unless can_create_project) do title: (_('You have reached your project limit') unless can_create_project) do
- if /no_((\w*)_)*avatar/.match(avatar) - if /no_((\w*)_)*avatar/.match(avatar)
= project_icon(namespace, class: "avatar s100 identicon") = group_icon(namespace, class: "avatar s100 identicon")
- else - else
.avatar-container.s100 .avatar-container.s100
= image_tag(avatar, class: "avatar s100") = image_tag(avatar, class: "avatar s100")
......
---
title: Link to the tag for a version on the help page instead of to the commit
merge_request: 22015
author:
type: changed
---
title: Update docs regarding frozen string
merge_request:
author: gfyoung
type: other
---
title: Fix Error 500 when forking projects with Gravatar disabled
merge_request:
author:
type: fixed
...@@ -364,8 +364,7 @@ Depending on the size of the String and how frequently it would be allocated ...@@ -364,8 +364,7 @@ Depending on the size of the String and how frequently it would be allocated
there's no guarantee it will. there's no guarantee it will.
Strings will be frozen by default in Ruby 3.0. To prepare our code base for Strings will be frozen by default in Ruby 3.0. To prepare our code base for
this eventuality, it's a good practice to add the following header to all this eventuality, we will be adding the following header to all Ruby files:
Ruby files:
```ruby ```ruby
# frozen_string_literal: true # frozen_string_literal: true
...@@ -379,6 +378,9 @@ test = +"hello" ...@@ -379,6 +378,9 @@ test = +"hello"
test += " world" test += " world"
``` ```
When adding new Ruby files, please check that you can add the above header,
as omitting it may lead to style check failures.
## Anti-Patterns ## Anti-Patterns
This is a collection of [anti-patterns][anti-pattern] that should be avoided This is a collection of [anti-patterns][anti-pattern] that should be avoided
......
...@@ -41,7 +41,8 @@ However, for this to work there are the following requirements: ...@@ -41,7 +41,8 @@ However, for this to work there are the following requirements:
1. You can only upgrade 1 minor release at a time. So from 9.1 to 9.2, not to 1. You can only upgrade 1 minor release at a time. So from 9.1 to 9.2, not to
9.3. 9.3.
2. You have to use [post-deployment 2. You have to use [post-deployment
migrations](../development/post_deployment_migrations.md). migrations](../development/post_deployment_migrations.md) (included in
zero downtime update steps below)
3. You are using PostgreSQL. If you are using MySQL please look at the release 3. You are using PostgreSQL. If you are using MySQL please look at the release
post to see if downtime is required. post to see if downtime is required.
......
...@@ -53,6 +53,18 @@ describe 'Project fork' do ...@@ -53,6 +53,18 @@ describe 'Project fork' do
expect(current_path).to have_content(/#{user.namespace.name}/i) expect(current_path).to have_content(/#{user.namespace.name}/i)
end end
it 'shows avatars when Gravatar is disabled' do
stub_application_setting(gravatar_enabled: false)
visit project_path(project)
click_link 'Fork'
page.within('.fork-thumbnail-container') do
expect(page).to have_css('div.identicon')
end
end
it 'shows the forked project on the list' do it 'shows the forked project on the list' do
visit project_path(project) visit project_path(project)
......
...@@ -32,18 +32,6 @@ describe AvatarsHelper do ...@@ -32,18 +32,6 @@ describe AvatarsHelper do
end end
end end
context 'when providing a project path' do
it_behaves_like 'resource with a default avatar', 'project' do
let(:resource) { create(:project, name: 'foo') }
let(:helper_args) { [resource.full_path] }
end
it_behaves_like 'resource with a custom avatar', 'project' do
let(:resource) { create(:project, :public, avatar: File.open(uploaded_image_temp_path)) }
let(:helper_args) { [resource.full_path] }
end
end
context 'when providing a group' do context 'when providing a group' do
it_behaves_like 'resource with a default avatar', 'group' do it_behaves_like 'resource with a default avatar', 'group' do
let(:resource) { create(:group, name: 'foo') } let(:resource) { create(:group, name: 'foo') }
...@@ -55,18 +43,6 @@ describe AvatarsHelper do ...@@ -55,18 +43,6 @@ describe AvatarsHelper do
let(:helper_args) { [resource] } let(:helper_args) { [resource] }
end end
end end
context 'when providing a group path' do
it_behaves_like 'resource with a default avatar', 'group' do
let(:resource) { create(:group, name: 'foo') }
let(:helper_args) { [resource.full_path] }
end
it_behaves_like 'resource with a custom avatar', 'group' do
let(:resource) { create(:group, avatar: File.open(uploaded_image_temp_path)) }
let(:helper_args) { [resource.full_path] }
end
end
end end
describe '#avatar_icon_for' do describe '#avatar_icon_for' do
......
...@@ -21,7 +21,11 @@ describe 'help/index' do ...@@ -21,7 +21,11 @@ describe 'help/index' do
render render
expect(rendered).to match '8.0.2' expect(rendered).to match '8.0.2'
<<<<<<< HEAD
expect(rendered).to have_link('8.0.2', href: 'https://gitlab.com/gitlab-org/gitlab-ee/tags/v8.0.2') expect(rendered).to have_link('8.0.2', href: 'https://gitlab.com/gitlab-org/gitlab-ee/tags/v8.0.2')
=======
expect(rendered).to have_link('8.0.2', href: 'https://gitlab.com/gitlab-org/gitlab-ce/tags/v8.0.2')
>>>>>>> upstream/master
end end
end end
......
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