gitlab-org--gitlab-foss/app/helpers/user_callouts_helper.rb
Mayra Cabrera fe083f505d Removes experimental label from cluster views
As part of https://gitlab.com/gitlab-org/gitlab-ce/issues/51716, we need
to remove 'experimental' labels from cluster views (show and form), as
well as the promp about cluster configuration, since it won't apply.

These changes were originally introduced on
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22011/, but we're
trying to reduce the size of that MR as it's to big to review with
confidence.
2018-11-05 11:25:09 +01:00

21 lines
549 B
Ruby

# frozen_string_literal: true
module UserCalloutsHelper
GKE_CLUSTER_INTEGRATION = 'gke_cluster_integration'.freeze
GCP_SIGNUP_OFFER = 'gcp_signup_offer'.freeze
def show_gke_cluster_integration_callout?(project)
can?(current_user, :create_cluster, project) &&
!user_dismissed?(GKE_CLUSTER_INTEGRATION)
end
def show_gcp_signup_offer?
!user_dismissed?(GCP_SIGNUP_OFFER)
end
private
def user_dismissed?(feature_name)
current_user&.callouts&.find_by(feature_name: UserCallout.feature_names[feature_name])
end
end