gatsby-core-theme 40.0.37 → 40.0.39
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,26 @@
|
|
|
1
|
+
## [40.0.39](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v40.0.38...v40.0.39) (2024-11-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* added featured events to tournaments page ([4451573](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/44515735ff6357e4e7cc01e3ebcd15f83f1d2838))
|
|
7
|
+
* bonus header ribbon ([2dc1e2c](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/2dc1e2cf7df2d16d4a798e4b9816f0bc24d00720))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
* Merge branch 'bonus_header_ribon' into 'master' ([47b7af1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/47b7af13a9239c2d566396a2bbf146a1ed7e7cf8))
|
|
11
|
+
|
|
12
|
+
## [40.0.38](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v40.0.37...v40.0.38) (2024-11-20)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* betamerica issue ([3640184](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/36401841ab582b79273cfd9594523fc83059aff4))
|
|
18
|
+
* preview ([67752fb](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/67752fbafacfa464331a3936d20d8a1c80ac0f48))
|
|
19
|
+
* search data json ([74b4bc3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/74b4bc36548c786305c82caae9e879c8a069fd5a))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
* Merge branch 'market-issue' into 'master' ([c343693](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/c3436931dfb8416d7ca26889058d54e65be7c189))
|
|
23
|
+
|
|
1
24
|
## [40.0.37](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v40.0.36...v40.0.37) (2024-11-18)
|
|
2
25
|
|
|
3
26
|
|
package/package.json
CHANGED
|
@@ -88,33 +88,34 @@ export function processSitemapPages(pages, markets) {
|
|
|
88
88
|
return pageListByMarket;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
const
|
|
92
|
-
const
|
|
91
|
+
const groupByMarketAndType = (data) => Object.values(data).reduce((acc, item) => {
|
|
92
|
+
const market = item.market;
|
|
93
93
|
const type = item.type;
|
|
94
94
|
|
|
95
95
|
// Initialize language and type groupings if not already present
|
|
96
|
-
if (!acc[
|
|
97
|
-
if (!acc[
|
|
96
|
+
if (!acc[market]) acc[market] = {};
|
|
97
|
+
if (!acc[market][type]) acc[market][type] = [];
|
|
98
98
|
|
|
99
99
|
// Add the item to the appropriate group
|
|
100
|
-
acc[
|
|
100
|
+
acc[market][type].push(item);
|
|
101
101
|
return acc;
|
|
102
102
|
}, {});
|
|
103
103
|
|
|
104
104
|
export function transform(response) {
|
|
105
105
|
const transformed = {};
|
|
106
106
|
|
|
107
|
-
const pages =
|
|
107
|
+
const pages = groupByMarketAndType(response.pages);
|
|
108
|
+
|
|
108
109
|
|
|
109
110
|
Object.keys(response.site_markets).forEach((siteMarket) => {
|
|
110
|
-
const
|
|
111
|
+
const market = siteMarket
|
|
111
112
|
transformed[siteMarket] = {};
|
|
112
113
|
|
|
113
|
-
if (pages[
|
|
114
|
-
Object.keys(pages[
|
|
114
|
+
if (pages[market]) {
|
|
115
|
+
Object.keys(pages[market]).forEach((pageType) => {
|
|
115
116
|
transformed[siteMarket][pageType] = [];
|
|
116
|
-
Object.keys(pages[
|
|
117
|
-
const page = pages[
|
|
117
|
+
Object.keys(pages[market][pageType]).forEach((pageId) => {
|
|
118
|
+
const page = pages[market][pageType][pageId];
|
|
118
119
|
|
|
119
120
|
if (response.site_markets[siteMarket].path_prefix && page) {
|
|
120
121
|
// set page prefix for multiple markets
|
|
@@ -279,6 +280,7 @@ export function processExtraFields(
|
|
|
279
280
|
return;
|
|
280
281
|
}
|
|
281
282
|
Object.keys(extraFields).forEach((key) => {
|
|
283
|
+
if (key && extraFields[key]) {
|
|
282
284
|
const { type, value } = extraFields[key];
|
|
283
285
|
|
|
284
286
|
if (type === "operator") {
|
|
@@ -300,6 +302,7 @@ export function processExtraFields(
|
|
|
300
302
|
} else {
|
|
301
303
|
extraFields[key] = value;
|
|
302
304
|
}
|
|
305
|
+
}
|
|
303
306
|
});
|
|
304
307
|
}
|
|
305
308
|
|
|
@@ -554,10 +557,6 @@ export default {
|
|
|
554
557
|
});
|
|
555
558
|
});
|
|
556
559
|
|
|
557
|
-
if (searchEnabled) {
|
|
558
|
-
processSearchData(searchData, fs);
|
|
559
|
-
}
|
|
560
|
-
|
|
561
560
|
pagesCloned = cloneDeep(transformedPages[market]);
|
|
562
561
|
|
|
563
562
|
// fill market sections
|
|
@@ -603,6 +602,10 @@ export default {
|
|
|
603
602
|
}
|
|
604
603
|
});
|
|
605
604
|
|
|
605
|
+
if (searchEnabled) {
|
|
606
|
+
processSearchData(searchData, fs);
|
|
607
|
+
}
|
|
608
|
+
|
|
606
609
|
data.pages = transformedPages;
|
|
607
610
|
const end = new Date() - start;
|
|
608
611
|
console.log(
|
|
@@ -284,10 +284,16 @@ export function processCardsV2(
|
|
|
284
284
|
);
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
-
export function processBonus(module, relations) {
|
|
287
|
+
export function processBonus(module, relations, data) {
|
|
288
|
+
|
|
288
289
|
const object = sanitizeOperatorData(
|
|
289
|
-
cloneDeep(relations.operator[module.value])
|
|
290
|
+
cloneDeep(relations.operator[module.value]),
|
|
291
|
+
[],
|
|
292
|
+
[],
|
|
293
|
+
[],
|
|
294
|
+
data
|
|
290
295
|
);
|
|
296
|
+
|
|
291
297
|
if (object.bonus) {
|
|
292
298
|
const removeFields =
|
|
293
299
|
settings.remove_bonus_data[process.env.GATSBY_SITE_NAME] ||
|
|
@@ -477,7 +483,7 @@ export function processModule(
|
|
|
477
483
|
} else if (module.name === "content") {
|
|
478
484
|
processContentModule(module, translations, relationData, content);
|
|
479
485
|
} else if (module.name === "bonus") {
|
|
480
|
-
processBonus(module, relations);
|
|
486
|
+
processBonus(module, relations, data);
|
|
481
487
|
} else if (module.name === "top_list") {
|
|
482
488
|
processTopListModule(
|
|
483
489
|
module,
|
|
@@ -158,6 +158,7 @@ export function addSportsDataToPage(sportsData, page, themeType) {
|
|
|
158
158
|
);
|
|
159
159
|
// eslint-disable-next-line prefer-destructuring
|
|
160
160
|
relation.event = getSortedEvents(relation.tournaments, sportsData.events)[0];
|
|
161
|
+
relation.featured_events = sportsData.featured_events.soccer || null;
|
|
161
162
|
// relation.events = findEvents(relation.tournaments, sportsData.events);
|
|
162
163
|
relation.providers = providersArray.filter(
|
|
163
164
|
(provider) => provider.sports_data.soccer !== null
|
|
@@ -4,37 +4,38 @@
|
|
|
4
4
|
import loadSource from '~helpers/search-source';
|
|
5
5
|
import { deparam } from '~helpers/strings';
|
|
6
6
|
import { groupBy } from '~helpers/getters';
|
|
7
|
-
import {getData} from '~helpers/api'
|
|
7
|
+
import { getData } from '~helpers/api'
|
|
8
8
|
import processor from "./processor/index.mjs";
|
|
9
9
|
import { fetchSiteSettings } from './fetch-site-settings.mjs';
|
|
10
|
-
|
|
11
|
-
export async function getAPIData(page, url, headers, preview) {
|
|
10
|
+
|
|
11
|
+
export async function getAPIData(page, url, headers, preview) {
|
|
12
12
|
if (preview) {
|
|
13
13
|
try {
|
|
14
|
-
const siteName = process.env.GATSBY_SITE_NAME;
|
|
14
|
+
const siteName = process.env.GATSBY_SITE_NAME;
|
|
15
15
|
const params = deparam(url.split('?')[1]);
|
|
16
16
|
// eslint-disable-next-line camelcase
|
|
17
17
|
const response = await getData(siteName, params?.path, params?.market_id, true);
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
const { siteSettingsData, siteGeneralData, responsableGamingData, toplistData, contentData, ribbonsData } = await fetchSiteSettings(siteName, true);
|
|
19
|
+
|
|
20
20
|
const pagePreview = response.pages.preview;
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
const processed = processor.run({
|
|
23
23
|
...response,
|
|
24
24
|
siteSettingsData,
|
|
25
25
|
general: siteGeneralData,
|
|
26
|
-
prefilled_market_modules:siteSettingsData.prefilled_modules,
|
|
26
|
+
prefilled_market_modules: siteSettingsData.prefilled_modules,
|
|
27
27
|
responsible_gamings: responsableGamingData,
|
|
28
28
|
toplists: toplistData,
|
|
29
29
|
content: contentData,
|
|
30
30
|
ribbons: ribbonsData
|
|
31
|
-
},{}, null, null, true);
|
|
32
|
-
|
|
31
|
+
}, {}, null, null, true);
|
|
32
|
+
|
|
33
|
+
|
|
33
34
|
const pagePreviewProcessed = processed.pages[pagePreview.market][
|
|
34
35
|
pagePreview.relation_type
|
|
35
36
|
// eslint-disable-next-line no-shadow
|
|
36
|
-
]
|
|
37
|
-
|
|
37
|
+
][0]
|
|
38
|
+
|
|
38
39
|
return {
|
|
39
40
|
props: {
|
|
40
41
|
marketSections: processed.market_sections[pagePreview.market],
|
|
@@ -49,23 +50,23 @@ export async function getAPIData(page, url, headers, preview) {
|
|
|
49
50
|
console.log("Error fetching preview data:", error);
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
|
-
|
|
53
|
+
|
|
53
54
|
const results = await loadSource(page.market);
|
|
54
55
|
if (page.path.endsWith('/s') || page.path === 's') {
|
|
55
56
|
let urlParams = null;
|
|
56
57
|
if (url && url.split('?').length === 2) {
|
|
57
58
|
urlParams = deparam(`${url.split('?')[1]}`);
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
+
|
|
60
61
|
const searchData = urlParams
|
|
61
62
|
? urlParams.hasOwnProperty('s')
|
|
62
63
|
? groupBy(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
results.filter((item) => item.title.toLowerCase().includes(urlParams.s.toLowerCase())),
|
|
65
|
+
'type'
|
|
66
|
+
)
|
|
66
67
|
: null
|
|
67
68
|
: null;
|
|
68
|
-
|
|
69
|
+
|
|
69
70
|
return {
|
|
70
71
|
props: {
|
|
71
72
|
data: searchData,
|
|
@@ -73,10 +74,10 @@ export async function getAPIData(page, url, headers, preview) {
|
|
|
73
74
|
},
|
|
74
75
|
};
|
|
75
76
|
}
|
|
76
|
-
|
|
77
|
+
|
|
77
78
|
const res = await fetch(`https://random-data-api.com/api/appliance/random_appliance/`);
|
|
78
79
|
const data = await res.json();
|
|
79
|
-
|
|
80
|
+
|
|
80
81
|
return {
|
|
81
82
|
props: data.equipment,
|
|
82
83
|
};
|