Commit c5e98d69 authored by Giorgenes Gelatti's avatar Giorgenes Gelatti

Adds tracking to registry UI

Add hooks to UI to track user events related to package
parent 97d0bf88
......@@ -85,6 +85,8 @@ export default {
v-gl-modal="modalId"
:title="s__('ContainerRegistry|Remove repository')"
:aria-label="s__('ContainerRegistry|Remove repository')"
data-track-event="click_button"
data-track-label="registry_repository_delete"
class="js-remove-repo btn-inverted"
variant="danger"
>
......
......@@ -192,6 +192,8 @@ export default {
v-gl-modal="modalId"
:disabled="!itemsToBeDeleted || itemsToBeDeleted.length === 0"
class="js-delete-registry float-right"
data-track-event="click_button"
data-track-label="bulk_registry_tag_delete"
variant="danger"
:title="s__('ContainerRegistry|Remove selected tags')"
:aria-label="s__('ContainerRegistry|Remove selected tags')"
......@@ -246,6 +248,8 @@ export default {
v-gl-modal="modalId"
:title="s__('ContainerRegistry|Remove tag')"
:aria-label="s__('ContainerRegistry|Remove tag')"
data-track-event="click_button"
data-track-label="registry_tag_delete"
variant="danger"
class="js-delete-registry-row float-right btn-inverted btn-border-color btn-icon"
@click="deleteSingleItem(index)"
......
......@@ -42,6 +42,7 @@ describe Projects::Registry::RepositoriesController do
it 'tracks the event' do
expect(Gitlab::Tracking).to receive(:event).with(anything, 'list_repositories', {})
go_to_index
end
......@@ -97,6 +98,7 @@ describe Projects::Registry::RepositoriesController do
expect(DeleteContainerRepositoryWorker).to receive(:perform_async).with(user.id, repository.id)
delete_repository(repository)
expect(response).to have_gitlab_http_status(:no_content)
end
......
......@@ -41,6 +41,7 @@ describe Projects::Registry::TagsController do
it 'tracks the event' do
expect(Gitlab::Tracking).to receive(:event).with(anything, 'list_tags', {})
get_tags
end
end
......@@ -107,8 +108,9 @@ describe Projects::Registry::TagsController do
end
it 'tracks the event' do
allow_any_instance_of(ContainerRegistry::Tag).to receive(:delete) { true }
expect(Gitlab::Tracking).to receive(:event).with(anything, 'delete_tag', {})
expect_delete_tags(%w[test.])
expect(controller).to receive(:track_event).with(:delete_tag)
destroy_tag('test.')
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