|
|
@ -194,18 +194,18 @@ |
|
|
// For providers referencing another provider, just use the rows it |
|
|
// For providers referencing another provider, just use the rows it |
|
|
// provides |
|
|
// provides |
|
|
allRows = dataSource?.value?.rows || [] |
|
|
allRows = dataSource?.value?.rows || [] |
|
|
} else if (dataSource?.type === "field") { |
|
|
} else if ( |
|
|
// Field sources will be available from context. |
|
|
dataSource?.type === "field" || |
|
|
// Enrich non object elements into object to ensure a valid schema. |
|
|
dataSource?.type === "jsonarray" |
|
|
|
|
|
) { |
|
|
|
|
|
// These sources will be available directly from context. |
|
|
|
|
|
// Enrich non object elements into objects to ensure a valid schema. |
|
|
const data = dataSource?.value || [] |
|
|
const data = dataSource?.value || [] |
|
|
if (Array.isArray(data) && data[0] && typeof data[0] !== "object") { |
|
|
if (Array.isArray(data) && data[0] && typeof data[0] !== "object") { |
|
|
allRows = data.map(value => ({ value })) |
|
|
allRows = data.map(value => ({ value })) |
|
|
} else { |
|
|
} else { |
|
|
allRows = data |
|
|
allRows = data |
|
|
} |
|
|
} |
|
|
} else if (dataSource?.type === "jsonarray") { |
|
|
|
|
|
// JSON array sources will be available from context |
|
|
|
|
|
allRows = dataSource?.value || [] |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
// For other data sources like queries or views, fetch all rows from the |
|
|
// For other data sources like queries or views, fetch all rows from the |
|
|
// server |
|
|
// server |
|
|
|