|
|
@@ -76,21 +76,20 @@ const commentMailNotify = (notifications, comment, path) => {
|
|
|
|
|
|
/**
|
|
|
* the service class of GlobalNotificationSetting
|
|
|
- * @static
|
|
|
*/
|
|
|
class GlobalNotification {
|
|
|
|
|
|
constructor(crowi) {
|
|
|
+ this.crowi = crowi;
|
|
|
this.config = crowi.getConfig();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* send notification at page creation
|
|
|
- * @static
|
|
|
* @memberof GlobalNotification
|
|
|
* @param {obejct} page
|
|
|
*/
|
|
|
- static sendPageCreateNotification(page) {
|
|
|
+ sendPageCreateNotification(page) {
|
|
|
const notifications = Notification.findSettingByPathAndEvent(page.path, 'pageCreate');
|
|
|
pageCreateMailNotify(notifications, page);
|
|
|
// slackNotify(notifications, page);
|
|
|
@@ -98,11 +97,10 @@ class GlobalNotification {
|
|
|
|
|
|
/**
|
|
|
* send notification at page edit
|
|
|
- * @static
|
|
|
* @memberof GlobalNotification
|
|
|
* @param {obejct} page
|
|
|
*/
|
|
|
- static sendPageEditNotification(page) {
|
|
|
+ sendPageEditNotification(page) {
|
|
|
const notifications = Notification.findSettingByPathAndEvent(page.path, 'pageEdit');
|
|
|
pageEditMailNotify(notifications, page);
|
|
|
// slackNotify(notifications, page);
|
|
|
@@ -110,11 +108,10 @@ class GlobalNotification {
|
|
|
|
|
|
/**
|
|
|
* send notification at page deletion
|
|
|
- * @static
|
|
|
* @memberof GlobalNotification
|
|
|
* @param {obejct} page
|
|
|
*/
|
|
|
- static sendPageDeleteNotification(page) {
|
|
|
+ sendPageDeleteNotification(page) {
|
|
|
const notifications = Notification.findSettingByPathAndEvent(page.path, 'pageDelete');
|
|
|
pageDeleteMailNotify(notifications, page);
|
|
|
// slackNotify(notifications, page);
|
|
|
@@ -122,11 +119,10 @@ class GlobalNotification {
|
|
|
|
|
|
/**
|
|
|
* send notification at page move
|
|
|
- * @static
|
|
|
* @memberof GlobalNotification
|
|
|
* @param {obejct} page
|
|
|
*/
|
|
|
- static sendPageMoveNotification(page) {
|
|
|
+ sendPageMoveNotification(page) {
|
|
|
const notifications = Notification.findSettingByPathAndEvent(page.path, 'pageMove');
|
|
|
pageMoveMailNotify(notifications, page);
|
|
|
// slackNotify(notifications, page);
|
|
|
@@ -134,11 +130,10 @@ class GlobalNotification {
|
|
|
|
|
|
/**
|
|
|
* send notification at page like
|
|
|
- * @static
|
|
|
* @memberof GlobalNotification
|
|
|
* @param {obejct} page
|
|
|
*/
|
|
|
- static sendPageLikeNotification(page) {
|
|
|
+ sendPageLikeNotification(page) {
|
|
|
const notifications = Notification.findSettingByPathAndEvent(page.path, 'pageLike');
|
|
|
pageLikeMailNotify(notifications, page);
|
|
|
// slackNotify(notifications, page);
|
|
|
@@ -146,12 +141,11 @@ class GlobalNotification {
|
|
|
|
|
|
/**
|
|
|
* send notification at page comment
|
|
|
- * @static
|
|
|
* @memberof GlobalNotification
|
|
|
* @param {obejct} page
|
|
|
* @param {obejct} comment
|
|
|
*/
|
|
|
- static sendCommentNotification(comment, path) {
|
|
|
+ sendCommentNotification(comment, path) {
|
|
|
const notifications = Notification.findSettingByPathAndEvent(path, 'comment');
|
|
|
commentMailNotify(notifications, comment, path);
|
|
|
// slackNotify(notifications, comment, path);
|