Fix bug with popup not closing (#115954)

This commit is contained in:
Phillip Burch 2021-10-25 04:39:43 -05:00 committed by GitHub
parent 6b5b06fc03
commit d66abdf25e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -46,7 +46,7 @@ export const LogStashPipelinePage: React.FC<ComponentProps> = ({ clusters }) =>
cluster_uuid: clusterUuid,
}) as any;
const [data, setData] = useState({} as any);
const [detailVertexId, setDetailVertexId] = useState<string | null>(null);
const [detailVertexId, setDetailVertexId] = useState<string | null | undefined>(undefined);
const { updateTotalItemCount } = useTable('logstash.pipelines');
const title = i18n.translate('xpack.monitoring.logstash.pipeline.routeTitle', {
@ -128,18 +128,19 @@ export const LogStashPipelinePage: React.FC<ComponentProps> = ({ clusters }) =>
const timeseriesTooltipXValueFormatter = (xValue: any) => moment(xValue).format(dateFormat);
const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context);
const onVertexChange = useCallback(
(vertex: any) => {
if (!vertex) {
setDetailVertexId(null);
} else {
setDetailVertexId(vertex.id);
}
const onVertexChange = useCallback((vertex: any) => {
if (!vertex) {
setDetailVertexId(null);
} else {
setDetailVertexId(vertex.id);
}
}, []);
useEffect(() => {
if (detailVertexId !== undefined) {
getPageData();
},
[getPageData]
);
}
}, [detailVertexId, getPageData]);
const onChangePipelineHash = useCallback(() => {
window.location.hash = getSafeForExternalLink(