From 526084f4ee443f0ce8005ff92611fdfe084f1228 Mon Sep 17 00:00:00 2001 From: pghorpade Date: Fri, 2 Aug 2024 16:11:36 -0700 Subject: [PATCH] APPS-2831 fix locations by adding both uri and to field as sometimes some compnnets use to and some use uri --- gql/fragments/BlockBannerFeaturedFragment.gql | 1 + gql/fragments/BlockCardWithImageFragment.gql | 1 + gql/fragments/BlockHighlightFragment.gql | 1 + gql/queries/ArticleDetail.gql | 2 ++ gql/queries/EventDetail.gql | 3 +++ gql/queries/Homepage.gql | 1 + gql/queries/LocationDetail.gql | 1 + .../ServiceOrResourceOrWorkshopDetail.gql | 3 +++ gql/queries/StaffDetail.gql | 1 + pages/give/endowments/index.vue | 20 ++++++++++--------- 10 files changed, 25 insertions(+), 9 deletions(-) diff --git a/gql/fragments/BlockBannerFeaturedFragment.gql b/gql/fragments/BlockBannerFeaturedFragment.gql index 2b0b26205..5af82d7c8 100644 --- a/gql/fragments/BlockBannerFeaturedFragment.gql +++ b/gql/fragments/BlockBannerFeaturedFragment.gql @@ -58,6 +58,7 @@ fragment BlockBannerFeaturedFragment on ElementInterface { id title to: uri + uri } projectLocations: region { ... on meapProjectRegion_Category { diff --git a/gql/fragments/BlockCardWithImageFragment.gql b/gql/fragments/BlockCardWithImageFragment.gql index bb6ec0187..6c61b1e44 100644 --- a/gql/fragments/BlockCardWithImageFragment.gql +++ b/gql/fragments/BlockCardWithImageFragment.gql @@ -65,6 +65,7 @@ fragment BlockCardWithImageFragment on ElementInterface { id title to: uri + uri } projectLocations: region { ... on meapProjectRegion_Category { diff --git a/gql/fragments/BlockHighlightFragment.gql b/gql/fragments/BlockHighlightFragment.gql index 8d7e8c7ed..a7fb9428b 100644 --- a/gql/fragments/BlockHighlightFragment.gql +++ b/gql/fragments/BlockHighlightFragment.gql @@ -64,6 +64,7 @@ fragment BlockHighlightFragment on ElementInterface { id title to: uri + uri } projectLocations: region { ... on meapProjectRegion_Category { diff --git a/gql/queries/ArticleDetail.gql b/gql/queries/ArticleDetail.gql index 8ddbd1ac3..779ff286e 100644 --- a/gql/queries/ArticleDetail.gql +++ b/gql/queries/ArticleDetail.gql @@ -43,6 +43,7 @@ query ArticleNewsDetail($slug: [String!]) { id title to: uri + uri ... on location_location_Entry { id email @@ -71,6 +72,7 @@ query ArticleNewsDetail($slug: [String!]) { id title to: slug + uri } image: staffPortrait { ...Image diff --git a/gql/queries/EventDetail.gql b/gql/queries/EventDetail.gql index f0ff99290..884500fdc 100644 --- a/gql/queries/EventDetail.gql +++ b/gql/queries/EventDetail.gql @@ -45,6 +45,7 @@ query EventDetail($slug: [String!]) { ... on location_location_Entry { id to: uri + uri title summary } @@ -129,6 +130,7 @@ query EventDetail($slug: [String!]) { ... on location_location_Entry { id to: uri + uri title summary } @@ -302,6 +304,7 @@ query EventDetail($slug: [String!]) { ... on location_location_Entry { id to: uri + uri title summary } diff --git a/gql/queries/Homepage.gql b/gql/queries/Homepage.gql index 88266f341..417849cc3 100644 --- a/gql/queries/Homepage.gql +++ b/gql/queries/Homepage.gql @@ -63,6 +63,7 @@ query Homepage { ... on location_location_Entry { id to: uri + uri title summary } diff --git a/gql/queries/LocationDetail.gql b/gql/queries/LocationDetail.gql index 0054a77ab..f78a75162 100644 --- a/gql/queries/LocationDetail.gql +++ b/gql/queries/LocationDetail.gql @@ -210,6 +210,7 @@ query LocationDetail($slug: [String!]) { id title to: uri + uri } } } diff --git a/gql/queries/ServiceOrResourceOrWorkshopDetail.gql b/gql/queries/ServiceOrResourceOrWorkshopDetail.gql index 01d1524d3..036a0e962 100644 --- a/gql/queries/ServiceOrResourceOrWorkshopDetail.gql +++ b/gql/queries/ServiceOrResourceOrWorkshopDetail.gql @@ -31,6 +31,7 @@ query ServiceOrResourceOrWorkshopDetail($slug: [String!]) { locations: associatedLocations { id to: slug + uri title } associatedTopics { @@ -74,6 +75,7 @@ query ServiceOrResourceOrWorkshopDetail($slug: [String!]) { ... on location_location_Entry { id to: uri + uri title summary } @@ -118,6 +120,7 @@ query ServiceOrResourceOrWorkshopDetail($slug: [String!]) { ... on location_location_Entry { id to: uri + uri title summary } diff --git a/gql/queries/StaffDetail.gql b/gql/queries/StaffDetail.gql index b2698ef5e..9bb2063ed 100644 --- a/gql/queries/StaffDetail.gql +++ b/gql/queries/StaffDetail.gql @@ -28,6 +28,7 @@ query StaffDetail($slug: [String]!) { locations: staffAssociatedLocations { title to: uri + uri id } pronouns diff --git a/pages/give/endowments/index.vue b/pages/give/endowments/index.vue index b4ab798de..5d9ad596f 100644 --- a/pages/give/endowments/index.vue +++ b/pages/give/endowments/index.vue @@ -93,6 +93,7 @@ const parsedEndowmentsList = computed(() => { associatedLocations: _get(obj, 'associatedLocations', []).map((loc) => { return { ...loc, + to: fixUri(loc.uri), uri: fixUri(loc.uri), } }), @@ -130,12 +131,12 @@ const searchGenericQuery = ref({ watch(() => route.query, -(newVal, oldVal) => { - // console.log('ES newVal, oldVal', newVal, oldVal) - searchGenericQuery.value.queryText = route.query.q || '' - searchGenericQuery.value.queryFilters = parseFilters(route.query.filters || '') - searchES() -}, { deep: true, immediate: true } + (newVal, oldVal) => { + // console.log('ES newVal, oldVal', newVal, oldVal) + searchGenericQuery.value.queryText = route.query.q || '' + searchGenericQuery.value.queryFilters = parseFilters(route.query.filters || '') + searchES() + }, { deep: true, immediate: true } ) async function searchES() { @@ -193,6 +194,7 @@ function parseHits(hits = []) { associatedLocations: _get(obj._source, 'associatedLocations', []).map((loc) => { return { ...loc, + to: fixUri(loc.uri), uri: fixUri(loc.uri), } }), @@ -274,7 +276,7 @@ onMounted(async () => { parsedFeaturedEndowments.length && hits.length == 0 && !noResultsFound - " + " class="section-no-top-margin" :section-title="page.featuredEndowments[0].titleGeneral" :section-summary="page.featuredEndowments[0].sectionSummary" @@ -292,7 +294,7 @@ onMounted(async () => { parsedFeaturedEndowments.length && hits.length == 0 && !noResultsFound - " + " theme="divider" > @@ -304,7 +306,7 @@ onMounted(async () => { parsedEndowmentsList.length && hits.length == 0 && !noResultsFound - " + " section-title="All Collection Endowments" >