Fix table blocks not being able to create rows through V2 views

This commit is contained in:
Andrew Kingston 2023-08-24 16:29:21 +01:00
parent 8269ecf237
commit f7805ef5f9
1 changed files with 3 additions and 3 deletions

View File

@ -45,6 +45,7 @@
let enrichedSearchColumns let enrichedSearchColumns
let schemaLoaded = false let schemaLoaded = false
$: isDSPlus = dataSource?.type === "table" || dataSource?.type === "viewV2"
$: fetchSchema(dataSource) $: fetchSchema(dataSource)
$: enrichSearchColumns(searchColumns, schema).then( $: enrichSearchColumns(searchColumns, schema).then(
val => (enrichedSearchColumns = val) val => (enrichedSearchColumns = val)
@ -53,8 +54,7 @@
$: editTitle = getEditTitle(detailsFormBlockId, primaryDisplay) $: editTitle = getEditTitle(detailsFormBlockId, primaryDisplay)
$: normalFields = getNormalFields(schema) $: normalFields = getNormalFields(schema)
$: rowClickActions = $: rowClickActions =
clickBehaviour === "actions" || clickBehaviour === "actions" || !isDSPlus
(dataSource?.type !== "table" && dataSource?.type !== "viewV2")
? onClick ? onClick
: [ : [
{ {
@ -76,7 +76,7 @@
}, },
] ]
$: buttonClickActions = $: buttonClickActions =
titleButtonClickBehaviour === "actions" || dataSource?.type !== "table" titleButtonClickBehaviour === "actions" || !isDSPlus
? onClickTitleButton ? onClickTitleButton
: [ : [
{ {