itizawa 6 anos atrás
pai
commit
a3771ad1cb

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

@@ -43,9 +43,9 @@ class GlobalNotification extends React.Component {
         {/* TODO GW-1279 i18n */}
         <h2 className="border-bottom mb-5">通知が有効になるページ</h2>
 
-        {/* TODO GW-1279 add checkbox for display isNotificationOwnerPageEnabled */}
+        {/* TODO GW-1279 add checkbox for display isNotificationForOwnerPageEnabled */}
 
-        {/* TODO GW-1279 add checkbox for display isNotificationGroupPageEnabled */}
+        {/* TODO GW-1279 add checkbox for display isNotificationForGroupPageEnabled */}
 
         <div className="row my-3">
           <div className="col-xs-offset-4 col-xs-5">

+ 10 - 10
src/client/js/services/AdminNotificationContainer.js

@@ -24,8 +24,8 @@ export default class AdminNotificationContainer extends Container {
       isIncomingWebhookPrioritized: false,
       slackToken: '',
       userNotifications: [],
-      isNotificationOwnerPageEnabled: false,
-      isNotificationGroupPageEnabled: false,
+      isNotificationForOwnerPageEnabled: false,
+      isNotificationForGroupPageEnabled: false,
       globalNotifications: [],
     };
 
@@ -51,8 +51,8 @@ export default class AdminNotificationContainer extends Container {
         isIncomingWebhookPrioritized: notificationParams.isIncomingWebhookPrioritized,
         slackToken: notificationParams.slackToken,
         userNotifications: notificationParams.userNotifications,
-        isNotificationOwnerPageEnabled: notificationParams.isNotificationOwnerPageEnabled,
-        isNotificationGroupPageEnabled: notificationParams.isNotificationGroupPageEnabled,
+        isNotificationForOwnerPageEnabled: notificationParams.isNotificationForOwnerPageEnabled,
+        isNotificationForGroupPageEnabled: notificationParams.isNotificationForGroupPageEnabled,
         globalNotifications: notificationParams.globalNotifications,
       });
 
@@ -129,17 +129,17 @@ export default class AdminNotificationContainer extends Container {
   }
 
   /**
-   * Switch isNotificationOwnerPageEnabled
+   * Switch isNotificationForOwnerPageEnabled
    */
   switchIsNotificationOwnerPageEnabled() {
-    this.setState({ isNotificationOwnerPageEnabled: !this.state.isNotificationOwnerPageEnabled });
+    this.setState({ isNotificationForOwnerPageEnabled: !this.state.isNotificationForOwnerPageEnabled });
   }
 
   /**
-   * Switch isNotificationGroupPageEnabled
+   * Switch isNotificationForGroupPageEnabled
    */
   switchIsNotificationGroupPageEnabled() {
-    this.setState({ isNotificationGroupPageEnabled: !this.state.isNotificationGroupPageEnabled });
+    this.setState({ isNotificationForGroupPageEnabled: !this.state.isNotificationForGroupPageEnabled });
   }
 
   /**
@@ -148,8 +148,8 @@ export default class AdminNotificationContainer extends Container {
    */
   async updateGlobalNotificationForPages() {
     const response = await this.appContainer.apiv3.put('/notification-setting/notify-for-page-grant/', {
-      isNotificationOwnerPageEnabled: this.state.isNotificationOwnerPageEnabled,
-      isNotificationGroupPageEnabled: this.state.isNotificationGroupPageEnabled,
+      isNotificationForOwnerPageEnabled: this.state.isNotificationForOwnerPageEnabled,
+      isNotificationForGroupPageEnabled: this.state.isNotificationForGroupPageEnabled,
     });
 
     return response;

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

@@ -33,8 +33,8 @@ const validator = {
     }),
   ],
   notifyForPageGrant: [
-    body('isNotificationOwnerPageEnabled').isBoolean(),
-    body('isNotificationGroupPageEnabled').isBoolean(),
+    body('isNotificationForOwnerPageEnabled').isBoolean(),
+    body('isNotificationForGroupPageEnabled').isBoolean(),
   ],
 };
 
@@ -73,10 +73,10 @@ const validator = {
  *      NotifyForPageGrant:
  *        type: object
  *        properties:
- *          isNotificationOwnerPageEnabled:
+ *          isNotificationForOwnerPageEnabled:
  *            type: string
  *            description: Whether to notify on owner page
- *          isNotificationGroupPageEnabled:
+ *          isNotificationForGroupPageEnabled:
  *            type: string
  *            description: Whether to notify on group page
  *      GlobalNotificationParams:
@@ -138,8 +138,8 @@ module.exports = (crowi) => {
       isIncomingWebhookPrioritized: await crowi.configManager.getConfig('notification', 'slack:isIncomingWebhookPrioritized'),
       slackToken: await crowi.configManager.getConfig('notification', 'slack:token'),
       userNotifications: await UpdatePost.findAll(),
-      isNotificationOwnerPageEnabled: await crowi.configManager.getConfig('notification', 'notification:owner-page:isEnabled'),
-      isNotificationGroupPageEnabled: await crowi.configManager.getConfig('notification', 'notification:group-page:isEnabled'),
+      isNotificationForOwnerPageEnabled: await crowi.configManager.getConfig('notification', 'notification:owner-page:isEnabled'),
+      isNotificationForGroupPageEnabled: await crowi.configManager.getConfig('notification', 'notification:group-page:isEnabled'),
       globalNotifications: await GlobalNotificationSetting.findAll(),
     };
     return res.apiv3({ notificationParams });
@@ -441,14 +441,14 @@ module.exports = (crowi) => {
   router.put('/notify-for-page-grant', loginRequiredStrictly, adminRequired, csrf, validator.notifyForPageGrant, ApiV3FormValidator, async(req, res) => {
 
     const requestParams = {
-      'notification:owner-page:isEnabled': req.body.isNotificationOwnerPageEnabled,
-      'notification:group-page:isEnabled': req.body.isNotificationGroupPageEnabled,
+      'notification:owner-page:isEnabled': req.body.isNotificationForOwnerPageEnabled,
+      'notification:group-page:isEnabled': req.body.isNotificationForGroupPageEnabled,
     };
     try {
       await crowi.configManager.updateConfigsInTheSameNamespace('notification', requestParams);
       const responseParams = {
-        isNotificationOwnerPageEnabled: await crowi.configManager.getConfig('notification', 'notification:owner-page:isEnabled'),
-        isNotificationGroupPageEnabled: await crowi.configManager.getConfig('notification', 'notification:group-page:isEnabled'),
+        isNotificationForOwnerPageEnabled: await crowi.configManager.getConfig('notification', 'notification:owner-page:isEnabled'),
+        isNotificationForGroupPageEnabled: await crowi.configManager.getConfig('notification', 'notification:group-page:isEnabled'),
       };
       return res.apiv3({ responseParams });
     }