Shun Miyazawa 4 years ago
parent
commit
00927b153a

+ 1 - 1
packages/app/src/components/InAppNotification/InAppNotificationElm.tsx

@@ -5,7 +5,7 @@ import { IInAppNotification } from '~/interfaces/in-app-notification';
 import { HasObjectId } from '~/interfaces/has-object-id';
 
 // Change the display for each targetmodel
-import PageModelNotification from './TargetModel/Page/PageModelNotification';
+import PageModelNotification from './PageNotification/PageModelNotification';
 
 interface Props {
   notification: IInAppNotification & HasObjectId

+ 2 - 2
packages/app/src/components/InAppNotification/TargetModel/Page/PageModelNotification.tsx → packages/app/src/components/InAppNotification/PageNotification/PageModelNotification.tsx

@@ -1,10 +1,10 @@
 import React, { FC, useCallback } from 'react';
 import { PagePathLabel } from '@growi/ui';
 import { apiv3Post } from '~/client/util/apiv3-client';
-import { getSnapshotPagePath } from './snapshot';
+import { getSnapshotPagePath } from '../../../models/serializers/in-app-notification-snapshot/page';
 import { IInAppNotification } from '~/interfaces/in-app-notification';
 import { HasObjectId } from '~/interfaces/has-object-id';
-import FormattedDistanceDate from '../../../FormattedDistanceDate';
+import FormattedDistanceDate from '../../FormattedDistanceDate';
 
 interface Props {
   notification: IInAppNotification & HasObjectId

+ 7 - 2
packages/app/src/components/InAppNotification/TargetModel/Page/snapshot.ts → packages/app/src/models/serializers/in-app-notification-snapshot/page.ts

@@ -1,6 +1,11 @@
-import { IPage } from '~/interfaces/page';
+import { IUser } from '~/interfaces/user';
 
-export const stringifyPageModel = (page: IPage): string => {
+export interface IPageSnapshot {
+  path: string
+  creator: IUser
+}
+
+export const stringifyPageModel = (page: IPageSnapshot): string => {
   return JSON.stringify({
     path: page.path,
     creator: page.creator,

+ 1 - 1
packages/app/src/server/service/comment.ts

@@ -4,7 +4,7 @@ import loggerFactory from '../../utils/logger';
 import ActivityDefine from '../util/activityDefine';
 import Crowi from '../crowi';
 
-import { stringifyPageModel } from '../../components/InAppNotification/TargetModel/Page/snapshot';
+import { stringifyPageModel } from '~/models/serializers/in-app-notification-snapshot/page';
 
 const logger = loggerFactory('growi:service:CommentService');
 

+ 1 - 1
packages/app/src/server/service/page.js

@@ -2,7 +2,7 @@ import { pagePathUtils } from '@growi/core';
 import loggerFactory from '~/utils/logger';
 import ActivityDefine from '../util/activityDefine';
 
-import { stringifyPageModel } from '../../components/InAppNotification/TargetModel/Page/snapshot';
+import { stringifyPageModel } from '~/models/serializers/in-app-notification-snapshot/page';
 
 const mongoose = require('mongoose');
 const escapeStringRegexp = require('escape-string-regexp');