diff --git a/src/views/ManageForms.svelte b/src/views/ManageForms.svelte index a63d4c68..0c70a432 100644 --- a/src/views/ManageForms.svelte +++ b/src/views/ManageForms.svelte @@ -1,16 +1,25 @@ -

Manage forms

- - +
+

Manage forms

+ + {#if invalidForms.length} + +

+ Please take a look at the invalid forms section for details and + potential fixes. +

+ {/if} +
{#each forms as form}
-

{form.name}

+

{form.name}

+
+ {#each Object.entries(form) as [key, value]} + {#if key !== "name"} + + {Array.isArray(value) + ? value.length + : value} + + {/if} + {/each} + + + {#each form.fields as field} + {field.name} + {/each} + +
- - - + + - +
{/each} + {#if invalidForms.length} + +
+ {#each invalidForms as form} +
+

{form.name}

+ {#each form.error.issues as error} + + {error.message} + + {/each} +
+ {/each} +
+ {/if}
diff --git a/src/views/ManageFormsView.ts b/src/views/ManageFormsView.ts index 56a8cbbb..ed5f8f8d 100644 --- a/src/views/ManageFormsView.ts +++ b/src/views/ManageFormsView.ts @@ -58,7 +58,12 @@ export class ManageFormsView extends ItemView { }, duplicateForm: (form: FormDefinition) => { this.plugin.duplicateForm(form); + }, + copyFormToClipboard: async (form: FormDefinition) => { + await navigator.clipboard.writeText(JSON.stringify(form, null, 2)); + new Notice("Form has been copied to the clipboard"); } + } }) // container.createEl("h3", { text: "Manage forms" }); diff --git a/src/views/components/Button.svelte b/src/views/components/Button.svelte new file mode 100644 index 00000000..ed1cf03a --- /dev/null +++ b/src/views/components/Button.svelte @@ -0,0 +1,28 @@ + + + diff --git a/src/views/components/KeyValue.svelte b/src/views/components/KeyValue.svelte new file mode 100644 index 00000000..f266a39c --- /dev/null +++ b/src/views/components/KeyValue.svelte @@ -0,0 +1,20 @@ + + +
+ {key}: + +
+ + diff --git a/styles.css b/styles.css index f1c0fa70..a03e55c8 100644 --- a/styles.css +++ b/styles.css @@ -9,6 +9,7 @@ If your plugin does not need CSS, delete this file. :root { --mf-spacing: 0.75rem; + --mf-spacing2: 1.5rem; } /* Utilities to remove styles from native obsidian elements when wrapped like this