Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-16 12:08:46 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-16 12:08:46 +0300
commitb806264d29b8d52ccb78a41dcc3d67f2b040700c (patch)
treeaf97e9d36b2c82520d6850836dee6ba8d7ed9b17 /app
parent34ab9be97ecf84dd2b7a3b8f3149c0f7d1d7ab5c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/graphql/types/error_tracking/sentry_detailed_error_type.rb3
-rw-r--r--app/helpers/application_settings_helper.rb1
-rw-r--r--app/models/error_tracking/project_error_tracking_setting.rb2
-rw-r--r--app/policies/user_policy.rb9
-rw-r--r--app/serializers/error_tracking/detailed_error_entity.rb1
-rw-r--r--app/services/users/update_service.rb9
-rw-r--r--app/views/admin/application_settings/_account_and_limit.html.haml7
-rw-r--r--app/views/profiles/_name.html.haml5
8 files changed, 10 insertions, 27 deletions
diff --git a/app/graphql/types/error_tracking/sentry_detailed_error_type.rb b/app/graphql/types/error_tracking/sentry_detailed_error_type.rb
index 81d97a08a7e..af6d8818d90 100644
--- a/app/graphql/types/error_tracking/sentry_detailed_error_type.rb
+++ b/app/graphql/types/error_tracking/sentry_detailed_error_type.rb
@@ -79,6 +79,9 @@ module Types
field :gitlab_commit, GraphQL::STRING_TYPE,
null: true,
description: "GitLab commit SHA attributed to the Error based on the release version"
+ field :gitlab_commit_path, GraphQL::STRING_TYPE,
+ null: true,
+ description: "Path to the GitLab page for the GitLab commit attributed to the error"
def first_seen
DateTime.parse(object.first_seen)
diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb
index 66cb5d2bedb..0e14db6ddbf 100644
--- a/app/helpers/application_settings_helper.rb
+++ b/app/helpers/application_settings_helper.rb
@@ -284,7 +284,6 @@ module ApplicationSettingsHelper
:unique_ips_limit_enabled,
:unique_ips_limit_per_user,
:unique_ips_limit_time_window,
- :updating_name_disabled_for_users,
:usage_ping_enabled,
:instance_statistics_visibility_private,
:user_default_external,
diff --git a/app/models/error_tracking/project_error_tracking_setting.rb b/app/models/error_tracking/project_error_tracking_setting.rb
index bf7e0e9580a..4b61eb02914 100644
--- a/app/models/error_tracking/project_error_tracking_setting.rb
+++ b/app/models/error_tracking/project_error_tracking_setting.rb
@@ -4,6 +4,7 @@ module ErrorTracking
class ProjectErrorTrackingSetting < ApplicationRecord
include Gitlab::Utils::StrongMemoize
include ReactiveCaching
+ include Gitlab::Routing
SENTRY_API_ERROR_TYPE_BAD_REQUEST = 'bad_request_for_sentry_api'
SENTRY_API_ERROR_TYPE_MISSING_KEYS = 'missing_keys_in_sentry_response'
@@ -141,6 +142,7 @@ module ErrorTracking
def add_gitlab_issue_details(issue)
issue.gitlab_commit = match_gitlab_commit(issue.first_release_version)
+ issue.gitlab_commit_path = project_commit_path(project, issue.gitlab_commit) if issue.gitlab_commit
issue
end
diff --git a/app/policies/user_policy.rb b/app/policies/user_policy.rb
index fd5708f742f..43f472b4c1d 100644
--- a/app/policies/user_policy.rb
+++ b/app/policies/user_policy.rb
@@ -13,11 +13,6 @@ class UserPolicy < BasePolicy
desc "The user is blocked"
condition(:blocked_user, scope: :subject, score: 0) { @subject.blocked? }
- condition(:updating_name_disabled_for_users) do
- ::Gitlab::CurrentSettings.current_application_settings
- .updating_name_disabled_for_users
- end
-
rule { ~restricted_public_level }.enable :read_user
rule { ~anonymous }.enable :read_user
@@ -27,8 +22,8 @@ class UserPolicy < BasePolicy
enable :update_user_status
end
- rule { can?(:update_user) & ( admin | ~updating_name_disabled_for_users ) }.enable :update_name
-
rule { default }.enable :read_user_profile
rule { (private_profile | blocked_user) & ~(user_is_self | admin) }.prevent :read_user_profile
end
+
+UserPolicy.prepend_if_ee('EE::UserPolicy')
diff --git a/app/serializers/error_tracking/detailed_error_entity.rb b/app/serializers/error_tracking/detailed_error_entity.rb
index 7bc2b3ce576..d3b38a24316 100644
--- a/app/serializers/error_tracking/detailed_error_entity.rb
+++ b/app/serializers/error_tracking/detailed_error_entity.rb
@@ -9,6 +9,7 @@ module ErrorTracking
:first_release_last_commit,
:first_release_short_version,
:gitlab_commit,
+ :gitlab_commit_path,
:first_seen,
:frequency,
:gitlab_issue,
diff --git a/app/services/users/update_service.rb b/app/services/users/update_service.rb
index dfbb65b7fcf..e7667b0ca18 100644
--- a/app/services/users/update_service.rb
+++ b/app/services/users/update_service.rb
@@ -54,7 +54,6 @@ module Users
def discard_read_only_attributes
discard_synced_attributes
- discard_name unless name_updatable?
end
def discard_synced_attributes
@@ -65,14 +64,6 @@ module Users
end
end
- def discard_name
- params.delete(:name)
- end
-
- def name_updatable?
- can?(current_user, :update_name, @user)
- end
-
def assign_attributes
@user.assign_attributes(params.except(*identity_attributes)) unless params.empty?
end
diff --git a/app/views/admin/application_settings/_account_and_limit.html.haml b/app/views/admin/application_settings/_account_and_limit.html.haml
index 60130f9b5ef..80a53dba2aa 100644
--- a/app/views/admin/application_settings/_account_and_limit.html.haml
+++ b/app/views/admin/application_settings/_account_and_limit.html.haml
@@ -51,13 +51,8 @@
= f.check_box :user_show_add_ssh_key_message, class: 'form-check-input'
= f.label :user_show_add_ssh_key_message, class: 'form-check-label' do
= _("Inform users without uploaded SSH keys that they can't push over SSH until one is added")
- .form-group
- = f.label :updating_name_disabled_for_users, _('User restrictions'), class: 'label-bold'
- .form-check
- = f.check_box :updating_name_disabled_for_users, class: 'form-check-input'
- = f.label :updating_name_disabled_for_users, class: 'form-check-label' do
- = _("Prevent users from changing their profile name")
+ = render_if_exists 'admin/application_settings/updating_name_disabled_for_users', form: f
= render_if_exists 'admin/application_settings/availability_on_namespace_setting', form: f
= f.submit _('Save changes'), class: 'btn btn-success qa-save-changes-button'
diff --git a/app/views/profiles/_name.html.haml b/app/views/profiles/_name.html.haml
index 8711be5cd29..87f1634b4f3 100644
--- a/app/views/profiles/_name.html.haml
+++ b/app/views/profiles/_name.html.haml
@@ -1,8 +1,5 @@
- if user.read_only_attribute?(:name)
= form.text_field :name, required: true, readonly: true, wrapper: { class: 'col-md-9 qa-full-name rspec-full-name' },
help: s_("Profiles|Your name was automatically set based on your %{provider_label} account, so people you know can recognize you") % { provider_label: attribute_provider_label(:name) }
-- elsif can?(current_user, :update_name, user)
- = form.text_field :name, label: s_('Profiles|Full name'), required: true, title: s_("Profiles|Using emojis in names seems fun, but please try to set a status message instead"), wrapper: { class: 'col-md-9 qa-full-name rspec-full-name' }, help: s_("Profiles|Enter your name, so people you know can recognize you")
- else
- = form.text_field :name, required: true, readonly: true, wrapper: { class: 'col-md-9 qa-full-name rspec-full-name' },
- help: s_("Profiles|The ability to update your name has been disabled by your administrator.")
+ = form.text_field :name, label: s_('Profiles|Full name'), required: true, title: s_("Profiles|Using emojis in names seems fun, but please try to set a status message instead"), wrapper: { class: 'col-md-9 qa-full-name rspec-full-name' }, help: s_("Profiles|Enter your name, so people you know can recognize you")