From f196054c7e2c21924c6600d0cebfc8a7e5183941 Mon Sep 17 00:00:00 2001 From: Caryl Wyatt Date: Fri, 8 Nov 2024 13:38:18 -0500 Subject: [PATCH 1/2] add original location filter to advanced search --- .../AdvancedSearchForm/index.svelte | 48 ++++++++++++++++++- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/src/js/components/AdvancedSearchForm/index.svelte b/src/js/components/AdvancedSearchForm/index.svelte index a82e0ea..21c1706 100644 --- a/src/js/components/AdvancedSearchForm/index.svelte +++ b/src/js/components/AdvancedSearchForm/index.svelte @@ -10,6 +10,7 @@ // { + if (value.includes('htsource')) { + originalLocation = value.replace('htsource:', ''); + } + }); + originalLocation = originalLocation; + } if (!params.get('ft') && window.location.href.includes('?')) { isFullView = false; @@ -343,6 +360,14 @@ }); format = format; } + if (params.get('facet')?.includes('htsource')) { + params.getAll('facet').forEach((value) => { + if (value.includes('htsource')) { + originalLocation = value.replace('htsource:', '').replaceAll('"', ''); + } + }); + originalLocation = originalLocation; + } yop = params.get('yop') || 'after'; switch (yop) { @@ -686,6 +711,25 @@ /> + +
+ Original Location + +
+ ({ + option: item, + key: item, + value: item, + }))} + label="Original location" + placeholder="Filter by original location" + multiple={false} + bind:value={originalLocation} + /> +
+
From e4ed5fbeb42d7243e1478fa224de9250123fb2c7 Mon Sep 17 00:00:00 2001 From: Caryl Wyatt Date: Fri, 6 Dec 2024 16:05:18 -0500 Subject: [PATCH 2/2] fix ampersand in data --- src/js/components/FilterableSelection.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/components/FilterableSelection.svelte b/src/js/components/FilterableSelection.svelte index 2c6a626..a491972 100644 --- a/src/js/components/FilterableSelection.svelte +++ b/src/js/components/FilterableSelection.svelte @@ -123,7 +123,7 @@ on:focus={(event) => updateValue(event, true)} /> {/if} - + {/each}