Skip to content

Commit

Permalink
EPMRPP-91774 || Added plugin type in delete modal
Browse files Browse the repository at this point in the history
  • Loading branch information
maria-hambardzumian committed Jun 21, 2024
1 parent 39b0094 commit e7999d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,26 @@ import { ModalLayout } from 'componentLibrary/modal';
import { withModal } from 'components/main/modal';
import { hideModalAction } from 'controllers/modal';
import { useDispatch } from 'react-redux';
import { capitalizeWord } from '../addEditNotificationModal/util';

const messages = defineMessages({
title: {
id: 'DeleteNotificationCaseModal.title',
defaultMessage: 'Delete Notification Rule',
defaultMessage: 'Delete {pluginType} Notification Rule',
},
message: {
id: 'DeleteNotificationModal.message',
defaultMessage: 'Are you sure you want to delete this notification rule?',
},
});

const DeleteNotificationCaseModal = ({ data: { onSave } }) => {
const DeleteNotificationCaseModal = ({ data: { onSave, type } }) => {
const { formatMessage } = useIntl();
const dispatch = useDispatch();

return (
<ModalLayout
title={formatMessage(messages.title)}
title={formatMessage(messages.title, { pluginType: capitalizeWord(type) })}
okButton={{
text: formatMessage(COMMON_LOCALE_KEYS.DELETE),
danger: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ export const RuleGroup = ({ pluginName, ruleDescription, rules, isPluginEnabled,
id: 'deleteNotificationModal',
data: {
onSave: () => confirmDelete(notification.id),
type: pluginName,
},
}),
);
Expand Down

0 comments on commit e7999d7

Please sign in to comment.