Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7c69a4f5
Commit
7c69a4f5
authored
Feb 24, 2022
by
Tyler Williams
Committed by
Simon Knox
Feb 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add combined groups/project GTM tracking
parent
1c553a0d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
1 deletion
+38
-1
app/assets/javascripts/google_tag_manager/index.js
app/assets/javascripts/google_tag_manager/index.js
+11
-0
ee/app/assets/javascripts/pages/registrations/groups_projects/new/index.js
...ascripts/pages/registrations/groups_projects/new/index.js
+2
-0
ee/app/controllers/registrations/groups_projects_controller.rb
...p/controllers/registrations/groups_projects_controller.rb
+3
-0
ee/app/views/registrations/groups_projects/new.html.haml
ee/app/views/registrations/groups_projects/new.html.haml
+1
-1
ee/spec/views/registrations/groups_projects/new.html.haml_spec.rb
...views/registrations/groups_projects/new.html.haml_spec.rb
+12
-0
spec/frontend/google_tag_manager/index_spec.js
spec/frontend/google_tag_manager/index_spec.js
+9
-0
No files found.
app/assets/javascripts/google_tag_manager/index.js
View file @
7c69a4f5
...
@@ -260,3 +260,14 @@ export const trackAddToCartUsageTab = () => {
...
@@ -260,3 +260,14 @@ export const trackAddToCartUsageTab = () => {
});
});
});
});
};
};
export
const
trackCombinedGroupProjectForm
=
()
=>
{
if
(
!
isSupported
())
{
return
;
}
const
form
=
document
.
querySelector
(
'
.js-groups-projects-form
'
);
form
.
addEventListener
(
'
submit
'
,
()
=>
{
pushEvent
(
'
combinedGroupProjectFormSubmit
'
);
});
};
ee/app/assets/javascripts/pages/registrations/groups_projects/new/index.js
View file @
7c69a4f5
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
import
mountComponents
from
'
ee/registrations/groups_projects/new
'
;
import
mountComponents
from
'
ee/registrations/groups_projects/new
'
;
import
Group
from
'
~/group
'
;
import
Group
from
'
~/group
'
;
import
{
trackCombinedGroupProjectForm
}
from
'
~/google_tag_manager
'
;
new
Group
();
new
Group
();
mountComponents
();
mountComponents
();
trackCombinedGroupProjectForm
();
ee/app/controllers/registrations/groups_projects_controller.rb
View file @
7c69a4f5
...
@@ -10,6 +10,9 @@ module Registrations
...
@@ -10,6 +10,9 @@ module Registrations
skip_before_action
:require_verification
,
only: :new
skip_before_action
:require_verification
,
only: :new
before_action
:set_requires_verification
,
only: :new
,
if:
->
{
helpers
.
require_verification_experiment
.
candidate?
}
before_action
:set_requires_verification
,
only: :new
,
if:
->
{
helpers
.
require_verification_experiment
.
candidate?
}
before_action
:require_verification
,
only:
[
:create
,
:import
],
if:
->
{
current_user
.
requires_credit_card_verification
}
before_action
:require_verification
,
only:
[
:create
,
:import
],
if:
->
{
current_user
.
requires_credit_card_verification
}
before_action
only:
[
:new
]
do
push_frontend_feature_flag
(
:gitlab_gtm_datalayer
,
type: :ops
)
end
layout
'minimal'
layout
'minimal'
...
...
ee/app/views/registrations/groups_projects/new.html.haml
View file @
7c69a4f5
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
.tab-content.gitlab-tab-content.gl-bg-white.js-group-project-tab-contents
.tab-content.gitlab-tab-content.gl-bg-white.js-group-project-tab-contents
#blank-project-pane
.tab-pane.js-toggle-container.active
{
role:
'tabpanel'
}
#blank-project-pane
.tab-pane.js-toggle-container.active
{
role:
'tabpanel'
}
=
form_tag
users_sign_up_groups_projects_path
(
form_params
),
class:
'gl-show-field-errors gl-w-full gl-p-4'
do
=
form_tag
users_sign_up_groups_projects_path
(
form_params
),
class:
'gl-show-field-errors gl-w-full gl-p-4
js-groups-projects-form
'
do
=
form_errors
(
@group
,
type:
"Group"
)
=
form_errors
(
@group
,
type:
"Group"
)
=
form_errors
(
@project
,
type:
"Project"
)
=
form_errors
(
@project
,
type:
"Project"
)
=
render
'layouts/flash'
=
render
'layouts/flash'
...
...
ee/spec/views/registrations/groups_projects/new.html.haml_spec.rb
View file @
7c69a4f5
...
@@ -42,4 +42,16 @@ RSpec.describe 'registrations/groups_projects/new' do
...
@@ -42,4 +42,16 @@ RSpec.describe 'registrations/groups_projects/new' do
is_expected
.
not_to
match
(
/www.googletagmanager.com/
)
is_expected
.
not_to
match
(
/www.googletagmanager.com/
)
end
end
end
end
describe
'expected DOM elements'
do
before
do
render
end
subject
{
rendered
}
it
'contains js-groups-projects-form class'
do
is_expected
.
to
have_css
(
'.js-groups-projects-form'
)
end
end
end
end
spec/frontend/google_tag_manager/index_spec.js
View file @
7c69a4f5
import
{
merge
}
from
'
lodash
'
;
import
{
merge
}
from
'
lodash
'
;
import
{
v4
as
uuidv4
}
from
'
uuid
'
;
import
{
v4
as
uuidv4
}
from
'
uuid
'
;
import
{
import
{
trackCombinedGroupProjectForm
,
trackFreeTrialAccountSubmissions
,
trackFreeTrialAccountSubmissions
,
trackNewRegistrations
,
trackNewRegistrations
,
trackSaasTrialSubmit
,
trackSaasTrialSubmit
,
...
@@ -200,6 +201,14 @@ describe('~/google_tag_manager/index', () => {
...
@@ -200,6 +201,14 @@ describe('~/google_tag_manager/index', () => {
},
},
],
],
}),
}),
createTestCase
(
trackCombinedGroupProjectForm
,
{
forms
:
[
{
cls
:
'
js-groups-projects-form
'
,
expectation
:
{
event
:
'
combinedGroupProjectFormSubmit
'
},
},
],
}),
])(
'
%p
'
,
(
subject
,
{
links
=
[],
forms
=
[],
expectedEvents
})
=>
{
])(
'
%p
'
,
(
subject
,
{
links
=
[],
forms
=
[],
expectedEvents
})
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
setHTMLFixture
(
createHTML
({
links
,
forms
}));
setHTMLFixture
(
createHTML
({
links
,
forms
}));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment