|
|
@@ -27,6 +27,7 @@ class UserTriggerNotification extends React.Component {
|
|
|
this.changeChannel = this.changeChannel.bind(this);
|
|
|
this.validateForm = this.validateForm.bind(this);
|
|
|
this.onClickSubmit = this.onClickSubmit.bind(this);
|
|
|
+ this.onClickDeleteBtn = this.onClickDeleteBtn.bind(this);
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -62,6 +63,19 @@ class UserTriggerNotification extends React.Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ async onClickDeleteBtn(notificationIdForDelete) {
|
|
|
+ const { t, adminNotificationContainer } = this.props;
|
|
|
+
|
|
|
+ try {
|
|
|
+ const deletedNotificaton = await adminNotificationContainer.deleteUserTriggerNotificationPattern(notificationIdForDelete);
|
|
|
+ toastSuccess(t('notification_setting.delete_notification_pattern', { path: deletedNotificaton.pathPattern }));
|
|
|
+ }
|
|
|
+ catch (err) {
|
|
|
+ toastError(err);
|
|
|
+ logger.error(err);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// TODO GW-788 i18n
|
|
|
render() {
|
|
|
const { t, adminNotificationContainer } = this.props;
|
|
|
@@ -111,7 +125,7 @@ class UserTriggerNotification extends React.Component {
|
|
|
</td>
|
|
|
</tr>
|
|
|
{adminNotificationContainer.state.userNotifications.map((notification) => {
|
|
|
- return <UserNotificationRow notification={notification} />;
|
|
|
+ return <UserNotificationRow notification={notification} onClickDeleteBtn={this.onClickDeleteBtn} />;
|
|
|
})
|
|
|
}
|
|
|
</tbody>
|