Skip to content

Commit

Permalink
fix: show title in the template builder
Browse files Browse the repository at this point in the history
  • Loading branch information
danielo515 committed May 31, 2024
1 parent e899b54 commit 012901d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/views/components/TemplateBuilder.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
</script>

<div class="modal-form flex flex-col gap-2">
<h2 style="margin-bottom: 0;">Template for: {model.title}</h2>
<div class="flex gap-2">
<div class="flex gap-1 flex-col">
<h3>Fields to exclude</h3>
Expand Down
10 changes: 9 additions & 1 deletion src/views/components/TemplateBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,15 @@ export const makeModel = (formDefinition: FormDefinition) => {
function omitField(name: string, value: boolean) {
setField(name, { omit: value } as Field);
}
return { fields, setField, code, omitField, toggleAllFrontmatter, options };
return {
fields,
setField,
code,
omitField,
toggleAllFrontmatter,
options,
title: formDefinition.name,
};
};

export type TemplateBuilderModel = ReturnType<typeof makeModel>;

0 comments on commit 012901d

Please sign in to comment.