Commit eda467fd authored by Robert Speicher's avatar Robert Speicher

Merge branch 'update-consolidated-menu-tracking-labels' into 'master'

Update tracking labels for consolidated edit menu

See merge request gitlab-org/gitlab!64179
parents 2b02452d aa1425fc
......@@ -93,9 +93,8 @@ export default {
tooltip: '',
attrs: {
'data-qa-selector': 'edit_button',
'data-track-event': 'click_edit',
// eslint-disable-next-line @gitlab/require-i18n-strings
'data-track-label': 'Edit',
'data-track-action': 'click_consolidated_edit',
'data-track-label': 'edit',
},
...handleOptions,
};
......@@ -127,9 +126,8 @@ export default {
tooltip: '',
attrs: {
'data-qa-selector': 'web_ide_button',
'data-track-event': 'click_edit_ide',
// eslint-disable-next-line @gitlab/require-i18n-strings
'data-track-label': 'Web IDE',
'data-track-action': 'click_consolidated_edit_ide',
'data-track-label': 'web_ide',
},
...handleOptions,
};
......
......@@ -65,7 +65,7 @@ module BlobHelper
return unless blob = readable_blob(options, path, project, ref)
common_classes = "btn gl-button btn-confirm js-edit-blob gl-ml-3 #{options[:extra_class]}"
data = { track_event: 'click_edit', track_label: 'Edit' }
data = { track_action: 'click_edit', track_label: 'edit' }
if Feature.enabled?(:web_ide_primary_edit, project.group)
common_classes += " btn-inverted"
......@@ -85,7 +85,7 @@ module BlobHelper
return unless blob
common_classes = 'btn gl-button btn-confirm ide-edit-button gl-ml-3'
data = { track_event: 'click_edit_ide', track_label: 'Web IDE' }
data = { track_action: 'click_edit_ide', track_label: 'web_ide' }
unless Feature.enabled?(:web_ide_primary_edit, project.group)
common_classes += " btn-inverted"
......
......@@ -15,8 +15,8 @@ const ACTION_EDIT = {
tooltip: '',
attrs: {
'data-qa-selector': 'edit_button',
'data-track-event': 'click_edit',
'data-track-label': 'Edit',
'data-track-action': 'click_consolidated_edit',
'data-track-label': 'edit',
},
};
const ACTION_EDIT_CONFIRM_FORK = {
......@@ -32,8 +32,8 @@ const ACTION_WEB_IDE = {
text: 'Web IDE',
attrs: {
'data-qa-selector': 'web_ide_button',
'data-track-event': 'click_edit_ide',
'data-track-label': 'Web IDE',
'data-track-action': 'click_consolidated_edit_ide',
'data-track-label': 'web_ide',
},
};
const ACTION_WEB_IDE_CONFIRM_FORK = {
......
......@@ -67,8 +67,8 @@ RSpec.describe BlobHelper do
it 'passes on primary tracking attributes' do
parsed_link = Capybara.string(link).find_link('Edit')
expect(parsed_link[:'data-track-event']).to eq("click_edit")
expect(parsed_link[:'data-track-label']).to eq("Edit")
expect(parsed_link[:'data-track-action']).to eq("click_edit")
expect(parsed_link[:'data-track-label']).to eq("edit")
expect(parsed_link[:'data-track-property']).to eq(nil)
end
end
......@@ -85,8 +85,8 @@ RSpec.describe BlobHelper do
it 'passes on secondary tracking attributes' do
parsed_link = Capybara.string(link).find_link('Edit')
expect(parsed_link[:'data-track-event']).to eq("click_edit")
expect(parsed_link[:'data-track-label']).to eq("Edit")
expect(parsed_link[:'data-track-action']).to eq("click_edit")
expect(parsed_link[:'data-track-label']).to eq("edit")
expect(parsed_link[:'data-track-property']).to eq("secondary")
end
end
......@@ -332,8 +332,8 @@ RSpec.describe BlobHelper do
it 'passes on secondary tracking attributes' do
parsed_link = Capybara.string(link).find_link('Web IDE')
expect(parsed_link[:'data-track-event']).to eq("click_edit_ide")
expect(parsed_link[:'data-track-label']).to eq("Web IDE")
expect(parsed_link[:'data-track-action']).to eq("click_edit_ide")
expect(parsed_link[:'data-track-label']).to eq("web_ide")
expect(parsed_link[:'data-track-property']).to eq("secondary")
end
end
......@@ -350,8 +350,8 @@ RSpec.describe BlobHelper do
it 'passes on primary tracking attributes' do
parsed_link = Capybara.string(link).find_link('Web IDE')
expect(parsed_link[:'data-track-event']).to eq("click_edit_ide")
expect(parsed_link[:'data-track-label']).to eq("Web IDE")
expect(parsed_link[:'data-track-action']).to eq("click_edit_ide")
expect(parsed_link[:'data-track-label']).to eq("web_ide")
expect(parsed_link[:'data-track-property']).to eq(nil)
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