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 { ...@@ -165,7 +165,7 @@ export default {
:title="$options.i18n.proceedButton" :title="$options.i18n.proceedButton"
variant="confirm" variant="confirm"
data-qa-selector="proceed_button" data-qa-selector="proceed_button"
data-track-event="click_button" data-track-action="click_button"
:data-track-label="`${$options.trackingLabelPrefix}proceed_button`" :data-track-label="`${$options.trackingLabelPrefix}proceed_button`"
>{{ $options.i18n.proceedButton }}</gl-button >{{ $options.i18n.proceedButton }}</gl-button
> >
......
...@@ -124,7 +124,7 @@ export default { ...@@ -124,7 +124,7 @@ export default {
:href="goToMergeRequestPath" :href="goToMergeRequestPath"
:data-track-property="humanAccess" :data-track-property="humanAccess"
:data-track-value="$options.goToTrackValueMergeRequest" :data-track-value="$options.goToTrackValueMergeRequest"
:data-track-event="$options.trackEvent" :data-track-action="$options.trackEvent"
:data-track-label="trackLabel" :data-track-label="trackLabel"
> >
{{ $options.i18n.mergeRequestButton }} {{ $options.i18n.mergeRequestButton }}
...@@ -135,7 +135,7 @@ export default { ...@@ -135,7 +135,7 @@ export default {
variant="success" variant="success"
:data-track-property="humanAccess" :data-track-property="humanAccess"
:data-track-value="$options.goToTrackValuePipelines" :data-track-value="$options.goToTrackValuePipelines"
:data-track-event="$options.trackEvent" :data-track-action="$options.trackEvent"
:data-track-label="trackLabel" :data-track-label="trackLabel"
> >
{{ $options.i18n.pipelinesButton }} {{ $options.i18n.pipelinesButton }}
......
...@@ -121,7 +121,7 @@ export default { ...@@ -121,7 +121,7 @@ export default {
icon="close" icon="close"
:data-track-property="humanAccess" :data-track-property="humanAccess"
:data-track-value="$options.dismissTrackValue" :data-track-value="$options.dismissTrackValue"
:data-track-event="$options.clickTrackValue" :data-track-action="$options.clickTrackValue"
:data-track-label="trackLabel" :data-track-label="trackLabel"
@click="onDismiss" @click="onDismiss"
/> />
......
...@@ -107,7 +107,7 @@ function createLink(data, selected, options, index) { ...@@ -107,7 +107,7 @@ function createLink(data, selected, options, index) {
} }
if (options.trackSuggestionClickedLabel) { 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-label', options.trackSuggestionClickedLabel);
link.setAttribute('data-track-value', index); link.setAttribute('data-track-value', index);
link.setAttribute('data-track-property', slugify(data.category || 'no-category')); link.setAttribute('data-track-property', slugify(data.category || 'no-category'));
......
...@@ -123,7 +123,7 @@ export default { ...@@ -123,7 +123,7 @@ export default {
category="primary" category="primary"
variant="confirm" variant="confirm"
type="submit" type="submit"
data-track-event="click_button" data-track-action="click_button"
data-qa-selector="save_comment_button" data-qa-selector="save_comment_button"
@click="$emit('submit-form')" @click="$emit('submit-form')"
> >
......
...@@ -341,7 +341,7 @@ export default { ...@@ -341,7 +341,7 @@ export default {
:gfm="gfmCopyText" :gfm="gfmCopyText"
data-testid="diff-file-copy-clipboard" data-testid="diff-file-copy-clipboard"
category="tertiary" 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-label="diff_copy_file_path_button"
data-track-property="diff_copy_file" data-track-property="diff_copy_file"
/> />
...@@ -382,7 +382,7 @@ export default { ...@@ -382,7 +382,7 @@ export default {
:title="externalUrlLabel" :title="externalUrlLabel"
:aria-label="externalUrlLabel" :aria-label="externalUrlLabel"
target="_blank" 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-label="diff_toggle_external_button"
data-track-property="diff_toggle_external" data-track-property="diff_toggle_external"
icon="external-link" icon="external-link"
......
...@@ -48,7 +48,7 @@ export default { ...@@ -48,7 +48,7 @@ export default {
<gl-toggle <gl-toggle
:value="active" :value="active"
data-testid="feature-flag-status-toggle" data-testid="feature-flag-status-toggle"
data-track-event="click_button" data-track-action="click_button"
data-track-label="feature_flag_toggle" data-track-label="feature_flag_toggle"
class="gl-mr-4" class="gl-mr-4"
:label="__('Feature flag status')" :label="__('Feature flag status')"
......
...@@ -115,7 +115,7 @@ export default { ...@@ -115,7 +115,7 @@ export default {
:label="$options.i18n.toggleLabel" :label="$options.i18n.toggleLabel"
label-position="hidden" label-position="hidden"
data-testid="feature-flag-status-toggle" data-testid="feature-flag-status-toggle"
data-track-event="click_button" data-track-action="click_button"
data-track-label="feature_flag_toggle" data-track-label="feature_flag_toggle"
@change="toggleFeatureFlag(featureFlag)" @change="toggleFeatureFlag(featureFlag)"
/> />
......
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
if (this.event && this.label) { if (this.event && this.label) {
return { return {
...baseAttributes, ...baseAttributes,
'data-track-event': this.event, 'data-track-action': this.event,
'data-track-label': this.label, 'data-track-label': this.label,
}; };
} }
......
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
:href="exportCsvPath" :href="exportCsvPath"
data-method="post" data-method="post"
:data-qa-selector="`export_${issuableType}_button`" :data-qa-selector="`export_${issuableType}_button`"
data-track-event="click_button" data-track-action="click_button"
:data-track-label="`export_${issuableType}_csv`" :data-track-label="`export_${issuableType}_csv`"
> >
<gl-sprintf :message="__('Export %{name}')"> <gl-sprintf :message="__('Export %{name}')">
......
...@@ -93,7 +93,7 @@ export default { ...@@ -93,7 +93,7 @@ export default {
data-testid="comment-button" data-testid="comment-button"
data-qa-selector="comment_button" data-qa-selector="comment_button"
:data-track-label="trackingLabel" :data-track-label="trackingLabel"
data-track-event="click_button" data-track-action="click_button"
@click="$emit('click')" @click="$emit('click')"
> >
<gl-dropdown-item is-check-item :is-checked="isNoteTypeComment" @click="setNoteTypeToComment"> <gl-dropdown-item is-check-item :is-checked="isNoteTypeComment" @click="setNoteTypeToComment">
......
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
:title="__('Jump to next unresolved thread')" :title="__('Jump to next unresolved thread')"
:aria-label="__('Jump to next unresolved thread')" :aria-label="__('Jump to next unresolved thread')"
class="discussion-next-btn" class="discussion-next-btn"
data-track-event="click_button" data-track-action="click_button"
data-track-label="mr_next_unresolved_thread" data-track-label="mr_next_unresolved_thread"
data-track-property="click_next_unresolved_thread_top" data-track-property="click_next_unresolved_thread_top"
icon="comment-next" icon="comment-next"
......
...@@ -19,7 +19,7 @@ export default { ...@@ -19,7 +19,7 @@ export default {
<template> <template>
<gl-button <gl-button
v-gl-tooltip v-gl-tooltip
data-track-event="click_button" data-track-action="click_button"
data-track-label="reply_comment_button" data-track-label="reply_comment_button"
category="tertiary" category="tertiary"
icon="comment" icon="comment"
......
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ export default {
); );
if (button) { 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); button.setAttribute('data-track-label', this.trackLabel);
} }
}, },
......
...@@ -53,7 +53,7 @@ export default { ...@@ -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" 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="#" href="#"
data-test-id="edit-link" data-test-id="edit-link"
data-track-event="click_edit_button" data-track-action="click_edit_button"
data-track-label="right_sidebar" data-track-label="right_sidebar"
data-track-property="assignee" data-track-property="assignee"
> >
......
...@@ -93,7 +93,7 @@ export default { ...@@ -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" 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="#" href="#"
data-testid="edit-link" data-testid="edit-link"
data-track-event="click_edit_button" data-track-action="click_edit_button"
data-track-label="right_sidebar" data-track-label="right_sidebar"
data-track-property="lock_issue" data-track-property="lock_issue"
@click.prevent="toggleForm" @click.prevent="toggleForm"
......
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
v-if="editable" 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" 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="#" href="#"
data-track-event="click_edit_button" data-track-action="click_edit_button"
data-track-label="right_sidebar" data-track-label="right_sidebar"
data-track-property="reviewer" data-track-property="reviewer"
> >
......
...@@ -136,7 +136,7 @@ export default { ...@@ -136,7 +136,7 @@ export default {
size="small" size="small"
class="gl-text-gray-900! gl-ml-auto hide-collapsed gl-mr-n2" class="gl-text-gray-900! gl-ml-auto hide-collapsed gl-mr-n2"
data-testid="edit-button" data-testid="edit-button"
:data-track-event="tracking.event" :data-track-action="tracking.event"
:data-track-label="tracking.label" :data-track-label="tracking.label"
:data-track-property="tracking.property" :data-track-property="tracking.property"
data-qa-selector="edit_link" data-qa-selector="edit_link"
......
...@@ -2,10 +2,12 @@ import $ from 'jquery'; ...@@ -2,10 +2,12 @@ import $ from 'jquery';
import Tracking from '~/tracking'; import Tracking from '~/tracking';
export default function initTrackInviteMembers(userDropdown) { 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', () => { $(userDropdown).on('shown.bs.dropdown', () => {
Tracking.event(undefined, trackEvent, { Tracking.event(undefined, trackAction, {
label: trackLabel, label: trackLabel,
}); });
}); });
......
...@@ -98,7 +98,7 @@ export default { ...@@ -98,7 +98,7 @@ export default {
data-testid="add-pipeline-link" data-testid="add-pipeline-link"
:data-track-property="humanAccess" :data-track-property="humanAccess"
:data-track-value="$options.SP_LINK_TRACK_VALUE" :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" :data-track-label="$options.SP_TRACK_LABEL"
> >
{{ content }} {{ content }}
...@@ -139,7 +139,7 @@ export default { ...@@ -139,7 +139,7 @@ export default {
:href="pipelinePath" :href="pipelinePath"
:data-track-property="humanAccess" :data-track-property="humanAccess"
:data-track-value="$options.SP_SHOW_TRACK_VALUE" :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" :data-track-label="$options.SP_TRACK_LABEL"
> >
{{ __('Show me how to add a pipeline') }} {{ __('Show me how to add a pipeline') }}
......
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
target="_blank" target="_blank"
rel="noopener noreferrer nofollow" rel="noopener noreferrer nofollow"
:class="cssClass" :class="cssClass"
data-track-event="open_review_app" data-track-action="open_review_app"
data-track-label="review_app" data-track-label="review_app"
> >
{{ display.text }} <gl-icon class="fgray" name="external-link" /> {{ display.text }} <gl-icon class="fgray" name="external-link" />
......
...@@ -104,7 +104,7 @@ export default { ...@@ -104,7 +104,7 @@ export default {
:href="plan.job_path" :href="plan.job_path"
target="_blank" target="_blank"
data-testid="terraform-report-link" 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-label="mr_widget_terraform_mr_plan_button"
data-track-property="terraform_mr_plan_button" data-track-property="terraform_mr_plan_button"
class="btn btn-sm" class="btn btn-sm"
......
...@@ -75,7 +75,7 @@ export default { ...@@ -75,7 +75,7 @@ export default {
variant="link" variant="link"
:track-experiment="$options.inviteMembersInComment" :track-experiment="$options.inviteMembersInComment"
:trigger-source="$options.inviteMembersInComment" :trigger-source="$options.inviteMembersInComment"
data-track-event="comment_invite_click" data-track-action="comment_invite_click"
/> />
<span class="uploading-progress-container hide"> <span class="uploading-progress-container hide">
<gl-icon name="media" /> <gl-icon name="media" />
......
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
:href="feature.url" :href="feature.url"
target="_blank" target="_blank"
class="gl-display-block" 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-label="feature.title"
:data-track-property="feature.url" :data-track-property="feature.url"
> >
...@@ -55,7 +55,7 @@ export default { ...@@ -55,7 +55,7 @@ export default {
:href="feature.url" :href="feature.url"
target="_blank" target="_blank"
class="whats-new-item-title-link gl-display-block gl-mt-4 gl-mb-1" 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-label="feature.title"
:data-track-property="feature.url" :data-track-property="feature.url"
> >
...@@ -79,7 +79,7 @@ export default { ...@@ -79,7 +79,7 @@ export default {
<gl-button <gl-button
:href="feature.url" :href="feature.url"
target="_blank" target="_blank"
data-track-event="click_whats_new_item" data-track-action="click_whats_new_item"
:data-track-label="feature.title" :data-track-label="feature.title"
:data-track-property="feature.url" :data-track-property="feature.url"
> >
......
...@@ -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
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,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')
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,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')
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,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')
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,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")
......
%h4.gl-mt-0.gl-mb-3{ data: { testid: 'invite-member-section', %h4.gl-mt-0.gl-mb-3{ data: { testid: 'invite-member-section',
track_label: 'invite_members_empty_project', track_label: 'invite_members_empty_project',
track_event: 'render' } } track_action: 'render' } }
= s_('InviteMember|Invite your team') = s_('InviteMember|Invite your team')
%p= s_('InviteMember|Add members to this project and start collaborating with your team.') %p= s_('InviteMember|Add members to this project and start collaborating with your team.')
.js-invite-members-trigger{ data: { variant: 'confirm', .js-invite-members-trigger{ data: { variant: 'confirm',
......
...@@ -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")
.js-blob-result.gl-mt-3.gl-mb-5{ data: { qa_selector: 'result_item_content' } } .js-blob-result.gl-mt-3.gl-mb-5{ data: { qa_selector: 'result_item_content' } }
.file-holder.file-holder-top-border .file-holder.file-holder-top-border
.js-file-title.file-title{ data: { qa_selector: 'file_title_content' } } .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') = sprite_icon('document')
%strong %strong
= search_blob_title(project, path) = 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 @@ ...@@ -3,7 +3,7 @@
%span.gl-display-flex.gl-align-items-center %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) %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? = 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 %span.term.str-truncated.gl-font-weight-bold.gl-ml-2= issuable.title
.gl-text-gray-500.gl-my-3 .gl-text-gray-500.gl-my-3
= issuable_project_reference(issuable) = issuable_project_reference(issuable)
......
.search-result-row .search-result-row
%h4 %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 %span.term.str-truncated= milestone.title
- if milestone.description.present? - if milestone.description.present?
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
- else - else
%span #{note.noteable_type.titleize} ##{noteable_identifier} %span #{note.noteable_type.titleize} ##{noteable_identifier}
&middot; &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.note-headline-light.note-headline-meta
%span.system-note-separator %span.system-note-separator
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
%div{ class: 'search-result-row gl-pb-3! gl-mt-5 gl-mb-0!' } %div{ class: 'search-result-row gl-pb-3! gl-mt-5 gl-mb-0!' }
%span.gl-display-flex.gl-align-items-center %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) %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 .description.term.col-sm-10.gl-px-0
= simple_search_highlight_and_truncate(wiki_blob.data, @search_term) = simple_search_highlight_and_truncate(wiki_blob.data, @search_term)
= 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'))
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
- options[:footer_content] = true - options[:footer_content] = true
- options[:wrapper_class] = local_assigns.fetch(:wrapper_class) - options[:wrapper_class] = local_assigns.fetch(:wrapper_class)
- options[:toggle_class] += ' js-invite-members-track' - 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) - data['track-label'] = local_assigns.fetch(:track_label)
= dropdown_tag(data['dropdown-title'], options: options) do = dropdown_tag(data['dropdown-title'], options: options) do
......
...@@ -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")}
......
...@@ -38,7 +38,7 @@ export default { ...@@ -38,7 +38,7 @@ export default {
:value="isShowingLabels" :value="isShowingLabels"
:label="__('Show labels')" :label="__('Show labels')"
:data-track-property="trackProperty" :data-track-property="trackProperty"
data-track-event="toggle" data-track-action="toggle"
data-track-label="show_labels" data-track-label="show_labels"
label-position="left" label-position="left"
aria-describedby="board-labels-toggle-text" aria-describedby="board-labels-toggle-text"
......
...@@ -70,7 +70,7 @@ export default { ...@@ -70,7 +70,7 @@ export default {
// eslint-disable-next-line @gitlab/require-i18n-strings // eslint-disable-next-line @gitlab/require-i18n-strings
rel: 'noopener noreferrer', rel: 'noopener noreferrer',
class: 'discover-button justify-content-center', class: 'discover-button justify-content-center',
'data-track-event': 'click_button', 'data-track-action': 'click_button',
}; };
}, },
}, },
...@@ -192,7 +192,7 @@ export default { ...@@ -192,7 +192,7 @@ export default {
variant="default" variant="default"
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
data-track-event="click_button" data-track-action="click_button"
data-track-label="security-discover-feedback-cta" data-track-label="security-discover-feedback-cta"
:data-track-property="slide" :data-track-property="slide"
:href="linkFeedback" :href="linkFeedback"
......
...@@ -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
......
...@@ -30,7 +30,7 @@ module EE ...@@ -30,7 +30,7 @@ module EE
nil, nil,
nil, nil,
{ {
'track-event': 'cta_clicked_button', 'track-action': 'cta_clicked_button',
'track-experiment': 'sast_entry_points' 'track-experiment': 'sast_entry_points'
} }
) )
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
- link_emoji = emoji_icon('clock9', 'aria-hidden': true) - link_emoji = emoji_icon('clock9', 'aria-hidden': true)
- link_class = 'ci-minutes-emoji js-buy-pipeline-minutes-link' - link_class = 'ci-minutes-emoji js-buy-pipeline-minutes-link'
- root_namespace = root_ancestor_namespace(project, namespace) - 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) - path = usage_quotas_path(root_namespace)
- content_for :buy_pipeline_with_subtext do - content_for :buy_pipeline_with_subtext do
......
...@@ -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'
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
%li %li
= link_to EE::SUBSCRIPTIONS_PLANS_URL, = link_to EE::SUBSCRIPTIONS_PLANS_URL,
class: 'upgrade-plan-link js-upgrade-plan-link', 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") = s_("CurrentUser|Upgrade")
= emoji_icon('rocket', 'aria-hidden': true) = emoji_icon('rocket', 'aria-hidden': true)
- 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' } }
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
= link_to s_('UsageQuota|Buy additional minutes'), = link_to s_('UsageQuota|Buy additional minutes'),
link_to_buy_additional_minutes_path(namespace), link_to_buy_additional_minutes_path(namespace),
class: 'gl-button btn btn-confirm float-right', 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 .row
.col-sm-6 .col-sm-6
......
...@@ -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
......
...@@ -14,5 +14,5 @@ ...@@ -14,5 +14,5 @@
- if project.feature_available?(:full_codequality_report) && pipeline.downloadable_path_for_report_type(:codequality) - if project.feature_available?(:full_codequality_report) && pipeline.downloadable_path_for_report_type(:codequality)
%li.js-codequality-tab-link %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') = _('Code Quality')
...@@ -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?
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
- else - else
%span.badge.badge-success.badge-pill.gl-badge.sm= _("Open") %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? = 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 %span.term.str-truncated.gl-font-weight-bold.gl-ml-2= epic.title
.gl-text-gray-500.gl-my-3 .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 = 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 ...@@ -157,7 +157,7 @@ RSpec.describe 'Groups > Usage Quotas' do
link = page.find('a', text: 'Buy additional minutes') 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-label']).to eq(group.actual_plan_name)
expect(link['data-track-property']).to eq('pipeline_quota_page') expect(link['data-track-property']).to eq('pipeline_quota_page')
end end
......
...@@ -224,7 +224,7 @@ RSpec.describe 'Pipeline', :js do ...@@ -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(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(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"]') expect(page).to have_selector('[data-track-label="get_codequality_report"]')
end end
end end
......
...@@ -86,7 +86,7 @@ exports[`Environment Header renders name and link to app matches the snapshot 1` ...@@ -86,7 +86,7 @@ exports[`Environment Header renders name and link to app matches the snapshot 1`
<a <a
class="btn btn-default btn-md gl-button btn btn-default btn-sm" 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" data-track-label="review_app"
href="http://example.com" href="http://example.com"
rel="noopener noreferrer nofollow" rel="noopener noreferrer nofollow"
......
...@@ -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' }
) )
] ]
}) })
......
...@@ -14,7 +14,7 @@ RSpec.describe 'layouts/application' do ...@@ -14,7 +14,7 @@ RSpec.describe 'layouts/application' do
end end
describe 'layouts/_user_notification_dot' do 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 } let(:show_notification_dot) { false }
before do before do
......
...@@ -25,7 +25,7 @@ RSpec.describe 'layouts/header/_current_user_dropdown' do ...@@ -25,7 +25,7 @@ RSpec.describe 'layouts/header/_current_user_dropdown' do
context 'when pipeline minutes need bought without notification dot' do context 'when pipeline minutes need bought without notification dot' do
it 'has "Buy Pipeline minutes" link with correct data properties', :aggregate_failures 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-label='#{user.namespace.actual_plan_name}']")
expect(subject).to have_selector('[data-track-property="user_dropdown"]') expect(subject).to have_selector('[data-track-property="user_dropdown"]')
expect(subject).to have_link('Buy Pipeline minutes') expect(subject).to have_link('Buy Pipeline minutes')
......
...@@ -117,7 +117,7 @@ RSpec.describe 'Issue Sidebar' do ...@@ -117,7 +117,7 @@ RSpec.describe 'Issue Sidebar' do
page.within '.dropdown-menu-user' do page.within '.dropdown-menu-user' do
expect(page).to have_link('Invite members') 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"]') expect(page).to have_selector('[data-track-label="edit_assignee"]')
end end
......
...@@ -26,7 +26,7 @@ RSpec.describe 'Merge request > User edits reviewers sidebar', :js do ...@@ -26,7 +26,7 @@ RSpec.describe 'Merge request > User edits reviewers sidebar', :js do
page.within '.dropdown-menu-user' do page.within '.dropdown-menu-user' do
expect(page).to have_link('Invite Members') 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"]') expect(page).to have_selector('[data-track-label="edit_reviewer"]')
end end
......
...@@ -78,7 +78,7 @@ describe('RecoveryCodes', () => { ...@@ -78,7 +78,7 @@ describe('RecoveryCodes', () => {
it('fires Snowplow event', () => { it('fires Snowplow event', () => {
expect(findProceedButton().attributes()).toMatchObject({ expect(findProceedButton().attributes()).toMatchObject({
'data-track-event': 'click_button', 'data-track-action': 'click_button',
'data-track-label': '2fa_recovery_codes_proceed_button', 'data-track-label': '2fa_recovery_codes_proceed_button',
}); });
}); });
......
...@@ -323,7 +323,7 @@ describe('deprecatedJQueryDropdown', () => { ...@@ -323,7 +323,7 @@ describe('deprecatedJQueryDropdown', () => {
const li = dropdown.renderItem(item, null, 3); const li = dropdown.renderItem(item, null, 3);
const link = li.querySelector('a'); 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-label', 'some_value_for_label');
expect(link).toHaveAttr('data-track-value', '3'); expect(link).toHaveAttr('data-track-value', '3');
expect(link).toHaveAttr('data-track-property', 'suggestion-category'); expect(link).toHaveAttr('data-track-property', 'suggestion-category');
......
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Design reply form component renders button text as "Comment" when creating a comment 1`] = ` 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\\"> <!----> <span class=\\"gl-button-text\\">
Comment Comment
...@@ -9,7 +9,7 @@ exports[`Design reply form component renders button text as "Comment" when creat ...@@ -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`] = ` 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\\"> <!----> <span class=\\"gl-button-text\\">
Save comment Save comment
......
...@@ -59,8 +59,8 @@ describe('Header', () => { ...@@ -59,8 +59,8 @@ describe('Header', () => {
beforeEach(() => { beforeEach(() => {
setFixtures(` setFixtures(`
<li class="js-nav-user-dropdown"> <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-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-event="click_upgrade_link" data-track-label="free" data-track-property="user_dropdown">Upgrade</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>`); </li>`);
trackingSpy = mockTracking('_category_', $('.js-nav-user-dropdown').element, jest.spyOn); trackingSpy = mockTracking('_category_', $('.js-nav-user-dropdown').element, jest.spyOn);
......
...@@ -79,14 +79,14 @@ describe.each(['button', 'anchor'])('with triggerElement as %s', (triggerElement ...@@ -79,14 +79,14 @@ describe.each(['button', 'anchor'])('with triggerElement as %s', (triggerElement
it('does not add tracking attributes', () => { it('does not add tracking attributes', () => {
createComponent(); createComponent();
expect(findButton().attributes('data-track-event')).toBeUndefined(); expect(findButton().attributes('data-track-action')).toBeUndefined();
expect(findButton().attributes('data-track-label')).toBeUndefined(); expect(findButton().attributes('data-track-label')).toBeUndefined();
}); });
it('adds tracking attributes', () => { it('adds tracking attributes', () => {
createComponent({ label: '_label_', event: '_event_' }); 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_'); expect(findButton().attributes('data-track-label')).toBe('_label_');
}); });
}); });
......
...@@ -65,7 +65,7 @@ describe('CustomizeHomepageBanner', () => { ...@@ -65,7 +65,7 @@ describe('CustomizeHomepageBanner', () => {
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
const button = wrapper.find(`[href='${wrapper.vm.preferencesBehaviorPath}']`); 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); expect(button.attributes('data-track-label')).toEqual(provide.trackLabel);
}); });
......
...@@ -10,7 +10,7 @@ describe('Track user dropdown open', () => { ...@@ -10,7 +10,7 @@ describe('Track user dropdown open', () => {
document.body.innerHTML = ` document.body.innerHTML = `
<div id="dummy-wrapper-element"> <div id="dummy-wrapper-element">
<div class="js-sidebar-assignee-dropdown"> <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> </div>
</div> </div>
......
...@@ -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',
......
...@@ -15,7 +15,7 @@ RSpec.shared_examples 'issuable invite members' do ...@@ -15,7 +15,7 @@ RSpec.shared_examples 'issuable invite members' do
page.within '.dropdown-menu-user' do page.within '.dropdown-menu-user' do
expect(page).to have_link('Invite Members') 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"]') expect(page).to have_selector('[data-track-label="edit_assignee"]')
end end
......
...@@ -53,7 +53,7 @@ RSpec.describe 'projects/empty' do ...@@ -53,7 +53,7 @@ RSpec.describe 'projects/empty' do
it 'shows invite members info', :aggregate_failures do it 'shows invite members info', :aggregate_failures do
render 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_selector('[data-track-label=invite_members_empty_project]')
expect(rendered).to have_content('Invite your team') expect(rendered).to have_content('Invite your team')
expect(rendered).to have_content('Add members to this project and start collaborating with 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 ...@@ -74,7 +74,7 @@ RSpec.describe 'search/_results' do
it 'renders the click text event tracking attributes' do it 'renders the click text event tracking attributes' do
render 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]') expect(rendered).to have_selector('[data-track-property=search_result]')
end end
end end
...@@ -83,7 +83,7 @@ RSpec.describe 'search/_results' do ...@@ -83,7 +83,7 @@ RSpec.describe 'search/_results' do
it 'does not render the click text event tracking attributes' do it 'does not render the click text event tracking attributes' do
render 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]') expect(rendered).not_to have_selector('[data-track-property=search_result]')
end end
end end
...@@ -105,7 +105,7 @@ RSpec.describe 'search/_results' do ...@@ -105,7 +105,7 @@ RSpec.describe 'search/_results' do
it 'renders the click text event tracking attributes' do it 'renders the click text event tracking attributes' do
render 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]') expect(rendered).to have_selector('[data-track-property=search_result]')
end end
end end
...@@ -114,7 +114,7 @@ RSpec.describe 'search/_results' do ...@@ -114,7 +114,7 @@ RSpec.describe 'search/_results' do
it 'does not render the click text event tracking attributes' do it 'does not render the click text event tracking attributes' do
render 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]') expect(rendered).not_to have_selector('[data-track-property=search_result]')
end end
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