Commit a38ffa2a authored by Thong Kuah's avatar Thong Kuah

Merge branch 'refactor/move-gtm-feature-flag-to-before-action' into 'master'

Refactor: move gitlab_gtm_datalayer flag to before action

See merge request gitlab-org/gitlab!78212
parents fe30a060 975916d5
...@@ -17,11 +17,14 @@ class RegistrationsController < Devise::RegistrationsController ...@@ -17,11 +17,14 @@ class RegistrationsController < Devise::RegistrationsController
check_rate_limit!(:user_sign_up, scope: request.ip) if Feature.enabled?(:rate_limit_user_sign_up_endpoint, default_enabled: :yaml) check_rate_limit!(:user_sign_up, scope: request.ip) if Feature.enabled?(:rate_limit_user_sign_up_endpoint, default_enabled: :yaml)
end end
before_action only: [:new] do
push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)
end
feature_category :authentication_and_authorization feature_category :authentication_and_authorization
def new def new
@resource = build_resource @resource = build_resource
push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)
end end
def create def create
......
...@@ -23,10 +23,13 @@ module EE ...@@ -23,10 +23,13 @@ module EE
experiment(:trial_registration_with_reassurance, actor: current_user) experiment(:trial_registration_with_reassurance, actor: current_user)
.track(:render, label: 'registrations:welcome:show', user: current_user) .track(:render, label: 'registrations:welcome:show', user: current_user)
end end
before_action only: [:trial_getting_started] do
push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)
end
end end
def trial_getting_started def trial_getting_started
push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)
render locals: { learn_gitlab_project: learn_gitlab_project } render locals: { learn_gitlab_project: learn_gitlab_project }
end end
......
...@@ -12,13 +12,13 @@ module Registrations ...@@ -12,13 +12,13 @@ module Registrations
before_action only: [:new] do before_action only: [:new] do
set_namespace set_namespace
authorize_create_project! authorize_create_project!
push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)
end end
feature_category :onboarding feature_category :onboarding
def new def new
@project = Project.new(namespace: @namespace) @project = Project.new(namespace: @namespace)
push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)
end end
def create def create
......
...@@ -11,9 +11,11 @@ class TrialRegistrationsController < RegistrationsController ...@@ -11,9 +11,11 @@ class TrialRegistrationsController < RegistrationsController
before_action :check_if_gl_com_or_dev before_action :check_if_gl_com_or_dev
before_action :set_redirect_url, only: [:new] before_action :set_redirect_url, only: [:new]
before_action only: [:new] do
push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)
end
def new def new
push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)
end end
private private
......
...@@ -14,19 +14,20 @@ class TrialsController < ApplicationController ...@@ -14,19 +14,20 @@ class TrialsController < ApplicationController
before_action :find_or_create_namespace, only: :apply before_action :find_or_create_namespace, only: :apply
before_action :find_namespace, only: [:extend_reactivate, :create_hand_raise_lead] before_action :find_namespace, only: [:extend_reactivate, :create_hand_raise_lead]
before_action :authenticate_namespace_owner!, only: [:extend_reactivate] before_action :authenticate_namespace_owner!, only: [:extend_reactivate]
before_action only: [:new, :select] do
push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)
end
feature_category :purchase feature_category :purchase
def new def new
experiment(:trial_registration_with_reassurance, actor: current_user) experiment(:trial_registration_with_reassurance, actor: current_user)
.track(:render, label: 'trials:new', user: current_user) .track(:render, label: 'trials:new', user: current_user)
push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)
end end
def select def select
experiment(:trial_registration_with_reassurance, actor: current_user) experiment(:trial_registration_with_reassurance, actor: current_user)
.track(:render, label: 'trials:select', user: current_user) .track(:render, label: 'trials:select', user: current_user)
push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)
end end
def create_lead def create_lead
......
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