forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace useServiceTransactionTypes with useTransactionTypes
- Loading branch information
1 parent
30863ad
commit bae7fa4
Showing
14 changed files
with
219 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
x-pack/legacy/plugins/apm/public/services/rest/apm/transaction_types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { TransactionTypesAPIResponse } from '../../../../server/lib/transaction_types/get_transaction_types'; | ||
import { callApi } from '../callApi'; | ||
|
||
export async function loadTransactionTypes({ | ||
serviceName, | ||
start, | ||
end | ||
}: { | ||
serviceName: string | undefined; | ||
start: string; | ||
end: string; | ||
}) { | ||
const { transactionTypes } = await callApi<TransactionTypesAPIResponse>({ | ||
pathname: `/api/apm/transaction_types`, | ||
query: { | ||
start, | ||
end, | ||
serviceName | ||
} | ||
}); | ||
return transactionTypes; | ||
} |
46 changes: 0 additions & 46 deletions
46
x-pack/legacy/plugins/apm/server/lib/services/__snapshots__/queries.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
x-pack/legacy/plugins/apm/server/lib/transaction_types/__snapshots__/queries.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
x-pack/legacy/plugins/apm/server/lib/transaction_types/queries.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { getTransactionTypes } from './get_transaction_types'; | ||
import { | ||
SearchParamsMock, | ||
inspectSearchParams | ||
} from '../../../public/utils/testHelpers'; | ||
|
||
describe('services queries', () => { | ||
let mock: SearchParamsMock; | ||
|
||
afterEach(() => { | ||
mock.teardown(); | ||
}); | ||
|
||
it('fetches the transaction types without service name', async () => { | ||
mock = await inspectSearchParams(setup => getTransactionTypes({ setup })); | ||
|
||
expect(mock.params).toMatchSnapshot(); | ||
}); | ||
|
||
it('fetches the transaction types with a service name', async () => { | ||
mock = await inspectSearchParams(setup => | ||
getTransactionTypes({ setup, serviceName: 'foo' }) | ||
); | ||
|
||
expect(mock.params).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.