builder: create record: set collection name automatically

This commit is contained in:
Michael Shanks 2019-10-31 09:25:26 +00:00
parent 0cb7125bac
commit 2f457555a1
1 changed files with 8 additions and 2 deletions

View File

@ -79,6 +79,12 @@ let getTypeOptions = typeOptions =>
join("<br>")
]);
const nameChanged = ev => {
const pluralName = n => `${n}s`;
if(record.collectionName === "") {
record.collectionName = pluralName(ev.target.value);
}
}
</script>
@ -89,7 +95,7 @@ let getTypeOptions = typeOptions =>
Settings
</h3>
<Textbox label="Name:" bind:text={record.name} />
<Textbox label="Name:" bind:text={record.name} on:change={nameChanged}/>
{#if !record.isSingle}
<Textbox label="Collection Name:" bind:text={record.collectionName} />
<Textbox label="Shard Factor:" bind:text={record.allidsShardFactor} />