itizawa 6 лет назад
Родитель
Сommit
97faff4655

+ 9 - 9
src/client/js/components/Admin/Notification/GrobalNotification.jsx → src/client/js/components/Admin/Notification/GlobalNotification.jsx

@@ -9,13 +9,13 @@ import AppContainer from '../../../services/AppContainer';
 import AdminNotificationContainer from '../../../services/AdminNotificationContainer';
 
 
-class GrobalNotification extends React.Component {
+class GlobalNotification extends React.Component {
 
   renderNotification() {
     const { t, adminNotificationContainer } = this.props;
-    const { grobalNotifications } = adminNotificationContainer.state;
+    const { globalNotifications } = adminNotificationContainer.state;
 
-    grobalNotifications.map((notification) => {
+    globalNotifications.map((notification) => {
       return (
         <tr>
           <td className="align-middle td-abs-center">
@@ -97,7 +97,7 @@ class GrobalNotification extends React.Component {
 
   render() {
     const { t, adminNotificationContainer } = this.props;
-    const { grobalNotifications } = adminNotificationContainer.state;
+    const { globalNotifications } = adminNotificationContainer.state;
     return (
       <React.Fragment>
 
@@ -118,7 +118,7 @@ class GrobalNotification extends React.Component {
               <th></th>
             </tr>
           </thead>
-          {grobalNotifications.length !== 0 && (
+          {globalNotifications.length !== 0 && (
             <tbody className="admin-notif-list">
               {this.renderNotification()}
             </tbody>
@@ -131,15 +131,15 @@ class GrobalNotification extends React.Component {
 
 }
 
-const GrobalNotificationWrapper = (props) => {
-  return createSubscribedElement(GrobalNotification, props, [AppContainer, AdminNotificationContainer]);
+const GlobalNotificationWrapper = (props) => {
+  return createSubscribedElement(GlobalNotification, props, [AppContainer, AdminNotificationContainer]);
 };
 
-GrobalNotification.propTypes = {
+GlobalNotification.propTypes = {
   t: PropTypes.func.isRequired, // i18next
   appContainer: PropTypes.instanceOf(AppContainer).isRequired,
   adminNotificationContainer: PropTypes.instanceOf(AdminNotificationContainer).isRequired,
 
 };
 
-export default withTranslation()(GrobalNotificationWrapper);
+export default withTranslation()(GlobalNotificationWrapper);

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

@@ -12,7 +12,7 @@ import AdminNotificationContainer from '../../../services/AdminNotificationConta
 
 import SlackAppConfiguration from './SlackAppConfiguration';
 import UserTriggerNotification from './UserTriggerNotification';
-import GrobalNotification from './GrobalNotification';
+import GlobalNotification from './GlobalNotification';
 
 const logger = loggerFactory('growi:NotificationSetting');
 
@@ -56,7 +56,7 @@ class NotificationSetting extends React.Component {
               <UserTriggerNotification />
             </div>
             <div id="global-notification" className="tab-pane" role="tabpanel">
-              <GrobalNotification />
+              <GlobalNotification />
             </div>
           </div>
         </div>

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

@@ -24,7 +24,7 @@ export default class AdminNotificationContainer extends Container {
       isIncomingWebhookPrioritized: false,
       slackToken: '',
       userNotifications: [],
-      grobalNotifications: [],
+      globalNotifications: [],
     };
 
   }

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

@@ -61,6 +61,9 @@ module.exports = (crowi) => {
   const adminRequired = require('../../middleware/admin-required')(crowi);
   const csrf = require('../../middleware/csrf')(crowi);
 
+  const UpdatePost = crowi.model('UpdatePost');
+  const GlobalNotificationSetting = crowi.model('GlobalNotificationSetting');
+
   const { ApiV3FormValidator } = crowi.middlewares;
 
   /**
@@ -82,8 +85,6 @@ module.exports = (crowi) => {
    *                      description: notification params
    */
   router.get('/', loginRequiredStrictly, adminRequired, async(req, res) => {
-    const UpdatePost = crowi.model('UpdatePost');
-    const GlobalNotificationSetting = crowi.model('GlobalNotificationSetting');
 
     const notificationParams = {
       webhookUrl: await crowi.configManager.getConfig('notification', 'slack:incomingWebhookUrl'),