Commit 44a05ff1 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch '218037-move-enums-to-foss' into 'master'

Move all user callout enums to FOSS [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!42249
parents 83912362 2f7171ce
# frozen_string_literal: true
module Enums
module UserCallout
# Returns the `Hash` to use for the `feature_name` enum in the `UserCallout`
# model.
#
# This method is separate from the `UserCallout` model so that it can be
# extended by EE.
#
# If you are going to add new items to this hash, check that you're not going
# to conflict with EE-only values: https://gitlab.com/gitlab-org/gitlab/blob/master/ee/app/models/concerns/ee/enums/user_callout.rb
def self.feature_names
{
gke_cluster_integration: 1,
gcp_signup_offer: 2,
cluster_security_warning: 3,
suggest_popover_dismissed: 9,
tabs_position_highlight: 10,
webhooks_moved: 13,
service_templates_deprecated: 14,
admin_integrations_moved: 15,
web_ide_alert_dismissed: 16,
personal_access_token_expiry: 21, # EE-only
suggest_pipeline: 22,
customize_homepage: 23,
feature_flags_new_version: 24
}
end
end
end
Enums::UserCallout.prepend_if_ee('EE::Enums::UserCallout')
...@@ -3,9 +3,30 @@ ...@@ -3,9 +3,30 @@
class UserCallout < ApplicationRecord class UserCallout < ApplicationRecord
belongs_to :user belongs_to :user
# We use `Enums::UserCallout.feature_names` here so that EE can more easily enum feature_name: {
# extend this `Hash` with new values. gke_cluster_integration: 1,
enum feature_name: Enums::UserCallout.feature_names gcp_signup_offer: 2,
cluster_security_warning: 3,
gold_trial: 4, # EE-only
geo_enable_hashed_storage: 5, # EE-only
geo_migrate_hashed_storage: 6, # EE-only
canary_deployment: 7, # EE-only
gold_trial_billings: 8, # EE-only
suggest_popover_dismissed: 9,
tabs_position_highlight: 10,
threat_monitoring_info: 11, # EE-only
account_recovery_regular_check: 12, # EE-only
webhooks_moved: 13,
service_templates_deprecated: 14,
admin_integrations_moved: 15,
web_ide_alert_dismissed: 16,
active_user_count_threshold: 18, # EE-only
buy_pipeline_minutes_notification_dot: 19, # EE-only
personal_access_token_expiry: 21, # EE-only
suggest_pipeline: 22,
customize_homepage: 23,
feature_flags_new_version: 24
}
validates :user, presence: true validates :user, presence: true
validates :feature_name, validates :feature_name,
......
# frozen_string_literal: true
module EE
module Enums
module UserCallout
extend ActiveSupport::Concern
class_methods do
extend ::Gitlab::Utils::Override
# If you are going to add new items to this hash, check that you're not going
# to conflict with FOSS-only values: https://gitlab.com/gitlab-org/gitlab/blob/master/app/models/concerns/enums/user_callout.rb
override :feature_names
def feature_names
super.merge(
gold_trial: 4,
geo_enable_hashed_storage: 5,
geo_migrate_hashed_storage: 6,
canary_deployment: 7,
gold_trial_billings: 8,
threat_monitoring_info: 11,
account_recovery_regular_check: 12,
active_user_count_threshold: 18,
buy_pipeline_minutes_notification_dot: 19
)
end
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