Added validation buttons per row in datasheet UI; need to configure correct validations per data field

This commit is contained in:
efarooqui
2020-08-21 09:35:20 -07:00
parent fba74d8e9c
commit 1971128b18
3 changed files with 23 additions and 25 deletions

View File

@@ -1,4 +1,5 @@
import { fmtObj } from '../lib/util'
import { getColumnValidation } from '../lib/validation'
/**
* Each resource item is an object with values labelled according
@@ -35,7 +36,6 @@ export default (data) => {
}
}
})
// generate the value for deep labels using the structure created
data.forEach((row, idx) => {
if (idx === 0) return
@@ -61,6 +61,8 @@ export default (data) => {
// move values for flat labels over from base
structure.__flat.forEach(label => {
const validatedLabel = getColumnValidation(label, baseRow[label])
console.log(validatedLabel)
deepRow[label] = baseRow[label]
})
if (!Object.keys(deepRow).every(k => deepRow[k] === '')) {