Skip to content

Commit

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

# Backport

This will backport the following commits from `main` to `8.x`:
- [[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","v8.17.0"],"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.x"],"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,"url":"https://github.com/elastic/kibana/pull/198391","number":198391,"state":"MERGED","mergeCommit":{"sha":"8d3515762850843c99545881d5b43b024b5a8bd2","message":"[8.16]
[ML] Fix the Trained Models table expanded row refresh (#198149)
(#198391)\n\n# Backport\n\nThis will backport the following commits from
`main` to `8.16`:\n- [[ML] Fix the Trained Models table expanded row
refresh\n(#198149)](https://github.com/elastic/kibana/pull/198149)\n\n<!---
Backport version: 9.4.3 -->\n\n### Questions ?\nPlease refer to the
[Backport
tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT
[{\"author\":{\"name\":\"Dima\nArnautov\",\"email\":\"[email protected]\"},\"sourceCommit\":{\"committedDate\":\"2024-10-30T15:34:29Z\",\"message\":\"[ML]\nFix
the Trained Models table expanded row refresh
(#198149)\\n\\n##\nSummary\\r\\n\\r\\nFixes a regression
introduced\nin\\r\\nhttps://github.com//pull/194614/,
where the content\nof\\r\\nexpanded rows in the Trained Model table
stopped being updated\non\\r\\nrefresh.\\r\\n\\r\\nCo-authored-by:
Elastic
Machine\n<[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\nParty
Models\",\"Team:ML\",\"v8.16.0\",\"backport:version\"],\"title\":\"[ML]
Fix\nthe Trained Models table expanded
row\nrefresh\",\"number\":198149,\"url\":\"https://github.com/elastic/kibana/pull/198149\",\"mergeCommit\":{\"message\":\"[ML]\nFix
the Trained Models table expanded row refresh
(#198149)\\n\\n##\nSummary\\r\\n\\r\\nFixes a regression
introduced\nin\\r\\nhttps://github.com//pull/194614/,
where the content\nof\\r\\nexpanded rows in the Trained Model table
stopped being updated\non\\r\\nrefresh.\\r\\n\\r\\nCo-authored-by:
Elastic
Machine\n<[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]\nFix
the Trained Models table expanded row refresh
(#198149)\\n\\n##\nSummary\\r\\n\\r\\nFixes a regression
introduced\nin\\r\\nhttps://github.com//pull/194614/,
where the content\nof\\r\\nexpanded rows in the Trained Model table
stopped being updated\non\\r\\nrefresh.\\r\\n\\r\\nCo-authored-by:
Elastic
Machine\n<[email protected]>\",\"sha\":\"7e05d5c2e8084212584770fa52fe5701e2dd2166\"}},{\"branch\":\"8.16\",\"label\":\"v8.16.0\",\"branchLabelMappingKey\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"}]}]\nBACKPORT-->\n\nCo-authored-by:
Dima Arnautov
<[email protected]>"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Dima Arnautov <[email protected]>
  • Loading branch information
kibanamachine and darnautov authored Oct 31, 2024
1 parent 35113f8 commit 89e94b3
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 89e94b3

Please sign in to comment.