mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-06 06:48:21 +00:00
Removed autogeneration logic.
This commit is contained in:
parent
8304a72458
commit
1207c5cdf1
1 changed files with 2 additions and 4 deletions
|
|
@ -50,7 +50,6 @@ export default function autogenerateColumns(
|
|||
const currentKey = parentKey ? `${parentKey}.${key}` : key;
|
||||
if (isValueIsPlainObject(value)) {
|
||||
// if value is object particularly, then we only want nested keys till one level of nesting
|
||||
accumulator.push(currentKey);
|
||||
accumulator.push(...limitToOneLevelNestingHelperFunc(value, currentKey));
|
||||
} else if (isValueIsPremitiveOrArray(value)) {
|
||||
// check if value is premitive or array then simply push current key in the accumulator.
|
||||
|
|
@ -99,7 +98,7 @@ export default function autogenerateColumns(
|
|||
id: uuidv4(),
|
||||
name: key,
|
||||
key: key,
|
||||
columnType: convertDataTypeToColumnType(dataType, firstRow[key]),
|
||||
columnType: convertDataTypeToColumnType(dataType),
|
||||
autogenerated: true,
|
||||
}));
|
||||
|
||||
|
|
@ -124,8 +123,7 @@ const dataTypeToColumnTypeMapping = {
|
|||
boolean: 'boolean',
|
||||
};
|
||||
|
||||
const convertDataTypeToColumnType = (dataType, value) => {
|
||||
const convertDataTypeToColumnType = (dataType) => {
|
||||
if (Object.keys(dataTypeToColumnTypeMapping).includes(dataType)) return dataTypeToColumnTypeMapping[dataType];
|
||||
if (dataType === 'object' && !Array.isArray(value)) return 'json';
|
||||
else return 'string';
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue