summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-24 15:07:59 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-24 15:07:59 +0000
commit725ab660a432fdffcc6835ba34340e84951fb97f (patch)
tree5528e29871806cfd8f92b61b70a031bca088c685
parent00df932c458bdd6bb2107760875124054f15543f (diff)
downloadgitlab-ce-725ab660a432fdffcc6835ba34340e84951fb97f.tar.gz
Add latest changes from gitlab-org/gitlab@12-8-stable-ee
-rw-r--r--app/graphql/types/user_type.rb2
-rw-r--r--changelogs/unreleased/ph-207723-userTypeGravatarDisabled.yml5
-rw-r--r--doc/api/graphql/reference/gitlab_schema.graphql2
-rw-r--r--doc/api/graphql/reference/gitlab_schema.json10
-rw-r--r--doc/api/graphql/reference/index.md2
-rw-r--r--spec/features/projects/tree/tree_show_spec.rb17
6 files changed, 28 insertions, 10 deletions
diff --git a/app/graphql/types/user_type.rb b/app/graphql/types/user_type.rb
index 3943c891335..e530641d6ae 100644
--- a/app/graphql/types/user_type.rb
+++ b/app/graphql/types/user_type.rb
@@ -14,7 +14,7 @@ module Types
description: 'Human-readable name of the user'
field :username, GraphQL::STRING_TYPE, null: false,
description: 'Username of the user. Unique within this instance of GitLab'
- field :avatar_url, GraphQL::STRING_TYPE, null: false,
+ field :avatar_url, GraphQL::STRING_TYPE, null: true,
description: "URL of the user's avatar"
field :web_url, GraphQL::STRING_TYPE, null: false,
description: 'Web URL of the user'
diff --git a/changelogs/unreleased/ph-207723-userTypeGravatarDisabled.yml b/changelogs/unreleased/ph-207723-userTypeGravatarDisabled.yml
new file mode 100644
index 00000000000..047d3aee506
--- /dev/null
+++ b/changelogs/unreleased/ph-207723-userTypeGravatarDisabled.yml
@@ -0,0 +1,5 @@
+---
+title: Fixed last commit widget when Gravatar is disabled
+merge_request:
+author:
+type: fixed
diff --git a/doc/api/graphql/reference/gitlab_schema.graphql b/doc/api/graphql/reference/gitlab_schema.graphql
index 898ad11f450..c5bf95e0aa6 100644
--- a/doc/api/graphql/reference/gitlab_schema.graphql
+++ b/doc/api/graphql/reference/gitlab_schema.graphql
@@ -7878,7 +7878,7 @@ type User {
"""
URL of the user's avatar
"""
- avatarUrl: String!
+ avatarUrl: String
"""
Human-readable name of the user
diff --git a/doc/api/graphql/reference/gitlab_schema.json b/doc/api/graphql/reference/gitlab_schema.json
index 41872ffa9c2..b4724c73c54 100644
--- a/doc/api/graphql/reference/gitlab_schema.json
+++ b/doc/api/graphql/reference/gitlab_schema.json
@@ -5894,13 +5894,9 @@
],
"type": {
- "kind": "NON_NULL",
- "name": null,
- "ofType": {
- "kind": "SCALAR",
- "name": "String",
- "ofType": null
- }
+ "kind": "SCALAR",
+ "name": "String",
+ "ofType": null
},
"isDeprecated": false,
"deprecationReason": null
diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md
index 19d145a664f..97b736d614d 100644
--- a/doc/api/graphql/reference/index.md
+++ b/doc/api/graphql/reference/index.md
@@ -1277,7 +1277,7 @@ Autogenerated return type of UpdateSnippet
| Name | Type | Description |
| --- | ---- | ---------- |
-| `avatarUrl` | String! | URL of the user's avatar |
+| `avatarUrl` | String | URL of the user's avatar |
| `name` | String! | Human-readable name of the user |
| `userPermissions` | UserPermissions! | Permissions for the current user on the resource |
| `username` | String! | Username of the user. Unique within this instance of GitLab |
diff --git a/spec/features/projects/tree/tree_show_spec.rb b/spec/features/projects/tree/tree_show_spec.rb
index 180ffac4d4d..23b13858096 100644
--- a/spec/features/projects/tree/tree_show_spec.rb
+++ b/spec/features/projects/tree/tree_show_spec.rb
@@ -5,11 +5,14 @@ require 'spec_helper'
describe 'Projects tree', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :repository) }
+ let(:gravatar_enabled) { true }
# This commit has a known state on the master branch of gitlab-test
let(:test_sha) { '7975be0116940bf2ad4321f79d02a55c5f7779aa' }
before do
+ stub_application_setting(gravatar_enabled: gravatar_enabled)
+
project.add_maintainer(user)
sign_in(user)
end
@@ -34,6 +37,20 @@ describe 'Projects tree', :js do
expect(page).not_to have_selector('.flash-alert')
end
+ context 'gravatar disabled' do
+ let(:gravatar_enabled) { false }
+
+ it 'renders last commit' do
+ visit project_tree_path(project, test_sha)
+ wait_for_requests
+
+ page.within('.project-last-commit') do
+ expect(page).to have_selector('.user-avatar-link')
+ expect(page).to have_content('Merge branch')
+ end
+ end
+ end
+
context 'for signed commit' do
it 'displays a GPG badge' do
visit project_tree_path(project, '33f3729a45c02fc67d00adb1b8bca394b0e761d9')