mirror of
https://github.com/nocodb/nocodb.git
synced 2026-02-01 23:38:21 +00:00
Merge pull request #12976 from nocodb/nc-fix/v3-transformfn-empty-meta
handle empty meta during v3 transform
This commit is contained in:
@@ -38,7 +38,7 @@ export async function getFormulasReferredTheColumn(
|
||||
if (UITypes.Button === c.uidt && (formula as ButtonColumn)?.type !== 'url')
|
||||
return columns;
|
||||
|
||||
if (fn(formulaJsep(formula.formula))) {
|
||||
if (formula.formula && fn(formulaJsep(formula.formula))) {
|
||||
columns.push(c);
|
||||
}
|
||||
return columns;
|
||||
|
||||
@@ -430,8 +430,7 @@ export const columnBuilder = builderGenerator<Column | ColumnType, FieldV3Type>(
|
||||
}
|
||||
|
||||
if (data.type === UITypes.Checkbox) {
|
||||
const { icon, iconIdx, ...rest } = data.options as Record<string, any>;
|
||||
|
||||
const { icon, iconIdx, ...rest } = options;
|
||||
// extract option meta and include only label and color
|
||||
options = rest;
|
||||
|
||||
@@ -443,7 +442,7 @@ export const columnBuilder = builderGenerator<Column | ColumnType, FieldV3Type>(
|
||||
)?.label;
|
||||
}
|
||||
} else if (data.type === UITypes.Rating) {
|
||||
const { icon, iconIdx, ...rest } = data.options as Record<string, any>;
|
||||
const { icon, iconIdx, ...rest } = options;
|
||||
|
||||
// extract option meta and include only label and color
|
||||
options = rest;
|
||||
@@ -456,10 +455,7 @@ export const columnBuilder = builderGenerator<Column | ColumnType, FieldV3Type>(
|
||||
)?.label;
|
||||
}
|
||||
} else if (data.type === UITypes.Duration) {
|
||||
const { duration, duration_format, ...rest } = data.options as Record<
|
||||
string,
|
||||
any
|
||||
>;
|
||||
const { duration, duration_format, ...rest } = options;
|
||||
const durationFormat = duration ?? duration_format;
|
||||
// extract option meta and include only label and color
|
||||
options = rest;
|
||||
@@ -468,7 +464,7 @@ export const columnBuilder = builderGenerator<Column | ColumnType, FieldV3Type>(
|
||||
options.duration_format = durationOptions[durationFormat]?.title;
|
||||
}
|
||||
} else if (data.type === UITypes.Button) {
|
||||
const { type, ...rest } = data.options as Record<string, any>;
|
||||
const { type, ...rest } = options;
|
||||
|
||||
// Transform button properties based on type
|
||||
if (type === 'formula') {
|
||||
@@ -514,11 +510,9 @@ export const columnBuilder = builderGenerator<Column | ColumnType, FieldV3Type>(
|
||||
options = { ...rest, button_type: type };
|
||||
}
|
||||
} else if (isLinksOrLTAR(data.type)) {
|
||||
const { type, ...rest } =
|
||||
(data.options as Record<string, any>) ?? options;
|
||||
const { type, ...rest } = options;
|
||||
options = { ...rest, relation_type: type };
|
||||
}
|
||||
options = options || data.options;
|
||||
|
||||
// exclude rollup function if Links
|
||||
if (data.type === UITypes.Links && options && options.rollup_function) {
|
||||
|
||||
Reference in New Issue
Block a user