gatsby-core-theme 44.29.0 → 44.30.0
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 +16 -0
- package/package.json +1 -1
- package/src/components/atoms/iframe/index.js +0 -8
- package/src/resolver/games.mjs +59 -17
- package/src/resolver/games.test.js +66 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
# [44.30.0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.29.0...v44.30.0) (2026-06-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* update iframe module by removing unecessary noscript ([e84bef4](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/e84bef46dd629827a7a6eb2c4d58c8171ece48b6))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
* Merge branch 'update-iframe' into 'master' ([409530a](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/409530a1af0ad65ca69ae1dbf65b6fb91ef8e84b))
|
|
10
|
+
* Merge branch 'feat/new-jackpot-response' into 'master' ([38f26a6](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/38f26a6a244312d1e45a3567fdf54341c8f1bbff))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* new jackpot response format ([421c8a6](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/421c8a6e6a69072d290aefcb53d2c42a0caab511))
|
|
16
|
+
|
|
1
17
|
# [44.29.0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.28.0...v44.29.0) (2026-06-18)
|
|
2
18
|
|
|
3
19
|
|
package/package.json
CHANGED
|
@@ -20,14 +20,6 @@ const Iframe = ({
|
|
|
20
20
|
loading={lazyLoad ? 'lazy' : 'eager'}
|
|
21
21
|
frameBorder={frameBorder}
|
|
22
22
|
/>
|
|
23
|
-
<noscript>
|
|
24
|
-
{`<iframe title="${title}"
|
|
25
|
-
style="width: 100%, ${minHeight}, display: block"
|
|
26
|
-
width={868}
|
|
27
|
-
height={454}
|
|
28
|
-
src="${src}"
|
|
29
|
-
loading="${lazyLoad ? 'lazy' : 'eager'}" />`}
|
|
30
|
-
</noscript>
|
|
31
23
|
</div>
|
|
32
24
|
</>
|
|
33
25
|
);
|
package/src/resolver/games.mjs
CHANGED
|
@@ -83,25 +83,67 @@ export function transformGames(jsonData, relationsData) {
|
|
|
83
83
|
export function transformGamesJackpot(data) {
|
|
84
84
|
const transformedData = {};
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
86
|
+
// Accepts both jackpot payloads and normalises them to the shape the site
|
|
87
|
+
// consumes, keyed by game id:
|
|
88
|
+
// { [gameId]: { [jackpotType]: { …jackpot… } } }
|
|
89
|
+
//
|
|
90
|
+
// New (flat) shape — one jackpot leaf per game:
|
|
91
|
+
// { [gameId]: { game_id, jackpot_type, jackpot, … } }
|
|
92
|
+
//
|
|
93
|
+
// Legacy (nested) shape — grouped by operator then tier. Operators carry
|
|
94
|
+
// identical network jackpots, so the operator dimension is collapsed:
|
|
95
|
+
// { [gameId]: {
|
|
96
|
+
// game_short_name,
|
|
97
|
+
// [operatorId]: { operator_short_name, [jackpotType]: { …jackpot… } }
|
|
98
|
+
// } }
|
|
99
|
+
Object.values(data).forEach((gameEntry) => {
|
|
100
|
+
if (!gameEntry || typeof gameEntry !== "object") {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// New flat shape: the entry *is* a single jackpot leaf (one per game).
|
|
105
|
+
// { [gameId]: { game_id, jackpot_type, jackpot, … } }
|
|
106
|
+
if (gameEntry.game_id !== null && gameEntry.game_id !== undefined) {
|
|
107
|
+
const { game_id: gameId, jackpot_type: jackpotType } = gameEntry;
|
|
108
|
+
transformedData[gameId] = { [jackpotType || "n/a"]: gameEntry };
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
Object.entries(gameEntry).forEach(([operatorKey, operatorEntry]) => {
|
|
113
|
+
// Skip the game-level metadata, keep only the operator buckets.
|
|
114
|
+
if (
|
|
115
|
+
operatorKey === "game_short_name" ||
|
|
116
|
+
!operatorEntry ||
|
|
117
|
+
typeof operatorEntry !== "object"
|
|
118
|
+
) {
|
|
119
|
+
return;
|
|
101
120
|
}
|
|
102
|
-
});
|
|
103
121
|
|
|
104
|
-
|
|
122
|
+
Object.entries(operatorEntry).forEach(([jackpotType, jackpot]) => {
|
|
123
|
+
// Skip the operator-level metadata, keep only jackpot buckets.
|
|
124
|
+
if (
|
|
125
|
+
jackpotType === "operator_short_name" ||
|
|
126
|
+
!jackpot ||
|
|
127
|
+
typeof jackpot !== "object"
|
|
128
|
+
) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const { game_id: gameId } = jackpot;
|
|
133
|
+
if (gameId === null || gameId === undefined) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (!transformedData[gameId]) {
|
|
138
|
+
transformedData[gameId] = {};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// First operator wins per jackpot type (values match across operators).
|
|
142
|
+
if (!(jackpotType in transformedData[gameId])) {
|
|
143
|
+
transformedData[gameId][jackpotType] = jackpot;
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
});
|
|
105
147
|
});
|
|
106
148
|
|
|
107
149
|
return transformedData;
|
|
@@ -105,6 +105,72 @@ describe("transformGamesJackpot", () => {
|
|
|
105
105
|
expect(transformGamesJackpot(inputData)).toEqual(expectedOutput);
|
|
106
106
|
});
|
|
107
107
|
|
|
108
|
+
test("should collapse multiple operators of the same game into one entry", () => {
|
|
109
|
+
const progressive = {
|
|
110
|
+
game_id: 32,
|
|
111
|
+
game_short_name: "mega_moolah",
|
|
112
|
+
jackpot_type: "progressive",
|
|
113
|
+
operator_id: 352,
|
|
114
|
+
currency: "GBP",
|
|
115
|
+
jackpot: 11477605,
|
|
116
|
+
};
|
|
117
|
+
const minor = {
|
|
118
|
+
game_id: 32,
|
|
119
|
+
game_short_name: "mega_moolah",
|
|
120
|
+
jackpot_type: "minor",
|
|
121
|
+
operator_id: 352,
|
|
122
|
+
currency: "GBP",
|
|
123
|
+
jackpot: 94,
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const inputData = {
|
|
127
|
+
32: {
|
|
128
|
+
game_short_name: "mega_moolah",
|
|
129
|
+
352: {
|
|
130
|
+
operator_short_name: "fun_casino",
|
|
131
|
+
progressive,
|
|
132
|
+
minor,
|
|
133
|
+
},
|
|
134
|
+
// Second operator carries the same network jackpots and must not
|
|
135
|
+
// produce a duplicate or extra nesting level.
|
|
136
|
+
312: {
|
|
137
|
+
operator_short_name: "no_bonus_casino",
|
|
138
|
+
progressive,
|
|
139
|
+
minor,
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
expect(transformGamesJackpot(inputData)).toEqual({
|
|
145
|
+
32: { progressive, minor },
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
test("should transform the new flat shape", () => {
|
|
150
|
+
const leaf = {
|
|
151
|
+
game_id: 32,
|
|
152
|
+
game_short_name: "mega_moolah",
|
|
153
|
+
jackpot_type: "progressive",
|
|
154
|
+
operator_name: "Fun Casino",
|
|
155
|
+
operator_id: 352,
|
|
156
|
+
currency: "GBP",
|
|
157
|
+
jackpot: 10975893,
|
|
158
|
+
};
|
|
159
|
+
const untyped = {
|
|
160
|
+
game_id: 491,
|
|
161
|
+
game_short_name: "gladiator",
|
|
162
|
+
jackpot_type: null,
|
|
163
|
+
operator_id: null,
|
|
164
|
+
currency: "EUR",
|
|
165
|
+
jackpot: 854887,
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
expect(transformGamesJackpot({ 32: leaf, 491: untyped })).toEqual({
|
|
169
|
+
32: { progressive: leaf },
|
|
170
|
+
491: { "n/a": untyped },
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
|
|
108
174
|
test("should return an empty object if input is empty", () => {
|
|
109
175
|
expect(transformGamesJackpot({})).toEqual({});
|
|
110
176
|
});
|