Browse Source

refactor(nocodb): keep present tense form for AuditOperationSubTypes

pull/5403/head
Wing-Kam Wong 2 years ago
parent
commit
670d9052f7
  1. 6
      packages/nocodb/src/lib/models/Audit.ts
  2. 6
      packages/nocodb/src/lib/services/column.svc.ts
  3. 4
      packages/nocodb/src/lib/services/table.svc.ts
  4. 6
      packages/nocodb/src/schema/swagger.json

6
packages/nocodb/src/lib/models/Audit.ts

@ -30,13 +30,11 @@ const opSubTypes = <const>[
'LINK_RECORD',
'UNLINK_RECORD',
'DELETE',
'CREATED',
'DELETED',
'RENAMED',
'CREATE',
'RENAME',
'IMPORT_FROM_ZIP',
'EXPORT_TO_FS',
'EXPORT_TO_ZIP',
'UPDATED',
'SIGNIN',
'SIGNUP',
'PASSWORD_RESET',

6
packages/nocodb/src/lib/services/column.svc.ts

@ -822,7 +822,7 @@ export async function columnUpdate(param: {
await Audit.insert({
project_id: base.project_id,
op_type: AuditOperationTypes.TABLE_COLUMN,
op_sub_type: AuditOperationSubTypes.UPDATED,
op_sub_type: AuditOperationSubTypes.UPDATE,
user: param.req?.user?.email,
description: `updated column ${column.column_name} with alias ${column.title} from table ${table.table_name}`,
ip: param.req?.clientIp,
@ -1127,7 +1127,7 @@ export async function columnAdd(param: {
await Audit.insert({
project_id: base.project_id,
op_type: AuditOperationTypes.TABLE_COLUMN,
op_sub_type: AuditOperationSubTypes.CREATED,
op_sub_type: AuditOperationSubTypes.CREATE,
user: param?.req.user?.email,
description: `created column ${colBody.column_name} with alias ${colBody.title} from table ${table.table_name}`,
ip: param?.req.clientIp,
@ -1339,7 +1339,7 @@ export async function columnDelete(param: { req?: any; columnId: string }) {
await Audit.insert({
project_id: base.project_id,
op_type: AuditOperationTypes.TABLE_COLUMN,
op_sub_type: AuditOperationSubTypes.DELETED,
op_sub_type: AuditOperationSubTypes.DELETE,
user: param?.req?.user?.email,
description: `deleted column ${column.column_name} with alias ${column.title} from table ${table.table_name}`,
ip: param?.req.clientIp,

4
packages/nocodb/src/lib/services/table.svc.ts

@ -185,7 +185,7 @@ export async function tableDelete(param: {
project_id: project.id,
base_id: base.id,
op_type: AuditOperationTypes.TABLE,
op_sub_type: AuditOperationSubTypes.DELETED,
op_sub_type: AuditOperationSubTypes.DELETE,
user: param.user?.email,
description: `Deleted ${table.type} ${table.table_name} with alias ${table.title} `,
ip: param.req?.clientIp,
@ -433,7 +433,7 @@ export async function tableCreate(param: {
project_id: project.id,
base_id: base.id,
op_type: AuditOperationTypes.TABLE,
op_sub_type: AuditOperationSubTypes.CREATED,
op_sub_type: AuditOperationSubTypes.CREATE,
user: param.user?.email,
description: `created table ${tableCreatePayLoad.table_name} with alias ${tableCreatePayLoad.title} `,
ip: param.req?.clientIp,

6
packages/nocodb/src/schema/swagger.json

@ -14020,13 +14020,11 @@
"LINK_RECORD",
"UNLINK_RECORD",
"DELETE",
"CREATED",
"DELETED",
"RENAMED",
"CREATE",
"RENAME",
"IMPORT_FROM_ZIP",
"EXPORT_TO_FS",
"EXPORT_TO_ZIP",
"UPDATED",
"SIGNIN",
"SIGNUP",
"PASSWORD_RESET",

Loading…
Cancel
Save