gatsby-core-theme 42.0.12 → 42.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [42.0.13](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v42.0.12...v42.0.13) (2025-02-19)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * sports data ([b7c1b03](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/b7c1b03a028e02b7fa260b55e886877e9c050c1f))
7
+ * sports data ([5003bc5](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/5003bc513afad38eba7af9334fedf5c3291822ab))
8
+
1
9
  ## [42.0.12](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v42.0.11...v42.0.12) (2025-02-19)
2
10
 
3
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "42.0.12",
3
+ "version": "42.0.13",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -101,7 +101,7 @@ export const processSportsRelations = (
101
101
  break;
102
102
  case "country":
103
103
  case "tournament":
104
- const tournaments = [];
104
+ const tournaments = {};
105
105
  const tournamentIds = [];
106
106
  events = modifyMarketEvents(sportsMarketData, data, market);
107
107
 
@@ -110,22 +110,21 @@ export const processSportsRelations = (
110
110
  ) {
111
111
  transformedPages[market][pageType][index].relation_id.map(
112
112
  (tournament) => {
113
- tournaments.push(
114
- cloneDeep(sportsMarketData.tournaments[tournament])
115
- );
116
113
  if (sportsMarketData.tournaments[tournament]) {
114
+ Object.assign(tournaments, {[sportsMarketData.tournaments[tournament].id]: cloneDeep(sportsMarketData.tournaments[tournament])});
117
115
  tournamentIds.push(sportsMarketData.tournaments[tournament].id);
118
116
  }
119
117
  }
120
118
  );
121
119
  } else {
122
- tournaments.push(
123
- cloneDeep(
124
- sportsMarketData.tournaments[
125
- transformedPages[market][pageType][index].relation_id
126
- ]
127
- )
128
- );
120
+ Object.assign(tournaments, {[sportsMarketData.tournaments[
121
+ transformedPages[market][pageType][index].relation_id
122
+ ].id]: cloneDeep(
123
+ sportsMarketData.tournaments[
124
+ transformedPages[market][pageType][index].relation_id
125
+ ]
126
+ )});
127
+
129
128
  tournamentIds.push(
130
129
  sportsMarketData.tournaments[
131
130
  transformedPages[market][pageType][index].relation_id
@@ -159,11 +158,16 @@ export const processSportsRelations = (
159
158
  (id) => sportsMarketData.events[id].featured === 1
160
159
  );
161
160
 
162
- relation.featured_events = allFeaturedEvents.filter((id) =>
163
- tournaments.length > 0 && tournaments[0] && tournaments[0].events
164
- ? tournaments[0].events.includes(parseInt(id))
165
- : false
166
- );
161
+
162
+
163
+ if(page.template === 'tournament') {
164
+ relation.featured_events = allFeaturedEvents.filter((id) =>
165
+ tournaments.length > 0 && tournaments[0] && tournaments[0].events
166
+ ? tournaments[0].events.includes(parseInt(id))
167
+ : false
168
+ );
169
+ }
170
+
167
171
  transformedPages[market][pageType][index].relation = relation;
168
172
  break;
169
173
  default:
@@ -33,8 +33,8 @@ describe("processSportsRelations function", () => {
33
33
  data = {
34
34
  site_markets: {
35
35
  market1: {
36
- path_prefix: null
37
- }
36
+ path_prefix: null,
37
+ },
38
38
  },
39
39
  relations: {
40
40
  sports_data: {
@@ -56,7 +56,9 @@ describe("processSportsRelations function", () => {
56
56
  "2024-01-01": { tournaments: { 1: { events: [1] } } },
57
57
  },
58
58
  },
59
- tournaments: { 1: { id: 1, stage_id: "stage1", teams: [1, 2], events: [1] } },
59
+ tournaments: {
60
+ 1: { id: 1, stage_id: "stage1", teams: [1, 2], events: [1] },
61
+ },
60
62
  },
61
63
  },
62
64
  },
@@ -108,7 +110,7 @@ describe("processSportsRelations function", () => {
108
110
  expect(
109
111
  transformedPages[market][pageType][index].relation.tournament
110
112
  ).toEqual(
111
- cloneDeep(data.relations.sports_data.markets.gb_en.tournaments[1])
113
+ cloneDeep(data.relations.sports_data.markets.gb_en.tournaments[1])
112
114
  );
113
115
  });
114
116
 
@@ -127,10 +129,10 @@ describe("processSportsRelations function", () => {
127
129
 
128
130
  expect(
129
131
  transformedPages[market][pageType][index].relation.tournaments
130
- ).toEqual([
131
- cloneDeep(data.relations.sports_data.markets.gb_en.tournaments[1]),
132
- ]);
133
-
132
+ ).toEqual({
133
+ 1: cloneDeep(data.relations.sports_data.markets.gb_en.tournaments[1]),
134
+ });
135
+
134
136
  expect(transformedPages[market][pageType][index].relation.schedule).toEqual(
135
137
  {
136
138
  soccer: {