From d85e01f3364c39a8459f02f9492b92f2fb3c6e24 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 3 Apr 2023 19:51:23 +0800 Subject: [PATCH] refactor(nc-gui): remove audit calls from frontend side --- .../composables/useExpandedFormStore.ts | 19 ++----------------- .../nc-gui/composables/useKanbanViewStore.ts | 9 --------- packages/nc-gui/composables/useViewData.ts | 9 --------- 3 files changed, 2 insertions(+), 35 deletions(-) diff --git a/packages/nc-gui/composables/useExpandedFormStore.ts b/packages/nc-gui/composables/useExpandedFormStore.ts index 98e5769445..8555e8868f 100644 --- a/packages/nc-gui/composables/useExpandedFormStore.ts +++ b/packages/nc-gui/composables/useExpandedFormStore.ts @@ -7,7 +7,6 @@ import { computed, extractPkFromRow, extractSdkResponseErrorMsg, - getHTMLEncodedText, message, populateInsertObject, ref, @@ -253,22 +252,8 @@ const [useProvideExpandedFormStore, useExpandedFormStore] = useInjectionState((m }) } - for (const key of Object.keys(updateOrInsertObj)) { - // audit - $api.utils - .auditRowUpdate(id, { - fk_model_id: meta.value.id, - column_name: key, - row_id: id, - value: getHTMLEncodedText(updateOrInsertObj[key]), - prev_value: getHTMLEncodedText(row.value.oldRow[key]), - }) - .then(async () => { - /** load latest comments/audit if right drawer is open */ - if (commentsDrawer.value) { - await loadCommentsAndLogs() - } - }) + if (commentsDrawer.value) { + await loadCommentsAndLogs() } } else { // No columns to update diff --git a/packages/nc-gui/composables/useKanbanViewStore.ts b/packages/nc-gui/composables/useKanbanViewStore.ts index 048663706f..e6241545a7 100644 --- a/packages/nc-gui/composables/useKanbanViewStore.ts +++ b/packages/nc-gui/composables/useKanbanViewStore.ts @@ -8,7 +8,6 @@ import { enumColor, extractPkFromRow, extractSdkResponseErrorMsg, - getHTMLEncodedText, inject, message, parseProp, @@ -401,14 +400,6 @@ const [useProvideKanbanViewStore, useKanbanViewStore] = useInjectionState( // query: { ignoreWebhook: !saved } // } ) - // audit - $api.utils.auditRowUpdate(id, { - fk_model_id: meta.value?.id as string, - column_name: property, - row_id: id, - value: getHTMLEncodedText(toUpdate.row[property]), - prev_value: getHTMLEncodedText(toUpdate.oldRow[property]), - }) if (!undo) { const oldRowIndex = moveHistory.value.find((ele) => ele.op === 'removed' && ele.pk === id) diff --git a/packages/nc-gui/composables/useViewData.ts b/packages/nc-gui/composables/useViewData.ts index e3841dc7ee..9ca27c7b14 100644 --- a/packages/nc-gui/composables/useViewData.ts +++ b/packages/nc-gui/composables/useViewData.ts @@ -8,7 +8,6 @@ import { computed, extractPkFromRow, extractSdkResponseErrorMsg, - getHTMLEncodedText, message, populateInsertObject, ref, @@ -350,14 +349,6 @@ export function useViewData( // query: { ignoreWebhook: !saved } // } ) - // audit - $api.utils.auditRowUpdate(encodeURIComponent(id), { - fk_model_id: metaValue?.id as string, - column_name: property, - row_id: id, - value: getHTMLEncodedText(toUpdate.row[property]), - prev_value: getHTMLEncodedText(toUpdate.oldRow[property]), - }) if (!undo) { addUndo({