allow creation of username

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

View File

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

View File

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