Commit a77833c3 authored by Olena Horal-Koretska's avatar Olena Horal-Koretska

Merge branch '334222-plain-renaming-usage-ping-data-to-service-ping-data-on-frontend' into 'master'

Plain renaming Usage Ping/Data to Service Ping/Data on Frontend

See merge request gitlab-org/gitlab!64855
parents 8bd3a911 99a44615
......@@ -83,8 +83,8 @@ const Api = {
tagsPath: '/api/:version/projects/:id/repository/tags',
freezePeriodsPath: '/api/:version/projects/:id/freeze_periods',
freezePeriodPath: '/api/:version/projects/:id/freeze_periods/:freeze_period_id',
usageDataIncrementCounterPath: '/api/:version/usage_data/increment_counter',
usageDataIncrementUniqueUsersPath: '/api/:version/usage_data/increment_unique_users',
serviceDataIncrementCounterPath: '/api/:version/usage_data/increment_counter',
serviceDataIncrementUniqueUsersPath: '/api/:version/usage_data/increment_unique_users',
featureFlagUserLists: '/api/:version/projects/:id/feature_flags_user_lists',
featureFlagUserList: '/api/:version/projects/:id/feature_flags_user_lists/:list_iid',
containerRegistryDetailsPath: '/api/:version/registry/repositories/:id/',
......@@ -875,7 +875,7 @@ const Api = {
return null;
}
const url = Api.buildUrl(this.usageDataIncrementCounterPath);
const url = Api.buildUrl(this.serviceDataIncrementCounterPath);
const headers = {
'Content-Type': 'application/json',
};
......@@ -888,7 +888,7 @@ const Api = {
return null;
}
const url = Api.buildUrl(this.usageDataIncrementUniqueUsersPath);
const url = Api.buildUrl(this.serviceDataIncrementUniqueUsersPath);
const headers = {
'Content-Type': 'application/json',
};
......
......@@ -41,7 +41,7 @@ import {
TOGGLE_TODO_ERROR,
designDeletionError,
} from '../../utils/error_messages';
import { trackDesignDetailView, usagePingDesignDetailView } from '../../utils/tracking';
import { trackDesignDetailView, servicePingDesignDetailView } from '../../utils/tracking';
const DEFAULT_SCALE = 1;
......@@ -292,7 +292,7 @@ export default {
);
if (this.glFeatures.usageDataDesignAction) {
usagePingDesignDetailView();
servicePingDesignDetailView();
}
},
updateActiveDiscussion(id, source = ACTIVE_DISCUSSION_SOURCE_TYPES.discussion) {
......
......@@ -14,7 +14,7 @@ export const DESIGN_SNOWPLOW_EVENT_TYPES = {
UPDATE_DESIGN: 'update_design',
};
export const DESIGN_USAGE_PING_EVENT_TYPES = {
export const DESIGN_SERVICE_PING_EVENT_TYPES = {
DESIGN_ACTION: 'design_action',
};
......@@ -52,8 +52,8 @@ export function trackDesignUpdate() {
}
/**
* Track "design detail" view via usage ping
* Track "design detail" view via service ping
*/
export function usagePingDesignDetailView() {
Api.trackRedisHllUserEvent(DESIGN_USAGE_PING_EVENT_TYPES.DESIGN_ACTION);
export function servicePingDesignDetailView() {
Api.trackRedisHllUserEvent(DESIGN_SERVICE_PING_EVENT_TYPES.DESIGN_ACTION);
}
......@@ -28,7 +28,8 @@ export const TRACKING_ACTION_CREATE_COMMIT = 'create_commit';
export const TRACKING_ACTION_CREATE_MERGE_REQUEST = 'create_merge_request';
export const TRACKING_ACTION_INITIALIZE_EDITOR = 'initialize_editor';
export const USAGE_PING_TRACKING_ACTION_CREATE_COMMIT = 'static_site_editor_commits';
export const USAGE_PING_TRACKING_ACTION_CREATE_MERGE_REQUEST = 'static_site_editor_merge_requests';
export const SERVICE_PING_TRACKING_ACTION_CREATE_COMMIT = 'static_site_editor_commits';
export const SERVICE_PING_TRACKING_ACTION_CREATE_MERGE_REQUEST =
'static_site_editor_merge_requests';
export const MR_META_LOCAL_STORAGE_KEY = 'sse-merge-request-meta-storage-key';
......@@ -9,8 +9,8 @@ import {
SUBMIT_CHANGES_MERGE_REQUEST_ERROR,
TRACKING_ACTION_CREATE_COMMIT,
TRACKING_ACTION_CREATE_MERGE_REQUEST,
USAGE_PING_TRACKING_ACTION_CREATE_COMMIT,
USAGE_PING_TRACKING_ACTION_CREATE_MERGE_REQUEST,
SERVICE_PING_TRACKING_ACTION_CREATE_COMMIT,
SERVICE_PING_TRACKING_ACTION_CREATE_MERGE_REQUEST,
DEFAULT_FORMATTING_CHANGES_COMMIT_MESSAGE,
DEFAULT_FORMATTING_CHANGES_COMMIT_DESCRIPTION,
} from '../constants';
......@@ -58,7 +58,7 @@ const createUpdateSourceFileAction = (sourcePath, content) => [
const commit = (projectId, message, branch, actions) => {
Tracking.event(document.body.dataset.page, TRACKING_ACTION_CREATE_COMMIT);
Api.trackRedisCounterEvent(USAGE_PING_TRACKING_ACTION_CREATE_COMMIT);
Api.trackRedisCounterEvent(SERVICE_PING_TRACKING_ACTION_CREATE_COMMIT);
return Api.commitMultiple(
projectId,
......@@ -74,7 +74,7 @@ const commit = (projectId, message, branch, actions) => {
const createMergeRequest = (projectId, title, description, sourceBranch, targetBranch) => {
Tracking.event(document.body.dataset.page, TRACKING_ACTION_CREATE_MERGE_REQUEST);
Api.trackRedisCounterEvent(USAGE_PING_TRACKING_ACTION_CREATE_MERGE_REQUEST);
Api.trackRedisCounterEvent(SERVICE_PING_TRACKING_ACTION_CREATE_MERGE_REQUEST);
return Api.createProjectMergeRequest(
projectId,
......
......@@ -122,7 +122,7 @@ export default {
this.hasError = true;
},
onProjectClick() {
api.trackRedisHllUserEvent(this.$options.usagePingProjectEvent);
api.trackRedisHllUserEvent(this.$options.servicePingProjectEvent);
},
selectAllProjects() {
this.allProjectsSelected = true;
......@@ -179,7 +179,7 @@ export default {
totalHeight: 15,
},
averageCoverageFormatter: getFormatter(SUPPORTED_FORMATS.percentHundred),
usagePingProjectEvent: 'i_testing_group_code_coverage_project_click_total',
servicePingProjectEvent: 'i_testing_group_code_coverage_project_click_total',
};
</script>
<template>
......
......@@ -36,7 +36,7 @@ describe('Group repository analytics app', () => {
});
});
describe('usage ping events', () => {
describe('service ping events', () => {
describe('with the feature flag enabled', () => {
beforeEach(() => {
createComponent({ [VISIT_EVENT_FEATURE_FLAG]: true });
......
......@@ -180,7 +180,7 @@ describe('Test coverage table component', () => {
expect(Api.trackRedisHllUserEvent).toHaveBeenCalledTimes(1);
expect(Api.trackRedisHllUserEvent).toHaveBeenCalledWith(
wrapper.vm.$options.usagePingProjectEvent,
wrapper.vm.$options.servicePingProjectEvent,
);
});
});
......
......@@ -43,7 +43,7 @@ describe('Codequality report actions', () => {
testAction(actions.requestReport, null, state, [{ type: types.REQUEST_REPORT }], [], done);
});
it('tracks a usage ping event when the feature flag is enabled', () => {
it('tracks a service ping event when the feature flag is enabled', () => {
window.gon = { features: { [VIEW_EVENT_FEATURE_FLAG]: true } };
actions.requestReport({ commit: jest.fn() });
......@@ -51,7 +51,7 @@ describe('Codequality report actions', () => {
expect(Api.trackRedisHllUserEvent).toHaveBeenCalledWith(VIEW_EVENT_NAME);
});
it('does not track a usage ping event when the feature flag is disabled', () => {
it('does not track a service ping event when the feature flag is disabled', () => {
window.gon = { features: { [VIEW_EVENT_FEATURE_FLAG]: false } };
actions.requestReport({ commit: jest.fn() });
......
......@@ -35,7 +35,7 @@ describe('Grouped test reports app', () => {
wrapper = null;
});
describe('usage ping events', () => {
describe('service ping events', () => {
describe('when feature flag is enabled', () => {
beforeEach(() => {
mountComponent({ usageDataITestingWebPerformanceWidgetTotal: true });
......
......@@ -35,7 +35,7 @@ describe('Grouped load performance reports app', () => {
wrapper = null;
});
describe('usage ping events', () => {
describe('service ping events', () => {
describe('when feature flag is enabled', () => {
beforeEach(() => {
mountComponent({ usageDataITestingLoadPerformanceWidgetTotal: true });
......
......@@ -1481,7 +1481,7 @@ describe('Api', () => {
'Content-Type': 'application/json',
};
describe('when usage data increment counter is called with feature flag disabled', () => {
describe('when service data increment counter is called with feature flag disabled', () => {
beforeEach(() => {
gon.features = { ...gon.features, usageDataApi: false };
});
......@@ -1495,7 +1495,7 @@ describe('Api', () => {
});
});
describe('when usage data increment counter is called', () => {
describe('when service data increment counter is called', () => {
beforeEach(() => {
gon.features = { ...gon.features, usageDataApi: true };
});
......@@ -1526,7 +1526,7 @@ describe('Api', () => {
window.gon.current_user_id = 1;
});
describe('when usage data increment unique users is called with feature flag disabled', () => {
describe('when service data increment unique users is called with feature flag disabled', () => {
beforeEach(() => {
gon.features = { ...gon.features, usageDataApi: false };
});
......@@ -1541,7 +1541,7 @@ describe('Api', () => {
});
});
describe('when usage data increment unique users is called', () => {
describe('when service data increment unique users is called', () => {
beforeEach(() => {
gon.features = { ...gon.features, usageDataApi: true };
});
......
......@@ -20,7 +20,7 @@ import {
import {
DESIGN_TRACKING_PAGE_NAME,
DESIGN_SNOWPLOW_EVENT_TYPES,
DESIGN_USAGE_PING_EVENT_TYPES,
DESIGN_SERVICE_PING_EVENT_TYPES,
} from '~/design_management/utils/tracking';
import createFlash from '~/flash';
import mockAllVersions from '../../mock_data/all_versions';
......@@ -391,7 +391,7 @@ describe('Design management design index page', () => {
});
describe('with usage_data_design_action enabled', () => {
it('tracks design view usage ping', () => {
it('tracks design view service ping', () => {
createComponent(
{ loading: true },
{
......@@ -402,13 +402,13 @@ describe('Design management design index page', () => {
);
expect(Api.trackRedisHllUserEvent).toHaveBeenCalledTimes(1);
expect(Api.trackRedisHllUserEvent).toHaveBeenCalledWith(
DESIGN_USAGE_PING_EVENT_TYPES.DESIGN_ACTION,
DESIGN_SERVICE_PING_EVENT_TYPES.DESIGN_ACTION,
);
});
});
describe('with usage_data_design_action disabled', () => {
it("doesn't track design view usage ping", () => {
it("doesn't track design view service ping", () => {
createComponent({ loading: true });
expect(Api.trackRedisHllUserEvent).toHaveBeenCalledTimes(0);
});
......
......@@ -114,7 +114,7 @@ describe('Grouped test reports app', () => {
setReports(newFailedTestReports);
});
it('tracks usage ping metric when enabled', () => {
it('tracks service ping metric when enabled', () => {
mountComponent({ glFeatures: { usageDataITestingSummaryWidgetTotal: true } });
findExpandButton().trigger('click');
......@@ -132,7 +132,7 @@ describe('Grouped test reports app', () => {
expect(Api.trackRedisHllUserEvent).toHaveBeenCalledTimes(1);
});
it('does not track usage ping metric when disabled', () => {
it('does not track service ping metric when disabled', () => {
mountComponent({ glFeatures: { usageDataITestingSummaryWidgetTotal: false } });
findExpandButton().trigger('click');
......
......@@ -8,8 +8,8 @@ import {
SUBMIT_CHANGES_MERGE_REQUEST_ERROR,
TRACKING_ACTION_CREATE_COMMIT,
TRACKING_ACTION_CREATE_MERGE_REQUEST,
USAGE_PING_TRACKING_ACTION_CREATE_COMMIT,
USAGE_PING_TRACKING_ACTION_CREATE_MERGE_REQUEST,
SERVICE_PING_TRACKING_ACTION_CREATE_COMMIT,
SERVICE_PING_TRACKING_ACTION_CREATE_MERGE_REQUEST,
DEFAULT_FORMATTING_CHANGES_COMMIT_MESSAGE,
DEFAULT_FORMATTING_CHANGES_COMMIT_DESCRIPTION,
} from '~/static_site_editor/constants';
......@@ -237,7 +237,7 @@ describe('submitContentChanges', () => {
});
});
describe('sends the correct Usage Ping tracking event', () => {
describe('sends the correct Service Ping tracking event', () => {
beforeEach(() => {
jest.spyOn(Api, 'trackRedisCounterEvent').mockResolvedValue({ data: '' });
});
......@@ -245,7 +245,7 @@ describe('submitContentChanges', () => {
it('for commiting changes', () => {
return submitContentChanges(buildPayload()).then(() => {
expect(Api.trackRedisCounterEvent).toHaveBeenCalledWith(
USAGE_PING_TRACKING_ACTION_CREATE_COMMIT,
SERVICE_PING_TRACKING_ACTION_CREATE_COMMIT,
);
});
});
......@@ -253,7 +253,7 @@ describe('submitContentChanges', () => {
it('for creating a merge request', () => {
return submitContentChanges(buildPayload()).then(() => {
expect(Api.trackRedisCounterEvent).toHaveBeenCalledWith(
USAGE_PING_TRACKING_ACTION_CREATE_MERGE_REQUEST,
SERVICE_PING_TRACKING_ACTION_CREATE_MERGE_REQUEST,
);
});
});
......
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