Skip to content

Commit

Permalink
[ML] Fix the Trained Models table expanded row refresh (elastic#198149)
Browse files Browse the repository at this point in the history
## Summary

Fixes a regression introduced in
elastic#194614, where the content of
expanded rows in the Trained Model table stopped being updated on
refresh.

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
darnautov and elasticmachine authored Oct 30, 2024
1 parent 0b87e90 commit 7e05d5c
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,16 @@ export const ModelsList: FC<Props> = ({
};
});
});

setItemIdToExpandedRowMap((prev) => {
// Refresh expanded rows
return Object.fromEntries(
Object.keys(prev).map((modelId) => {
const item = resultItems.find((i) => i.model_id === modelId);
return item ? [modelId, <ExpandedRow item={item as ModelItemFull} />] : [];
})
);
});
} catch (error) {
displayErrorToast(
error,
Expand Down

0 comments on commit 7e05d5c

Please sign in to comment.