From a44156b1ed3c7615caad655091ac5dcc4beafc03 Mon Sep 17 00:00:00 2001 From: Paul d'Aoust Date: Fri, 15 Sep 2023 11:12:22 -0700 Subject: [PATCH 1/5] pass hashes, not records, from FoosForBar template to FooDetail template --- ...inked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git "a/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" "b/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" index 9d2ee32bf..cc1f5e514 100644 --- "a/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" +++ "b/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" @@ -23,13 +23,14 @@ onMount(async () => { } try { - hashes = await client.callZome({ + const records = await client.callZome({ cap_secret: null, role_name: '{{dna_role_name}}', zome_name: '{{../coordinator_zome_manifest.name}}', fn_name: 'get_{{snake_case (plural ../entry_type.name)}}_for_{{snake_case linked_from.name}}', payload: {{camel_case linked_from.singular_arg}} }); + hashes = records.map(r => {{#if (eq referenceable.hash_type "ActionHash")}}r.signed_action.hashed.hash{{else}}(r.signed_action.hashed.content as NewEntryAction).entry_hash{{/if}}); } catch (e) { error = e; } From 88aaedb017f456acec89e0df133503edab0bd710 Mon Sep 17 00:00:00 2001 From: Paul d'Aoust Date: Fri, 15 Sep 2023 11:13:22 -0700 Subject: [PATCH 2/5] remove loading spinner after foos for bar are loaded --- ...linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" "b/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" index cc1f5e514..9bb8b7021 100644 --- "a/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" +++ "b/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" @@ -34,7 +34,7 @@ onMount(async () => { } catch (e) { error = e; } - loading = true; + loading = false; }); From a2f621738619e7e0e91fa72a7fe5f1fbd6f983e5 Mon Sep 17 00:00:00 2001 From: Paul d'Aoust Date: Fri, 15 Sep 2023 14:47:33 -0700 Subject: [PATCH 3/5] correct path to dna_role_name in FoosForBar template --- ...linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" "b/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" index 9bb8b7021..0fff3fb62 100644 --- "a/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" +++ "b/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" @@ -25,7 +25,7 @@ onMount(async () => { try { const records = await client.callZome({ cap_secret: null, - role_name: '{{dna_role_name}}', + role_name: '{{../dna_role_name}}', zome_name: '{{../coordinator_zome_manifest.name}}', fn_name: 'get_{{snake_case (plural ../entry_type.name)}}_for_{{snake_case linked_from.name}}', payload: {{camel_case linked_from.singular_arg}} From 8c49a5665f68f1f395c1c963bc8f0f0c99df4bb1 Mon Sep 17 00:00:00 2001 From: Paul d'Aoust Date: Tue, 19 Sep 2023 13:21:49 -0700 Subject: [PATCH 4/5] get actual hash type for linked entries --- ...linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" "b/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" index 0fff3fb62..e78f290b9 100644 --- "a/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" +++ "b/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" @@ -30,7 +30,7 @@ onMount(async () => { fn_name: 'get_{{snake_case (plural ../entry_type.name)}}_for_{{snake_case linked_from.name}}', payload: {{camel_case linked_from.singular_arg}} }); - hashes = records.map(r => {{#if (eq referenceable.hash_type "ActionHash")}}r.signed_action.hashed.hash{{else}}(r.signed_action.hashed.content as NewEntryAction).entry_hash{{/if}}); + hashes = records.map(r => {{#if ../entry_type.reference_entry_hash}}(r.signed_action.hashed.content as NewEntryAction).entry_hash{{else}}r.signed_action.hashed.hash{{/if}}); } catch (e) { error = e; } From f49002a3fb5325490e8e846d97e23a2abf45ed4d Mon Sep 17 00:00:00 2001 From: Paul d'Aoust Date: Tue, 19 Sep 2023 15:04:24 -0700 Subject: [PATCH 5/5] import newentryaction into barsforfoo template --- ...linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" "b/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" index e78f290b9..1b0afd753 100644 --- "a/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" +++ "b/templates/svelte/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.svelte{{\302\241if}}{{\302\241each}}.hbs" @@ -1,7 +1,7 @@