Commit eb980847 authored by Kerri Miller's avatar Kerri Miller

Merge branch '290962-rename-event-to-action-in-html' into 'master'

Replace "data-track-event" with "data-track-action" [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!56904
parents b9a715c2 9b7d9365
......@@ -165,7 +165,7 @@ export default {
:title="$options.i18n.proceedButton"
variant="confirm"
data-qa-selector="proceed_button"
data-track-event="click_button"
data-track-action="click_button"
:data-track-label="`${$options.trackingLabelPrefix}proceed_button`"
>{{ $options.i18n.proceedButton }}</gl-button
>
......
......@@ -124,7 +124,7 @@ export default {
:href="goToMergeRequestPath"
:data-track-property="humanAccess"
:data-track-value="$options.goToTrackValueMergeRequest"
:data-track-event="$options.trackEvent"
:data-track-action="$options.trackEvent"
:data-track-label="trackLabel"
>
{{ $options.i18n.mergeRequestButton }}
......@@ -135,7 +135,7 @@ export default {
variant="success"
:data-track-property="humanAccess"
:data-track-value="$options.goToTrackValuePipelines"
:data-track-event="$options.trackEvent"
:data-track-action="$options.trackEvent"
:data-track-label="trackLabel"
>
{{ $options.i18n.pipelinesButton }}
......
......@@ -121,7 +121,7 @@ export default {
icon="close"
:data-track-property="humanAccess"
:data-track-value="$options.dismissTrackValue"
:data-track-event="$options.clickTrackValue"
:data-track-action="$options.clickTrackValue"
:data-track-label="trackLabel"
@click="onDismiss"
/>
......
......@@ -107,7 +107,7 @@ function createLink(data, selected, options, index) {
}
if (options.trackSuggestionClickedLabel) {
link.setAttribute('data-track-event', 'click_text');
link.setAttribute('data-track-action', 'click_text');
link.setAttribute('data-track-label', options.trackSuggestionClickedLabel);
link.setAttribute('data-track-value', index);
link.setAttribute('data-track-property', slugify(data.category || 'no-category'));
......
......@@ -123,7 +123,7 @@ export default {
category="primary"
variant="confirm"
type="submit"
data-track-event="click_button"
data-track-action="click_button"
data-qa-selector="save_comment_button"
@click="$emit('submit-form')"
>
......
......@@ -341,7 +341,7 @@ export default {
:gfm="gfmCopyText"
data-testid="diff-file-copy-clipboard"
category="tertiary"
data-track-event="click_copy_file_button"
data-track-action="click_copy_file_button"
data-track-label="diff_copy_file_path_button"
data-track-property="diff_copy_file"
/>
......@@ -382,7 +382,7 @@ export default {
:title="externalUrlLabel"
:aria-label="externalUrlLabel"
target="_blank"
data-track-event="click_toggle_external_button"
data-track-action="click_toggle_external_button"
data-track-label="diff_toggle_external_button"
data-track-property="diff_toggle_external"
icon="external-link"
......
......@@ -48,7 +48,7 @@ export default {
<gl-toggle
:value="active"
data-testid="feature-flag-status-toggle"
data-track-event="click_button"
data-track-action="click_button"
data-track-label="feature_flag_toggle"
class="gl-mr-4"
:label="__('Feature flag status')"
......
......@@ -115,7 +115,7 @@ export default {
:label="$options.i18n.toggleLabel"
label-position="hidden"
data-testid="feature-flag-status-toggle"
data-track-event="click_button"
data-track-action="click_button"
data-track-label="feature_flag_toggle"
@change="toggleFeatureFlag(featureFlag)"
/>
......
......@@ -65,7 +65,7 @@ export default {
if (this.event && this.label) {
return {
...baseAttributes,
'data-track-event': this.event,
'data-track-action': this.event,
'data-track-label': this.label,
};
}
......
......@@ -89,7 +89,7 @@ export default {
:href="exportCsvPath"
data-method="post"
:data-qa-selector="`export_${issuableType}_button`"
data-track-event="click_button"
data-track-action="click_button"
:data-track-label="`export_${issuableType}_csv`"
>
<gl-sprintf :message="__('Export %{name}')">
......
......@@ -93,7 +93,7 @@ export default {
data-testid="comment-button"
data-qa-selector="comment_button"
:data-track-label="trackingLabel"
data-track-event="click_button"
data-track-action="click_button"
@click="$emit('click')"
>
<gl-dropdown-item is-check-item :is-checked="isNoteTypeComment" @click="setNoteTypeToComment">
......
......@@ -89,7 +89,7 @@ export default {
:title="__('Jump to next unresolved thread')"
:aria-label="__('Jump to next unresolved thread')"
class="discussion-next-btn"
data-track-event="click_button"
data-track-action="click_button"
data-track-label="mr_next_unresolved_thread"
data-track-property="click_next_unresolved_thread_top"
icon="comment-next"
......
......@@ -19,7 +19,7 @@ export default {
<template>
<gl-button
v-gl-tooltip
data-track-event="click_button"
data-track-action="click_button"
data-track-label="reply_comment_button"
category="tertiary"
icon="comment"
......
......@@ -77,7 +77,7 @@ export default {
);
if (button) {
button.setAttribute('data-track-event', 'click_go_to_preferences');
button.setAttribute('data-track-action', 'click_go_to_preferences');
button.setAttribute('data-track-label', this.trackLabel);
}
},
......
......@@ -53,7 +53,7 @@ export default {
class="js-sidebar-dropdown-toggle edit-link btn gl-text-gray-900! gl-ml-auto hide-collapsed btn-default btn-sm gl-button btn-default-tertiary float-right"
href="#"
data-test-id="edit-link"
data-track-event="click_edit_button"
data-track-action="click_edit_button"
data-track-label="right_sidebar"
data-track-property="assignee"
>
......
......@@ -93,7 +93,7 @@ export default {
class="float-right lock-edit btn gl-text-gray-900! gl-ml-auto hide-collapsed btn-default btn-sm gl-button btn-default-tertiary gl-mr-n2"
href="#"
data-testid="edit-link"
data-track-event="click_edit_button"
data-track-action="click_edit_button"
data-track-label="right_sidebar"
data-track-property="lock_issue"
@click.prevent="toggleForm"
......
......@@ -40,7 +40,7 @@ export default {
v-if="editable"
class="js-sidebar-dropdown-toggle edit-link btn gl-text-gray-900! gl-ml-auto hide-collapsed btn-default btn-sm gl-button btn-default-tertiary float-right"
href="#"
data-track-event="click_edit_button"
data-track-action="click_edit_button"
data-track-label="right_sidebar"
data-track-property="reviewer"
>
......
......@@ -136,7 +136,7 @@ export default {
size="small"
class="gl-text-gray-900! gl-ml-auto hide-collapsed gl-mr-n2"
data-testid="edit-button"
:data-track-event="tracking.event"
:data-track-action="tracking.event"
:data-track-label="tracking.label"
:data-track-property="tracking.property"
data-qa-selector="edit_link"
......
......@@ -2,10 +2,12 @@ import $ from 'jquery';
import Tracking from '~/tracking';
export default function initTrackInviteMembers(userDropdown) {
const { trackEvent, trackLabel } = userDropdown.querySelector('.js-invite-members-track').dataset;
const { trackAction, trackLabel } = userDropdown.querySelector(
'.js-invite-members-track',
).dataset;
$(userDropdown).on('shown.bs.dropdown', () => {
Tracking.event(undefined, trackEvent, {
Tracking.event(undefined, trackAction, {
label: trackLabel,
});
});
......
......@@ -98,7 +98,7 @@ export default {
data-testid="add-pipeline-link"
:data-track-property="humanAccess"
:data-track-value="$options.SP_LINK_TRACK_VALUE"
:data-track-event="$options.SP_LINK_TRACK_EVENT"
:data-track-action="$options.SP_LINK_TRACK_EVENT"
:data-track-label="$options.SP_TRACK_LABEL"
>
{{ content }}
......@@ -139,7 +139,7 @@ export default {
:href="pipelinePath"
:data-track-property="humanAccess"
:data-track-value="$options.SP_SHOW_TRACK_VALUE"
:data-track-event="$options.SP_SHOW_TRACK_EVENT"
:data-track-action="$options.SP_SHOW_TRACK_EVENT"
:data-track-label="$options.SP_TRACK_LABEL"
>
{{ __('Show me how to add a pipeline') }}
......
......@@ -39,7 +39,7 @@ export default {
target="_blank"
rel="noopener noreferrer nofollow"
:class="cssClass"
data-track-event="open_review_app"
data-track-action="open_review_app"
data-track-label="review_app"
>
{{ display.text }} <gl-icon class="fgray" name="external-link" />
......
......@@ -104,7 +104,7 @@ export default {
:href="plan.job_path"
target="_blank"
data-testid="terraform-report-link"
data-track-event="click_terraform_mr_plan_button"
data-track-action="click_terraform_mr_plan_button"
data-track-label="mr_widget_terraform_mr_plan_button"
data-track-property="terraform_mr_plan_button"
class="btn btn-sm"
......
......@@ -75,7 +75,7 @@ export default {
variant="link"
:track-experiment="$options.inviteMembersInComment"
:trigger-source="$options.inviteMembersInComment"
data-track-event="comment_invite_click"
data-track-action="comment_invite_click"
/>
<span class="uploading-progress-container hide">
<gl-icon name="media" />
......
......@@ -40,7 +40,7 @@ export default {
:href="feature.url"
target="_blank"
class="gl-display-block"
data-track-event="click_whats_new_item"
data-track-action="click_whats_new_item"
:data-track-label="feature.title"
:data-track-property="feature.url"
>
......@@ -55,7 +55,7 @@ export default {
:href="feature.url"
target="_blank"
class="whats-new-item-title-link gl-display-block gl-mt-4 gl-mb-1"
data-track-event="click_whats_new_item"
data-track-action="click_whats_new_item"
:data-track-label="feature.title"
:data-track-property="feature.url"
>
......@@ -79,7 +79,7 @@ export default {
<gl-button
:href="feature.url"
target="_blank"
data-track-event="click_whats_new_item"
data-track-action="click_whats_new_item"
:data-track-label="feature.title"
:data-track-property="feature.url"
>
......
......@@ -373,7 +373,7 @@ module IssuablesHelper
is_collapsed: is_collapsed,
track_label: "right_sidebar",
track_property: "update_todo",
track_event: "click_button",
track_action: "click_button",
track_value: ""
}
end
......
......@@ -32,7 +32,7 @@ module Nav
id: 'new_project',
title: _('New project/repository'),
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
......@@ -43,7 +43,7 @@ module Nav
id: 'new_subgroup',
title: _('New subgroup'),
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
......@@ -74,7 +74,7 @@ module Nav
id: 'new_issue',
title: _('New issue'),
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
......@@ -85,7 +85,7 @@ module Nav
id: 'new_mr',
title: _('New merge request'),
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
......@@ -96,7 +96,7 @@ module Nav
id: 'new_snippet',
title: _('New snippet'),
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
......@@ -124,7 +124,7 @@ module Nav
id: 'general_new_project',
title: _('New project/repository'),
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
......@@ -135,7 +135,7 @@ module Nav
id: 'general_new_group',
title: _('New group'),
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
......@@ -146,7 +146,7 @@ module Nav
id: 'general_new_snippet',
title: _('New snippet'),
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
......@@ -164,7 +164,7 @@ module Nav
emoji: ('shaking_hands' if experiment_enabled?(:invite_members_new_dropdown)),
href: href,
data: {
track_event: 'click_link',
track_action: 'click_link',
track_label: tracking_label,
track_property: experiment_tracking_category_and_group(:invite_members_new_dropdown)
}
......
......@@ -98,7 +98,7 @@ module Nav
builder.add_primary_menu_item_with_shortcut(
active: nav == 'project' || active_nav_link?(path: %w[root#index projects#trending projects#starred dashboard/projects#index]),
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,
shortcut_href: dashboard_projects_path,
**projects_menu_item_attrs
......@@ -112,7 +112,7 @@ module Nav
builder.add_primary_menu_item_with_shortcut(
active: nav == 'group' || active_nav_link?(path: %w[dashboard/groups explore/groups]),
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,
shortcut_href: dashboard_groups_path,
**groups_menu_item_attrs
......
......@@ -6,4 +6,4 @@
%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?
%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|
.search-input-container
.search-input-wrap
......
......@@ -46,7 +46,7 @@
= 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',
track_label: 'main_navigation',
track_event: 'click_issues_link',
track_action: 'click_issues_link',
track_property: 'navigation',
container: 'body' } do
= sprite_icon('issues')
......@@ -60,7 +60,7 @@
toggle: "dropdown",
placement: 'bottom',
track_label: 'main_navigation',
track_event: 'click_merge_link',
track_action: 'click_merge_link',
track_property: 'navigation',
container: 'body' } do
= sprite_icon('git-merge')
......@@ -86,7 +86,7 @@
= 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',
track_label: 'main_navigation',
track_event: 'click_to_do_link',
track_action: 'click_to_do_link',
track_property: 'navigation',
container: 'body' } do
= sprite_icon('todo-done')
......@@ -102,7 +102,7 @@
.dropdown-menu.dropdown-menu-right
= render 'layouts/header/help_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
= 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
......
......@@ -6,7 +6,7 @@
- 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
= sprite_icon('plus-square')
= sprite_icon('chevron-down', css_class: 'caret-down')
......
......@@ -76,7 +76,7 @@
- if phabricator_import_enabled?
%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
= custom_icon('issues')
= _("Phabricator Tasks")
......
%h4.gl-mt-0.gl-mb-3{ data: { testid: 'invite-member-section',
track_label: 'invite_members_empty_project',
track_event: 'render' } }
track_action: 'render' } }
= s_('InviteMember|Invite your team')
%p= s_('InviteMember|Add members to this project and start collaborating with your team.')
.js-invite-members-trigger{ data: { variant: 'confirm',
......
......@@ -8,7 +8,7 @@
.form-group.project-name.col-sm-12
= f.label :name, class: 'label-bold' do
%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
= f.label :namespace_id, class: 'label-bold' do
%span= _('Project URL')
......@@ -26,7 +26,7 @@
display_path: true,
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
.input-group-prepend.static-namespace.flex-shrink-0.has-tooltip{ title: user_url(current_user.username) + '/' }
.input-group-text.border-0
......@@ -45,7 +45,7 @@
.form-group
= 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 }
= 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
= s_('ProjectsNew|Visibility Level')
......@@ -56,12 +56,12 @@
.form-group.row.initialize-with-readme-setting
%div{ :class => "col-sm-12" }
.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
.option-title
%strong= s_('ProjectsNew|Initialize repository with a README')
.option-description
= 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: "" }
= 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: "" }
= 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_action: "click_button", track_property: "cancel", track_value: "" }
......@@ -8,9 +8,9 @@
.text-muted
= template.description
.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")
%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' } }
= _("Use template")
.js-blob-result.gl-mt-3.gl-mb-5{ data: { qa_selector: 'result_item_content' } }
.file-holder.file-holder-top-border
.js-file-title.file-title{ data: { qa_selector: 'file_title_content' } }
= link_to blob_link, data: {track_event: 'click_text', track_label: 'blob_path', track_property: 'search_result'} do
= link_to blob_link, data: {track_action: 'click_text', track_label: 'blob_path', track_property: 'search_result'} do
= sprite_icon('document')
%strong
= search_blob_title(project, path)
......
= 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'}
......@@ -3,7 +3,7 @@
%span.gl-display-flex.gl-align-items-center
%span.badge.badge-pill.gl-badge.sm{ class: "badge-#{issuable_state_to_badge_class(issuable)}" }= issuable_state_text(issuable)
= sprite_icon('eye-slash', css_class: 'gl-text-gray-500 gl-ml-2') if issuable.respond_to?(:confidential?) && issuable.confidential?
= link_to issuable_path(issuable), data: { track_event: 'click_text', track_label: "#{issuable.class.name.downcase}_title", track_property: 'search_result' }, class: 'gl-w-full' do
= link_to issuable_path(issuable), data: { track_action: 'click_text', track_label: "#{issuable.class.name.downcase}_title", track_property: 'search_result' }, class: 'gl-w-full' do
%span.term.str-truncated.gl-font-weight-bold.gl-ml-2= issuable.title
.gl-text-gray-500.gl-my-3
= issuable_project_reference(issuable)
......
.search-result-row
%h4
= link_to project_milestone_path(milestone.project, milestone), data: {track_event: 'click_text', track_label: 'milestone_title', track_property: 'search_result'} do
= link_to project_milestone_path(milestone.project, milestone), data: {track_action: 'click_text', track_label: 'milestone_title', track_property: 'search_result'} do
%span.term.str-truncated= milestone.title
- if milestone.description.present?
......
......@@ -18,7 +18,7 @@
- else
%span #{note.noteable_type.titleize} ##{noteable_identifier}
&middot;
= link_to note.noteable.title, note_url, data: {track_event: 'click_text', track_label: 'noteable_title', track_property: 'search_result'}
= link_to note.noteable.title, note_url, data: {track_action: 'click_text', track_label: 'noteable_title', track_property: 'search_result'}
%span.note-headline-light.note-headline-meta
%span.system-note-separator
......
......@@ -3,7 +3,7 @@
%div{ class: 'search-result-row gl-pb-3! gl-mt-5 gl-mb-0!' }
%span.gl-display-flex.gl-align-items-center
= link_to wiki_blob_link, data: { track_event: 'click_text', track_label: "wiki_title", track_property: 'search_result' }, class: 'gl-w-full' do
= link_to wiki_blob_link, data: { track_action: 'click_text', track_label: "wiki_title", track_property: 'search_result' }, class: 'gl-w-full' do
%span.term.str-truncated.gl-font-weight-bold= ::Gitlab::Git::Wiki::GollumSlug.canonicalize_filename(wiki_blob.path)
.description.term.col-sm-10.gl-px-0
= simple_search_highlight_and_truncate(wiki_blob.data, @search_term)
= 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 @@
- available_visibility_levels.each do |level|
.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
= visibility_level_icon(level)
.option-title
......
......@@ -88,7 +88,7 @@
= custom_icon('icon_arrow_right')
.dropdown.sidebar-move-issue-dropdown.hide-collapsed
%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')
.dropdown-menu.dropdown-menu-selectable.dropdown-extended-height
= dropdown_title(_('Move issue'))
......
......@@ -6,7 +6,7 @@
- options[:footer_content] = true
- options[:wrapper_class] = local_assigns.fetch(:wrapper_class)
- options[:toggle_class] += ' js-invite-members-track'
- data['track-event'] = 'show_invite_members'
- data['track-action'] = 'show_invite_members'
- data['track-label'] = local_assigns.fetch(:track_label)
= dropdown_tag(data['dropdown-title'], options: options) do
......
......@@ -21,7 +21,7 @@
%li.js-filter-issuable-type
= 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")}
%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
#{sprite_icon(work_item_type_icon(:incident), css_class: 'gl-icon')} #{_("Incident")}
......
......@@ -38,7 +38,7 @@ export default {
:value="isShowingLabels"
:label="__('Show labels')"
:data-track-property="trackProperty"
data-track-event="toggle"
data-track-action="toggle"
data-track-label="show_labels"
label-position="left"
aria-describedby="board-labels-toggle-text"
......
......@@ -70,7 +70,7 @@ export default {
// eslint-disable-next-line @gitlab/require-i18n-strings
rel: 'noopener noreferrer',
class: 'discover-button justify-content-center',
'data-track-event': 'click_button',
'data-track-action': 'click_button',
};
},
},
......@@ -192,7 +192,7 @@ export default {
variant="default"
target="_blank"
rel="noopener noreferrer"
data-track-event="click_button"
data-track-action="click_button"
data-track-label="security-discover-feedback-cta"
:data-track-property="slide"
:href="linkFeedback"
......
......@@ -14,7 +14,7 @@ module EE
id: 'create_epic',
title: _('New epic'),
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
......
......@@ -30,7 +30,7 @@ module EE
nil,
nil,
{
'track-event': 'cta_clicked_button',
'track-action': 'cta_clicked_button',
'track-experiment': 'sast_entry_points'
}
)
......
......@@ -4,7 +4,7 @@
- link_emoji = emoji_icon('clock9', 'aria-hidden': true)
- link_class = 'ci-minutes-emoji js-buy-pipeline-minutes-link'
- root_namespace = root_ancestor_namespace(project, namespace)
- data_attributes = { 'track-event': 'click_buy_ci_minutes', 'track-label': root_namespace.actual_plan_name, 'track-property': 'user_dropdown' }
- data_attributes = { 'track-action': 'click_buy_ci_minutes', 'track-label': root_namespace.actual_plan_name, 'track-property': 'user_dropdown' }
- path = usage_quotas_path(root_namespace)
- content_for :buy_pipeline_with_subtext do
......
......@@ -4,7 +4,7 @@
- if message.present? && subscribable.present?
.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 } }
%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')
.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
......@@ -19,7 +19,7 @@
= message
- 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
= 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 _("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 _('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_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'
......@@ -2,6 +2,6 @@
%li
= link_to EE::SUBSCRIPTIONS_PLANS_URL,
class: 'upgrade-plan-link js-upgrade-plan-link',
data: { 'track-event': 'click_upgrade_link', 'track-label': current_user.namespace.actual_plan_name, 'track-property': 'user_dropdown' } do
data: { 'track-action': 'click_upgrade_link', 'track-label': current_user.namespace.actual_plan_name, 'track-property': 'user_dropdown' } do
= s_("CurrentUser|Upgrade")
= emoji_icon('rocket', 'aria-hidden': true)
- 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' } }
......@@ -9,7 +9,7 @@
= link_to s_('UsageQuota|Buy additional minutes'),
link_to_buy_additional_minutes_path(namespace),
class: 'gl-button btn btn-confirm float-right',
data: { track_event: 'click_buy_ci_minutes', track_label: namespace.actual_plan_name, track_property: 'pipeline_quota_page' }
data: { track_action: 'click_buy_ci_minutes', track_label: namespace.actual_plan_name, track_property: 'pipeline_quota_page' }
.row
.col-sm-6
......
......@@ -19,12 +19,12 @@
.import-buttons
%div
- 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')
GitHub
%div
- 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')
= _('Repo by URL')
.col-lg-12
......
......@@ -14,5 +14,5 @@
- if project.feature_available?(:full_codequality_report) && pipeline.downloadable_path_for_report_type(:codequality)
%li.js-codequality-tab-link
= link_to codequality_report_project_pipeline_path(project, pipeline), data: { target: '#js-tab-codequality', action: 'codequality_report', toggle: 'tab', 'track-event': 'click_button', 'track-label': 'get_codequality_report' }, class: 'codequality-tab' do
= link_to codequality_report_project_pipeline_path(project, pipeline), data: { target: '#js-tab-codequality', action: 'codequality_report', toggle: 'tab', 'track-action': 'click_button', 'track-label': 'get_codequality_report' }, class: 'codequality-tab' do
= _('Code Quality')
......@@ -19,10 +19,10 @@
.js-toggle-container.gl-w-full
%ul.nav.nav-tabs.nav-links.gitlab-tabs.js-group-project-tabs{ role: 'tablist' }
%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')
%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')
.tab-content.gitlab-tab-content.gl-bg-white.js-group-project-tab-contents
......@@ -55,7 +55,7 @@
.form-group.project-name.col-sm-12
= pf.label :name, class: 'gl-font-weight-bold' do
%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
= _('Your project will be created at:')
......@@ -68,7 +68,7 @@
%p.form-text.text-muted.gl-text-center{ class: 'gl-mb-5!' }
= _('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' }
- if import_sources_enabled?
......
......@@ -16,10 +16,10 @@
.js-toggle-container.gl-w-full
%ul.nav.nav-tabs.nav-links.gitlab-tabs{ role: 'tablist' }
%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')
%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')
.tab-content.gitlab-tab-content.gl-bg-white
......@@ -31,7 +31,7 @@
.form-group.project-name.col-sm-12
= f.label :name, class: 'gl-font-weight-bold' do
%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-group.col-sm-12
= f.label :path, class: 'gl-font-weight-bold' do
......@@ -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'
= 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' }
- if import_sources_enabled?
......
......@@ -5,7 +5,7 @@
- else
%span.badge.badge-success.badge-pill.gl-badge.sm= _("Open")
= sprite_icon('eye-slash', css_class: 'gl-text-gray-500 gl-ml-2') if epic.confidential?
= link_to group_epic_path(epic.group, epic), data: { track_event: 'click_text', track_label: 'epic_title', track_property: 'search_result' }, class: 'gl-w-full' do
= link_to group_epic_path(epic.group, epic), data: { track_action: 'click_text', track_label: 'epic_title', track_property: 'search_result' }, class: 'gl-w-full' do
%span.term.str-truncated.gl-font-weight-bold.gl-ml-2= epic.title
.gl-text-gray-500.gl-my-3
= sprintf(s_('%{group_name}&%{epic_iid} &middot; created %{epic_created} by %{author}'), { group_name: epic.group.full_name, epic_iid: epic.iid, epic_created: time_ago_with_tooltip(epic.created_at, placement: 'bottom'), author: link_to_member(@project, epic.author, avatar: false) }).html_safe
......
......@@ -157,7 +157,7 @@ RSpec.describe 'Groups > Usage Quotas' do
link = page.find('a', text: 'Buy additional minutes')
expect(link['data-track-event']).to eq('click_buy_ci_minutes')
expect(link['data-track-action']).to eq('click_buy_ci_minutes')
expect(link['data-track-label']).to eq(group.actual_plan_name)
expect(link['data-track-property']).to eq('pipeline_quota_page')
end
......
......@@ -224,7 +224,7 @@ RSpec.describe 'Pipeline', :js do
expect(page).to have_content('Method `new_array` has 12 arguments (exceeds 4 allowed). Consider refactoring.')
expect(find_link('foo.rb:10')[:href]).to end_with(project_blob_path(project, File.join(pipeline.commit.id, 'foo.rb')) + '#L10')
expect(page).to have_selector('[data-track-event="click_button"]')
expect(page).to have_selector('[data-track-action="click_button"]')
expect(page).to have_selector('[data-track-label="get_codequality_report"]')
end
end
......
......@@ -86,7 +86,7 @@ exports[`Environment Header renders name and link to app matches the snapshot 1`
<a
class="btn btn-default btn-md gl-button btn btn-default btn-sm"
data-track-event="open_review_app"
data-track-action="open_review_app"
data-track-label="review_app"
href="http://example.com"
rel="noopener noreferrer nofollow"
......
......@@ -24,7 +24,7 @@ RSpec.describe Nav::NewDropdownHelper do
id: 'create_epic',
title: 'New epic',
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' }
)
]
})
......
......@@ -14,7 +14,7 @@ RSpec.describe 'layouts/application' do
end
describe 'layouts/_user_notification_dot' do
let(:track_selector) { '[data-track-event="render"][data-track-label="show_buy_ci_minutes_notification"]' }
let(:track_selector) { '[data-track-action="render"][data-track-label="show_buy_ci_minutes_notification"]' }
let(:show_notification_dot) { false }
before do
......
......@@ -25,7 +25,7 @@ RSpec.describe 'layouts/header/_current_user_dropdown' do
context 'when pipeline minutes need bought without notification dot' do
it 'has "Buy Pipeline minutes" link with correct data properties', :aggregate_failures do
expect(subject).to have_selector('[data-track-event="click_buy_ci_minutes"]')
expect(subject).to have_selector('[data-track-action="click_buy_ci_minutes"]')
expect(subject).to have_selector("[data-track-label='#{user.namespace.actual_plan_name}']")
expect(subject).to have_selector('[data-track-property="user_dropdown"]')
expect(subject).to have_link('Buy Pipeline minutes')
......
......@@ -117,7 +117,7 @@ RSpec.describe 'Issue Sidebar' do
page.within '.dropdown-menu-user' do
expect(page).to have_link('Invite members')
expect(page).to have_selector('[data-track-event="click_invite_members"]')
expect(page).to have_selector('[data-track-action="click_invite_members"]')
expect(page).to have_selector('[data-track-label="edit_assignee"]')
end
......
......@@ -26,7 +26,7 @@ RSpec.describe 'Merge request > User edits reviewers sidebar', :js do
page.within '.dropdown-menu-user' do
expect(page).to have_link('Invite Members')
expect(page).to have_selector('[data-track-event="click_invite_members"]')
expect(page).to have_selector('[data-track-action="click_invite_members"]')
expect(page).to have_selector('[data-track-label="edit_reviewer"]')
end
......
......@@ -78,7 +78,7 @@ describe('RecoveryCodes', () => {
it('fires Snowplow event', () => {
expect(findProceedButton().attributes()).toMatchObject({
'data-track-event': 'click_button',
'data-track-action': 'click_button',
'data-track-label': '2fa_recovery_codes_proceed_button',
});
});
......
......@@ -323,7 +323,7 @@ describe('deprecatedJQueryDropdown', () => {
const li = dropdown.renderItem(item, null, 3);
const link = li.querySelector('a');
expect(link).toHaveAttr('data-track-event', 'click_text');
expect(link).toHaveAttr('data-track-action', 'click_text');
expect(link).toHaveAttr('data-track-label', 'some_value_for_label');
expect(link).toHaveAttr('data-track-value', '3');
expect(link).toHaveAttr('data-track-property', 'suggestion-category');
......
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Design reply form component renders button text as "Comment" when creating a comment 1`] = `
"<button data-track-event=\\"click_button\\" data-qa-selector=\\"save_comment_button\\" type=\\"submit\\" disabled=\\"disabled\\" class=\\"btn gl-mr-3 gl-w-auto! btn-confirm btn-md disabled gl-button\\">
"<button data-track-action=\\"click_button\\" data-qa-selector=\\"save_comment_button\\" type=\\"submit\\" disabled=\\"disabled\\" class=\\"btn gl-mr-3 gl-w-auto! btn-confirm btn-md disabled gl-button\\">
<!---->
<!----> <span class=\\"gl-button-text\\">
Comment
......@@ -9,7 +9,7 @@ exports[`Design reply form component renders button text as "Comment" when creat
`;
exports[`Design reply form component renders button text as "Save comment" when creating a comment 1`] = `
"<button data-track-event=\\"click_button\\" data-qa-selector=\\"save_comment_button\\" type=\\"submit\\" disabled=\\"disabled\\" class=\\"btn gl-mr-3 gl-w-auto! btn-confirm btn-md disabled gl-button\\">
"<button data-track-action=\\"click_button\\" data-qa-selector=\\"save_comment_button\\" type=\\"submit\\" disabled=\\"disabled\\" class=\\"btn gl-mr-3 gl-w-auto! btn-confirm btn-md disabled gl-button\\">
<!---->
<!----> <span class=\\"gl-button-text\\">
Save comment
......
......@@ -59,8 +59,8 @@ describe('Header', () => {
beforeEach(() => {
setFixtures(`
<li class="js-nav-user-dropdown">
<a class="js-buy-pipeline-minutes-link" data-track-event="click_buy_ci_minutes" data-track-label="free" data-track-property="user_dropdown">Buy Pipeline minutes</a>
<a class="js-upgrade-plan-link" data-track-event="click_upgrade_link" data-track-label="free" data-track-property="user_dropdown">Upgrade</a>
<a class="js-buy-pipeline-minutes-link" data-track-action="click_buy_ci_minutes" data-track-label="free" data-track-property="user_dropdown">Buy Pipeline minutes</a>
<a class="js-upgrade-plan-link" data-track-action="click_upgrade_link" data-track-label="free" data-track-property="user_dropdown">Upgrade</a>
</li>`);
trackingSpy = mockTracking('_category_', $('.js-nav-user-dropdown').element, jest.spyOn);
......
......@@ -79,14 +79,14 @@ describe.each(['button', 'anchor'])('with triggerElement as %s', (triggerElement
it('does not add tracking attributes', () => {
createComponent();
expect(findButton().attributes('data-track-event')).toBeUndefined();
expect(findButton().attributes('data-track-action')).toBeUndefined();
expect(findButton().attributes('data-track-label')).toBeUndefined();
});
it('adds tracking attributes', () => {
createComponent({ label: '_label_', event: '_event_' });
expect(findButton().attributes('data-track-event')).toBe('_event_');
expect(findButton().attributes('data-track-action')).toBe('_event_');
expect(findButton().attributes('data-track-label')).toBe('_label_');
});
});
......
......@@ -65,7 +65,7 @@ describe('CustomizeHomepageBanner', () => {
await wrapper.vm.$nextTick();
const button = wrapper.find(`[href='${wrapper.vm.preferencesBehaviorPath}']`);
expect(button.attributes('data-track-event')).toEqual(preferencesTrackingEvent);
expect(button.attributes('data-track-action')).toEqual(preferencesTrackingEvent);
expect(button.attributes('data-track-label')).toEqual(provide.trackLabel);
});
......
......@@ -10,7 +10,7 @@ describe('Track user dropdown open', () => {
document.body.innerHTML = `
<div id="dummy-wrapper-element">
<div class="js-sidebar-assignee-dropdown">
<div class="js-invite-members-track" data-track-event="_track_event_" data-track-label="_track_label_">
<div class="js-invite-members-track" data-track-action="_track_event_" data-track-label="_track_label_">
</div>
</div>
</div>
......
......@@ -51,7 +51,7 @@ RSpec.describe Nav::NewDropdownHelper do
title: 'Invite members',
href: expected_href,
data: {
track_event: 'click_link',
track_action: 'click_link',
track_label: 'test_tracking_label',
track_property: :invite_members_new_dropdown
}
......@@ -104,7 +104,7 @@ RSpec.describe Nav::NewDropdownHelper do
id: 'general_new_project',
title: 'New project/repository',
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
id: 'general_new_group',
title: 'New group',
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
id: 'general_new_snippet',
title: 'New snippet',
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
id: 'new_project',
title: 'New project/repository',
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
id: 'new_subgroup',
title: 'New subgroup',
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
id: 'new_issue',
title: 'New issue',
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
id: 'new_mr',
title: 'New merge request',
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
id: 'new_snippet',
title: 'New snippet',
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
expected_primary = ::Gitlab::Nav::TopNavMenuItem.build(
css_class: 'qa-projects-dropdown',
data: {
track_event: 'click_dropdown',
track_action: 'click_dropdown',
track_label: 'projects_dropdown'
},
icon: 'project',
......@@ -248,7 +248,7 @@ RSpec.describe Nav::TopNavHelper do
expected_primary = ::Gitlab::Nav::TopNavMenuItem.build(
css_class: 'qa-groups-dropdown',
data: {
track_event: 'click_dropdown',
track_action: 'click_dropdown',
track_label: 'groups_dropdown'
},
icon: 'group',
......
......@@ -15,7 +15,7 @@ RSpec.shared_examples 'issuable invite members' do
page.within '.dropdown-menu-user' do
expect(page).to have_link('Invite Members')
expect(page).to have_selector('[data-track-event="click_invite_members"]')
expect(page).to have_selector('[data-track-action="click_invite_members"]')
expect(page).to have_selector('[data-track-label="edit_assignee"]')
end
......
......@@ -53,7 +53,7 @@ RSpec.describe 'projects/empty' do
it 'shows invite members info', :aggregate_failures do
render
expect(rendered).to have_selector('[data-track-event=render]')
expect(rendered).to have_selector('[data-track-action=render]')
expect(rendered).to have_selector('[data-track-label=invite_members_empty_project]')
expect(rendered).to have_content('Invite your team')
expect(rendered).to have_content('Add members to this project and start collaborating with your team.')
......
......@@ -74,7 +74,7 @@ RSpec.describe 'search/_results' do
it 'renders the click text event tracking attributes' do
render
expect(rendered).to have_selector('[data-track-event=click_text]')
expect(rendered).to have_selector('[data-track-action=click_text]')
expect(rendered).to have_selector('[data-track-property=search_result]')
end
end
......@@ -83,7 +83,7 @@ RSpec.describe 'search/_results' do
it 'does not render the click text event tracking attributes' do
render
expect(rendered).not_to have_selector('[data-track-event=click_text]')
expect(rendered).not_to have_selector('[data-track-action=click_text]')
expect(rendered).not_to have_selector('[data-track-property=search_result]')
end
end
......@@ -105,7 +105,7 @@ RSpec.describe 'search/_results' do
it 'renders the click text event tracking attributes' do
render
expect(rendered).to have_selector('[data-track-event=click_text]')
expect(rendered).to have_selector('[data-track-action=click_text]')
expect(rendered).to have_selector('[data-track-property=search_result]')
end
end
......@@ -114,7 +114,7 @@ RSpec.describe 'search/_results' do
it 'does not render the click text event tracking attributes' do
render
expect(rendered).not_to have_selector('[data-track-event=click_text]')
expect(rendered).not_to have_selector('[data-track-action=click_text]')
expect(rendered).not_to have_selector('[data-track-property=search_result]')
end
end
......
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