diff --git a/client/src/app/editor/editor.component.ts b/client/src/app/editor/editor.component.ts index 8aa3bc1..8556c35 100644 --- a/client/src/app/editor/editor.component.ts +++ b/client/src/app/editor/editor.component.ts @@ -1051,9 +1051,11 @@ export class EditorComponent implements OnInit, AfterViewInit, OnDestroy { */ private createEmptyRow(): any { const newRow: any = {} - this.headerColumns.forEach((col: string) => { - const defaultValue = this.dcValidator?.getNotNullDefaultValue(col) - newRow[col] = defaultValue !== undefined ? defaultValue : '' + this.cellValidation.forEach((rule: any) => { + const dataKey = rule.data + newRow[dataKey] = this.hotDataSchema.hasOwnProperty(dataKey) + ? this.hotDataSchema[dataKey] + : '' }) newRow['noLinkOption'] = true return newRow diff --git a/client/src/app/shared/dc-validator/utils/getHotDataSchema.ts b/client/src/app/shared/dc-validator/utils/getHotDataSchema.ts index d47602f..23bc73b 100644 --- a/client/src/app/shared/dc-validator/utils/getHotDataSchema.ts +++ b/client/src/app/shared/dc-validator/utils/getHotDataSchema.ts @@ -27,6 +27,7 @@ export function getHotDataSchema( if (!type) return schemaTypeMap.default switch (type) { + case 'dropdown': case 'autocomplete': { return cellValidation && cellValidation.source ? (cellValidation.source as string[] | number[])[0]