From daaadb41c5281517563bd5b1ebef7b430fec054b Mon Sep 17 00:00:00 2001 From: ctot-nondef Date: Fri, 19 Jan 2024 17:09:31 +0100 Subject: [PATCH 1/3] autocomp adjusted with custom template, only specific store paths persisted --- src/components/Search/SearchDimensions.vue | 14 +++++++++++++- src/stores/searchSettings.ts | 21 +++++++++++---------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/components/Search/SearchDimensions.vue b/src/components/Search/SearchDimensions.vue index 8475edd..240fe9e 100644 --- a/src/components/Search/SearchDimensions.vue +++ b/src/components/Search/SearchDimensions.vue @@ -16,5 +16,17 @@ const { selectedSearches, possibleSearchKeys } = storeToRefs(searchSettings); clearable chips :items="possibleSearchKeys" - /> + > + + + + diff --git a/src/stores/searchSettings.ts b/src/stores/searchSettings.ts index 16adcae..cb0932a 100644 --- a/src/stores/searchSettings.ts +++ b/src/stores/searchSettings.ts @@ -10,13 +10,12 @@ export const useSearchSettingsStore = defineStore( const { getRegionsFrequencies } = useRegionsSearch(); const { getKeywordInContext } = useKeywordInContextSearch(); - const t = useTranslations("Corpsum"); - const possibleSearchKeys: Ref> = ref([ - { value: "yearlyFrequencies", title: t("yearlyFrequencies") }, - { value: "wordFormFrequencies", title: t("wordFormFrequencies") }, - { value: "regionalFrequencies", title: t("regionalFrequencies") }, - { value: "mediaSources", title: t("mediaSources") }, - { value: "keywordInContext", title: t("keywordInContext") }, + const possibleSearchKeys: Ref> = ref([ + "yearlyFrequencies", + "wordFormFrequencies", + "regionalFrequencies", + "mediaSources", + "keywordInContext", ]); const searchFunctions: Record Promise> = { @@ -40,8 +39,6 @@ export const useSearchSettingsStore = defineStore( ]); async function doSearches(query: CorpusQuery) { - // console.log({ selsearchVal: selectedSearches.value }); - return await Promise.all( selectedSearches.value.map( (a: SearchFunctionKey) => @@ -82,7 +79,11 @@ export const useSearchSettingsStore = defineStore( doSearches, }; }, - { persist: true }, + { + persist: { + paths: ["selectedSearches"], + }, + }, ); if (import.meta.hot) { From 47e167e2a428c262a48b60e44422c810a4824cc6 Mon Sep 17 00:00:00 2001 From: ctot-nondef Date: Fri, 19 Jan 2024 17:31:37 +0100 Subject: [PATCH 2/3] typing troubles --- src/components/Search/SearchDimensions.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Search/SearchDimensions.vue b/src/components/Search/SearchDimensions.vue index 240fe9e..3029715 100644 --- a/src/components/Search/SearchDimensions.vue +++ b/src/components/Search/SearchDimensions.vue @@ -22,6 +22,7 @@ const { selectedSearches, possibleSearchKeys } = storeToRefs(searchSettings);