Skip to content

Commit

Permalink
Merge pull request #163 from invopop/fix_sections
Browse files Browse the repository at this point in the history
Exclude string arrays from document headers
  • Loading branch information
beliolfa authored Oct 3, 2024
2 parents 693e066 + 1d72c7b commit ce37af7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/store/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { getUIModel, type UIModelRootField } from "$lib/editor/form/utils/model"
import { getDebouncedFunction } from "$lib/editor/form/utils/debounce";
import type { Envelope } from "$lib/types/envelope";
import { newEnvelope } from "$lib/helpers/envelope";
import type { Schema } from "$lib/editor/form/utils/schema";

const BUILDER_CONTEXT_ID = "builder-context";

Expand Down Expand Up @@ -99,7 +100,10 @@ export function createBuilderContext(): BuilderContext {
const root = { slug: fields.id, label: `${rootKey.charAt(0).toUpperCase()}${rootKey.slice(1)}`, active: true };
const items =
fields.children
?.filter((f) => ["object", "array"].includes(f.type))
?.filter((f) => {
const childrenType = (f.schema.items as Schema)?.type;
return ["object", "array"].includes(f.type) && childrenType !== "string";
})
.map((f) => ({
slug: f.id,
label: f.schema.title || "",
Expand Down

0 comments on commit ce37af7

Please sign in to comment.