Commit 975916d5 authored by Tyler Williams's avatar Tyler Williams Committed by Thong Kuah

Refactor: move gitlab_gtm_datalayer flag to before action

parent c43580ea
......@@ -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)
end
before_action only: [:new] do
push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)
end
feature_category :authentication_and_authorization
def new
@resource = build_resource
push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)
end
def create
......
......@@ -23,10 +23,13 @@ module EE
experiment(:trial_registration_with_reassurance, actor: current_user)
.track(:render, label: 'registrations:welcome:show', user: current_user)
end
before_action only: [:trial_getting_started] do
push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)
end
end
def trial_getting_started
push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)
render locals: { learn_gitlab_project: learn_gitlab_project }
end
......
......@@ -12,13 +12,13 @@ module Registrations
before_action only: [:new] do
set_namespace
authorize_create_project!
push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)
end
feature_category :onboarding
def new
@project = Project.new(namespace: @namespace)
push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)
end
def create
......
......@@ -11,9 +11,11 @@ class TrialRegistrationsController < RegistrationsController
before_action :check_if_gl_com_or_dev
before_action :set_redirect_url, only: [:new]
before_action only: [:new] do
push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)
end
def new
push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)
end
private
......
......@@ -14,19 +14,20 @@ class TrialsController < ApplicationController
before_action :find_or_create_namespace, only: :apply
before_action :find_namespace, only: [:extend_reactivate, :create_hand_raise_lead]
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
def new
experiment(:trial_registration_with_reassurance, actor: current_user)
.track(:render, label: 'trials:new', user: current_user)
push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)
end
def select
experiment(:trial_registration_with_reassurance, actor: current_user)
.track(:render, label: 'trials:select', user: current_user)
push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)
end
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