Shun Miyazawa 3 lat temu
rodzic
commit
99d1d56a86

+ 1 - 1
packages/app/.env.development

@@ -30,4 +30,4 @@ OGP_URI="http://ogp:8088"
 # GROWI_CLOUD_URI='http://growi.cloud'
 # GROWI_CLOUD_URI='http://growi.cloud'
 # GROWI_APP_ID_FOR_GROWI_CLOUD=012345
 # GROWI_APP_ID_FOR_GROWI_CLOUD=012345
 # ACTIVITY_EXPIRATION_SECONDS=2592000
 # ACTIVITY_EXPIRATION_SECONDS=2592000
-# AUDIT_LOG_ACTION_GROUP_SIZE='SMALL'
+# AUDIT_LOG_ACTION_GROUP_SIZE=SMALL

+ 16 - 5
packages/app/src/interfaces/activity.ts

@@ -142,10 +142,21 @@ export const MediumActionGroup = {
   ACTION_COMMENT_REMOVE,
   ACTION_COMMENT_REMOVE,
 } as const;
 } as const;
 
 
-// MediumActionGroup + All Actions by Admin Users + PAGE_VIEW
+// MediumActionGroup + All Actions by Admin Users - PAGE_VIEW
 export const LargeActionGroup = {
 export const LargeActionGroup = {
   ...MediumActionGroup,
   ...MediumActionGroup,
-  ACTION_PAGE_VIEW,
+  ACTION_ADMIN_SECURITY_SETTINGS_UPDATE,
+  ACTION_ADMIN_LINE_BREAK_UPDATE,
+  ACTION_ADMIN_LAYOUT_UPDATE,
+  ACTION_ADMIN_ARCHIVE_DATA_UPLOAD,
+  ACTION_ADMIN_ARCHIVE_DATA_CREATE,
+  ACTION_ADMIN_USER_NOTIFICATION_SETTINGS_ADD,
+  ACTION_ADMIN_SLACK_WORKSPACE_CREATE,
+  ACTION_ADMIN_SLACK_CONFIGURATION_SETTING_UPDATE,
+  ACTION_ADMIN_USERS_INVITE,
+  ACTION_ADMIN_USER_GROUP_CREATE,
+  ACTION_ADMIN_SEARCH_INDICES_NORMALIZE,
+  ACTION_ADMIN_SEARCH_INDICES_REBUILD,
 } as const;
 } as const;
 
 
 export const SupportedActionToNotified = {
 export const SupportedActionToNotified = {
@@ -187,9 +198,9 @@ export const AllSupportedTargetModel = Object.values(SupportedTargetModel);
 export const AllSupportedEventModel = Object.values(SupportedEventModel);
 export const AllSupportedEventModel = Object.values(SupportedEventModel);
 export const AllSupportedAction = Object.values(SupportedAction);
 export const AllSupportedAction = Object.values(SupportedAction);
 export const AllSupportedActionToNotified = Object.values(SupportedActionToNotified);
 export const AllSupportedActionToNotified = Object.values(SupportedActionToNotified);
-export const AllSmallAction = Object.values(SmallActionGroup);
-export const AllMediumAction = Object.values(MediumActionGroup);
-export const AllLargeAction = Object.values(LargeActionGroup);
+export const AllSmallGroupActions = Object.values(SmallActionGroup);
+export const AllMediumGroupActions = Object.values(MediumActionGroup);
+export const AllLargeGroupActions = Object.values(LargeActionGroup);
 
 
 /*
 /*
  * Type
  * Type

+ 1 - 1
packages/app/src/server/models/activity.ts

@@ -119,7 +119,7 @@ activitySchema.statics.createByParameters = async function(parameters): Promise<
   return activity;
   return activity;
 };
 };
 
 
-// Check if you should update using ActivityService.shoudUpdateActivity
+// When using this method, ensure that activity updates are allowed using ActivityService.shoutUpdateActivity
 activitySchema.statics.updateByParameters = async function(activityId: string, parameters): Promise<IActivity> {
 activitySchema.statics.updateByParameters = async function(activityId: string, parameters): Promise<IActivity> {
   const activity = await this.findOneAndUpdate({ _id: activityId }, parameters, { new: true }) as unknown as IActivity;
   const activity = await this.findOneAndUpdate({ _id: activityId }, parameters, { new: true }) as unknown as IActivity;
 
 

+ 4 - 4
packages/app/src/server/service/activity.ts

@@ -1,7 +1,7 @@
 import mongoose from 'mongoose';
 import mongoose from 'mongoose';
 
 
 import {
 import {
-  IActivity, SupportedActionType, ActionGroupSize, AllSmallAction, AllMediumAction, AllLargeAction, AllSupportedActionToNotified,
+  IActivity, SupportedActionType, ActionGroupSize, AllSmallGroupActions, AllMediumGroupActions, AllLargeGroupActions, AllSupportedActionToNotified,
 } from '~/interfaces/activity';
 } from '~/interfaces/activity';
 import { IPage } from '~/interfaces/page';
 import { IPage } from '~/interfaces/page';
 import Activity from '~/server/models/activity';
 import Activity from '~/server/models/activity';
@@ -54,13 +54,13 @@ class ActivityService {
 
 
     switch (auditLogActionGroupSize) {
     switch (auditLogActionGroupSize) {
       case ActionGroupSize.Small:
       case ActionGroupSize.Small:
-        shoudUpdate = (AllSmallAction as ReadonlyArray<string>).includes(action);
+        shoudUpdate = (AllSmallGroupActions as ReadonlyArray<string>).includes(action);
         break;
         break;
       case ActionGroupSize.Medium:
       case ActionGroupSize.Medium:
-        shoudUpdate = (AllMediumAction as ReadonlyArray<string>).includes(action);
+        shoudUpdate = (AllMediumGroupActions as ReadonlyArray<string>).includes(action);
         break;
         break;
       case ActionGroupSize.Large:
       case ActionGroupSize.Large:
-        shoudUpdate = (AllLargeAction as ReadonlyArray<string>).includes(action);
+        shoudUpdate = (AllLargeGroupActions as ReadonlyArray<string>).includes(action);
         break;
         break;
     }
     }