Skip to content

Commit

Permalink
fix: close details after delete
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskari committed Aug 5, 2024
1 parent 91de837 commit 8217d15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 32 deletions.
15 changes: 1 addition & 14 deletions src/components/KymaModules/KymaModulesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,20 +261,7 @@ export default function KymaModulesList({
return kymaResourceModule.name === resource.name;
});
setChosenModuleIndex(index);
handleResourceDelete({
deleteFn: () => {
selectedModules.splice(index, 1);
setKymaResourceState({
...kymaResource,
spec: {
...kymaResource.spec,
modules: selectedModules,
},
});
handleModuleUninstall();
setInitialUnchangedResource(cloneDeep(kymaResourceState));
},
});
handleResourceDelete({});
},
},
];
Expand Down
24 changes: 6 additions & 18 deletions src/resources/other/kymaModules.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,24 +104,7 @@ const ColumnWraper = (defaultColumn = 'list') => {

const headerActions = (
<>
<Button
onClick={() =>
handleResourceDelete({
deleteFn: () => {
selectedModules.splice(openedModuleIndex, 1);
setKymaResourceState({
...kymaResource,
spec: {
...kymaResource.spec,
modules: selectedModules,
},
});
handleModuleUninstall();
},
})
}
design="Transparent"
>
<Button onClick={() => handleResourceDelete({})} design="Transparent">
{t('common.buttons.delete-module')}
</Button>
{createPortal(
Expand All @@ -138,6 +121,11 @@ const ColumnWraper = (defaultColumn = 'list') => {
});
handleModuleUninstall();
setInitialUnchangedResource(cloneDeep(kymaResourceState));
setLayoutColumn({
layout: 'OneColumn',
midColumn: null,
endColumn: null,
});
}}
/>,
document.body,
Expand Down

0 comments on commit 8217d15

Please sign in to comment.