Skip to content

Commit

Permalink
[8.16] [ML] Fix Trained model deletion with expanded row (#198530) (#…
Browse files Browse the repository at this point in the history
…198567)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[ML] Fix Trained model deletion with expanded row
(#198530)](#198530)

<!--- 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-31T15:33:17Z","message":"[ML]
Fix Trained model deletion with expanded row (#198530)\n\n##
Summary\r\n\r\nFixes #198408.\r\n\r\nFixes trained model item deletion
with expanded row.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"bd21496b3c0af2167918bd385bd259b05c8e765d","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":[":ml","release_note:skip","v9.0.0","Team:ML","v8.16.0","backport:version","v8.17.0"],"title":"[ML]
Fix Trained model deletion with expanded
row","number":198530,"url":"https://github.com/elastic/kibana/pull/198530","mergeCommit":{"message":"[ML]
Fix Trained model deletion with expanded row (#198530)\n\n##
Summary\r\n\r\nFixes #198408.\r\n\r\nFixes trained model item deletion
with expanded row.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"bd21496b3c0af2167918bd385bd259b05c8e765d"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198530","number":198530,"mergeCommit":{"message":"[ML]
Fix Trained model deletion with expanded row (#198530)\n\n##
Summary\r\n\r\nFixes #198408.\r\n\r\nFixes trained model item deletion
with expanded row.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"bd21496b3c0af2167918bd385bd259b05c8e765d"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"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 7dbd7c7 commit 6d6852d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,14 @@ export const ModelsList: FC<Props> = ({
}
});

setItemIdToExpandedRowMap((prev) => {
const newMap = { ...prev };
modelsToDelete.forEach((model) => {
delete newMap[model.model_id];
});
return newMap;
});

setModelsToDelete([]);

if (refreshList) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,8 @@ export default function ({ getService }: FtrProviderContext) {

it('displays a model without an ingest pipeline and model can be deleted', async () => {
await ml.testExecution.logTestStep('should display the model in the table');
await ml.trainedModelsTable.filterWithSearchString(modelWithoutPipelineData.modelId, 1);
await ml.testExecution.logTestStep('expands the row to show the model details');
await ml.trainedModelsTable.ensureRowIsExpanded(modelWithoutPipelineData.modelId);

await ml.testExecution.logTestStep(
'displays expected row values for the model in the table'
Expand Down

0 comments on commit 6d6852d

Please sign in to comment.