fix: fix column def sync for evalv2
This commit is contained in:
@@ -71,20 +71,10 @@
|
||||
|
||||
// Type guard for configuration structure
|
||||
const conf = rawConf as ColumnDefsConfiguration
|
||||
if (!conf.type || (conf.type !== 'static' && conf.type !== 'evalv2')) return
|
||||
if (!conf.type || conf.type !== 'static') return
|
||||
|
||||
let currentColumns: WindmillColumnDef[] | undefined
|
||||
if (conf.type === 'static') {
|
||||
currentColumns = Array.isArray(conf.value) ? conf.value : []
|
||||
} else if (conf.type === 'evalv2') {
|
||||
try {
|
||||
const parsed = JSON.parse(conf.expr ?? '[]')
|
||||
currentColumns = Array.isArray(parsed) ? parsed : []
|
||||
} catch (e) {
|
||||
console.warn('Failed to parse columnDefs expression:', e)
|
||||
currentColumns = []
|
||||
}
|
||||
}
|
||||
currentColumns = Array.isArray(conf.value) ? conf.value : []
|
||||
|
||||
const hasPlaceholder = hasActionsPlaceholder(currentColumns)
|
||||
|
||||
@@ -99,11 +89,7 @@
|
||||
if (needsRemove) nextColumns = removeActionsPlaceholder(nextColumns)
|
||||
|
||||
// Update configuration with proper typing
|
||||
if (conf.type === 'static') {
|
||||
conf.value = nextColumns
|
||||
} else if (conf.type === 'evalv2') {
|
||||
conf.expr = JSON.stringify(nextColumns)
|
||||
}
|
||||
conf.value = nextColumns
|
||||
|
||||
await updateConfiguration()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user