Commit 9b7d9365 authored by Axel García's avatar Axel García Committed by Axel Garcia

Use track_action for data attributes on HAML files

This also updates the related specs
parent 825eec24
...@@ -373,7 +373,7 @@ module IssuablesHelper ...@@ -373,7 +373,7 @@ module IssuablesHelper
is_collapsed: is_collapsed, is_collapsed: is_collapsed,
track_label: "right_sidebar", track_label: "right_sidebar",
track_property: "update_todo", track_property: "update_todo",
track_event: "click_button", track_action: "click_button",
track_value: "" track_value: ""
} }
end end
......
...@@ -32,7 +32,7 @@ module Nav ...@@ -32,7 +32,7 @@ module Nav
id: 'new_project', id: 'new_project',
title: _('New project/repository'), title: _('New project/repository'),
href: new_project_path(namespace_id: group.id), href: new_project_path(namespace_id: group.id),
data: { track_event: 'click_link_new_project_group', track_label: 'plus_menu_dropdown' } data: { track_action: 'click_link_new_project_group', track_label: 'plus_menu_dropdown' }
) )
) )
end end
...@@ -43,7 +43,7 @@ module Nav ...@@ -43,7 +43,7 @@ module Nav
id: 'new_subgroup', id: 'new_subgroup',
title: _('New subgroup'), title: _('New subgroup'),
href: new_group_path(parent_id: group.id), href: new_group_path(parent_id: group.id),
data: { track_event: 'click_link_new_subgroup', track_label: 'plus_menu_dropdown' } data: { track_action: 'click_link_new_subgroup', track_label: 'plus_menu_dropdown' }
) )
) )
end end
...@@ -74,7 +74,7 @@ module Nav ...@@ -74,7 +74,7 @@ module Nav
id: 'new_issue', id: 'new_issue',
title: _('New issue'), title: _('New issue'),
href: new_project_issue_path(project), href: new_project_issue_path(project),
data: { track_event: 'click_link_new_issue', track_label: 'plus_menu_dropdown', qa_selector: 'new_issue_link' } data: { track_action: 'click_link_new_issue', track_label: 'plus_menu_dropdown', qa_selector: 'new_issue_link' }
) )
) )
end end
...@@ -85,7 +85,7 @@ module Nav ...@@ -85,7 +85,7 @@ module Nav
id: 'new_mr', id: 'new_mr',
title: _('New merge request'), title: _('New merge request'),
href: project_new_merge_request_path(merge_project), href: project_new_merge_request_path(merge_project),
data: { track_event: 'click_link_new_mr', track_label: 'plus_menu_dropdown' } data: { track_action: 'click_link_new_mr', track_label: 'plus_menu_dropdown' }
) )
) )
end end
...@@ -96,7 +96,7 @@ module Nav ...@@ -96,7 +96,7 @@ module Nav
id: 'new_snippet', id: 'new_snippet',
title: _('New snippet'), title: _('New snippet'),
href: new_project_snippet_path(project), href: new_project_snippet_path(project),
data: { track_event: 'click_link_new_snippet_project', track_label: 'plus_menu_dropdown' } data: { track_action: 'click_link_new_snippet_project', track_label: 'plus_menu_dropdown' }
) )
) )
end end
...@@ -124,7 +124,7 @@ module Nav ...@@ -124,7 +124,7 @@ module Nav
id: 'general_new_project', id: 'general_new_project',
title: _('New project/repository'), title: _('New project/repository'),
href: new_project_path, href: new_project_path,
data: { track_event: 'click_link_new_project', track_label: 'plus_menu_dropdown', qa_selector: 'global_new_project_link' } data: { track_action: 'click_link_new_project', track_label: 'plus_menu_dropdown', qa_selector: 'global_new_project_link' }
) )
) )
end end
...@@ -135,7 +135,7 @@ module Nav ...@@ -135,7 +135,7 @@ module Nav
id: 'general_new_group', id: 'general_new_group',
title: _('New group'), title: _('New group'),
href: new_group_path, href: new_group_path,
data: { track_event: 'click_link_new_group', track_label: 'plus_menu_dropdown' } data: { track_action: 'click_link_new_group', track_label: 'plus_menu_dropdown' }
) )
) )
end end
...@@ -146,7 +146,7 @@ module Nav ...@@ -146,7 +146,7 @@ module Nav
id: 'general_new_snippet', id: 'general_new_snippet',
title: _('New snippet'), title: _('New snippet'),
href: new_snippet_path, href: new_snippet_path,
data: { track_event: 'click_link_new_snippet_parent', track_label: 'plus_menu_dropdown', qa_selector: 'global_new_snippet_link' } data: { track_action: 'click_link_new_snippet_parent', track_label: 'plus_menu_dropdown', qa_selector: 'global_new_snippet_link' }
) )
) )
end end
...@@ -164,7 +164,7 @@ module Nav ...@@ -164,7 +164,7 @@ module Nav
emoji: ('shaking_hands' if experiment_enabled?(:invite_members_new_dropdown)), emoji: ('shaking_hands' if experiment_enabled?(:invite_members_new_dropdown)),
href: href, href: href,
data: { data: {
track_event: 'click_link', track_action: 'click_link',
track_label: tracking_label, track_label: tracking_label,
track_property: experiment_tracking_category_and_group(:invite_members_new_dropdown) track_property: experiment_tracking_category_and_group(:invite_members_new_dropdown)
} }
......
...@@ -98,7 +98,7 @@ module Nav ...@@ -98,7 +98,7 @@ module Nav
builder.add_primary_menu_item_with_shortcut( builder.add_primary_menu_item_with_shortcut(
active: nav == 'project' || active_nav_link?(path: %w[root#index projects#trending projects#starred dashboard/projects#index]), active: nav == 'project' || active_nav_link?(path: %w[root#index projects#trending projects#starred dashboard/projects#index]),
css_class: 'qa-projects-dropdown', css_class: 'qa-projects-dropdown',
data: { track_label: "projects_dropdown", track_event: "click_dropdown" }, data: { track_label: "projects_dropdown", track_action: "click_dropdown" },
view: PROJECTS_VIEW, view: PROJECTS_VIEW,
shortcut_href: dashboard_projects_path, shortcut_href: dashboard_projects_path,
**projects_menu_item_attrs **projects_menu_item_attrs
...@@ -112,7 +112,7 @@ module Nav ...@@ -112,7 +112,7 @@ module Nav
builder.add_primary_menu_item_with_shortcut( builder.add_primary_menu_item_with_shortcut(
active: nav == 'group' || active_nav_link?(path: %w[dashboard/groups explore/groups]), active: nav == 'group' || active_nav_link?(path: %w[dashboard/groups explore/groups]),
css_class: 'qa-groups-dropdown', css_class: 'qa-groups-dropdown',
data: { track_label: "groups_dropdown", track_event: "click_dropdown" }, data: { track_label: "groups_dropdown", track_action: "click_dropdown" },
view: GROUPS_VIEW, view: GROUPS_VIEW,
shortcut_href: dashboard_groups_path, shortcut_href: dashboard_groups_path,
**groups_menu_item_attrs **groups_menu_item_attrs
......
...@@ -6,4 +6,4 @@ ...@@ -6,4 +6,4 @@
%a.nav-link.active{ href: '#login-pane', data: { toggle: 'tab', qa_selector: 'sign_in_tab' }, role: 'tab' }= tab_title %a.nav-link.active{ href: '#login-pane', data: { toggle: 'tab', qa_selector: 'sign_in_tab' }, role: 'tab' }= tab_title
- if render_signup_link && allow_signup? - if render_signup_link && allow_signup?
%li.nav-item{ role: 'presentation' } %li.nav-item{ role: 'presentation' }
%a.nav-link{ href: '#register-pane', data: { track_label: 'sign_in_register', track_property: '', track_event: 'click_button', track_value: '', toggle: 'tab', qa_selector: 'register_tab' }, role: 'tab' } Register %a.nav-link{ href: '#register-pane', data: { track_label: 'sign_in_register', track_property: '', track_action: 'click_button', track_value: '', toggle: 'tab', qa_selector: 'register_tab' }, role: 'tab' } Register
.search.search-form{ data: { track_label: "navbar_search", track_event: "activate_form_input", track_value: "" } } .search.search-form{ data: { track_label: "navbar_search", track_action: "activate_form_input", track_value: "" } }
= form_tag search_path, method: :get, class: 'form-inline form-control' do |_f| = form_tag search_path, method: :get, class: 'form-inline form-control' do |_f|
.search-input-container .search-input-container
.search-input-wrap .search-input-wrap
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
= link_to assigned_issues_dashboard_path, title: _('Issues'), class: 'dashboard-shortcuts-issues', aria: { label: _('Issues') }, = link_to assigned_issues_dashboard_path, title: _('Issues'), class: 'dashboard-shortcuts-issues', aria: { label: _('Issues') },
data: { qa_selector: 'issues_shortcut_button', toggle: 'tooltip', placement: 'bottom', data: { qa_selector: 'issues_shortcut_button', toggle: 'tooltip', placement: 'bottom',
track_label: 'main_navigation', track_label: 'main_navigation',
track_event: 'click_issues_link', track_action: 'click_issues_link',
track_property: 'navigation', track_property: 'navigation',
container: 'body' } do container: 'body' } do
= sprite_icon('issues') = sprite_icon('issues')
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
toggle: "dropdown", toggle: "dropdown",
placement: 'bottom', placement: 'bottom',
track_label: 'main_navigation', track_label: 'main_navigation',
track_event: 'click_merge_link', track_action: 'click_merge_link',
track_property: 'navigation', track_property: 'navigation',
container: 'body' } do container: 'body' } do
= sprite_icon('git-merge') = sprite_icon('git-merge')
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
= link_to dashboard_todos_path, title: _('To-Do List'), aria: { label: _('To-Do List') }, class: 'shortcuts-todos', = link_to dashboard_todos_path, title: _('To-Do List'), aria: { label: _('To-Do List') }, class: 'shortcuts-todos',
data: { qa_selector: 'todos_shortcut_button', toggle: 'tooltip', placement: 'bottom', data: { qa_selector: 'todos_shortcut_button', toggle: 'tooltip', placement: 'bottom',
track_label: 'main_navigation', track_label: 'main_navigation',
track_event: 'click_to_do_link', track_action: 'click_to_do_link',
track_property: 'navigation', track_property: 'navigation',
container: 'body' } do container: 'body' } do
= sprite_icon('todo-done') = sprite_icon('todo-done')
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
.dropdown-menu.dropdown-menu-right .dropdown-menu.dropdown-menu-right
= render 'layouts/header/help_dropdown' = render 'layouts/header/help_dropdown'
- if header_link?(:user_dropdown) - if header_link?(:user_dropdown)
%li.nav-item.header-user.js-nav-user-dropdown.dropdown{ data: { track_label: "profile_dropdown", track_event: "click_dropdown", track_value: "", qa_selector: 'user_menu' }, class: ('mr-0' if has_impersonation_link) } %li.nav-item.header-user.js-nav-user-dropdown.dropdown{ data: { track_label: "profile_dropdown", track_action: "click_dropdown", track_value: "", qa_selector: 'user_menu' }, class: ('mr-0' if has_impersonation_link) }
= link_to current_user, class: user_dropdown_class, data: { toggle: "dropdown" } do = link_to current_user, class: user_dropdown_class, data: { toggle: "dropdown" } do
= image_tag avatar_icon_for_user(current_user, 23), width: 23, height: 23, class: "header-user-avatar qa-user-avatar", alt: current_user.name = image_tag avatar_icon_for_user(current_user, 23), width: 23, height: 23, class: "header-user-avatar qa-user-avatar", alt: current_user.name
= render_if_exists 'layouts/header/user_notification_dot', project: project, namespace: group = render_if_exists 'layouts/header/user_notification_dot', project: project, namespace: group
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
- return if menu_sections.empty? - return if menu_sections.empty?
%li.header-new.dropdown{ class: top_class, data: { track_label: "new_dropdown", track_event: "click_dropdown" } } %li.header-new.dropdown{ class: top_class, data: { track_label: "new_dropdown", track_action: "click_dropdown" } }
= link_to new_project_path, class: "header-new-dropdown-toggle has-tooltip", id: "js-onboarding-new-project-link", title: title, ref: 'tooltip', aria: { label: title }, data: { toggle: 'dropdown', placement: 'bottom', container: 'body', display: 'static', qa_selector: 'new_menu_toggle' } do = link_to new_project_path, class: "header-new-dropdown-toggle has-tooltip", id: "js-onboarding-new-project-link", title: title, ref: 'tooltip', aria: { label: title }, data: { toggle: 'dropdown', placement: 'bottom', container: 'body', display: 'static', qa_selector: 'new_menu_toggle' } do
= sprite_icon('plus-square') = sprite_icon('plus-square')
= sprite_icon('chevron-down', css_class: 'caret-down') = sprite_icon('chevron-down', css_class: 'caret-down')
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
- if phabricator_import_enabled? - if phabricator_import_enabled?
%div %div
= link_to new_import_phabricator_path, class: 'gl-button btn-default btn import_phabricator', data: { track_label: "#{track_label}", track_event: "click_button", track_property: "phabricator" } do = link_to new_import_phabricator_path, class: 'gl-button btn-default btn import_phabricator', data: { track_label: "#{track_label}", track_action: "click_button", track_property: "phabricator" } do
.gl-button-icon .gl-button-icon
= custom_icon('issues') = custom_icon('issues')
= _("Phabricator Tasks") = _("Phabricator Tasks")
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
.form-group.project-name.col-sm-12 .form-group.project-name.col-sm-12
= f.label :name, class: 'label-bold' do = f.label :name, class: 'label-bold' do
%span= _("Project name") %span= _("Project name")
= f.text_field :name, placeholder: "My awesome project", class: "form-control gl-form-input input-lg", data: { track_label: "#{track_label}", track_event: "activate_form_input", track_property: "project_name", track_value: "" }, required: true, aria: { required: true } = f.text_field :name, placeholder: "My awesome project", class: "form-control gl-form-input input-lg", data: { track_label: "#{track_label}", track_action: "activate_form_input", track_property: "project_name", track_value: "" }, required: true, aria: { required: true }
.form-group.project-path.col-sm-6 .form-group.project-path.col-sm-6
= f.label :namespace_id, class: 'label-bold' do = f.label :namespace_id, class: 'label-bold' do
%span= _('Project URL') %span= _('Project URL')
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
display_path: true, display_path: true,
extra_group: namespace_id), extra_group: namespace_id),
{}, {},
{ class: 'select2 js-select-namespace qa-project-namespace-select block-truncated', data: { track_label: "#{track_label}", track_event: "activate_form_input", track_property: "project_path", track_value: "", qa_selector: "select_namespace_dropdown" }}) { class: 'select2 js-select-namespace qa-project-namespace-select block-truncated', data: { track_label: "#{track_label}", track_action: "activate_form_input", track_property: "project_path", track_value: "", qa_selector: "select_namespace_dropdown" }})
- else - else
.input-group-prepend.static-namespace.flex-shrink-0.has-tooltip{ title: user_url(current_user.username) + '/' } .input-group-prepend.static-namespace.flex-shrink-0.has-tooltip{ title: user_url(current_user.username) + '/' }
.input-group-text.border-0 .input-group-text.border-0
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
.form-group .form-group
= f.label :description, class: 'label-bold' do = f.label :description, class: 'label-bold' do
= s_('ProjectsNew|Project description %{tag_start}(optional)%{tag_end}').html_safe % { tag_start: '<span>'.html_safe, tag_end: '</span>'.html_safe } = s_('ProjectsNew|Project description %{tag_start}(optional)%{tag_end}').html_safe % { tag_start: '<span>'.html_safe, tag_end: '</span>'.html_safe }
= f.text_area :description, placeholder: s_('ProjectsNew|Description format'), class: "form-control gl-form-input", rows: 3, maxlength: 250, data: { track_label: "#{track_label}", track_event: "activate_form_input", track_property: "project_description", track_value: "" } = f.text_area :description, placeholder: s_('ProjectsNew|Description format'), class: "form-control gl-form-input", rows: 3, maxlength: 250, data: { track_label: "#{track_label}", track_action: "activate_form_input", track_property: "project_description", track_value: "" }
= f.label :visibility_level, class: 'label-bold' do = f.label :visibility_level, class: 'label-bold' do
= s_('ProjectsNew|Visibility Level') = s_('ProjectsNew|Visibility Level')
...@@ -56,12 +56,12 @@ ...@@ -56,12 +56,12 @@
.form-group.row.initialize-with-readme-setting .form-group.row.initialize-with-readme-setting
%div{ :class => "col-sm-12" } %div{ :class => "col-sm-12" }
.form-check .form-check
= check_box_tag 'project[initialize_with_readme]', '1', true, class: 'form-check-input', data: { qa_selector: "initialize_with_readme_checkbox", track_label: "#{track_label}", track_event: "activate_form_input", track_property: "init_with_readme", track_value: "" } = check_box_tag 'project[initialize_with_readme]', '1', true, class: 'form-check-input', data: { qa_selector: "initialize_with_readme_checkbox", track_label: "#{track_label}", track_action: "activate_form_input", track_property: "init_with_readme", track_value: "" }
= label_tag 'project[initialize_with_readme]', class: 'form-check-label' do = label_tag 'project[initialize_with_readme]', class: 'form-check-label' do
.option-title .option-title
%strong= s_('ProjectsNew|Initialize repository with a README') %strong= s_('ProjectsNew|Initialize repository with a README')
.option-description .option-description
= s_('ProjectsNew|Allows you to immediately clone this project’s repository. Skip this if you plan to push up an existing repository.') = s_('ProjectsNew|Allows you to immediately clone this project’s repository. Skip this if you plan to push up an existing repository.')
= f.submit _('Create project'), class: "btn gl-button btn-confirm", data: { track_label: "#{track_label}", track_event: "click_button", track_property: "create_project", track_value: "" } = f.submit _('Create project'), class: "btn gl-button btn-confirm", data: { track_label: "#{track_label}", track_action: "click_button", track_property: "create_project", track_value: "" }
= link_to _('Cancel'), dashboard_projects_path, class: 'btn gl-button btn-default btn-cancel', data: { track_label: "#{track_label}", track_event: "click_button", track_property: "cancel", track_value: "" } = link_to _('Cancel'), dashboard_projects_path, class: 'btn gl-button btn-default btn-cancel', data: { track_label: "#{track_label}", track_action: "click_button", track_property: "cancel", track_value: "" }
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
.text-muted .text-muted
= template.description = template.description
.controls.d-flex.align-items-center .controls.d-flex.align-items-center
%a.btn.gl-button.btn-default.gl-mr-3{ href: template.preview, rel: 'noopener noreferrer', target: '_blank', data: { track_label: "template_preview", track_property: template.name, track_event: "click_button", track_value: "" } } %a.btn.gl-button.btn-default.gl-mr-3{ href: template.preview, rel: 'noopener noreferrer', target: '_blank', data: { track_label: "template_preview", track_property: template.name, track_action: "click_button", track_value: "" } }
= _("Preview") = _("Preview")
%label.btn.gl-button.btn-confirm.template-button.choose-template.gl-mb-0{ for: template.name } %label.btn.gl-button.btn-confirm.template-button.choose-template.gl-mb-0{ for: template.name }
%input{ type: "radio", autocomplete: "off", name: "project[template_name]", id: template.name, value: template.name, data: { track_label: "template_use", track_property: template.name, track_event: "click_button", track_value: "" } } %input{ type: "radio", autocomplete: "off", name: "project[template_name]", id: template.name, value: template.name, data: { track_label: "template_use", track_property: template.name, track_action: "click_button", track_value: "" } }
%span{ data: { qa_selector: 'use_template_button' } } %span{ data: { qa_selector: 'use_template_button' } }
= _("Use template") = _("Use template")
= render 'projects/commits/commit', project: commit.project, commit: commit, ref: nil, show_project_name: @project.nil?, link_data_attrs: {track_event: 'click_text', track_label: 'commit_title', track_property: 'search_result'} = render 'projects/commits/commit', project: commit.project, commit: commit, ref: nil, show_project_name: @project.nil?, link_data_attrs: {track_action: 'click_text', track_label: 'commit_title', track_property: 'search_result'}
= link_to _("Community forum"), "https://forum.gitlab.com/", target: '_blank', class: 'text-nowrap', = link_to _("Community forum"), "https://forum.gitlab.com/", target: '_blank', class: 'text-nowrap',
rel: 'noopener noreferrer', data: { 'track_event': 'click_forum', 'track_property': 'question_menu' } rel: 'noopener noreferrer', data: { 'track_action': 'click_forum', 'track_property': 'question_menu' }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
- available_visibility_levels.each do |level| - available_visibility_levels.each do |level|
.form-check .form-check
= form.radio_button model_method, level, checked: (selected_level == level), class: 'form-check-input', data: { track_label: "blank_project", track_event: "activate_form_input", track_property: "#{model_method}_#{level}", track_value: "", qa_selector: "#{visibility_level_label(level).downcase}_radio" } = form.radio_button model_method, level, checked: (selected_level == level), class: 'form-check-input', data: { track_label: "blank_project", track_action: "activate_form_input", track_property: "#{model_method}_#{level}", track_value: "", qa_selector: "#{visibility_level_label(level).downcase}_radio" }
= form.label "#{model_method}_#{level}", class: 'form-check-label' do = form.label "#{model_method}_#{level}", class: 'form-check-label' do
= visibility_level_icon(level) = visibility_level_icon(level)
.option-title .option-title
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
= custom_icon('icon_arrow_right') = custom_icon('icon_arrow_right')
.dropdown.sidebar-move-issue-dropdown.hide-collapsed .dropdown.sidebar-move-issue-dropdown.hide-collapsed
%button.gl-button.btn.btn-default.btn-block.js-sidebar-dropdown-toggle.js-move-issue{ type: 'button', %button.gl-button.btn.btn-default.btn-block.js-sidebar-dropdown-toggle.js-move-issue{ type: 'button',
data: { toggle: 'dropdown', display: 'static', track_label: "right_sidebar", track_property: "move_issue", track_event: "click_button", track_value: "" } } data: { toggle: 'dropdown', display: 'static', track_label: "right_sidebar", track_property: "move_issue", track_action: "click_button", track_value: "" } }
= _('Move issue') = _('Move issue')
.dropdown-menu.dropdown-menu-selectable.dropdown-extended-height .dropdown-menu.dropdown-menu-selectable.dropdown-extended-height
= dropdown_title(_('Move issue')) = dropdown_title(_('Move issue'))
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
%li.js-filter-issuable-type %li.js-filter-issuable-type
= link_to new_project_issue_path(@project), class: ("is-active" if issuable.issue?) do = link_to new_project_issue_path(@project), class: ("is-active" if issuable.issue?) do
#{sprite_icon(work_item_type_icon(:issue), css_class: 'gl-icon')} #{_("Issue")} #{sprite_icon(work_item_type_icon(:issue), css_class: 'gl-icon')} #{_("Issue")}
%li.js-filter-issuable-type{ data: { track: { event: "select_issue_type_incident", label: "select_issue_type_incident_dropdown_option" } } } %li.js-filter-issuable-type{ data: { track: { action: "select_issue_type_incident", label: "select_issue_type_incident_dropdown_option" } } }
= link_to new_project_issue_path(@project, { issuable_template: 'incident', issue: { issue_type: 'incident' } }), class: ("is-active" if issuable.incident?) do = link_to new_project_issue_path(@project, { issuable_template: 'incident', issue: { issue_type: 'incident' } }), class: ("is-active" if issuable.incident?) do
#{sprite_icon(work_item_type_icon(:incident), css_class: 'gl-icon')} #{_("Incident")} #{sprite_icon(work_item_type_icon(:incident), css_class: 'gl-icon')} #{_("Incident")}
......
...@@ -14,7 +14,7 @@ module EE ...@@ -14,7 +14,7 @@ module EE
id: 'create_epic', id: 'create_epic',
title: _('New epic'), title: _('New epic'),
href: new_group_epic_path(group), href: new_group_epic_path(group),
data: { track_event: 'click_link_new_epic', track_label: 'plus_menu_dropdown' } data: { track_action: 'click_link_new_epic', track_label: 'plus_menu_dropdown' }
) )
end end
end end
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
- if message.present? && subscribable.present? - if message.present? && subscribable.present?
.container-fluid.container-limited.pt-3 .container-fluid.container-limited.pt-3
.gl-alert.gitlab-ee-license-banner.hidden.js-gitlab-ee-license-banner.gl-pb-7.gl-border-1.gl-border-solid.gl-border-gray-100.gl-rounded-base{ role: 'alert', data: { license_expiry: subscribable.expires_at } } .gl-alert.gitlab-ee-license-banner.hidden.js-gitlab-ee-license-banner.gl-pb-7.gl-border-1.gl-border-solid.gl-border-gray-100.gl-rounded-base{ role: 'alert', data: { license_expiry: subscribable.expires_at } }
%button.gl-alert-dismiss{ type: 'button', 'aria-label' => 'Dismiss', data: { track_event: 'click_button', track_label: 'dismiss_subscribable_banner' } } %button.gl-alert-dismiss{ type: 'button', 'aria-label' => 'Dismiss', data: { track_action: 'click_button', track_label: 'dismiss_subscribable_banner' } }
= sprite_icon('close', css_class: 'gl-icon js-close') = sprite_icon('close', css_class: 'gl-icon js-close')
.gl-display-flex.gl-flex-direction-row.gl-align-items-center .gl-display-flex.gl-flex-direction-row.gl-align-items-center
.gl-pr-6.gl-pl-5.gl-pt-3.gl-display-none.gl-sm-display-block .gl-pr-6.gl-pl-5.gl-pt-3.gl-display-none.gl-sm-display-block
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
= message = message
- if subscribable.block_changes? - if subscribable.block_changes?
= link_to _('Upgrade your plan'), upgrade_subscription_path, class: 'btn gl-button btn-confirm', data: { track_event: 'click_text', track_label: 'subscribable_action', track_property: 'upgrade' } = link_to _('Upgrade your plan'), upgrade_subscription_path, class: 'btn gl-button btn-confirm', data: { track_action: 'click_text', track_label: 'subscribable_action', track_property: 'upgrade' }
- else - else
= link_to _('Renew subscription'), renew_subscription_path, class: 'btn gl-button btn-confirm gl-mr-3 gl-mb-2', data: { track_event: 'click_text', track_label: 'subscribable_action', track_property: 'renew' } = link_to _('Renew subscription'), renew_subscription_path, class: 'btn gl-button btn-confirm gl-mr-3 gl-mb-2', data: { track_action: 'click_text', track_label: 'subscribable_action', track_property: 'renew' }
= link_to _("That's OK, I don't want to renew"), '#', data: { track_event: 'click_text', track_label: 'subscribable_action', track_property: 'thats_ok' }, 'aria-label' => 'Dismiss', class: 'btn gl-button btn-info btn-info-secondary js-close gl-mb-2' = link_to _("That's OK, I don't want to renew"), '#', data: { track_action: 'click_text', track_label: 'subscribable_action', track_property: 'thats_ok' }, 'aria-label' => 'Dismiss', class: 'btn gl-button btn-info btn-info-secondary js-close gl-mb-2'
- return unless show_pipeline_minutes_notification_dot?(project, namespace) - return unless show_pipeline_minutes_notification_dot?(project, namespace)
%span.notification-dot.rounded-circle.gl-absolute.gl-visibility-visible{ data: { track_label: "show_buy_ci_minutes_notification", track_property: current_user.namespace.actual_plan_name, track_event: 'render' } } %span.notification-dot.rounded-circle.gl-absolute.gl-visibility-visible{ data: { track_label: "show_buy_ci_minutes_notification", track_property: current_user.namespace.actual_plan_name, track_action: 'render' } }
...@@ -19,12 +19,12 @@ ...@@ -19,12 +19,12 @@
.import-buttons .import-buttons
%div %div
- if github_import_enabled? - if github_import_enabled?
= link_to new_import_github_path(ci_cd_only: true), class: 'btn gl-button btn-default js-import-github', data: { track_label: "#{track_label}", track_property: 'github', track_event: "click_button", track_value: "" } do = link_to new_import_github_path(ci_cd_only: true), class: 'btn gl-button btn-default js-import-github', data: { track_label: "#{track_label}", track_property: 'github', track_action: "click_button", track_value: "" } do
= sprite_icon('github', css_class: 'gl-button-icon') = sprite_icon('github', css_class: 'gl-button-icon')
GitHub GitHub
%div %div
- if git_import_enabled? - if git_import_enabled?
%button.btn.gl-button.btn-default.btn-svg.js-toggle-button.js-import-git-toggle-button{ type: "button", data: { toggle_open_class: 'active', track_label: "#{track_label}", track_property: 'repo_url', track_event: "click_button", track_value: "" } } %button.btn.gl-button.btn-default.btn-svg.js-toggle-button.js-import-git-toggle-button{ type: "button", data: { toggle_open_class: 'active', track_label: "#{track_label}", track_property: 'repo_url', track_action: "click_button", track_value: "" } }
= sprite_icon('link', css_class: 'gl-button-icon') = sprite_icon('link', css_class: 'gl-button-icon')
= _('Repo by URL') = _('Repo by URL')
.col-lg-12 .col-lg-12
......
...@@ -19,10 +19,10 @@ ...@@ -19,10 +19,10 @@
.js-toggle-container.gl-w-full .js-toggle-container.gl-w-full
%ul.nav.nav-tabs.nav-links.gitlab-tabs.js-group-project-tabs{ role: 'tablist' } %ul.nav.nav-tabs.nav-links.gitlab-tabs.js-group-project-tabs{ role: 'tablist' }
%li.nav-item{ role: 'presentation' } %li.nav-item{ role: 'presentation' }
%a#blank-project-tab.nav-link.active{ href: '#blank-project-pane', data: { toggle: 'tab', track_label: 'blank_project', track_event: 'click_tab', track_value: '' }, role: 'tab' } %a#blank-project-tab.nav-link.active{ href: '#blank-project-pane', data: { toggle: 'tab', track_label: 'blank_project', track_action: 'click_tab', track_value: '' }, role: 'tab' }
%span= s_('ProjectsNew|Create') %span= s_('ProjectsNew|Create')
%li.nav-item{ role: 'presentation' } %li.nav-item{ role: 'presentation' }
%a#import-project-tab.nav-link{ href: '#import-project-pane', data: { toggle: 'tab', track_label: 'import_project', track_event: 'click_tab', track_value: '' }, role: 'tab' } %a#import-project-tab.nav-link{ href: '#import-project-pane', data: { toggle: 'tab', track_label: 'import_project', track_action: 'click_tab', track_value: '' }, role: 'tab' }
%span= s_('ProjectsNew|Import') %span= s_('ProjectsNew|Import')
.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
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
.form-group.project-name.col-sm-12 .form-group.project-name.col-sm-12
= pf.label :name, class: 'gl-font-weight-bold' do = pf.label :name, class: 'gl-font-weight-bold' do
%span= _('Project name') %span= _('Project name')
= pf.text_field :name, id: 'blank_project_name', class: 'form-control js-project-path-source', required: true, data: { track_label: 'blank_project', track_event: 'activate_form_input', track_property: 'project_name', track_value: '' } = pf.text_field :name, id: 'blank_project_name', class: 'form-control js-project-path-source', required: true, data: { track_label: 'blank_project', track_action: 'activate_form_input', track_property: 'project_name', track_value: '' }
%p.form-text.gl-text-center %p.form-text.gl-text-center
= _('Your project will be created at:') = _('Your project will be created at:')
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
%p.form-text.text-muted.gl-text-center{ class: 'gl-mb-5!' } %p.form-text.text-muted.gl-text-center{ class: 'gl-mb-5!' }
= _('You can always change your URL later') = _('You can always change your URL later')
= submit_tag _('Create project'), class: 'btn gl-button btn-success btn-block', data: { track_label: 'blank_project', track_event: 'click_button', track_property: 'create_project', track_value: '' } = submit_tag _('Create project'), class: 'btn gl-button btn-success btn-block', data: { track_label: 'blank_project', track_action: 'click_button', track_property: 'create_project', track_value: '' }
#import-project-pane.tab-pane.import-project-pane.js-toggle-container{ role: 'tabpanel' } #import-project-pane.tab-pane.import-project-pane.js-toggle-container{ role: 'tabpanel' }
- if import_sources_enabled? - if import_sources_enabled?
......
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
.js-toggle-container.gl-w-full .js-toggle-container.gl-w-full
%ul.nav.nav-tabs.nav-links.gitlab-tabs{ role: 'tablist' } %ul.nav.nav-tabs.nav-links.gitlab-tabs{ role: 'tablist' }
%li.nav-item{ role: 'presentation' } %li.nav-item{ role: 'presentation' }
%a#blank-project-tab.nav-link.active{ href: '#blank-project-pane', data: { toggle: 'tab', track_label: 'blank_project', track_event: 'click_tab', track_value: '' }, role: 'tab' } %a#blank-project-tab.nav-link.active{ href: '#blank-project-pane', data: { toggle: 'tab', track_label: 'blank_project', track_action: 'click_tab', track_value: '' }, role: 'tab' }
%span= s_('ProjectsNew|Create') %span= s_('ProjectsNew|Create')
%li.nav-item{ role: 'presentation' } %li.nav-item{ role: 'presentation' }
%a#import-project-tab.nav-link{ href: '#import-project-pane', data: { toggle: 'tab', track_label: 'import_project', track_event: 'click_tab', track_value: '' }, role: 'tab' } %a#import-project-tab.nav-link{ href: '#import-project-pane', data: { toggle: 'tab', track_label: 'import_project', track_action: 'click_tab', track_value: '' }, role: 'tab' }
%span= s_('ProjectsNew|Import') %span= s_('ProjectsNew|Import')
.tab-content.gitlab-tab-content.gl-bg-white .tab-content.gitlab-tab-content.gl-bg-white
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
.form-group.project-name.col-sm-12 .form-group.project-name.col-sm-12
= f.label :name, class: 'gl-font-weight-bold' do = f.label :name, class: 'gl-font-weight-bold' do
%span= _('Project name') %span= _('Project name')
= f.text_field :name, class: 'form-control', autofocus: true, data: { track_label: 'blank_project', track_event: 'activate_form_input', track_property: 'project_name', track_value: '' } = f.text_field :name, class: 'form-control', autofocus: true, data: { track_label: 'blank_project', track_action: 'activate_form_input', track_property: 'project_name', track_value: '' }
.form-text.text-muted= _('You can always edit this later') .form-text.text-muted= _('You can always edit this later')
.form-group.col-sm-12 .form-group.col-sm-12
= f.label :path, class: 'gl-font-weight-bold' do = f.label :path, class: 'gl-font-weight-bold' do
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
= link_to sprite_icon('question-o'), help_page_path('public_access/public_access'), aria: { label: 'Documentation for Visibility Level' }, target: '_blank', rel: 'noopener noreferrer' = link_to sprite_icon('question-o'), help_page_path('public_access/public_access'), aria: { label: 'Documentation for Visibility Level' }, target: '_blank', rel: 'noopener noreferrer'
= render 'shared/visibility_level', f: f, visibility_level: visibility_level.to_i, can_change_visibility_level: true, form_model: @project, with_label: false = render 'shared/visibility_level', f: f, visibility_level: visibility_level.to_i, can_change_visibility_level: true, form_model: @project, with_label: false
= f.submit _('Create project'), class: 'btn gl-button btn-success btn-block', data: { track_label: 'blank_project', track_event: 'click_button', track_property: 'create_project', track_value: '' } = f.submit _('Create project'), class: 'btn gl-button btn-success btn-block', data: { track_label: 'blank_project', track_action: 'click_button', track_property: 'create_project', track_value: '' }
#import-project-pane.tab-pane.import-project-pane.js-toggle-container{ role: 'tabpanel' } #import-project-pane.tab-pane.import-project-pane.js-toggle-container{ role: 'tabpanel' }
- if import_sources_enabled? - if import_sources_enabled?
......
...@@ -24,7 +24,7 @@ RSpec.describe Nav::NewDropdownHelper do ...@@ -24,7 +24,7 @@ RSpec.describe Nav::NewDropdownHelper do
id: 'create_epic', id: 'create_epic',
title: 'New epic', title: 'New epic',
href: "/groups/#{group.path}/-/epics/new", href: "/groups/#{group.path}/-/epics/new",
data: { track_event: 'click_link_new_epic', track_label: 'plus_menu_dropdown' } data: { track_action: 'click_link_new_epic', track_label: 'plus_menu_dropdown' }
) )
] ]
}) })
......
...@@ -51,7 +51,7 @@ RSpec.describe Nav::NewDropdownHelper do ...@@ -51,7 +51,7 @@ RSpec.describe Nav::NewDropdownHelper do
title: 'Invite members', title: 'Invite members',
href: expected_href, href: expected_href,
data: { data: {
track_event: 'click_link', track_action: 'click_link',
track_label: 'test_tracking_label', track_label: 'test_tracking_label',
track_property: :invite_members_new_dropdown track_property: :invite_members_new_dropdown
} }
...@@ -104,7 +104,7 @@ RSpec.describe Nav::NewDropdownHelper do ...@@ -104,7 +104,7 @@ RSpec.describe Nav::NewDropdownHelper do
id: 'general_new_project', id: 'general_new_project',
title: 'New project/repository', title: 'New project/repository',
href: '/projects/new', href: '/projects/new',
data: { track_event: 'click_link_new_project', track_label: 'plus_menu_dropdown', qa_selector: 'global_new_project_link' } data: { track_action: 'click_link_new_project', track_label: 'plus_menu_dropdown', qa_selector: 'global_new_project_link' }
) )
) )
) )
...@@ -122,7 +122,7 @@ RSpec.describe Nav::NewDropdownHelper do ...@@ -122,7 +122,7 @@ RSpec.describe Nav::NewDropdownHelper do
id: 'general_new_group', id: 'general_new_group',
title: 'New group', title: 'New group',
href: '/groups/new', href: '/groups/new',
data: { track_event: 'click_link_new_group', track_label: 'plus_menu_dropdown' } data: { track_action: 'click_link_new_group', track_label: 'plus_menu_dropdown' }
) )
) )
) )
...@@ -140,7 +140,7 @@ RSpec.describe Nav::NewDropdownHelper do ...@@ -140,7 +140,7 @@ RSpec.describe Nav::NewDropdownHelper do
id: 'general_new_snippet', id: 'general_new_snippet',
title: 'New snippet', title: 'New snippet',
href: '/-/snippets/new', href: '/-/snippets/new',
data: { track_event: 'click_link_new_snippet_parent', track_label: 'plus_menu_dropdown', qa_selector: 'global_new_snippet_link' } data: { track_action: 'click_link_new_snippet_parent', track_label: 'plus_menu_dropdown', qa_selector: 'global_new_snippet_link' }
) )
) )
) )
...@@ -178,7 +178,7 @@ RSpec.describe Nav::NewDropdownHelper do ...@@ -178,7 +178,7 @@ RSpec.describe Nav::NewDropdownHelper do
id: 'new_project', id: 'new_project',
title: 'New project/repository', title: 'New project/repository',
href: "/projects/new?namespace_id=#{group.id}", href: "/projects/new?namespace_id=#{group.id}",
data: { track_event: 'click_link_new_project_group', track_label: 'plus_menu_dropdown' } data: { track_action: 'click_link_new_project_group', track_label: 'plus_menu_dropdown' }
) )
) )
) )
...@@ -196,7 +196,7 @@ RSpec.describe Nav::NewDropdownHelper do ...@@ -196,7 +196,7 @@ RSpec.describe Nav::NewDropdownHelper do
id: 'new_subgroup', id: 'new_subgroup',
title: 'New subgroup', title: 'New subgroup',
href: "/groups/new?parent_id=#{group.id}", href: "/groups/new?parent_id=#{group.id}",
data: { track_event: 'click_link_new_subgroup', track_label: 'plus_menu_dropdown' } data: { track_action: 'click_link_new_subgroup', track_label: 'plus_menu_dropdown' }
) )
) )
) )
...@@ -245,7 +245,7 @@ RSpec.describe Nav::NewDropdownHelper do ...@@ -245,7 +245,7 @@ RSpec.describe Nav::NewDropdownHelper do
id: 'new_issue', id: 'new_issue',
title: 'New issue', title: 'New issue',
href: "/#{project.path_with_namespace}/-/issues/new", href: "/#{project.path_with_namespace}/-/issues/new",
data: { track_event: 'click_link_new_issue', track_label: 'plus_menu_dropdown', qa_selector: 'new_issue_link' } data: { track_action: 'click_link_new_issue', track_label: 'plus_menu_dropdown', qa_selector: 'new_issue_link' }
) )
) )
) )
...@@ -263,7 +263,7 @@ RSpec.describe Nav::NewDropdownHelper do ...@@ -263,7 +263,7 @@ RSpec.describe Nav::NewDropdownHelper do
id: 'new_mr', id: 'new_mr',
title: 'New merge request', title: 'New merge request',
href: "/#{merge_project.path_with_namespace}/-/merge_requests/new", href: "/#{merge_project.path_with_namespace}/-/merge_requests/new",
data: { track_event: 'click_link_new_mr', track_label: 'plus_menu_dropdown' } data: { track_action: 'click_link_new_mr', track_label: 'plus_menu_dropdown' }
) )
) )
) )
...@@ -281,7 +281,7 @@ RSpec.describe Nav::NewDropdownHelper do ...@@ -281,7 +281,7 @@ RSpec.describe Nav::NewDropdownHelper do
id: 'new_snippet', id: 'new_snippet',
title: 'New snippet', title: 'New snippet',
href: "/#{project.path_with_namespace}/-/snippets/new", href: "/#{project.path_with_namespace}/-/snippets/new",
data: { track_event: 'click_link_new_snippet_project', track_label: 'plus_menu_dropdown' } data: { track_action: 'click_link_new_snippet_project', track_label: 'plus_menu_dropdown' }
) )
) )
) )
......
...@@ -142,7 +142,7 @@ RSpec.describe Nav::TopNavHelper do ...@@ -142,7 +142,7 @@ RSpec.describe Nav::TopNavHelper do
expected_primary = ::Gitlab::Nav::TopNavMenuItem.build( expected_primary = ::Gitlab::Nav::TopNavMenuItem.build(
css_class: 'qa-projects-dropdown', css_class: 'qa-projects-dropdown',
data: { data: {
track_event: 'click_dropdown', track_action: 'click_dropdown',
track_label: 'projects_dropdown' track_label: 'projects_dropdown'
}, },
icon: 'project', icon: 'project',
...@@ -248,7 +248,7 @@ RSpec.describe Nav::TopNavHelper do ...@@ -248,7 +248,7 @@ RSpec.describe Nav::TopNavHelper do
expected_primary = ::Gitlab::Nav::TopNavMenuItem.build( expected_primary = ::Gitlab::Nav::TopNavMenuItem.build(
css_class: 'qa-groups-dropdown', css_class: 'qa-groups-dropdown',
data: { data: {
track_event: 'click_dropdown', track_action: 'click_dropdown',
track_label: 'groups_dropdown' track_label: 'groups_dropdown'
}, },
icon: 'group', icon: 'group',
......
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