From fca85cdfe7c84ed97e635a9c0b8eda0b4283f79c Mon Sep 17 00:00:00 2001 From: Sachin Chaurasiya Date: Thu, 21 Nov 2024 16:35:57 +0530 Subject: [PATCH] minor: improve rule card actions dropdown (#18717) --- .../PoliciesDetailPage/PoliciesDetailPage.tsx | 91 +++++++++---------- 1 file changed, 41 insertions(+), 50 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/PoliciesPage/PoliciesDetailPage/PoliciesDetailPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/PoliciesPage/PoliciesDetailPage/PoliciesDetailPage.tsx index ee850793330a..cab22454dfed 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/PoliciesPage/PoliciesDetailPage/PoliciesDetailPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/PoliciesPage/PoliciesDetailPage/PoliciesDetailPage.tsx @@ -18,7 +18,6 @@ import { Card, Col, Dropdown, - Menu, Modal, Row, Space, @@ -236,55 +235,47 @@ const PoliciesDetailPage = () => { (rule: Rule) => { return ( { - e.stopPropagation(); - history.push( - getEditPolicyRulePath(fqn, rule.name || '') - ); - }}> - - - {t('label.edit')} - - - ), - key: 'edit-button', - }, - { - label: ( - - ), - key: 'delete-button', - }, - ]} - /> - } + menu={{ + items: [ + { + label: ( + + + + {t('label.edit')} + + ), + key: 'edit-button', + }, + { + label: ( + + + + {t('label.delete')} + + ), + key: 'delete-button', + }, + ], + onClick: (menuInfo) => { + if (menuInfo.key === 'edit-button') { + history.push(getEditPolicyRulePath(fqn, rule.name || '')); + } else if (menuInfo.key === 'delete-button') { + handleRuleDelete(rule); + } else { + return; + } + }, + }} placement="bottomRight" trigger={['click']}>