Merge pull request 'fix(edit): use cellValidation keys and hotDataSchema to fill in defaults on add row' (#205) from fix/204-default-value into demodata
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 4m15s
Build / Build-and-test-development (pull_request) Successful in 10m18s
Lighthouse Checks / lighthouse (24.5.0) (pull_request) Successful in 18m50s

Reviewed-on: #205
This commit was merged in pull request #205.
This commit is contained in:
2026-02-10 12:58:15 +00:00
2 changed files with 6 additions and 3 deletions

View File

@@ -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

View File

@@ -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]