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/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2019-02-12 17:41:34 +0300
committerGrzegorz Bizon <grzegorz@gitlab.com>2019-02-12 17:41:34 +0300
commitd29e81b2aa7fc26736eb09309bbbf2ab5a5d5050 (patch)
tree675f13458065dc931bae4cff1a8fb5d41431a943 /lib
parent453dec0a575bce9db8df6003f3de62228bec1f53 (diff)
parentfa518963ec7a703ddb321533884a49c516a4acd7 (diff)
Merge branch '7048_usage_ping_for_security_dashboard_as_default_view_for_groups-ce' into 'master'
Usage ping for Group overview default user preference See merge request gitlab-org/gitlab-ce!24980
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/usage_data.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb
index 6bfcf83f388..a65f4a8639c 100644
--- a/lib/gitlab/usage_data.rb
+++ b/lib/gitlab/usage_data.rb
@@ -90,8 +90,14 @@ module Gitlab
todos: count(Todo),
uploads: count(Upload),
web_hooks: count(WebHook)
- }.merge(services_usage).merge(approximate_counts)
- }
+ }
+ .merge(services_usage)
+ .merge(approximate_counts)
+ }.tap do |data|
+ if Feature.enabled?(:group_overview_security_dashboard)
+ data[:counts][:user_preferences] = user_preferences_usage
+ end
+ end
end
# rubocop: enable CodeReuse/ActiveRecord
@@ -159,6 +165,10 @@ module Gitlab
}
end
+ def user_preferences_usage
+ {} # augmented in EE
+ end
+
def count(relation, fallback: -1)
relation.count
rescue ActiveRecord::StatementInvalid