gatsby-core-theme 44.3.0 → 45.0.0-beta.1
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 +6 -150
- package/gatsby-node.mjs +0 -3
- package/package.json +1 -1
- package/src/components/atoms/admin/bar/layout-section/index.js +5 -5
- package/src/components/atoms/button/operator-cta.js +3 -1
- package/src/components/atoms/notifications/notification-items/cards-v2/index.js +33 -15
- package/src/components/molecules/bonus-box/template-one/index.js +0 -1
- package/src/components/molecules/bonus-box/template-three/index.js +1 -2
- package/src/components/molecules/floating-area/index.js +22 -22
- package/src/components/organisms/cookie-consent/cookie-consent.module.scss +1 -2
- package/src/components/organisms/cookie-consent/index.js +1 -1
- package/src/components/organisms/search/index.js +14 -11
- package/src/components/organisms/search/variable/index.js +1 -1
- package/src/components/organisms/search/variable/searchVariable.test.js +2 -0
- package/src/constants/site-settings/main.mjs +1 -1
- package/src/constants/site-settings/navigation.js +0 -1
- package/src/helpers/date-time.js +0 -22
- package/src/helpers/date-time.test.js +1 -16
- package/src/helpers/getters.mjs +0 -17
- package/src/helpers/getters.test.js +0 -52
- package/src/resolver/archive.mjs +0 -1
- package/src/resolver/common.mjs +1 -1
- package/src/resolver/index.mjs +30 -33
- package/src/resolver/modules.mjs +85 -116
- package/src/resolver/relations.mjs +0 -21
- package/src/resolver/sports-relations.mjs +0 -1
- package/src/services/api.mjs +0 -4
- package/src/services/fetch.mjs +4 -8
- package/src/resolver/build-toplist-filter.mjs +0 -66
- package/src/resolver/build-toplist-filter.test.js +0 -104
|
@@ -502,56 +502,4 @@ describe('Getters Helper', () => {
|
|
|
502
502
|
test('should handle null content', () => {
|
|
503
503
|
expect(Getters.trailingSlash(null)).toBeNull();
|
|
504
504
|
});
|
|
505
|
-
test("returns null if item is null", () => {
|
|
506
|
-
expect(Getters.getPromoCode(null, "main")).toBeNull();
|
|
507
|
-
});
|
|
508
|
-
|
|
509
|
-
test("returns null if bonuses object is missing", () => {
|
|
510
|
-
const item = {};
|
|
511
|
-
expect(Getters.getPromoCode(item, "main")).toBeNull();
|
|
512
|
-
});
|
|
513
|
-
|
|
514
|
-
test("returns null if promo code is an empty string", () => {
|
|
515
|
-
const item = {
|
|
516
|
-
bonuses: {
|
|
517
|
-
main: {
|
|
518
|
-
promo_code: "",
|
|
519
|
-
},
|
|
520
|
-
},
|
|
521
|
-
};
|
|
522
|
-
expect(Getters.getPromoCode(item, "main")).toBeNull();
|
|
523
|
-
});
|
|
524
|
-
|
|
525
|
-
test("returns correct promo code when it exists for tracker", () => {
|
|
526
|
-
const item = {
|
|
527
|
-
bonuses: {
|
|
528
|
-
main: {
|
|
529
|
-
promo_code: "PROMO123",
|
|
530
|
-
},
|
|
531
|
-
},
|
|
532
|
-
};
|
|
533
|
-
expect(Getters.getPromoCode(item, "main")).toBe("PROMO123");
|
|
534
|
-
});
|
|
535
|
-
|
|
536
|
-
test("returns null if tracker does not exist in bonuses", () => {
|
|
537
|
-
const item = {
|
|
538
|
-
bonuses: {
|
|
539
|
-
other: {
|
|
540
|
-
promo_code: "SOMECODE",
|
|
541
|
-
},
|
|
542
|
-
},
|
|
543
|
-
};
|
|
544
|
-
expect(Getters.getPromoCode(item, "main")).toBeNull();
|
|
545
|
-
});
|
|
546
|
-
|
|
547
|
-
test("returns correct promo code for non-main tracker", () => {
|
|
548
|
-
const item = {
|
|
549
|
-
bonuses: {
|
|
550
|
-
exclusive: {
|
|
551
|
-
promo_code: "EXCL2025",
|
|
552
|
-
},
|
|
553
|
-
},
|
|
554
|
-
};
|
|
555
|
-
expect(Getters.getPromoCode(item, "exclusive")).toBe("EXCL2025");
|
|
556
|
-
});
|
|
557
505
|
});
|
package/src/resolver/archive.mjs
CHANGED
package/src/resolver/common.mjs
CHANGED
|
@@ -171,7 +171,7 @@ export function removeUnwantedSections(obj, pageType, ribbonsData) {
|
|
|
171
171
|
]);
|
|
172
172
|
|
|
173
173
|
// Filter the object to retain only the sections in the sectionsToKeep set
|
|
174
|
-
const filteredObject = Object.keys(obj
|
|
174
|
+
const filteredObject = Object.keys(obj).reduce((acc, key) => {
|
|
175
175
|
if (sectionsToKeep.has(key)) {
|
|
176
176
|
acc[key] = obj[key];
|
|
177
177
|
|
package/src/resolver/index.mjs
CHANGED
|
@@ -113,20 +113,21 @@ export function transform(response) {
|
|
|
113
113
|
Object.keys(pages[market][pageType]).forEach((pageId) => {
|
|
114
114
|
const page = pages[market][pageType][pageId];
|
|
115
115
|
if (
|
|
116
|
-
mainSettings[page.relation_type] &&
|
|
117
|
-
mainSettings[page.relation_type].reading_time &&
|
|
116
|
+
mainSettings[page.relation_type] && mainSettings[page.relation_type].reading_time &&
|
|
118
117
|
mainSettings[page.relation_type].reading_time[
|
|
119
118
|
process.env.GATSBY_SITE_NAME
|
|
120
119
|
]
|
|
121
120
|
) {
|
|
122
121
|
page.reading_time = getReadingTime(page.sections, response.content);
|
|
123
122
|
}
|
|
123
|
+
|
|
124
124
|
|
|
125
125
|
if (response.site_markets[siteMarket].path_prefix && page) {
|
|
126
126
|
// set page prefix for multiple markets
|
|
127
127
|
page.path = `${response.site_markets[siteMarket].path_prefix}${
|
|
128
128
|
page.path !== "/" ? `/${page.path}` : ""
|
|
129
129
|
}`;
|
|
130
|
+
|
|
130
131
|
transformed[siteMarket][pageType].push(page);
|
|
131
132
|
} else if (page) {
|
|
132
133
|
transformed[siteMarket][pageType].push(page);
|
|
@@ -177,19 +178,13 @@ export function processSections(
|
|
|
177
178
|
shouldSavePrefilled(module, siteName) &&
|
|
178
179
|
savedModules[module.module_value_id]
|
|
179
180
|
) {
|
|
180
|
-
const filteredModule = cloneDeep(
|
|
181
|
-
savedModules[module.module_value_id]
|
|
182
|
-
);
|
|
181
|
+
const filteredModule = cloneDeep(savedModules[module.module_value_id]);
|
|
183
182
|
|
|
184
183
|
const relationID = pagesMappedById[pageId]?.relation_id;
|
|
185
|
-
if (
|
|
186
|
-
filteredModule.
|
|
187
|
-
relationID &&
|
|
188
|
-
filteredModule.items
|
|
184
|
+
if (filteredModule.name === 'cards_v2' &&
|
|
185
|
+
relationID && filteredModule.items
|
|
189
186
|
) {
|
|
190
|
-
filteredModule.items = filteredModule.items.filter(
|
|
191
|
-
(item) => !item.relation || item.relation.id !== relationID
|
|
192
|
-
);
|
|
187
|
+
filteredModule.items = filteredModule.items.filter((item) => !item.relation || item.relation.id !== relationID);
|
|
193
188
|
}
|
|
194
189
|
|
|
195
190
|
Object.assign(module, filteredModule);
|
|
@@ -200,12 +195,13 @@ export function processSections(
|
|
|
200
195
|
module = {
|
|
201
196
|
...cloneDeep(
|
|
202
197
|
prefilledMarketModules[module.module_value_id] ||
|
|
203
|
-
|
|
198
|
+
prefilledMarketModules[module.value_id]
|
|
204
199
|
),
|
|
205
200
|
value_type: ModuleValue.VALUE_TYPE_PREFILLED_MODULE_MARKET,
|
|
206
201
|
};
|
|
207
202
|
}
|
|
208
203
|
|
|
204
|
+
|
|
209
205
|
processModule(
|
|
210
206
|
module,
|
|
211
207
|
pages,
|
|
@@ -243,10 +239,7 @@ export function getReadingTime(sections, content) {
|
|
|
243
239
|
sections[sectionKey].modules.forEach((module) => {
|
|
244
240
|
// calculate reading time
|
|
245
241
|
if (module.name === "content") {
|
|
246
|
-
const nrOfWords =
|
|
247
|
-
removeTags(content ? content[module.value] : module.value).split(
|
|
248
|
-
" "
|
|
249
|
-
).length / 250;
|
|
242
|
+
const nrOfWords = removeTags(content ? content[module.value] : module.value).split(" ").length / 250;
|
|
250
243
|
const minPerModule = Math.floor(nrOfWords);
|
|
251
244
|
const secPerModule = Math.floor((nrOfWords % 1) * 60);
|
|
252
245
|
|
|
@@ -284,7 +277,7 @@ function processSearchData(data, fs, filename) {
|
|
|
284
277
|
if (error) {
|
|
285
278
|
console.log(
|
|
286
279
|
chalk.magenta("info") +
|
|
287
|
-
|
|
280
|
+
chalk.whiteBright(` Error writing search json file : ${error}`)
|
|
288
281
|
);
|
|
289
282
|
}
|
|
290
283
|
}
|
|
@@ -323,6 +316,7 @@ export function processExtraFields(
|
|
|
323
316
|
}
|
|
324
317
|
|
|
325
318
|
function updatePlaceholders(page, data, translationsData) {
|
|
319
|
+
|
|
326
320
|
page.title =
|
|
327
321
|
page.title &&
|
|
328
322
|
generatePlaceholderString(page.title, translationsData, {
|
|
@@ -334,21 +328,21 @@ function updatePlaceholders(page, data, translationsData) {
|
|
|
334
328
|
page.meta_title &&
|
|
335
329
|
generatePlaceholderString(page.meta_title, translationsData, {
|
|
336
330
|
siteName: data.site_name,
|
|
337
|
-
pageTitle: page.title
|
|
331
|
+
pageTitle: page.title
|
|
338
332
|
});
|
|
339
333
|
|
|
340
334
|
page.meta_description =
|
|
341
335
|
page.meta_description &&
|
|
342
336
|
generatePlaceholderString(page.meta_description, translationsData, {
|
|
343
337
|
siteName: data.site_name,
|
|
344
|
-
pageTitle: page.title
|
|
338
|
+
pageTitle: page.title
|
|
345
339
|
});
|
|
346
340
|
}
|
|
347
341
|
|
|
348
342
|
export default {
|
|
349
343
|
run(data, themeOptions, fs, translationsData, previewPageID = null) {
|
|
350
344
|
const start = new Date();
|
|
351
|
-
const transformedPages = transform(data);
|
|
345
|
+
const transformedPages = transform(data);
|
|
352
346
|
|
|
353
347
|
const allResponsibleGaming = data.responsible_gamings || null;
|
|
354
348
|
const generalData = data.general;
|
|
@@ -371,11 +365,12 @@ export default {
|
|
|
371
365
|
|
|
372
366
|
const searchEnabled =
|
|
373
367
|
themeOptions.searchEnabled !== undefined &&
|
|
374
|
-
|
|
368
|
+
themeOptions.searchEnabled !== null
|
|
375
369
|
? themeOptions.searchEnabled
|
|
376
370
|
: true;
|
|
377
371
|
|
|
378
372
|
menus = data.menus;
|
|
373
|
+
|
|
379
374
|
// Menu changes when there is a path prefix configured on hercules
|
|
380
375
|
Object.keys(menus).forEach((menu) => {
|
|
381
376
|
if (data?.site_markets[menus[menu]?.market]?.path_prefix !== null) {
|
|
@@ -385,6 +380,7 @@ export default {
|
|
|
385
380
|
);
|
|
386
381
|
}
|
|
387
382
|
});
|
|
383
|
+
|
|
388
384
|
Object.keys(data.site_markets).forEach((market) => {
|
|
389
385
|
relations = data.relations;
|
|
390
386
|
pages = transformedPages[market];
|
|
@@ -397,12 +393,10 @@ export default {
|
|
|
397
393
|
|
|
398
394
|
Object.keys(transformedPages[market]).forEach((pageType) => {
|
|
399
395
|
transformedPages[market][pageType].forEach((page, index) => {
|
|
400
|
-
// Check if it should build fuilters for this template
|
|
401
396
|
const translations = translationsData
|
|
402
397
|
? translationsData[page.language]
|
|
403
398
|
: {};
|
|
404
399
|
// process page extra fields
|
|
405
|
-
//
|
|
406
400
|
page.extra_fields &&
|
|
407
401
|
processExtraFields(
|
|
408
402
|
page.extra_fields,
|
|
@@ -410,6 +404,7 @@ export default {
|
|
|
410
404
|
relations,
|
|
411
405
|
data.content
|
|
412
406
|
);
|
|
407
|
+
|
|
413
408
|
updatePlaceholders(page, generalData, translations);
|
|
414
409
|
|
|
415
410
|
// Set Affiliate relations
|
|
@@ -533,7 +528,7 @@ export default {
|
|
|
533
528
|
extra_fields?.operator &&
|
|
534
529
|
filterRelation(
|
|
535
530
|
extra_fields?.operator,
|
|
536
|
-
searchReleationPickKeys
|
|
531
|
+
searchReleationPickKeys.operator
|
|
537
532
|
);
|
|
538
533
|
|
|
539
534
|
const minimalPage = {
|
|
@@ -554,14 +549,12 @@ export default {
|
|
|
554
549
|
cloneDeep({
|
|
555
550
|
...minimalPage,
|
|
556
551
|
...(filteredRelation && { relation: filteredRelation }),
|
|
557
|
-
...(filteredAuthorRelation && {
|
|
558
|
-
|
|
559
|
-
}),
|
|
560
|
-
...(operatorExtraFileds && {
|
|
552
|
+
...(filteredAuthorRelation && { author: filteredAuthorRelation }),
|
|
553
|
+
...operatorExtraFileds && {
|
|
561
554
|
extra_fields: {
|
|
562
|
-
operator: operatorExtraFileds
|
|
563
|
-
}
|
|
564
|
-
}
|
|
555
|
+
operator: operatorExtraFileds
|
|
556
|
+
}
|
|
557
|
+
},
|
|
565
558
|
})
|
|
566
559
|
);
|
|
567
560
|
}
|
|
@@ -582,6 +575,7 @@ export default {
|
|
|
582
575
|
const postSectionModules =
|
|
583
576
|
data.market_sections[market][res].modules || [];
|
|
584
577
|
postSectionModules.forEach((item) => {
|
|
578
|
+
|
|
585
579
|
if (!page.sections.main) {
|
|
586
580
|
return;
|
|
587
581
|
}
|
|
@@ -596,6 +590,7 @@ export default {
|
|
|
596
590
|
ModuleValue.VALUE_TYPE_PREFILLED_MODULE_MARKET,
|
|
597
591
|
});
|
|
598
592
|
} else {
|
|
593
|
+
|
|
599
594
|
if (
|
|
600
595
|
transformedPages[market][pageType][index].relation &&
|
|
601
596
|
checkForInactiveOperatorToplist(
|
|
@@ -616,6 +611,7 @@ export default {
|
|
|
616
611
|
});
|
|
617
612
|
});
|
|
618
613
|
|
|
614
|
+
|
|
619
615
|
// fill market sections
|
|
620
616
|
if (data.market_sections[market]) {
|
|
621
617
|
data.market_sections[market] = processSections(
|
|
@@ -630,7 +626,7 @@ export default {
|
|
|
630
626
|
data.content
|
|
631
627
|
);
|
|
632
628
|
}
|
|
633
|
-
|
|
629
|
+
|
|
634
630
|
// fill page sections
|
|
635
631
|
if (transformedPages[market]) {
|
|
636
632
|
Object.keys(transformedPages[market]).forEach((pageType) => {
|
|
@@ -641,6 +637,7 @@ export default {
|
|
|
641
637
|
(page.sections && !previewPageID) ||
|
|
642
638
|
(previewPageID && page.id === previewPageID)
|
|
643
639
|
) {
|
|
640
|
+
|
|
644
641
|
transformedPages[market][pageType][index] = Object.assign(page, {
|
|
645
642
|
sections: processSections(
|
|
646
643
|
page.sections,
|
package/src/resolver/modules.mjs
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import loadash from "lodash/index.js";
|
|
6
6
|
import { generatePlaceholderString } from "../helpers/generators.mjs";
|
|
7
7
|
import { anchorLink, removeSymbols } from "../helpers/strings.mjs";
|
|
8
|
-
import { stripDomainAndLeadingSlash } from "../helpers/path.mjs";
|
|
9
8
|
import {
|
|
10
9
|
clonePageForCards,
|
|
11
10
|
groupBy,
|
|
@@ -15,12 +14,7 @@ import {
|
|
|
15
14
|
import { sanitizeOperatorData } from "./operators.mjs";
|
|
16
15
|
import settings from "../constants/settings.mjs";
|
|
17
16
|
import ModuleValue from "../constants/module-value.mjs";
|
|
18
|
-
import {
|
|
19
|
-
shiftFirstOperator,
|
|
20
|
-
getModuleTitle,
|
|
21
|
-
trailingSlash,
|
|
22
|
-
} from "../helpers/getters.mjs";
|
|
23
|
-
import buildToplistFilter from "./build-toplist-filter.mjs";
|
|
17
|
+
import { shiftFirstOperator, getModuleTitle, trailingSlash } from "../helpers/getters.mjs";
|
|
24
18
|
|
|
25
19
|
const pagesGroupedByTemplateId = [];
|
|
26
20
|
const cardItems = {};
|
|
@@ -190,7 +184,7 @@ export function processCardsV2(
|
|
|
190
184
|
// Populate pagesList if page type and template exists
|
|
191
185
|
pagesList =
|
|
192
186
|
!pagesGroupedByTemplateId[`${cardType}_${market}`] ||
|
|
193
|
-
|
|
187
|
+
!pagesGroupedByTemplateId[`${cardType}_${market}`][pageTemplateId]
|
|
194
188
|
? []
|
|
195
189
|
: pagesGroupedByTemplateId[`${cardType}_${market}`][pageTemplateId];
|
|
196
190
|
} else {
|
|
@@ -282,6 +276,7 @@ export function processCardsV2(
|
|
|
282
276
|
}
|
|
283
277
|
}
|
|
284
278
|
|
|
279
|
+
|
|
285
280
|
if (styleName !== "comparison_table") {
|
|
286
281
|
const relationID = pagesMappedById[pageId]?.relation_id;
|
|
287
282
|
|
|
@@ -292,6 +287,7 @@ export function processCardsV2(
|
|
|
292
287
|
}
|
|
293
288
|
}
|
|
294
289
|
|
|
290
|
+
|
|
295
291
|
if (
|
|
296
292
|
styleName === "comparison_table" &&
|
|
297
293
|
pageId !== null &&
|
|
@@ -306,8 +302,7 @@ export function processCardsV2(
|
|
|
306
302
|
}
|
|
307
303
|
|
|
308
304
|
// modify page so it doesn't have too much data
|
|
309
|
-
module.items = module.items.map((item) =>
|
|
310
|
-
clonePageForCards(cloneDeep(item), module.style, content)
|
|
305
|
+
module.items = module.items.map((item) => clonePageForCards(cloneDeep(item), module.style, content)
|
|
311
306
|
);
|
|
312
307
|
}
|
|
313
308
|
|
|
@@ -332,33 +327,19 @@ export function processTopListModule(
|
|
|
332
327
|
data,
|
|
333
328
|
toplists
|
|
334
329
|
) {
|
|
335
|
-
const filterEnabled = module.style === "filter";
|
|
336
|
-
const filters = {
|
|
337
|
-
popular_filters: {
|
|
338
|
-
best_online: { items: [] },
|
|
339
|
-
crypto: { items: [] },
|
|
340
|
-
mobile_optimized: { items: [] },
|
|
341
|
-
best_live: { items: [] },
|
|
342
|
-
},
|
|
343
|
-
rating: {
|
|
344
|
-
1: { items: [] },
|
|
345
|
-
2: { items: [] },
|
|
346
|
-
3: { items: [] },
|
|
347
|
-
4: { items: [] },
|
|
348
|
-
5: { items: [] },
|
|
349
|
-
},
|
|
350
|
-
game_categories: {},
|
|
351
|
-
deposit_methods: {},
|
|
352
|
-
withdrawal_method: {},
|
|
353
|
-
payout_time: {},
|
|
354
|
-
payout_rate: {},
|
|
355
|
-
licenses: {},
|
|
356
|
-
};
|
|
357
|
-
|
|
358
330
|
module.items = module.items.map((listItem) => {
|
|
359
331
|
const { type } = listItem;
|
|
360
|
-
const showLoadMore =
|
|
361
|
-
const itemsCount =
|
|
332
|
+
const showLoadMore = listItem.show_load_more || 0;
|
|
333
|
+
const itemsCount = listItem.num_items_initial_load
|
|
334
|
+
? Number(listItem.num_items_initial_load)
|
|
335
|
+
: 0;
|
|
336
|
+
|
|
337
|
+
if (showLoadMore === 0 && itemsCount > 0) {
|
|
338
|
+
listItem.items = listItem.items
|
|
339
|
+
? listItem.items.slice(0, itemsCount)
|
|
340
|
+
: [];
|
|
341
|
+
}
|
|
342
|
+
|
|
362
343
|
if (listItem.id && toplists && toplists[listItem.id.toString()]) {
|
|
363
344
|
listItem.market = toplists[listItem.id].market?.short_code;
|
|
364
345
|
listItem.items = toplists[listItem.id].items;
|
|
@@ -366,84 +347,74 @@ export function processTopListModule(
|
|
|
366
347
|
listItem.tracker = toplists[listItem.id].tracker;
|
|
367
348
|
}
|
|
368
349
|
|
|
369
|
-
if (!showLoadMore && itemsCount) {
|
|
370
|
-
listItem.items = listItem.items?.slice(0, itemsCount);
|
|
371
|
-
}
|
|
372
|
-
|
|
373
350
|
listItem.items = listItem.items
|
|
374
351
|
? listItem.items.map((item) => {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
352
|
+
const operatorRelation = cloneDeep(
|
|
353
|
+
Object.values(relations.operator).find(
|
|
354
|
+
(operator) =>
|
|
355
|
+
operator.operator_id === item.operator_id &&
|
|
356
|
+
operator.market === listItem.market &&
|
|
357
|
+
type === operator.type
|
|
358
|
+
)
|
|
359
|
+
);
|
|
360
|
+
|
|
361
|
+
if (operatorRelation) {
|
|
362
|
+
operatorRelation.ribbons =
|
|
363
|
+
item.ribbon_ids && item.ribbon_ids.length === 0
|
|
364
|
+
? operatorRelation.ribbons
|
|
365
|
+
: item.ribbon_ids;
|
|
366
|
+
|
|
367
|
+
operatorRelation.selling_points =
|
|
368
|
+
item.selling_points && item.selling_points.length === 0
|
|
369
|
+
? operatorRelation.selling_points
|
|
370
|
+
: item.selling_points;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
operatorRelation.updated_at = item.updated_at;
|
|
374
|
+
operatorRelation.toplist_bonus = item.bonus_name;
|
|
375
|
+
|
|
376
|
+
const operatorPage =
|
|
377
|
+
pages && pages.operator && operatorRelation
|
|
378
|
+
? pages.operator.filter(
|
|
379
|
+
(page) =>
|
|
380
|
+
page.relation &&
|
|
381
|
+
page.relation.operator_id ===
|
|
382
|
+
operatorRelation.operator_id &&
|
|
383
|
+
page.relation.type === operatorRelation.type
|
|
381
384
|
)
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
operatorPage[0]?.path
|
|
414
|
-
: operatorPage[0]?.path;
|
|
415
|
-
|
|
416
|
-
const authorTitle =
|
|
417
|
-
operatorPage[0] && operatorPage[0]?.author?.author_title;
|
|
418
|
-
|
|
419
|
-
const clone = sanitizeOperatorData(
|
|
420
|
-
cloneDeep(operatorRelation),
|
|
421
|
-
operatorPage,
|
|
422
|
-
data,
|
|
423
|
-
toplists && toplists[listItem.id].label
|
|
424
|
-
);
|
|
425
|
-
|
|
426
|
-
const socialAuthorLinks = [
|
|
427
|
-
"facebook_profile",
|
|
428
|
-
"twitter_profile",
|
|
429
|
-
"instagram_profile",
|
|
430
|
-
"linkedin_profile",
|
|
431
|
-
];
|
|
432
|
-
if (filterEnabled) {
|
|
433
|
-
buildToplistFilter(filters, clone);
|
|
434
|
-
}
|
|
435
|
-
return Object.assign(clone, {
|
|
436
|
-
review_link: reviewLink,
|
|
437
|
-
author_title: authorTitle,
|
|
438
|
-
author_same_as:
|
|
439
|
-
operatorPage[0] &&
|
|
440
|
-
operatorPage[0]?.author &&
|
|
441
|
-
socialAuthorLinks
|
|
442
|
-
.map((socialLink) => operatorPage[0]?.author?.[socialLink])
|
|
443
|
-
.filter((socialLink) => socialLink),
|
|
444
|
-
});
|
|
445
|
-
})
|
|
385
|
+
: [];
|
|
386
|
+
|
|
387
|
+
const reviewLink =
|
|
388
|
+
process.env.DMS_REVIEW_LINKS_ENABLED === 'true'
|
|
389
|
+
? stripDomainAndLeadingSlash(operatorRelation?.review_link) || operatorPage[0]?.path
|
|
390
|
+
: operatorPage[0]?.path;
|
|
391
|
+
|
|
392
|
+
const authorTitle = operatorPage[0] && operatorPage[0]?.author?.author_title;
|
|
393
|
+
|
|
394
|
+
const clone = sanitizeOperatorData(
|
|
395
|
+
cloneDeep(operatorRelation),
|
|
396
|
+
operatorPage,
|
|
397
|
+
data,
|
|
398
|
+
toplists && toplists[listItem.id].label
|
|
399
|
+
);
|
|
400
|
+
|
|
401
|
+
const socialAuthorLinks = [
|
|
402
|
+
'facebook_profile',
|
|
403
|
+
'twitter_profile',
|
|
404
|
+
'instagram_profile',
|
|
405
|
+
'linkedin_profile',
|
|
406
|
+
];
|
|
407
|
+
|
|
408
|
+
return Object.assign(clone, {
|
|
409
|
+
review_link: reviewLink,
|
|
410
|
+
author_title: authorTitle,
|
|
411
|
+
author_same_as: operatorPage[0] && operatorPage[0]?.author && socialAuthorLinks
|
|
412
|
+
.map((socialLink) => operatorPage[0]?.author?.[socialLink])
|
|
413
|
+
.filter((socialLink) => socialLink),
|
|
414
|
+
});
|
|
415
|
+
})
|
|
446
416
|
: [];
|
|
417
|
+
|
|
447
418
|
const latestItems = listItem.items
|
|
448
419
|
.map((toplist) => ({
|
|
449
420
|
...toplist,
|
|
@@ -469,10 +440,10 @@ export function processTopListModule(
|
|
|
469
440
|
// eslint-disable-next-line no-restricted-globals
|
|
470
441
|
latestUpdatedDate instanceof Date && !isNaN(latestUpdatedDate)
|
|
471
442
|
? new Intl.DateTimeFormat("en-US", {
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
443
|
+
year: "numeric",
|
|
444
|
+
month: "long",
|
|
445
|
+
day: "numeric",
|
|
446
|
+
}).format(latestUpdatedDate)
|
|
476
447
|
: null;
|
|
477
448
|
|
|
478
449
|
listItem.latest_items = formattedLatestItems;
|
|
@@ -480,8 +451,6 @@ export function processTopListModule(
|
|
|
480
451
|
|
|
481
452
|
return listItem;
|
|
482
453
|
});
|
|
483
|
-
|
|
484
|
-
if (filterEnabled) module.filters = filters;
|
|
485
454
|
}
|
|
486
455
|
|
|
487
456
|
export function processContentModule(
|
|
@@ -553,7 +522,7 @@ export function processFaq(module = {}, content, relationData) {
|
|
|
553
522
|
null,
|
|
554
523
|
relationData
|
|
555
524
|
)) ||
|
|
556
|
-
|
|
525
|
+
item.question
|
|
557
526
|
);
|
|
558
527
|
item.answer = trailingSlash(
|
|
559
528
|
(content && content[item.answer]) || item.answer
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable no-unused-expressions */
|
|
2
1
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
3
2
|
import loadash from "lodash/index.js";
|
|
4
3
|
import { pickRelationKeys } from "../constants/pick-keys.mjs";
|
|
@@ -29,26 +28,6 @@ export const processRelations = (
|
|
|
29
28
|
? cloneDeep(data.relations[page.relation_type][page.relation_id])
|
|
30
29
|
: null;
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
// Add path for software and license
|
|
34
|
-
if(page.relation_type === "operator" && (process.env.ENABLE_PATH_SOFTWARE_AND_LICENSE === 'true')) {
|
|
35
|
-
// Software
|
|
36
|
-
transformedPages[market][page.relation_type][
|
|
37
|
-
index
|
|
38
|
-
]?.relation?.software?.forEach(software => {
|
|
39
|
-
const mappedSoftware = transformedPages[market]?.software_provider?.filter(pr => pr.relation_id === software.id)[0];
|
|
40
|
-
mappedSoftware && (software.path = mappedSoftware.path);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
// License
|
|
44
|
-
transformedPages[market][page.relation_type][
|
|
45
|
-
index
|
|
46
|
-
]?.relation?.license_objects?.forEach(license => {
|
|
47
|
-
const mappedLicense = transformedPages[market]?.operators_license?.filter(l => l.relation_id === license.id)[0];
|
|
48
|
-
mappedLicense && (license.path = mappedLicense.path);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
31
|
switch (page.relation_type) {
|
|
53
32
|
// // Add path for game page from game provider
|
|
54
33
|
case "game":
|
package/src/services/api.mjs
CHANGED
|
@@ -118,10 +118,6 @@ export async function getProviders() {
|
|
|
118
118
|
return callAPIV2(`v0.1/globals/software-sorted-v2`);
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
export async function getLicenses() {
|
|
122
|
-
return callAPIV2(`v0.1/operators/licenses/sorted`);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
121
|
export async function getGames(params) {
|
|
126
122
|
return callAPIV2(`v0.1/games/games-sorted-v2${params ? `?${params}` : ""}`);
|
|
127
123
|
}
|
package/src/services/fetch.mjs
CHANGED
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
getCryptoBrokers,
|
|
20
20
|
getCryptoExchanges,
|
|
21
21
|
getCryptoWallets,
|
|
22
|
-
getLicenses,
|
|
23
22
|
} from "./api.mjs";
|
|
24
23
|
import { groupBy } from "../helpers/getters.mjs";
|
|
25
24
|
import { transformOperators } from "../resolver/operators.mjs";
|
|
@@ -36,7 +35,7 @@ export const fetchSiteSettings = async (siteName, previewPath = null) => {
|
|
|
36
35
|
const countriesPromise = getCountries();
|
|
37
36
|
const providersPromise = getProviders();
|
|
38
37
|
const gamblingCompaniesPromise = getGamblingCompanies();
|
|
39
|
-
|
|
38
|
+
|
|
40
39
|
// NOTE Crypto data
|
|
41
40
|
const cryptoBrokersPromise = getCryptoBrokers();
|
|
42
41
|
const cryptoExchangesPromise = getCryptoExchanges();
|
|
@@ -86,8 +85,7 @@ export const fetchSiteSettings = async (siteName, previewPath = null) => {
|
|
|
86
85
|
sportsData,
|
|
87
86
|
cryptoBrokers,
|
|
88
87
|
cryptoExchanges,
|
|
89
|
-
cryptoWallets
|
|
90
|
-
licensesData
|
|
88
|
+
cryptoWallets
|
|
91
89
|
] = await Promise.all([
|
|
92
90
|
ribbonsPromise,
|
|
93
91
|
responsableGamingPromise,
|
|
@@ -105,8 +103,7 @@ export const fetchSiteSettings = async (siteName, previewPath = null) => {
|
|
|
105
103
|
sportsPromise,
|
|
106
104
|
cryptoBrokersPromise,
|
|
107
105
|
cryptoExchangesPromise,
|
|
108
|
-
cryptoWalletsPromise
|
|
109
|
-
licensesPromise
|
|
106
|
+
cryptoWalletsPromise
|
|
110
107
|
]);
|
|
111
108
|
|
|
112
109
|
const allMarketPrefixes = Object.keys(allMarketsData)
|
|
@@ -182,7 +179,6 @@ export const fetchSiteSettings = async (siteName, previewPath = null) => {
|
|
|
182
179
|
gamesData,
|
|
183
180
|
sportsData,
|
|
184
181
|
cryptoExchangesData,
|
|
185
|
-
cryptoBrokersData
|
|
186
|
-
licensesData
|
|
182
|
+
cryptoBrokersData
|
|
187
183
|
};
|
|
188
184
|
};
|