diff --git a/templates/react/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/Create{{pascal_case entry_type.name}}.tsx.hbs b/templates/react/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/Create{{pascal_case entry_type.name}}.tsx.hbs index bd6fe47ce..3b5e80733 100644 --- a/templates/react/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/Create{{pascal_case entry_type.name}}.tsx.hbs +++ b/templates/react/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/Create{{pascal_case entry_type.name}}.tsx.hbs @@ -60,7 +60,6 @@ const Create{{pascal_case entry_type.name}}: FC Vec/edit/render field_name=field_name field_type=field_type widget=widget }} {{/if}} - {{/if}} diff --git a/templates/react/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/types.ts.hbs b/templates/react/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/types.ts.hbs index 93009f2e3..1e8d8bf32 100644 --- a/templates/react/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/types.ts.hbs +++ b/templates/react/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/types.ts.hbs @@ -22,5 +22,4 @@ export interface {{pascal_case entry_type.name}} { {{#each entry_type.fields}} {{snake_case field_name}}: Array<{{> (concat field_type.type "/type") }}>; {{/if}} {{/each}} -} - +} \ No newline at end of file diff --git "a/templates/react/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if crud.update}}Edit{{pascal_case entry_type.name}}.tsx{{\302\241if}}.hbs" "b/templates/react/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if crud.update}}Edit{{pascal_case entry_type.name}}.tsx{{\302\241if}}.hbs" index 6bce2c300..402526321 100644 --- "a/templates/react/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if crud.update}}Edit{{pascal_case entry_type.name}}.tsx{{\302\241if}}.hbs" +++ "b/templates/react/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if crud.update}}Edit{{pascal_case entry_type.name}}.tsx{{\302\241if}}.hbs" @@ -99,7 +99,7 @@ const Edit{{pascal_case entry_type.name}}: FC { - setIs{{pascal_case entry_type.name}}Valid(true{{#each entry_type.fields}}{{#if widget}}{{#if (eq cardinality "single")}} && {{> (concat field_type.type "/" widget "/is-valid") variable_to_validate=(camel_case field_name) }}{{/if}}{{#if (eq cardinality "vector")}} && {{camel_case field_name}}?.every(e => {{> (concat field_type.type "/" widget "/is-valid") variable_to_validate="e" }}){{/if}}{{/if}}{{/each}}); + setIs{{pascal_case entry_type.name}}Valid(true{{#each entry_type.fields}}{{#if widget}}{{#if (eq cardinality "single")}} && {{> (concat field_type.type "/" widget "/is-valid") variable_to_validate=(camel_case field_name) }}{{/if}}{{#if (eq cardinality "vector")}} && {{camel_case field_name}}!.every(e => {{> (concat field_type.type "/" widget "/is-valid") variable_to_validate="e" }}){{/if}}{{/if}}{{/each}}); }, [{{#each entry_type.fields}}{{#if widget}}{{camel_case field_name}}{{#unless @last}}, {{/unless}}{{/if}}{{/each}}]); return ( @@ -112,7 +112,6 @@ const Edit{{pascal_case entry_type.name}}: FC Vec/edit/render field_name=field_name field_type=field_type widget=widget }} {{/if}} - {{/if}} diff --git a/templates/react/field-types/Enum/Select/edit/render.hbs b/templates/react/field-types/Enum/Select/edit/render.hbs index 0f072b056..644851ed0 100644 --- a/templates/react/field-types/Enum/Select/edit/render.hbs +++ b/templates/react/field-types/Enum/Select/edit/render.hbs @@ -1,8 +1,7 @@ - \ No newline at end of file + + diff --git a/templates/react/field-types/String/TextArea/edit/render.hbs b/templates/react/field-types/String/TextArea/edit/render.hbs index c84803901..e5f30dd5c 100644 --- a/templates/react/field-types/String/TextArea/edit/render.hbs +++ b/templates/react/field-types/String/TextArea/edit/render.hbs @@ -1,5 +1,6 @@ {{#if (eq cardinality "vector")}} + {{else}} + {{/if}} \ No newline at end of file diff --git a/templates/react/field-types/String/TextField/edit/render.hbs b/templates/react/field-types/String/TextField/edit/render.hbs index 228d7a67f..c03a456f5 100644 --- a/templates/react/field-types/String/TextField/edit/render.hbs +++ b/templates/react/field-types/String/TextField/edit/render.hbs @@ -1,5 +1,6 @@ {{#if (eq cardinality "vector")}} + {{else}} + set{{pascal_case variable_to_change}}(e.target.value)} /> {{/if}} \ No newline at end of file diff --git a/templates/react/field-types/Timestamp/DateTimePicker/edit/render.hbs b/templates/react/field-types/Timestamp/DateTimePicker/edit/render.hbs index 62cbf8196..5e73fb698 100644 --- a/templates/react/field-types/Timestamp/DateTimePicker/edit/render.hbs +++ b/templates/react/field-types/Timestamp/DateTimePicker/edit/render.hbs @@ -1,5 +1,6 @@ {{#if (eq cardinality "vector")}} + {{else}} - set{{pascal_case variable_to_change}}(Math.floor(new Date(e.target.value).getTime() / 1000))} {{#if required}}required{{/if}} /> + + set{{pascal_case variable_to_change}}(Math.floor(new Date(e.target.value).getTime() / 1000))} {{#if required}}required{{/if}} /> {{/if}} \ No newline at end of file diff --git a/templates/react/field-types/Vec/edit/render.hbs b/templates/react/field-types/Vec/edit/render.hbs index cf74b7790..327ae8932 100644 --- a/templates/react/field-types/Vec/edit/render.hbs +++ b/templates/react/field-types/Vec/edit/render.hbs @@ -3,6 +3,7 @@ { {{camel_case field_name}}?.map((value, i) => (
{{> (concat field_type.type "/" widget "/edit/render") label=(pascal_case field_name) variable_to_read="value" variable_to_change=(camel_case field_name) key="i" }} +
))} diff --git a/templates/react/field-types/bool/Checkbox/edit/render.hbs b/templates/react/field-types/bool/Checkbox/edit/render.hbs index 8e63e8966..974653713 100644 --- a/templates/react/field-types/bool/Checkbox/edit/render.hbs +++ b/templates/react/field-types/bool/Checkbox/edit/render.hbs @@ -1,5 +1,6 @@ {{#if (eq cardinality "vector")}} + {{else}} + set{{pascal_case variable_to_change}}(e.target.checked)} /> {{/if}} \ No newline at end of file diff --git a/templates/react/field-types/f32/NumberInput/edit/render.hbs b/templates/react/field-types/f32/NumberInput/edit/render.hbs index 7c6671b36..e6bf524cb 100644 --- a/templates/react/field-types/f32/NumberInput/edit/render.hbs +++ b/templates/react/field-types/f32/NumberInput/edit/render.hbs @@ -1,5 +1,6 @@ {{#if (eq cardinality "vector")}} + {{else}} + set{{pascal_case variable_to_change}}(parseFloat(e.target.value))} /> {{/if}} \ No newline at end of file diff --git a/templates/react/field-types/i32/NumberInput/edit/render.hbs b/templates/react/field-types/i32/NumberInput/edit/render.hbs index 46ec6f68b..8a654ffd0 100644 --- a/templates/react/field-types/i32/NumberInput/edit/render.hbs +++ b/templates/react/field-types/i32/NumberInput/edit/render.hbs @@ -1,5 +1,6 @@ {{#if (eq cardinality "vector")}} + {{else}} + set{{pascal_case variable_to_change}}(parseInt(e.target.value))} /> {{/if}} \ No newline at end of file diff --git a/templates/react/field-types/u32/NumberInput/edit/render.hbs b/templates/react/field-types/u32/NumberInput/edit/render.hbs index c33d87827..1a2bf4352 100644 --- a/templates/react/field-types/u32/NumberInput/edit/render.hbs +++ b/templates/react/field-types/u32/NumberInput/edit/render.hbs @@ -1,5 +1,6 @@ {{#if (eq cardinality "vector")}} + {{else}} + set{{pascal_case variable_to_change}}(parseInt(e.target.value))} /> {{/if}} \ No newline at end of file