Skip to content

Commit

Permalink
APPS-2831 fix locations by adding both uri and to field as sometimes …
Browse files Browse the repository at this point in the history
…some compnnets use to and some use uri
  • Loading branch information
pghorpade committed Aug 2, 2024
1 parent aee71e5 commit 526084f
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 9 deletions.
1 change: 1 addition & 0 deletions gql/fragments/BlockBannerFeaturedFragment.gql
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ fragment BlockBannerFeaturedFragment on ElementInterface {
id
title
to: uri
uri
}
projectLocations: region {
... on meapProjectRegion_Category {
Expand Down
1 change: 1 addition & 0 deletions gql/fragments/BlockCardWithImageFragment.gql
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ fragment BlockCardWithImageFragment on ElementInterface {
id
title
to: uri
uri
}
projectLocations: region {
... on meapProjectRegion_Category {
Expand Down
1 change: 1 addition & 0 deletions gql/fragments/BlockHighlightFragment.gql
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ fragment BlockHighlightFragment on ElementInterface {
id
title
to: uri
uri
}
projectLocations: region {
... on meapProjectRegion_Category {
Expand Down
2 changes: 2 additions & 0 deletions gql/queries/ArticleDetail.gql
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ query ArticleNewsDetail($slug: [String!]) {
id
title
to: uri
uri
... on location_location_Entry {
id
email
Expand Down Expand Up @@ -71,6 +72,7 @@ query ArticleNewsDetail($slug: [String!]) {
id
title
to: slug
uri
}
image: staffPortrait {
...Image
Expand Down
3 changes: 3 additions & 0 deletions gql/queries/EventDetail.gql
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ query EventDetail($slug: [String!]) {
... on location_location_Entry {
id
to: uri
uri
title
summary
}
Expand Down Expand Up @@ -129,6 +130,7 @@ query EventDetail($slug: [String!]) {
... on location_location_Entry {
id
to: uri
uri
title
summary
}
Expand Down Expand Up @@ -302,6 +304,7 @@ query EventDetail($slug: [String!]) {
... on location_location_Entry {
id
to: uri
uri
title
summary
}
Expand Down
1 change: 1 addition & 0 deletions gql/queries/Homepage.gql
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ query Homepage {
... on location_location_Entry {
id
to: uri
uri
title
summary
}
Expand Down
1 change: 1 addition & 0 deletions gql/queries/LocationDetail.gql
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ query LocationDetail($slug: [String!]) {
id
title
to: uri
uri
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions gql/queries/ServiceOrResourceOrWorkshopDetail.gql
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ query ServiceOrResourceOrWorkshopDetail($slug: [String!]) {
locations: associatedLocations {
id
to: slug
uri
title
}
associatedTopics {
Expand Down Expand Up @@ -74,6 +75,7 @@ query ServiceOrResourceOrWorkshopDetail($slug: [String!]) {
... on location_location_Entry {
id
to: uri
uri
title
summary
}
Expand Down Expand Up @@ -118,6 +120,7 @@ query ServiceOrResourceOrWorkshopDetail($slug: [String!]) {
... on location_location_Entry {
id
to: uri
uri
title
summary
}
Expand Down
1 change: 1 addition & 0 deletions gql/queries/StaffDetail.gql
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ query StaffDetail($slug: [String]!) {
locations: staffAssociatedLocations {
title
to: uri
uri
id
}
pronouns
Expand Down
20 changes: 11 additions & 9 deletions pages/give/endowments/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const parsedEndowmentsList = computed(() => {
associatedLocations: _get(obj, 'associatedLocations', []).map((loc) => {
return {
...loc,
to: fixUri(loc.uri),
uri: fixUri(loc.uri),
}
}),
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -193,6 +194,7 @@ function parseHits(hits = []) {
associatedLocations: _get(obj._source, 'associatedLocations', []).map((loc) => {
return {
...loc,
to: fixUri(loc.uri),
uri: fixUri(loc.uri),
}
}),
Expand Down Expand Up @@ -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"
Expand All @@ -292,7 +294,7 @@ onMounted(async () => {
parsedFeaturedEndowments.length &&
hits.length == 0 &&
!noResultsFound
"
"
theme="divider"
>
<DividerWayFinder color="about" />
Expand All @@ -304,7 +306,7 @@ onMounted(async () => {
parsedEndowmentsList.length &&
hits.length == 0 &&
!noResultsFound
"
"
section-title="All Collection Endowments"
>
<SectionGenericList :items="parsedEndowmentsList" />
Expand Down

0 comments on commit 526084f

Please sign in to comment.