builder: create record: set collection name automatically
This commit is contained in:
parent
0cb7125bac
commit
2f457555a1
|
@ -79,6 +79,12 @@ let getTypeOptions = typeOptions =>
|
||||||
join("<br>")
|
join("<br>")
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const nameChanged = ev => {
|
||||||
|
const pluralName = n => `${n}s`;
|
||||||
|
if(record.collectionName === "") {
|
||||||
|
record.collectionName = pluralName(ev.target.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -89,7 +95,7 @@ let getTypeOptions = typeOptions =>
|
||||||
Settings
|
Settings
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<Textbox label="Name:" bind:text={record.name} />
|
<Textbox label="Name:" bind:text={record.name} on:change={nameChanged}/>
|
||||||
{#if !record.isSingle}
|
{#if !record.isSingle}
|
||||||
<Textbox label="Collection Name:" bind:text={record.collectionName} />
|
<Textbox label="Collection Name:" bind:text={record.collectionName} />
|
||||||
<Textbox label="Shard Factor:" bind:text={record.allidsShardFactor} />
|
<Textbox label="Shard Factor:" bind:text={record.allidsShardFactor} />
|
||||||
|
|
Loading…
Reference in New Issue