crowi-slack-notification.js 698 B

12345678910111213141516171819202122232425
  1. const logger = require('@alias/logger')('growi:service:CrowiSlackNotification'); // eslint-disable-line no-unused-vars
  2. /**
  3. * the service class of GlobalNotificationSetting
  4. */
  5. class CrowiSlackNotificationService {
  6. constructor(crowi) {
  7. this.crowi = crowi;
  8. }
  9. hasSlackConfig() {
  10. let hasSlackToken = false;
  11. let hasSlackIwhUrl = false;
  12. if (this.configObject.notification) {
  13. hasSlackToken = !!this.crowi.configManager.getConfig('notification', 'slack:token');
  14. hasSlackIwhUrl = !!this.crowi.configManager.getConfig('notification', 'slack:incomingWebhookUrl');
  15. }
  16. return hasSlackToken || hasSlackIwhUrl;
  17. }
  18. }
  19. module.exports = CrowiSlackNotificationService;