diff --git a/packages/builder/src/components/database/ModelDataTable/modals/CreateEditModel.svelte b/packages/builder/src/components/database/ModelDataTable/modals/CreateEditModel.svelte index f6213268c6..61768f4479 100644 --- a/packages/builder/src/components/database/ModelDataTable/modals/CreateEditModel.svelte +++ b/packages/builder/src/components/database/ModelDataTable/modals/CreateEditModel.svelte @@ -1,7 +1,231 @@ -
- -
+ + {#if !editingField} + +

Create / Edit Model

+ {:else} + +

Create / Edit Field

+ {/if} +
+{#if !editingField} +
+

Settings

+ + {#if $store.errors && $store.errors.length > 0} + + {/if} + +
+ + + {#if isChildModel} +
+ +
{parent.name}
+
+ {/if} + + +
+ Fields +

Add new field

+
+ + + + + + + + + + + + {#each model ? model.fields : [] as field} + + + + + + + + {/each} + +
EditNameTypeValues +
+ editField(field)} /> + +
{field.name}
+
{field.type}{field.typeOptions.values || ''} + deleteField(field)} /> +
+
+ + Save + + {#if modelExistsInHierarchy} + + Create Child Model on {model.name} + + { + backendUiStore.actions.modals.show('VIEW') + await tick() + store.newChildIndex() + }}> + Create Child View on {model.name} + + + Delete + + {/if} +
+
+{:else} + +{/if} + + diff --git a/packages/builder/src/components/database/ModelView.svelte b/packages/builder/src/components/database/ModelView.svelte deleted file mode 100644 index 61768f4479..0000000000 --- a/packages/builder/src/components/database/ModelView.svelte +++ /dev/null @@ -1,231 +0,0 @@ - - - - {#if !editingField} - -

Create / Edit Model

- {:else} - -

Create / Edit Field

- {/if} -
-{#if !editingField} -
-

Settings

- - {#if $store.errors && $store.errors.length > 0} - - {/if} - -
- - - {#if isChildModel} -
- -
{parent.name}
-
- {/if} - - -
- Fields -

Add new field

-
- - - - - - - - - - - - {#each model ? model.fields : [] as field} - - - - - - - - {/each} - -
EditNameTypeValues -
- editField(field)} /> - -
{field.name}
-
{field.type}{field.typeOptions.values || ''} - deleteField(field)} /> -
-
- - Save - - {#if modelExistsInHierarchy} - - Create Child Model on {model.name} - - { - backendUiStore.actions.modals.show('VIEW') - await tick() - store.newChildIndex() - }}> - Create Child View on {model.name} - - - Delete - - {/if} -
-
-{:else} - -{/if} - -