Browse Source

fix(playwright): Renamed NC_FILE_FIELD_SIZE to NC_ATTACHMENT_FIELD_SIZE

pull/4538/head
Muhammed Mustafa 2 years ago
parent
commit
16099a9750
  1. 2
      packages/nocodb/src/lib/constants/index.ts
  2. 4
      packages/nocodb/src/lib/meta/NcMetaMgr.ts
  3. 4
      packages/nocodb/src/lib/meta/NcMetaMgrv2.ts
  4. 4
      packages/nocodb/src/lib/meta/api/attachmentApis.ts
  5. 4
      packages/nocodb/src/lib/meta/api/publicApis/publicDataApis.ts

2
packages/nocodb/src/lib/constants/index.ts

@ -1,5 +1,5 @@
export const NC_LICENSE_KEY = 'nc-license-key'; export const NC_LICENSE_KEY = 'nc-license-key';
export const NC_APP_SETTINGS = 'nc-app-settings'; export const NC_APP_SETTINGS = 'nc-app-settings';
export const NC_FILE_FIELD_SIZE = process.env['NC_ATTACHMENT_FIELD_SIZE'] export const NC_ATTACHMENT_FIELD_SIZE = process.env['NC_ATTACHMENT_FIELD_SIZE']
? Number(process.env['NC_ATTACHMENT_FIELD_SIZE']) ? Number(process.env['NC_ATTACHMENT_FIELD_SIZE'])
: 20 * 1024 * 1024; // 20 MB : 20 * 1024 * 1024; // 20 MB

4
packages/nocodb/src/lib/meta/NcMetaMgr.ts

@ -41,7 +41,7 @@ import { defaultConnectionConfig } from '../utils/NcConfigFactory';
import xcMetaDiff from './handlers/xcMetaDiff'; import xcMetaDiff from './handlers/xcMetaDiff';
import { UITypes } from 'nocodb-sdk'; import { UITypes } from 'nocodb-sdk';
import { Tele } from 'nc-help'; import { Tele } from 'nc-help';
import { NC_FILE_FIELD_SIZE } from '../constants'; import { NC_ATTACHMENT_FIELD_SIZE } from '../constants';
const randomID = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz_', 10); const randomID = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz_', 10);
const XC_PLUGIN_DET = 'XC_PLUGIN_DET'; const XC_PLUGIN_DET = 'XC_PLUGIN_DET';
@ -134,7 +134,7 @@ export default class NcMetaMgr {
// dest: path.join(this.config.toolDir, 'uploads') // dest: path.join(this.config.toolDir, 'uploads')
}), }),
limits: { limits: {
fieldSize: NC_FILE_FIELD_SIZE, fieldSize: NC_ATTACHMENT_FIELD_SIZE,
}, },
}); });
// router.post(this.config.dashboardPath, upload.single('file')); // router.post(this.config.dashboardPath, upload.single('file'));

4
packages/nocodb/src/lib/meta/NcMetaMgrv2.ts

@ -11,7 +11,7 @@ import NcPluginMgr from '../v1-legacy/plugins/NcPluginMgr';
import NcMetaIO from './NcMetaIO'; import NcMetaIO from './NcMetaIO';
import { defaultConnectionConfig } from '../utils/NcConfigFactory'; import { defaultConnectionConfig } from '../utils/NcConfigFactory';
import ncCreateLookup from './handlersv2/ncCreateLookup'; import ncCreateLookup from './handlersv2/ncCreateLookup';
import { NC_FILE_FIELD_SIZE } from '../constants'; import { NC_ATTACHMENT_FIELD_SIZE } from '../constants';
// import ncGetMeta from './handlersv2/ncGetMeta'; // import ncGetMeta from './handlersv2/ncGetMeta';
export default class NcMetaMgrv2 { export default class NcMetaMgrv2 {
@ -73,7 +73,7 @@ export default class NcMetaMgrv2 {
// dest: path.join(this.config.toolDir, 'uploads') // dest: path.join(this.config.toolDir, 'uploads')
}), }),
limits: { limits: {
fieldSize: NC_FILE_FIELD_SIZE, fieldSize: NC_ATTACHMENT_FIELD_SIZE,
}, },
}); });
// router.post(this.config.dashboardPath, upload.single('file')); // router.post(this.config.dashboardPath, upload.single('file'));

4
packages/nocodb/src/lib/meta/api/attachmentApis.ts

@ -9,7 +9,7 @@ import { Tele } from 'nc-help';
import ncMetaAclMw from '../helpers/ncMetaAclMw'; import ncMetaAclMw from '../helpers/ncMetaAclMw';
import catchError from '../helpers/catchError'; import catchError from '../helpers/catchError';
import NcPluginMgrv2 from '../helpers/NcPluginMgrv2'; import NcPluginMgrv2 from '../helpers/NcPluginMgrv2';
import { NC_FILE_FIELD_SIZE } from '../../constants'; import { NC_ATTACHMENT_FIELD_SIZE } from '../../constants';
// const storageAdapter = new Local(); // const storageAdapter = new Local();
export async function upload(req: Request, res: Response) { export async function upload(req: Request, res: Response) {
@ -153,7 +153,7 @@ router.post(
multer({ multer({
storage: multer.diskStorage({}), storage: multer.diskStorage({}),
limits: { limits: {
fieldSize: NC_FILE_FIELD_SIZE, fieldSize: NC_ATTACHMENT_FIELD_SIZE,
}, },
}).any(), }).any(),
ncMetaAclMw(upload, 'upload') ncMetaAclMw(upload, 'upload')

4
packages/nocodb/src/lib/meta/api/publicApis/publicDataApis.ts

@ -18,7 +18,7 @@ import slash from 'slash';
import { sanitizeUrlPath } from '../attachmentApis'; import { sanitizeUrlPath } from '../attachmentApis';
import getAst from '../../../db/sql-data-mapper/lib/sql/helpers/getAst'; import getAst from '../../../db/sql-data-mapper/lib/sql/helpers/getAst';
import { getColumnByIdOrName } from '../dataApis/helpers'; import { getColumnByIdOrName } from '../dataApis/helpers';
import { NC_FILE_FIELD_SIZE } from '../../../constants'; import { NC_ATTACHMENT_FIELD_SIZE } from '../../../constants';
export async function dataList(req: Request, res: Response) { export async function dataList(req: Request, res: Response) {
try { try {
@ -453,7 +453,7 @@ router.post(
multer({ multer({
storage: multer.diskStorage({}), storage: multer.diskStorage({}),
limits: { limits: {
fieldSize: NC_FILE_FIELD_SIZE, fieldSize: NC_ATTACHMENT_FIELD_SIZE,
}, },
}).any(), }).any(),
catchError(dataInsert) catchError(dataInsert)

Loading…
Cancel
Save