delete popup added for entity delete action

Signed-off-by: AmbrishRamachandiran <ambrish.r@infosys.com>
This commit is contained in:
AmbrishRamachandiran
2023-08-22 16:19:03 +05:30
parent 7029ba1ce0
commit 6f691871c5
@@ -85,15 +85,14 @@ const Contents = ({
setBusy(true);
try {
await state.deleteEntity();
const entityArray = [entity].flat();
const entityNames = entityArray.map(
item => item.metadata.title ?? item.metadata.name,
);
const entityNames = [entity]
.flat()
.map(item => item.metadata.title ?? item.metadata.name);
onConfirm();
const message =
entityNames.length === 1
? `Removed entity '${entityNames[0]}'`
: `Removed entities: '${entityNames.join("', '")}'`;
? `Removed entity ${entityNames[0]}`
: `Removed entities: ${entityNames.join("', '")}`;
alertApi.post({
message,