Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Transforms: Reduces rerenders and multiple fetches of source index on transform wizard load. #160979

Merged
merged 2 commits into from Jul 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions x-pack/plugins/transform/public/app/hooks/use_index_data.ts
Expand Up @@ -86,6 +86,9 @@ export const useIndexData = (
};

useEffect(() => {
if (dataView.timeFieldName !== undefined && timeRangeMs === undefined) {
return;
}
const abortController = new AbortController();

// Fetch 500 random documents to determine populated fields.
Expand Down Expand Up @@ -197,6 +200,9 @@ export const useIndexData = (
}, [JSON.stringify([query, timeRangeMs])]);

useEffect(() => {
if (typeof dataViewFields === 'undefined') {
return;
}
const abortController = new AbortController();

const fetchDataGridData = async function () {
Expand Down