Просмотр исходного кода

show if download expired when action is ACTION_PAGE_BULK_EXPORT_COMPLETED

Futa Arai 1 год назад
Родитель
Сommit
1cd6027637

+ 2 - 2
apps/app/src/components/InAppNotification/ModelNotification/ModelNotification.tsx

@@ -5,7 +5,7 @@ import type { HasObjectId } from '@growi/core';
 import { PagePathLabel } from '@growi/ui/dist/components';
 import { useTranslation } from 'react-i18next';
 
-import { SupportedTargetModel } from '~/interfaces/activity';
+import { SupportedAction, SupportedTargetModel } from '~/interfaces/activity';
 import type { IInAppNotification } from '~/interfaces/in-app-notification';
 
 import FormattedDistanceDate from '../../FormattedDistanceDate';
@@ -31,7 +31,7 @@ export const ModelNotification: FC<Props> = (props) => {
         {` ${actionMsg}`}
         <PagePathLabel path={notification.parsedSnapshot?.path ?? ''} />
       </div>
-      { (notification.targetModel === SupportedTargetModel.MODEL_PAGE_BULK_EXPORT_JOB && notification.target == null)
+      { (notification.action === SupportedAction.ACTION_PAGE_BULK_EXPORT_COMPLETED && notification.target == null)
         ? <div className="text-danger"><small>{t('page_export.bulk_export_download_expired')}</small></div> : <></> }
       <span className="material-symbols-outlined me-2">{actionIcon}</span>
       <FormattedDistanceDate

+ 3 - 2
apps/app/src/components/InAppNotification/ModelNotification/PageBulkExportJobModelNotification.tsx

@@ -3,7 +3,7 @@ import React from 'react';
 import { isPopulated, type HasObjectId } from '@growi/core';
 
 import type { IPageBulkExportJobHasId } from '~/features/page-bulk-export/interfaces/page-bulk-export';
-import { SupportedTargetModel } from '~/interfaces/activity';
+import { SupportedAction, SupportedTargetModel } from '~/interfaces/activity';
 import type { IInAppNotification } from '~/interfaces/in-app-notification';
 import * as pageBulkExportJobSerializers from '~/models/serializers/in-app-notification-snapshot/page-bulk-export-job';
 
@@ -42,7 +42,8 @@ export const usePageBulkExportJobModelNotification = (notification: IInAppNotifi
     );
   };
 
-  const clickLink = notification.target?.attachment != null && isPopulated(notification.target?.attachment)
+  const clickLink = (notification.action === SupportedAction.ACTION_PAGE_BULK_EXPORT_COMPLETED
+    && notification.target?.attachment != null && isPopulated(notification.target?.attachment))
     ? notification.target.attachment.downloadPathProxied : undefined;
 
   return {