Fix issue with enriching screen definitions causing bad component instances to be parsed
This commit is contained in:
parent
a8bf57dbd1
commit
fa6ad0daec
|
@ -201,7 +201,7 @@
|
||||||
|
|
||||||
// Metadata to pass into grid action to apply CSS
|
// Metadata to pass into grid action to apply CSS
|
||||||
const checkGrid = x =>
|
const checkGrid = x =>
|
||||||
x?._component.endsWith("/container") && x?.layout === "grid"
|
x?._component?.endsWith("/container") && x?.layout === "grid"
|
||||||
$: insideGrid = checkGrid(parent)
|
$: insideGrid = checkGrid(parent)
|
||||||
$: isGrid = checkGrid(instance)
|
$: isGrid = checkGrid(instance)
|
||||||
$: gridMetadata = {
|
$: gridMetadata = {
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
|
|
||||||
// Get the screen definition for the current route
|
// Get the screen definition for the current route
|
||||||
$: screen = $screenStore.activeScreen
|
$: screen = $screenStore.activeScreen
|
||||||
$: screenDefinition = { ...screen?.props, addEmptyRows: true }
|
|
||||||
$: onLoadActions.set(screen?.onLoad)
|
$: onLoadActions.set(screen?.onLoad)
|
||||||
$: runOnLoadActions($onLoadActions, params)
|
$: runOnLoadActions($onLoadActions, params)
|
||||||
|
|
||||||
|
@ -42,10 +41,10 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Ensure to fully remount when screen changes -->
|
<!-- Ensure to fully remount when screen changes -->
|
||||||
{#if $routeStore.routerLoaded}
|
{#if $routeStore.routerLoaded && screen?.props}
|
||||||
{#key screenDefinition?._id}
|
{#key screen.props._id}
|
||||||
<Provider key="url" data={params}>
|
<Provider key="url" data={params}>
|
||||||
<Component isRoot instance={screenDefinition} />
|
<Component isRoot instance={screen.props} />
|
||||||
</Provider>
|
</Provider>
|
||||||
{/key}
|
{/key}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
import { GridRowHeight, GridColumns } from "constants"
|
import { GridRowHeight, GridColumns } from "constants"
|
||||||
import { memo } from "@budibase/frontend-core"
|
import { memo } from "@budibase/frontend-core"
|
||||||
|
|
||||||
export let addEmptyRows = false
|
|
||||||
|
|
||||||
const component = getContext("component")
|
const component = getContext("component")
|
||||||
const { styleable, builderStore } = getContext("sdk")
|
const { styleable, builderStore } = getContext("sdk")
|
||||||
const context = getContext("context")
|
const context = getContext("context")
|
||||||
|
@ -18,11 +16,8 @@
|
||||||
let styles = memo({})
|
let styles = memo({})
|
||||||
|
|
||||||
$: inBuilder = $builderStore.inBuilder
|
$: inBuilder = $builderStore.inBuilder
|
||||||
$: requiredRows = calculateRequiredRows(
|
$: addEmptyRows = $component.isRoot && inBuilder
|
||||||
$children,
|
$: requiredRows = calculateRequiredRows($children, mobile, addEmptyRows)
|
||||||
mobile,
|
|
||||||
addEmptyRows && inBuilder
|
|
||||||
)
|
|
||||||
$: requiredHeight = requiredRows * GridRowHeight
|
$: requiredHeight = requiredRows * GridRowHeight
|
||||||
$: availableRows = Math.floor(height / GridRowHeight)
|
$: availableRows = Math.floor(height / GridRowHeight)
|
||||||
$: rows = Math.max(requiredRows, availableRows)
|
$: rows = Math.max(requiredRows, availableRows)
|
||||||
|
|
Loading…
Reference in New Issue