Yuki Takei 1 год назад
Родитель
Сommit
50de38017c

+ 7 - 3
apps/app/src/server/service/global-notification/index.js

@@ -1,14 +1,18 @@
 import loggerFactory from '~/utils/logger';
 import loggerFactory from '~/utils/logger';
 
 
 const logger = loggerFactory('growi:service:GlobalNotificationService');
 const logger = loggerFactory('growi:service:GlobalNotificationService');
-const GloabalNotificationSlack = require('./global-notification-slack');
 const GloabalNotificationMail = require('./global-notification-mail');
 const GloabalNotificationMail = require('./global-notification-mail');
+const GloabalNotificationSlack = require('./global-notification-slack');
 
 
 /**
 /**
  * service class of GlobalNotificationSetting
  * service class of GlobalNotificationSetting
  */
  */
 class GlobalNotificationService {
 class GlobalNotificationService {
 
 
+  /** @type {import('~/server/crowi').default} Crowi instance */
+  crowi;
+
+  /** @param {import('~/server/crowi').default} crowi Crowi instance */
   constructor(crowi) {
   constructor(crowi) {
     this.crowi = crowi;
     this.crowi = crowi;
     this.defaultLang = 'en_US'; // TODO: get defaultLang from app global config
     this.defaultLang = 'en_US'; // TODO: get defaultLang from app global config
@@ -67,9 +71,9 @@ class GlobalNotificationService {
       case this.Page.GRANT_SPECIFIED:
       case this.Page.GRANT_SPECIFIED:
         return false;
         return false;
       case this.Page.GRANT_OWNER:
       case this.Page.GRANT_OWNER:
-        return (this.crowi.configManager.getConfig('notification:owner-page:isEnabled') || false);
+        return (this.crowi.configManager.getConfig('notification:owner-page:isEnabled'));
       case this.Page.GRANT_USER_GROUP:
       case this.Page.GRANT_USER_GROUP:
-        return (this.crowi.configManager.getConfig('notification:group-page:isEnabled') || false);
+        return (this.crowi.configManager.getConfig('notification:group-page:isEnabled'));
     }
     }
   }
   }
 
 

+ 5 - 4
apps/app/src/server/service/s2s-messaging/index.ts

@@ -1,6 +1,7 @@
+import type Crowi from '~/server/crowi';
 import loggerFactory from '~/utils/logger';
 import loggerFactory from '~/utils/logger';
 
 
-import { S2sMessagingService } from './base';
+import type { S2sMessagingService } from './base';
 
 
 const logger = loggerFactory('growi:service:s2s-messaging:S2sMessagingServiceFactory');
 const logger = loggerFactory('growi:service:s2s-messaging:S2sMessagingServiceFactory');
 
 
@@ -42,7 +43,7 @@ class S2sMessagingServiceFactory {
 
 
   delegator!: S2sMessagingService;
   delegator!: S2sMessagingService;
 
 
-  initializeDelegator(crowi) {
+  initializeDelegator(crowi: Crowi) {
     const type = crowi.configManager.getConfig('s2sMessagingPubsub:serverType');
     const type = crowi.configManager.getConfig('s2sMessagingPubsub:serverType');
 
 
     if (type == null) {
     if (type == null) {
@@ -63,7 +64,7 @@ class S2sMessagingServiceFactory {
     }
     }
   }
   }
 
 
-  getDelegator(crowi) {
+  getDelegator(crowi: Crowi) {
     if (this.delegator == null) {
     if (this.delegator == null) {
       this.initializeDelegator(crowi);
       this.initializeDelegator(crowi);
     }
     }
@@ -74,6 +75,6 @@ class S2sMessagingServiceFactory {
 
 
 const factory = new S2sMessagingServiceFactory();
 const factory = new S2sMessagingServiceFactory();
 
 
-module.exports = (crowi) => {
+module.exports = (crowi: Crowi) => {
   return factory.getDelegator(crowi);
   return factory.getDelegator(crowi);
 };
 };

+ 0 - 2
apps/app/src/server/service/search-delegator/elasticsearch.ts

@@ -53,8 +53,6 @@ class ElasticsearchDelegator implements SearchDelegator<Data, ESTermsKey, ESQuer
 
 
   name!: SearchDelegatorName.DEFAULT;
   name!: SearchDelegatorName.DEFAULT;
 
 
-  configManager!: any;
-
   socketIoService!: any;
   socketIoService!: any;
 
 
   isElasticsearchV7: boolean;
   isElasticsearchV7: boolean;