allow creation of username

This commit is contained in:
Martin McKeaveney 2020-11-27 15:24:43 +00:00
parent 4a8c37440e
commit d78e2c8d94
2 changed files with 5 additions and 3 deletions

View File

@ -7,11 +7,13 @@
import LinkedRowSelector from "components/common/LinkedRowSelector.svelte"
export let meta
export let creating
export let value = meta.type === "boolean" ? false : ""
$: type = meta.type
$: label = capitalise(meta.name)
$: userTableSelected = $backendUiStore.selectedTable?._id === TableNames.USERS
$: editingUser =
!creating && $backendUiStore.selectedTable?._id === TableNames.USERS
</script>
{#if type === 'options'}
@ -39,5 +41,5 @@
data-cy="{meta.name}-input"
{type}
bind:value
disabled={userTableSelected} />
disabled={editingUser} />
{/if}

View File

@ -47,7 +47,7 @@
{/if}
{#each tableSchema as [key, meta]}
<div>
<RowFieldControl {meta} bind:value={row[key]} />
<RowFieldControl {meta} bind:value={row[key]} {creating} />
</div>
{/each}
</ModalContent>