Commit 9078236d authored by Axel García's avatar Axel García Committed by Axel Garcia

Plain replace of track-event to track-action

Changelog: other
MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56904
EE: true
parent 07647a61
......@@ -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"
......
......@@ -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"
>
......
......@@ -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
......
......@@ -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"
......
......@@ -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
......
......@@ -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)
......@@ -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')
......@@ -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>
......
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