Skip to content

Commit

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

# Backport

This will backport the following commits from `main` to `8.16`:
- [[ML] Fix the Trained Models table expanded row refresh
(#198149)](#198149)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Dima
Arnautov","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-30T15:34:29Z","message":"[ML]
Fix the Trained Models table expanded row refresh (#198149)\n\n##
Summary\r\n\r\nFixes a regression introduced
in\r\nhttps://github.com//pull/194614/, where the content
of\r\nexpanded rows in the Trained Model table stopped being updated
on\r\nrefresh.\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"7e05d5c2e8084212584770fa52fe5701e2dd2166","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","v9.0.0","Feature:3rd
Party Models","Team:ML","v8.16.0","backport:version"],"title":"[ML] Fix
the Trained Models table expanded row
refresh","number":198149,"url":"https://github.com/elastic/kibana/pull/198149","mergeCommit":{"message":"[ML]
Fix the Trained Models table expanded row refresh (#198149)\n\n##
Summary\r\n\r\nFixes a regression introduced
in\r\nhttps://github.com//pull/194614/, where the content
of\r\nexpanded rows in the Trained Model table stopped being updated
on\r\nrefresh.\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"7e05d5c2e8084212584770fa52fe5701e2dd2166"}},"sourceBranch":"main","suggestedTargetBranches":["8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198149","number":198149,"mergeCommit":{"message":"[ML]
Fix the Trained Models table expanded row refresh (#198149)\n\n##
Summary\r\n\r\nFixes a regression introduced
in\r\nhttps://github.com//pull/194614/, where the content
of\r\nexpanded rows in the Trained Model table stopped being updated
on\r\nrefresh.\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"7e05d5c2e8084212584770fa52fe5701e2dd2166"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Dima Arnautov <[email protected]>
  • Loading branch information
kibanamachine and darnautov authored Oct 30, 2024
1 parent 495a530 commit 8d35157
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 8d35157

Please sign in to comment.