Skip to content

Commit

Permalink
bug fix for empty connected services array (#339)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Ho <[email protected]>
  • Loading branch information
derek-ho authored Apr 3, 2023
1 parent 5aeb1a4 commit 9ad2c4d
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ import {
handleServiceMapRequest,
handleServiceViewRequest,
} from '../../../../../public/components/trace_analytics/requests/services_request_handler';
import { filtersToDsl, processTimeStamp } from '../../../../../public/components/trace_analytics/components/common/helper_functions';
import {
filtersToDsl,
processTimeStamp,
} from '../../../../../public/components/trace_analytics/components/common/helper_functions';
import { ServiceMap } from '../../../../../public/components/trace_analytics/components/services';
import { ServiceObject } from '../../../../../public/components/trace_analytics/components/common/plots/service_map';
import { SpanDetailTable } from '../../../../../public/components/trace_analytics/components/traces/span_detail_table';
Expand Down Expand Up @@ -64,7 +67,7 @@ export function ServiceDetailFlyout(props: ServiceFlyoutProps) {
),
getListItem(
'Connected services',
fields.connected_services
fields.connected_services && fields.connected_services.length
? fields.connected_services.reduce((prev: string, curr: string) => {
return [prev, ', ', curr];
})
Expand Down Expand Up @@ -118,7 +121,15 @@ export function ServiceDetailFlyout(props: ServiceFlyoutProps) {
}, [serviceName, fields, serviceMap, DSL, serviceMapIdSelected]);

useEffect(() => {
const serviceDSL = filtersToDsl(mode, filters, query, processTimeStamp(startTime, mode), processTimeStamp(endTime, mode), 'app', appConfigs);
const serviceDSL = filtersToDsl(
mode,
filters,
query,
processTimeStamp(startTime, mode),
processTimeStamp(endTime, mode),
'app',
appConfigs
);
handleServiceViewRequest(serviceName, http, serviceDSL, setFields, mode);
handleServiceMapRequest(http, serviceDSL, mode, setServiceMap, serviceName);
const spanDSL = filtersToDsl(mode, filters, query, startTime, endTime, 'app', appConfigs);
Expand Down

0 comments on commit 9ad2c4d

Please sign in to comment.