Skip to content

Commit

Permalink
adding back the function call for triggering audit log event on js ac…
Browse files Browse the repository at this point in the history
…tion execution on EE
  • Loading branch information
ankitakinger committed Apr 29, 2024
1 parent 0a06d18 commit 6cb9398
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
22 changes: 22 additions & 0 deletions app/client/src/ce/sagas/JSActionSagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ import { handleJSEntityRedirect } from "sagas/IDESaga";
import { getIDETypeByUrl } from "@appsmith/entities/IDE/utils";
import { IDE_TYPE } from "@appsmith/entities/IDE/constants";
import { CreateNewActionKey } from "@appsmith/entities/Engine/actionHelpers";
import type {
TriggerKind,
TriggerSource,
} from "constants/AppsmithActionConstants/ActionConstants";
import type { TMessage } from "utils/MessageUtil";

export function* fetchJSCollectionsSaga(
action: EvaluationReduxAction<FetchActionsPayload>,
Expand Down Expand Up @@ -500,3 +505,20 @@ export function* closeJSActionTabSaga(
yield call(handleJSEntityRedirect, id);
yield put(closeJsActionTabSuccess({ id }));
}

export function* logJSFunctionExecution(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
message: TMessage<{
data: {
jsFnFullName: string;
isSuccess: boolean;
triggerMeta: {
source: TriggerSource;
triggerPropertyName: string | undefined;
triggerKind: TriggerKind | undefined;
};
}[];
}>,
) {
/* This is intentionally left blank and has a definition on EE for audit logs, since this function needs to be called in a common file. */
}
6 changes: 6 additions & 0 deletions app/client/src/sagas/EvalWorkerActionSagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import { sortJSExecutionDataByCollectionId } from "workers/Evaluation/JSObject/u
import type { LintTreeSagaRequestData } from "plugins/Linting/types";
import { evalErrorHandler } from "./EvalErrorHandler";
import { getUnevaluatedDataTree } from "selectors/dataTreeSelectors";
import { logJSFunctionExecution } from "@appsmith/sagas/JSActionSagas";

export interface UpdateDataTreeMessageData {
workerResponse: EvalTreeResponseData;
unevalTree: UnEvalTree;
Expand Down Expand Up @@ -124,6 +126,10 @@ export function* handleEvalWorkerMessage(message: TMessage<any>) {
yield call(handleStoreOperations, data);
break;
}
case MAIN_THREAD_ACTION.LOG_JS_FUNCTION_EXECUTION: {
yield call(logJSFunctionExecution, message);
break;
}
case MAIN_THREAD_ACTION.PROCESS_BATCHED_TRIGGERS: {
const batchedTriggers = data;
yield all(
Expand Down

0 comments on commit 6cb9398

Please sign in to comment.