-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[APM] Remove initial time range for service maps (#57308)
* [APM] Remove initial time range for service maps The initial time range for the service maps request might no longer be necessary, from what I can tell. Not having it improves the overall loading time and the user experience. * Remove loading indicator for service maps * Don't unnecessarily paginate * Unset loading indicator if component unmounts
- Loading branch information
1 parent
cb97670
commit 6581426
Showing
6 changed files
with
58 additions
and
42 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
28 changes: 28 additions & 0 deletions
28
x-pack/legacy/plugins/apm/public/hooks/useLoadingIndicator.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 { useContext, useMemo, useEffect } from 'react'; | ||
import { LoadingIndicatorContext } from '../context/LoadingIndicatorContext'; | ||
import { useComponentId } from './useComponentId'; | ||
|
||
export function useLoadingIndicator() { | ||
const { dispatchStatus } = useContext(LoadingIndicatorContext); | ||
const id = useComponentId(); | ||
|
||
useEffect(() => { | ||
return () => { | ||
dispatchStatus({ id, isLoading: false }); | ||
}; | ||
}, [dispatchStatus, id]); | ||
|
||
return useMemo(() => { | ||
return { | ||
setIsLoading: (loading: boolean) => { | ||
dispatchStatus({ id, isLoading: loading }); | ||
} | ||
}; | ||
}, [dispatchStatus, id]); | ||
} |
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