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

+ 18 - 1
packages/app/src/components/Admin/AuditLog/SelectActionDropdown.tsx

@@ -3,7 +3,8 @@ import React, { FC, useMemo, useCallback } from 'react';
 import { useTranslation } from 'react-i18next';
 
 import {
-  SupportedActionType, SupportedActionCategoryType, SupportedActionCategory, PageActions, CommentActions, UserActions, AdminActions,
+  SupportedActionType, SupportedActionCategoryType, SupportedActionCategory,
+  PageActions, CommentActions, TagActions, ShareLinkActions, AttachmentActions, InAppNotificationActions, UserActions, AdminActions,
 } from '~/interfaces/activity';
 
 type Props = {
@@ -30,6 +31,22 @@ export const SelectActionDropdown: FC<Props> = (props: Props) => {
           actionCategory: SupportedActionCategory.COMMENT,
           actions: CommentActions.filter(action => availableActions.includes(action)),
         },
+        {
+          actionCategory: SupportedActionCategory.TAG,
+          actions: TagActions.filter(action => availableActions.includes(action)),
+        },
+        {
+          actionCategory: SupportedActionCategory.ATTACHMENT,
+          actions: AttachmentActions.filter(action => availableActions.includes(action)),
+        },
+        {
+          actionCategory: SupportedActionCategory.SHARE_LINK,
+          actions: ShareLinkActions.filter(action => availableActions.includes(action)),
+        },
+        {
+          actionCategory: SupportedActionCategory.IN_APP_NOTIFICATION,
+          actions: InAppNotificationActions.filter(action => availableActions.includes(action)),
+        },
         {
           actionCategory: SupportedActionCategory.USER,
           actions: UserActions.filter(action => availableActions.includes(action)),

+ 12 - 0
packages/app/src/interfaces/activity.ts

@@ -118,6 +118,10 @@ export const SupportedEventModel = {
 export const SupportedActionCategory = {
   PAGE: 'Page',
   COMMENT: 'Comment',
+  TAG: 'Tag',
+  ATTACHMENT: 'Attachment',
+  SHARE_LINK: 'ShareLink',
+  IN_APP_NOTIFICATION: 'InAppNotification',
   USER: 'User',
   ADMIN: 'Admin',
 } as const;
@@ -368,11 +372,19 @@ export const AllLargeGroupActions = Object.values(LargeActionGroup);
 // Action categories(for SelectActionDropdown.tsx)
 const pageRegExp = new RegExp(`^${SupportedActionCategory.PAGE.toUpperCase()}_`);
 const commentRegExp = new RegExp(`^${SupportedActionCategory.COMMENT.toUpperCase()}_`);
+const tagRegExp = new RegExp(`^${SupportedActionCategory.TAG.toUpperCase()}_`);
+const attachmentRegExp = RegExp(`^${SupportedActionCategory.ATTACHMENT.toUpperCase()}_`);
+const shareLinkRegExp = RegExp(`^${SupportedActionCategory.SHARE_LINK.toUpperCase()}_`);
+const inAppNotificationRegExp = RegExp(`^${SupportedActionCategory.IN_APP_NOTIFICATION.toUpperCase()}_`);
 const userRegExp = new RegExp(`^${SupportedActionCategory.USER.toUpperCase()}_`);
 const adminRegExp = new RegExp(`^${SupportedActionCategory.ADMIN.toUpperCase()}_`);
 
 export const PageActions = AllSupportedActions.filter(action => action.match(pageRegExp));
 export const CommentActions = AllSupportedActions.filter(action => action.match(commentRegExp));
+export const TagActions = AllSupportedActions.filter(action => action.match(tagRegExp));
+export const AttachmentActions = AllSupportedActions.filter(action => action.match(attachmentRegExp));
+export const ShareLinkActions = AllSupportedActions.filter(action => action.match(shareLinkRegExp));
+export const InAppNotificationActions = AllSupportedActions.filter(action => action.match(inAppNotificationRegExp));
 export const UserActions = AllSupportedActions.filter(action => action.match(userRegExp));
 export const AdminActions = AllSupportedActions.filter(action => action.match(adminRegExp));