diff --git a/src/scaffold/entry_type.rs b/src/scaffold/entry_type.rs index 78d58b769..4fc148bf7 100644 --- a/src/scaffold/entry_type.rs +++ b/src/scaffold/entry_type.rs @@ -101,15 +101,6 @@ pub fn scaffold_entry_type( } }; - let widget_fields = fields - .iter() - .map(|f| f.clone()) - .filter(|f| match f.widget { - Some(_) => true, - None => false - }) - .collect(); - let reference_entry_hash = match maybe_reference_entry_hash { Some(r) => r.clone(), None => { @@ -156,7 +147,6 @@ pub fn scaffold_entry_type( let entry_def = EntryDefinition { name: name.clone(), fields, - widget_fields, reference_entry_hash, }; diff --git a/src/scaffold/entry_type/definitions.rs b/src/scaffold/entry_type/definitions.rs index d262545de..04cf9507e 100644 --- a/src/scaffold/entry_type/definitions.rs +++ b/src/scaffold/entry_type/definitions.rs @@ -298,7 +298,6 @@ impl Referenceable { pub struct EntryDefinition { pub name: String, pub fields: Vec, - pub widget_fields: Vec, pub reference_entry_hash: bool, } diff --git "a/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if crud.update}}Edit{{pascal_case entry_type.name}}.svelte{{\302\241if}}.hbs" "b/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if crud.update}}Edit{{pascal_case entry_type.name}}.svelte{{\302\241if}}.hbs" index 45917c7ff..288a5c795 100644 --- "a/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if crud.update}}Edit{{pascal_case entry_type.name}}.svelte{{\302\241if}}.hbs" +++ "b/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if crud.update}}Edit{{pascal_case entry_type.name}}.svelte{{\302\241if}}.hbs" @@ -39,7 +39,7 @@ let {{camel_case field_name}}: Array<{{> (concat field_type.type "/type")}} | un let errorSnackbar: Snackbar; -$: {{#each entry_type.widget_fields}}{{camel_case field_name}}{{#unless @last}}, {{/unless}}{{/each}}; +$: {{#each (filter entry_type.fields "widget")}}{{camel_case field_name}}{{#unless @last}}, {{/unless}}{{/each}}; $: is{{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}}; onMount(() => {