Skip to content

Commit

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

Fixes elastic#198408.

Fixes trained model item deletion with expanded row.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
  • Loading branch information
darnautov authored Oct 31, 2024
1 parent 42e978b commit bd21496
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 bd21496

Please sign in to comment.