|
@@ -4,8 +4,6 @@ import { Activity } from '../models/activity';
|
|
|
|
|
|
|
|
import ActivityDefine from '../util/activityDefine';
|
|
import ActivityDefine from '../util/activityDefine';
|
|
|
|
|
|
|
|
-// const InAppNotificationService = require('./in-app-notification');
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
const logger = loggerFactory('growi:service:ActivityService');
|
|
const logger = loggerFactory('growi:service:ActivityService');
|
|
|
|
|
|
|
@@ -20,49 +18,8 @@ class ActivityService {
|
|
|
constructor(crowi) {
|
|
constructor(crowi) {
|
|
|
this.crowi = crowi;
|
|
this.crowi = crowi;
|
|
|
this.inAppNotificationService = crowi.inAppNotificationService;
|
|
this.inAppNotificationService = crowi.inAppNotificationService;
|
|
|
- // this.commentEvent = crowi.event('comment');
|
|
|
|
|
-
|
|
|
|
|
- // // init
|
|
|
|
|
- // this.initCommentEvent();
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // initCommentEvent(): void {
|
|
|
|
|
- // // create
|
|
|
|
|
- // this.commentEvent.on('create', async(savedComment) => {
|
|
|
|
|
- // this.commentEvent.onCreate();
|
|
|
|
|
-
|
|
|
|
|
- // try {
|
|
|
|
|
- // const activityLog = await Activity.createByPageComment(savedComment);
|
|
|
|
|
- // logger.info('Activity created', activityLog);
|
|
|
|
|
- // }
|
|
|
|
|
- // catch (err) {
|
|
|
|
|
- // throw err;
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
- // });
|
|
|
|
|
-
|
|
|
|
|
- // // update
|
|
|
|
|
- // this.commentEvent.on('update', (user) => {
|
|
|
|
|
- // this.commentEvent.onUpdate();
|
|
|
|
|
- // const inAppNotificationService = new InAppNotificationService(this.crowi);
|
|
|
|
|
-
|
|
|
|
|
- // inAppNotificationService.emitSocketIo(user);
|
|
|
|
|
- // });
|
|
|
|
|
-
|
|
|
|
|
- // // remove
|
|
|
|
|
- // this.commentEvent.on('remove', async(comment) => {
|
|
|
|
|
- // this.commentEvent.onRemove();
|
|
|
|
|
-
|
|
|
|
|
- // try {
|
|
|
|
|
- // // TODO: Able to remove child activities of comment by GW-7510
|
|
|
|
|
- // await this.removeByPageCommentDelete(comment);
|
|
|
|
|
- // }
|
|
|
|
|
- // catch (err) {
|
|
|
|
|
- // logger.error(err);
|
|
|
|
|
- // }
|
|
|
|
|
- // });
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* @param {Comment} comment
|
|
* @param {Comment} comment
|
|
|
* @return {Promise}
|
|
* @return {Promise}
|