Skip to content

Commit 7cedb28

Browse files
committed
feat: remove x-prefix from xFullText and xOngoing event search params
TH-1428. The filter `xFullText` is renamed to `fullText` and `xOngoing` to `ongoing` during the final phase of experiment stage in LinkedEvents API. The x-prefix is removed, since the x is for experimental features.
1 parent 23c095b commit 7cedb28

18 files changed

Lines changed: 14033 additions & 6260 deletions

File tree

apps/sports-helsinki/src/domain/event/__tests__/EventPageContainer.test.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ const mocks = [
117117
}),
118118
createEventListRequestAndResultMocks({
119119
variables: {
120-
xFullText: '',
121-
xOngoing: true,
120+
fullText: '',
121+
ongoing: true,
122122
keywordOrSet2: eventKeywordIds,
123123
eventType: [EventTypeId.Course],
124124
superEvent: 'none',
@@ -233,8 +233,8 @@ it('shows similar events when SIMILAR_EVENTS flag is on', async () => {
233233
...mocks,
234234
createEventListRequestAndResultMocks({
235235
variables: {
236-
xFullText: '',
237-
xOngoing: true,
236+
fullText: '',
237+
ongoing: true,
238238
keywordOrSet2: ['yso:p916', 'yso:p9824', 'yso:p6409'],
239239
eventType: [EventTypeId.Course],
240240
superEvent: 'none',
@@ -277,8 +277,8 @@ it('doesnt show similar events when keywords are not mapped', async () => {
277277
...mocks,
278278
createEventListRequestAndResultMocks({
279279
variables: {
280-
xFullText: '',
281-
xOngoing: true,
280+
fullText: '',
281+
ongoing: true,
282282
internetBased: undefined,
283283
keywordOrSet2: [''],
284284
language: undefined,

apps/sports-helsinki/src/domain/search/combinedSearch/__tests__/SearchUtilities.test.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,17 @@ const mocks = [
5555
}),
5656
createEventListRequestAndResultMocks({
5757
variables: {
58-
xFullText: '',
59-
xOngoing: true,
58+
fullText: '',
59+
ongoing: true,
6060
keywordOrSet1: SPORT_COURSES_KEYWORDS,
6161
language: undefined,
6262
},
6363
response: fakeEvents(5),
6464
}),
6565
createEventListRequestAndResultMocks({
6666
variables: {
67-
xFullText: '',
68-
xOngoing: true,
67+
fullText: '',
68+
ongoing: true,
6969
keywordOrSet1: SPORT_COURSES_KEYWORDS,
7070
language: undefined,
7171
eventType: EventTypeId.Course,
@@ -74,8 +74,8 @@ const mocks = [
7474
}),
7575
createEventListRequestAndResultMocks({
7676
variables: {
77-
xFullText: '',
78-
xOngoing: true,
77+
fullText: '',
78+
ongoing: true,
7979
keywordOrSet1: SPORT_COURSES_KEYWORDS,
8080
language: undefined,
8181
eventType: EventTypeId.General,

apps/sports-helsinki/src/domain/search/combinedSearch/adapters/EventSearchAdapter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class EventSearchAdapter implements CombinedSearchAdapter<EventSearchParams> {
1717
* List here all the event and course search parameters
1818
* that are wanted to be mapped with the combined search.
1919
*/
20-
xFullText?: EventSearchParams['xFullText'];
21-
xOngoing: EventSearchParams['xOngoing'];
20+
fullText?: EventSearchParams['fullText'];
21+
ongoing: EventSearchParams['ongoing'];
2222
start: EventSearchParams['start'];
2323
end: EventSearchParams['end'];
2424
include: EventSearchParams['include'];
@@ -50,7 +50,7 @@ class EventSearchAdapter implements CombinedSearchAdapter<EventSearchParams> {
5050
// Initialize the object with default values
5151
Object.assign(this, initialEventSearchAdapterValues, { eventType });
5252

53-
this.xFullText = input.text || initialEventSearchAdapterValues.xFullText;
53+
this.fullText = input.text || initialEventSearchAdapterValues.fullText;
5454
this.keywordAnd = [];
5555
this.keywordOrSet1 = SPORT_COURSES_KEYWORDS;
5656
this.keywordOrSet2 = this.getSportsKeywords(input);

apps/sports-helsinki/src/domain/search/combinedSearch/adapters/__tests__/CombinedSearchFormAdapter.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ describe('CombinedSearchFormAdapter', () => {
136136
keywordAnd: outputQuery.keywords,
137137
sort: outputQuery.eventOrderBy ?? null,
138138
eventType: EventTypeId.General,
139-
xFullText: outputQuery.text,
140-
xOngoing: true,
139+
fullText: outputQuery.text,
140+
ongoing: true,
141141
start: 'now',
142142
end: '',
143143
keywordNot: [],

apps/sports-helsinki/src/domain/search/combinedSearch/adapters/__tests__/EventSearchAdapter.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ describe('EventSearchAdapter', () => {
2121
const adapter = new EventSearchAdapter(input, eventType);
2222
const result = {
2323
eventType,
24-
xFullText: input.text,
25-
xOngoing: true,
24+
fullText: input.text,
25+
ongoing: true,
2626
start: 'now',
2727
end: '',
2828
keywordAnd: input.keywords,

apps/sports-helsinki/src/domain/search/combinedSearch/adapters/__tests__/__snapshots__/CombinedSearchProvider.test.tsx.snap

Lines changed: 18 additions & 18 deletions
Large diffs are not rendered by default.

apps/sports-helsinki/src/domain/search/combinedSearch/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ export const initialVenueSearchAdapterValues = {
4646
} as const satisfies VenueSearchParams;
4747

4848
export const initialEventSearchAdapterValues = {
49-
xFullText: '',
50-
xOngoing: true,
49+
fullText: '',
50+
ongoing: true,
5151
start: 'now',
5252
end: '',
5353
include: ['keywords', 'location'] as string[],

apps/sports-helsinki/src/domain/search/combinedSearch/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ export type CombinedSearchAdapterInputFallback =
9494
/** The fields that are used by the Event and Course search. */
9595
export type EventSearchParams = Pick<
9696
EventListQueryVariables,
97-
| 'xFullText'
98-
| 'xOngoing'
97+
| 'fullText'
98+
| 'ongoing'
9999
| 'start'
100100
| 'end'
101101
| 'include'

apps/sports-helsinki/src/domain/search/eventSearch/utils.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ export const getEventSearchVariables = ({
227227
];
228228

229229
return {
230-
xFullText: text?.join(', '),
231-
xOngoing: true,
230+
fullText: text?.join(', '),
231+
ongoing: true,
232232
isFree: isFree || undefined,
233233
end,
234234
include,

packages/components/src/components/domain/eventSearch/query.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ export const QUERY_EVENT_LIST = gql`
3838
$text: String
3939
$translation: String
4040
# Experimental fields...
41-
$xFullText: String
42-
$xOngoing: Boolean
41+
$fullText: String
42+
$ongoing: Boolean
4343
) {
4444
eventList(
4545
audienceMaxAgeGt: $audienceMaxAgeGt
@@ -78,8 +78,8 @@ export const QUERY_EVENT_LIST = gql`
7878
text: $text
7979
translation: $translation
8080
# Experimental fields...
81-
xFullText: $xFullText
82-
xOngoing: $xOngoing
81+
fullText: $fullText
82+
ongoing: $ongoing
8383
) {
8484
meta {
8585
count

0 commit comments

Comments
 (0)