Shun Miyazawa 3 лет назад
Родитель
Сommit
af80b1b559

+ 3 - 4
packages/app/src/components/Admin/AuditLogManagement.tsx

@@ -3,7 +3,7 @@ import React, { FC, useState, useCallback } from 'react';
 import { useTranslation } from 'react-i18next';
 
 import {
-  SupportedActionType, AllSupportedPageAction, AllSupportedCommentAction, AllSupportedActionType,
+  SupportedActionType, AllSupportedActionType, PageActions, CommentActions,
 } from '~/interfaces/activity';
 import { useSWRxActivityList } from '~/stores/activity';
 
@@ -12,7 +12,6 @@ import PaginationWrapper from '../PaginationWrapper';
 import { ActivityTable } from './AuditLog/ActivityTable';
 import { SelectActionDropdown } from './AuditLog/SelectActionDropdown';
 
-
 const PAGING_LIMIT = 10;
 
 export const AuditLogManagement: FC = () => {
@@ -63,8 +62,8 @@ export const AuditLogManagement: FC = () => {
 
       <SelectActionDropdown
         dropdownItems={[
-          { actionCategory: 'Page', actionNames: AllSupportedPageAction },
-          { actionCategory: 'Comment', actionNames: AllSupportedCommentAction },
+          { actionCategory: 'Page', actionNames: PageActions },
+          { actionCategory: 'Comment', actionNames: CommentActions },
         ]}
         actionMap={actionMap}
         onSelectAction={selectActionCheckboxChangedHandler}

+ 7 - 2
packages/app/src/interfaces/activity.ts

@@ -47,7 +47,11 @@ export const AllSupportedTargetModelType = Object.values(SUPPORTED_TARGET_MODEL_
 export const AllSupportedEventModelType = Object.values(SUPPORTED_EVENT_MODEL_TYPE);
 export const AllSupportedActionType = Object.values(SUPPORTED_ACTION_TYPE);
 
-export const AllSupportedPageAction = Object.values({
+
+/*
+ * For AuditLogManagement.tsx
+ */
+export const PageActions = Object.values({
   ACTION_PAGE_LIKE,
   ACTION_PAGE_BOOKMARK,
   ACTION_PAGE_CREATE,
@@ -59,11 +63,12 @@ export const AllSupportedPageAction = Object.values({
   ACTION_PAGE_REVERT,
 } as const);
 
-export const AllSupportedCommentAction = Object.values({
+export const CommentActions = Object.values({
   ACTION_COMMENT_CREATE,
   ACTION_COMMENT_UPDATE,
 } as const);
 
+
 export type SupportedTargetModelType = typeof SUPPORTED_TARGET_MODEL_TYPE[keyof typeof SUPPORTED_TARGET_MODEL_TYPE];
 // type supportedEventModelType = typeof SUPPORTED_EVENT_MODEL_TYPE[keyof typeof SUPPORTED_EVENT_MODEL_TYPE];
 export type SupportedActionType = typeof SUPPORTED_ACTION_TYPE[keyof typeof SUPPORTED_ACTION_TYPE];