mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
exists in the current pathname
This commit is contained in:
parent
a93ffdbfed
commit
8eb1f571e5
2 changed files with 9 additions and 9 deletions
|
@ -78,12 +78,6 @@ export const EnvironmentFilter: React.FC = () => {
|
|||
const { urlParams, uiFilters } = useUrlParams();
|
||||
const { start, end, serviceName } = urlParams;
|
||||
|
||||
// TODO fix the bug in urlParams that this code defensively overcomes
|
||||
let realServiceName = serviceName;
|
||||
if (serviceName === 'services') {
|
||||
realServiceName = undefined;
|
||||
}
|
||||
|
||||
const { environment } = uiFilters;
|
||||
const { data: environments = [], status = 'loading' } = useFetcher(
|
||||
() => {
|
||||
|
@ -91,11 +85,11 @@ export const EnvironmentFilter: React.FC = () => {
|
|||
return loadEnvironmentsFilter({
|
||||
start,
|
||||
end,
|
||||
serviceName: realServiceName
|
||||
serviceName
|
||||
});
|
||||
}
|
||||
},
|
||||
[start, end, realServiceName]
|
||||
[start, end, serviceName]
|
||||
);
|
||||
|
||||
return (
|
||||
|
|
|
@ -58,7 +58,7 @@ export function removeUndefinedProps<T>(obj: T): Partial<T> {
|
|||
|
||||
export function getPathParams(pathname: string = '') {
|
||||
const paths = getPathAsArray(pathname);
|
||||
const pageName = paths[1];
|
||||
const pageName = paths.length > 1 ? paths[1] : paths[0];
|
||||
|
||||
// TODO: use react router's real match params instead of guessing the path order
|
||||
switch (pageName) {
|
||||
|
@ -80,6 +80,12 @@ export function getPathParams(pathname: string = '') {
|
|||
processorEvent: 'metric',
|
||||
serviceName: paths[0]
|
||||
};
|
||||
case 'services': // fall thru since services and traces share path params
|
||||
case 'traces':
|
||||
return {
|
||||
processorEvent: 'transaction',
|
||||
serviceName: undefined
|
||||
};
|
||||
default:
|
||||
return {
|
||||
processorEvent: 'transaction',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue