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-04-03 21:10:03 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-03 21:10:03 +0300
commitb6847c621ff246e6abceb90545d5a608318762d6 (patch)
tree460da2a6c2be2e4f5164c2bba1851b66260f850d /app
parentc08d9c22569d1c9e7c7737e183969593394133d9 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/monitoring/components/dashboard.vue2
-rw-r--r--app/assets/stylesheets/utilities.scss6
-rw-r--r--app/graphql/types/snippet_type.rb2
-rw-r--r--app/models/project_wiki.rb1
-rw-r--r--app/models/snippet.rb2
-rw-r--r--app/models/user.rb28
-rw-r--r--app/policies/base_policy.rb3
7 files changed, 32 insertions, 12 deletions
diff --git a/app/assets/javascripts/monitoring/components/dashboard.vue b/app/assets/javascripts/monitoring/components/dashboard.vue
index 2229b6d8292..9db29f327da 100644
--- a/app/assets/javascripts/monitoring/components/dashboard.vue
+++ b/app/assets/javascripts/monitoring/components/dashboard.vue
@@ -478,7 +478,7 @@ export default {
:title="s__('Metrics|Reload this page')"
@click="refreshDashboard"
>
- <icon name="repeat" />
+ <icon name="retry" />
</gl-deprecated-button>
</gl-form-group>
diff --git a/app/assets/stylesheets/utilities.scss b/app/assets/stylesheets/utilities.scss
index 925c15262e9..0a1e97d1252 100644
--- a/app/assets/stylesheets/utilities.scss
+++ b/app/assets/stylesheets/utilities.scss
@@ -76,10 +76,16 @@
.gl-bg-green-100 { @include gl-bg-green-100;}
.gl-text-blue-500 { @include gl-text-blue-500; }
+.gl-text-gray-500 { @include gl-text-gray-500; }
.gl-text-gray-700 { @include gl-text-gray-700; }
.gl-text-gray-900 { @include gl-text-gray-900; }
.gl-text-red-700 { @include gl-text-red-700; }
+.gl-text-red-900 { @include gl-text-red-900; }
+.gl-text-orange-400 { @include gl-text-orange-400; }
+.gl-text-orange-500 { @include gl-text-orange-500; }
+.gl-text-orange-600 { @include gl-text-orange-600; }
.gl-text-orange-700 { @include gl-text-orange-700; }
+.gl-text-green-500 { @include gl-text-green-500; }
.gl-text-green-700 { @include gl-text-green-700; }
.gl-align-items-center { @include gl-align-items-center; }
diff --git a/app/graphql/types/snippet_type.rb b/app/graphql/types/snippet_type.rb
index 7affcae9f8f..4ebdbd5766c 100644
--- a/app/graphql/types/snippet_type.rb
+++ b/app/graphql/types/snippet_type.rb
@@ -67,10 +67,12 @@ module Types
field :ssh_url_to_repo, type: GraphQL::STRING_TYPE,
description: 'SSH URL to the snippet repository',
+ calls_gitaly: true,
null: true
field :http_url_to_repo, type: GraphQL::STRING_TYPE,
description: 'HTTP URL to the snippet repository',
+ calls_gitaly: true,
null: true
markdown_field :description_html, null: true, method: :description
diff --git a/app/models/project_wiki.rb b/app/models/project_wiki.rb
index 50ce1c67453..f0967b87345 100644
--- a/app/models/project_wiki.rb
+++ b/app/models/project_wiki.rb
@@ -39,6 +39,7 @@ class ProjectWiki
def full_path
@project.full_path + '.wiki'
end
+ alias_method :id, :full_path
# @deprecated use full_path when you need it for an URL route or disk_path when you want to point to the filesystem
alias_method :path_with_namespace, :full_path
diff --git a/app/models/snippet.rb b/app/models/snippet.rb
index edf524190e4..973bdc54111 100644
--- a/app/models/snippet.rb
+++ b/app/models/snippet.rb
@@ -310,7 +310,7 @@ class Snippet < ApplicationRecord
end
def versioned_enabled_for?(user)
- repository_exists? && ::Feature.enabled?(:version_snippets, user)
+ ::Feature.enabled?(:version_snippets, user) && repository_exists?
end
class << self
diff --git a/app/models/user.rb b/app/models/user.rb
index 4d450f9305f..343edfae799 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -58,6 +58,8 @@ class User < ApplicationRecord
BLOCKED_MESSAGE = "Your account has been blocked. Please contact your GitLab " \
"administrator if you think this is an error."
+ LOGIN_FORBIDDEN = "Your account does not have the required permission to login. Please contact your GitLab " \
+ "administrator if you think this is an error."
MINIMUM_INACTIVE_DAYS = 180
@@ -299,14 +301,6 @@ class User < ApplicationRecord
def blocked?
true
end
-
- def active_for_authentication?
- false
- end
-
- def inactive_message
- BLOCKED_MESSAGE
- end
end
before_transition do
@@ -354,6 +348,20 @@ class User < ApplicationRecord
.expiring_and_not_notified(at).select(1))
end
+ def active_for_authentication?
+ super && can?(:log_in)
+ end
+
+ def inactive_message
+ if blocked?
+ BLOCKED_MESSAGE
+ elsif internal?
+ LOGIN_FORBIDDEN
+ else
+ super
+ end
+ end
+
def self.with_visible_profile(user)
return with_public_profile if user.nil?
@@ -1701,6 +1709,10 @@ class User < ApplicationRecord
members.non_request.maximum(:access_level)
end
+ def confirmation_required_on_sign_in?
+ !confirmed? && !confirmation_period_valid?
+ end
+
protected
# override, from Devise::Validatable
diff --git a/app/policies/base_policy.rb b/app/policies/base_policy.rb
index ce3e5b0195c..2c26ba565ab 100644
--- a/app/policies/base_policy.rb
+++ b/app/policies/base_policy.rb
@@ -25,8 +25,7 @@ class BasePolicy < DeclarativePolicy::Base
with_options scope: :user, score: 0
condition(:inactive) do
Feature.enabled?(:inactive_policy_condition, default_enabled: true) &&
- @user &&
- !@user&.active_for_authentication?
+ @user&.confirmation_required_on_sign_in? || @user&.access_locked?
end
with_options scope: :user, score: 0