Shun Miyazawa 4 лет назад
Родитель
Сommit
112ca3d1f1

+ 2 - 1
packages/app/resource/locales/en_US/translation.json

@@ -263,7 +263,8 @@
     "no_notification": "You don't have any notificatios.",
     "all": "All",
     "unopend": "Unread",
-    "mark_all_as_read": "Mark all as read"
+    "mark_all_as_read": "Mark all as read",
+    "page_not_exist": "This page does not exist"
   },
   "in_app_notification_settings": {
     "in_app_notification_settings": "In-App Notification Settings",

+ 2 - 1
packages/app/resource/locales/ja_JP/translation.json

@@ -265,7 +265,8 @@
     "no_notification": "通知はありません",
     "all": "全て",
     "unopend": "未読",
-    "mark_all_as_read": "全て既読にする"
+    "mark_all_as_read": "全て既読にする",
+    "page_not_exist": "ページが存在しません"
   },
   "in_app_notification_settings": {
     "in_app_notification_settings": "アプリ内通知設定",

+ 2 - 1
packages/app/resource/locales/zh_CN/translation.json

@@ -244,7 +244,8 @@
     "no_notification": "您没有任何通知",
     "all": "全部",
     "unopend": "未读",
-    "mark_all_as_read" : "标记为已读"
+    "mark_all_as_read" : "标记为已读",
+    "page_not_exist": "该页面不存在"
   },
   "in_app_notification_settings": {
     "in_app_notification_settings": "在应用程序通知设置",

+ 7 - 0
packages/app/src/components/InAppNotification/PageNotification/PageModelNotification.tsx

@@ -1,10 +1,12 @@
 import React, { FC, useCallback } from 'react';
 import { PagePathLabel } from '@growi/ui';
+import { useTranslation } from 'react-i18next';
 import { apiv3Post } from '~/client/util/apiv3-client';
 import { parseSnapshot } 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 { toastWarning } from '~/client/util/apiNotification';
 
 interface Props {
   notification: IInAppNotification & HasObjectId
@@ -14,6 +16,8 @@ interface Props {
 }
 
 const PageModelNotification: FC<Props> = (props: Props) => {
+  const { t } = useTranslation();
+
   const {
     notification, actionMsg, actionIcon, actionUsers,
   } = props;
@@ -30,6 +34,9 @@ const PageModelNotification: FC<Props> = (props: Props) => {
     if (targetPagePath != null) {
       window.location.href = targetPagePath;
     }
+    else {
+      toastWarning(t('in_app_notification.page_not_exist'));
+    }
   }, []);
 
   return (