Skip to content

Commit

Permalink
[Upgrade Assistant] Rename "telemetry" to "stats" (#78127)
Browse files Browse the repository at this point in the history
  • Loading branch information
afharo authored Sep 22, 2020
1 parent c03c7b3 commit d7107e4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export class UpgradeAssistantTabs extends React.Component<Props, TabsState> {

this.setState({ telemetryState: TelemetryState.Running });

await this.props.http.fetch('/api/upgrade_assistant/telemetry/ui_open', {
await this.props.http.fetch('/api/upgrade_assistant/stats/ui_open', {
method: 'PUT',
body: JSON.stringify(set({}, tabName, true)),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export class ReindexButton extends React.Component<ReindexButtonProps, ReindexBu
};

private async sendUIReindexTelemetryInfo(uiReindexAction: UIReindexOption) {
await this.props.http.fetch('/api/upgrade_assistant/telemetry/ui_reindex', {
await this.props.http.fetch('/api/upgrade_assistant/stats/ui_reindex', {
method: 'PUT',
body: JSON.stringify(set({}, uiReindexAction, true)),
});
Expand Down
16 changes: 8 additions & 8 deletions x-pack/plugins/upgrade_assistant/server/routes/telemetry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('Upgrade Assistant Telemetry API', () => {
});
afterEach(() => jest.clearAllMocks());

describe('PUT /api/upgrade_assistant/telemetry/ui_open', () => {
describe('PUT /api/upgrade_assistant/stats/ui_open', () => {
it('returns correct payload with single option', async () => {
const returnPayload = {
overview: true,
Expand All @@ -51,7 +51,7 @@ describe('Upgrade Assistant Telemetry API', () => {

const resp = await routeDependencies.router.getHandler({
method: 'put',
pathPattern: '/api/upgrade_assistant/telemetry/ui_open',
pathPattern: '/api/upgrade_assistant/stats/ui_open',
})(
routeHandlerContextMock,
createRequestMock({ body: returnPayload }),
Expand All @@ -72,7 +72,7 @@ describe('Upgrade Assistant Telemetry API', () => {

const resp = await routeDependencies.router.getHandler({
method: 'put',
pathPattern: '/api/upgrade_assistant/telemetry/ui_open',
pathPattern: '/api/upgrade_assistant/stats/ui_open',
})(
routeHandlerContextMock,
createRequestMock({
Expand All @@ -93,7 +93,7 @@ describe('Upgrade Assistant Telemetry API', () => {

const resp = await routeDependencies.router.getHandler({
method: 'put',
pathPattern: '/api/upgrade_assistant/telemetry/ui_open',
pathPattern: '/api/upgrade_assistant/stats/ui_open',
})(
routeHandlerContextMock,
createRequestMock({
Expand All @@ -108,7 +108,7 @@ describe('Upgrade Assistant Telemetry API', () => {
});
});

describe('PUT /api/upgrade_assistant/telemetry/ui_reindex', () => {
describe('PUT /api/upgrade_assistant/stats/ui_reindex', () => {
it('returns correct payload with single option', async () => {
const returnPayload = {
close: false,
Expand All @@ -121,7 +121,7 @@ describe('Upgrade Assistant Telemetry API', () => {

const resp = await routeDependencies.router.getHandler({
method: 'put',
pathPattern: '/api/upgrade_assistant/telemetry/ui_reindex',
pathPattern: '/api/upgrade_assistant/stats/ui_reindex',
})(
routeHandlerContextMock,
createRequestMock({
Expand All @@ -147,7 +147,7 @@ describe('Upgrade Assistant Telemetry API', () => {

const resp = await routeDependencies.router.getHandler({
method: 'put',
pathPattern: '/api/upgrade_assistant/telemetry/ui_reindex',
pathPattern: '/api/upgrade_assistant/stats/ui_reindex',
})(
routeHandlerContextMock,
createRequestMock({
Expand All @@ -169,7 +169,7 @@ describe('Upgrade Assistant Telemetry API', () => {

const resp = await routeDependencies.router.getHandler({
method: 'put',
pathPattern: '/api/upgrade_assistant/telemetry/ui_reindex',
pathPattern: '/api/upgrade_assistant/stats/ui_reindex',
})(
routeHandlerContextMock,
createRequestMock({
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/upgrade_assistant/server/routes/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { RouteDependencies } from '../types';
export function registerTelemetryRoutes({ router, getSavedObjectsService }: RouteDependencies) {
router.put(
{
path: '/api/upgrade_assistant/telemetry/ui_open',
path: '/api/upgrade_assistant/stats/ui_open',
validate: {
body: schema.object({
overview: schema.boolean({ defaultValue: false }),
Expand Down Expand Up @@ -40,7 +40,7 @@ export function registerTelemetryRoutes({ router, getSavedObjectsService }: Rout

router.put(
{
path: '/api/upgrade_assistant/telemetry/ui_reindex',
path: '/api/upgrade_assistant/stats/ui_reindex',
validate: {
body: schema.object({
close: schema.boolean({ defaultValue: false }),
Expand Down

0 comments on commit d7107e4

Please sign in to comment.