Handle sections properly
This commit is contained in:
parent
ea2b7b8791
commit
9976bcf125
|
@ -8,13 +8,15 @@ import {
|
|||
Component,
|
||||
UIComponentError,
|
||||
ScreenProps,
|
||||
ComponentDefinition,
|
||||
} from "@budibase/types"
|
||||
import { queries } from "./queries"
|
||||
import { views } from "./views"
|
||||
import { findAllComponents } from "@/helpers/components"
|
||||
import { bindings, featureFlag } from "@/helpers"
|
||||
import { getBindableProperties } from "@/dataBinding"
|
||||
import { componentStore, ComponentDefinition } from "./components"
|
||||
import { componentStore } from "./components"
|
||||
import { getSettingsDefinition } from "@budibase/frontend-core"
|
||||
|
||||
function reduceBy<TItem extends {}, TKey extends keyof TItem>(
|
||||
key: TKey,
|
||||
|
@ -137,8 +139,9 @@ function getMissingRequiredSettings(
|
|||
for (const component of allComponents) {
|
||||
const definition = definitions[component._component]
|
||||
|
||||
const missingRequiredSettings = definition?.settings?.filter(
|
||||
(setting: any) => {
|
||||
const settings = getSettingsDefinition(definition)
|
||||
|
||||
const missingRequiredSettings = settings.filter((setting: any) => {
|
||||
let empty =
|
||||
component[setting.key] == null || component[setting.key] === ""
|
||||
let missing = setting.required && empty
|
||||
|
@ -170,8 +173,7 @@ function getMissingRequiredSettings(
|
|||
}
|
||||
|
||||
return missing
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
if (missingRequiredSettings?.length) {
|
||||
result[component._id!] = missingRequiredSettings.map((s: any) => ({
|
||||
|
|
Loading…
Reference in New Issue