itizawa il y a 6 ans
Parent
commit
5458cb96b4

+ 1 - 1
resource/locales/en-US/translation.json

@@ -612,7 +612,7 @@
     },
     "updated_slackApp": "Succeeded to update Slack App Configuration setting",
     "add_notification_pattern": "Add user trigger notification patterns",
-    "delete_notification_pattern": "Delete notification pattern",
+    "delete_notification_pattern": "Delete {{path}}",
     "delete_notification_pattern_desc": "Once deleted, it cannot be recovered"
   },
   "customize_page": {

+ 2 - 2
resource/locales/ja/translation.json

@@ -595,8 +595,8 @@
     },
     "updated_slackApp": "SlackApp設定を更新しました",
     "add_notification_pattern": "通知パターンを追加しました。",
-    "delete_notification_pattern": "通知パターンを削除しました。",
-    "delete_notification_pattern_desc": "Once deleted, it cannot be recovered"
+    "delete_notification_pattern": "{{path}} を削除しました。",
+    "delete_notification_pattern_desc": "一度消すと復元できません"
   },
   "customize_page": {
     "recommended": "おすすめ",

+ 2 - 2
src/client/js/components/Admin/Notification/GlobalNotificationList.jsx

@@ -40,8 +40,8 @@ class GlobalNotificationList extends React.Component {
     const { t, adminNotificationContainer } = this.props;
 
     try {
-      await adminNotificationContainer.deleteGlobalNotificationPattern(this.state.notificatiionIdForConfiguration);
-      toastSuccess(t('notification_setting.delete_notification_pattern'));
+      const deletedNotificaton = await adminNotificationContainer.deleteGlobalNotificationPattern(this.state.notificatiionIdForConfiguration);
+      toastSuccess(t('notification_setting.delete_notification_pattern', { path: deletedNotificaton.triggerPath }));
     }
     catch (err) {
       toastError(err);

+ 4 - 2
src/client/js/services/AdminNotificationContainer.js

@@ -118,8 +118,10 @@ export default class AdminNotificationContainer extends Container {
    * Delete global notification pattern
    */
   async deleteGlobalNotificationPattern(notificatiionId) {
-    await this.appContainer.apiv3.delete(`/notification-setting/global-notification/${notificatiionId}`);
-    return this.retrieveNotificationData();
+    const response = await this.appContainer.apiv3.delete(`/notification-setting/global-notification/${notificatiionId}`);
+    const deletedNotificaton = response.data;
+    await this.retrieveNotificationData();
+    return deletedNotificaton;
   }
 
 }

+ 2 - 2
src/server/routes/apiv3/notification-setting.js

@@ -195,8 +195,8 @@ module.exports = (crowi) => {
     const { id } = req.params;
 
     try {
-      await GlobalNotificationSetting.findOneAndRemove({ _id: id });
-      return res.apiv3({});
+      const deletedNotificaton = await GlobalNotificationSetting.findOneAndRemove({ _id: id });
+      return res.apiv3(deletedNotificaton);
     }
     catch (err) {
       const msg = 'Error occurred in delete global notification';