Skip to content

fix(search): filter event search with division#805

Merged
nikomakela merged 1 commit into
mainfrom
TH-1429-helsinki-division
Aug 28, 2025
Merged

fix(search): filter event search with division#805
nikomakela merged 1 commit into
mainfrom
TH-1429-helsinki-division

Conversation

@nikomakela

Copy link
Copy Markdown
Contributor

TH-1429.

NOTE: This affects in every apps searches:

  • event / course search
  • similar events
  • upcoming events

The event search result list should not contain events outside the city of Helsinki. This commit fixes the event list search variables to contain a city of Helsinki division filter.

The *Ongoing* -queries in LinkedEvents are using a search index (cache) that stores only the city of Helsinki events, but when the Ongoing -filter is not in use, the result set will contain also events outside the city of Helsinki. When the allOngoingAnd text query filter was replaced with a newer xFullText filter, the result set was no longer limited to city of Helsinki events (by the search index). To fix that, a new division filter is taken in action.

NOTE: This should not be mixed with the helsinkiOnly -filter, that is still active in code base (but might be hidden in UI). The helsinkiOnly filter currently limits the result set by filtering it with publisherAnchestor field value (ahjo:00001; Helsinki; https://api.hel.fi/linkedevents/v1/organization/ahjo:00001/).

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-hobbies-pr805.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-events-pr805.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-sports-pr805.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

TAPAHTUMAT-UI branch is deployed to platta: https://tapahtumat-pr805.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

HARRASTUKSET-UI branch is deployed to platta: https://harrastukset-pr805.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

LIIKUNTA-UI branch is deployed to platta: https://liikunta-pr805.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

TestCafe result is success for https://liikunta-pr805.dev.hel.ninja 😆🎉🎉🎉

@terovirtanen

Copy link
Copy Markdown
Contributor

EVENTS-GRAPHQL-PROXY branch is deployed to platta: https://events-graphql-proxy-pr805.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

VENUE-GRAPHQL-PROXY branch is deployed to platta: https://venue-graphql-proxy-pr805.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

TestCafe result is failed for https://tapahtumat-pr805.dev.hel.ninja 😿💢💥💥

@terovirtanen

Copy link
Copy Markdown
Contributor

TestCafe result is success for https://harrastukset-pr805.dev.hel.ninja 😆🎉🎉🎉

@nikomakela nikomakela force-pushed the TH-1429-helsinki-division branch from 3a6c463 to 0843cd9 Compare August 27, 2025 12:46
@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-events-pr805.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-hobbies-pr805.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-sports-pr805.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

TAPAHTUMAT-UI branch is deployed to platta: https://tapahtumat-pr805.dev.hel.ninja 🚀🚀🚀

TH-1429.

NOTE: This affects in every apps searches:
- event / course search
- similar events
- upcoming events

The event search result list should not contain events outside the city
of Helsinki. This commit fixes the event list search variables to
contain a city of Helsinki division filter.

The `*Ongoing*` -queries in LinkedEvents are using a search index
(cache) that stores only the city of Helsinki events, but when the
*Ongoing* -filter is not in use, the result set will contain also events
outside the city of Helsinki. When the `allOngoingAnd` text query filter
was replaced with a newer `xFullText` filter, the result set was no
longer limited to city of Helsinki events (by the search index). To fix
that, a new division filter is taken in action.

NOTE: This should not be mixed with the `helsinkiOnly` -filter, that is
still active in code base (but might be hidden in UI). The
`helsinkiOnly` filter currently limits the result set by filtering it
with `publisherAnchestor` field value (ahjo:00001; Helsinki; @see
https://api.hel.fi/linkedevents/v1/organization/ahjo:00001/).
@terovirtanen

Copy link
Copy Markdown
Contributor

LIIKUNTA-UI branch is deployed to platta: https://liikunta-pr805.dev.hel.ninja 🚀🚀🚀

@nikomakela nikomakela force-pushed the TH-1429-helsinki-division branch from 0843cd9 to b1cfa86 Compare August 27, 2025 12:57
@terovirtanen

Copy link
Copy Markdown
Contributor

HARRASTUKSET-UI branch is deployed to platta: https://harrastukset-pr805.dev.hel.ninja 🚀🚀🚀

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-hobbies-pr805.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-sports-pr805.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-events-pr805.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

TAPAHTUMAT-UI branch is deployed to platta: https://tapahtumat-pr805.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

HARRASTUKSET-UI branch is deployed to platta: https://harrastukset-pr805.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

LIIKUNTA-UI branch is deployed to platta: https://liikunta-pr805.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

EVENTS-GRAPHQL-PROXY branch is deployed to platta: https://events-graphql-proxy-pr805.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

VENUE-GRAPHQL-PROXY branch is deployed to platta: https://venue-graphql-proxy-pr805.dev.hel.ninja 🚀🚀🚀

@nikomakela nikomakela marked this pull request as ready for review August 27, 2025 13:11
@terovirtanen

Copy link
Copy Markdown
Contributor

TestCafe result is success for https://liikunta-pr805.dev.hel.ninja 😆🎉🎉🎉

@terovirtanen

Copy link
Copy Markdown
Contributor

TestCafe result is failed for https://tapahtumat-pr805.dev.hel.ninja 😿💢💥💥

@terovirtanen

Copy link
Copy Markdown
Contributor

TestCafe result is success for https://harrastukset-pr805.dev.hel.ninja 😆🎉🎉🎉

@karisal-anders karisal-anders left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarity IMHO it'd be good to rename the division to divisions because
it is explicitly defined to be an array, and can hold more than one element i.e.

division?: string[];
division: EventSearchParams['division'];
| 'division'
division: [HELSINKI_OCD_DIVISION_ID],
DIVISIONS = 'division',
[EVENT_SEARCH_FILTERS.DIVISIONS]: division,

divisions?: string[];
divisions: EventSearchParams['divisions'];
| 'divisions'
divisions: [HELSINKI_OCD_DIVISION_ID],
DIVISIONS = 'divisions',
[EVENT_SEARCH_FILTERS.DIVISIONS]: divisions,
```

Otherwise good to merge.

@nikomakela

Copy link
Copy Markdown
Contributor Author

For clarity IMHO it'd be good to rename the division to divisions because
it is explicitly defined to be an array, and can hold more than one element i.e.

I thought about this also, but then it would not be consistent with other parameters, which are following the naming in the LinkedEvents. In LE, the division-filter really is "division", even though it can handle multiple divisions. The naming actually comes from EventListQueryVariables https://github.com/City-of-Helsinki/events-helsinki-monorepo/blob/TH-1429-helsinki-division/packages/components/src/types/generated/graphql.tsx#L14644. Then it needs to be listed here in types.ts https://github.com/City-of-Helsinki/events-helsinki-monorepo/blob/TH-1429-helsinki-division/apps/sports-helsinki/src/domain/search/combinedSearch/types.ts#L117. Because of this, I would not like to do this change, at least not now.

@nikomakela nikomakela merged commit 180e755 into main Aug 28, 2025
72 checks passed
@charn charn deleted the TH-1429-helsinki-division branch July 8, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants