gatsby-core-theme 44.4.25 → 44.4.27
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 +19 -0
- package/gatsby-node.mjs +3 -0
- package/package.json +1 -1
- package/src/components/molecules/leave-comment-form/index.js +20 -11
- package/src/constants/forms.js +6 -6
- package/src/resolver/cryptos.mjs +2 -2
- package/src/resolver/cryptos.test.js +4 -4
- package/src/resolver/relations.mjs +6 -0
- package/src/services/fetch.mjs +7 -0
- package/tests/factories/crypto-exchanges/crypto-exchanges.factory.js +64 -60
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
## [44.4.27](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.26...v44.4.27) (2025-07-28)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add wallets data ([5338ab1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/5338ab162c121e07c6622092a27060c8179d012d))
|
|
7
|
+
* fix tests ([ba15ed7](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/ba15ed7a960acb9a753c012fc90d048183ffdd6b))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
* Merge branch 'tm-5662-crypto-wallets' into 'master' ([ed6aa81](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/ed6aa8168846c895d06bd3c00cd029efd445837b))
|
|
11
|
+
* Edit fetch.mjs ([49eb99c](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/49eb99c6ccde080643835ae2c96c8434b6f2cccd))
|
|
12
|
+
|
|
13
|
+
## [44.4.26](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.25...v44.4.26) (2025-07-28)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* reply issue with checkboxes ([151a5a3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/151a5a3f22d7b36657121c9060d0e543e1694134))
|
|
19
|
+
|
|
1
20
|
## [44.4.25](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.24...v44.4.25) (2025-07-25)
|
|
2
21
|
|
|
3
22
|
|
package/gatsby-node.mjs
CHANGED
|
@@ -57,6 +57,7 @@ let ribbonsData = null;
|
|
|
57
57
|
let operatorData = null;
|
|
58
58
|
let cryptoExchangesData = null;
|
|
59
59
|
let cryptoBrokersData = null;
|
|
60
|
+
let cryptoWalletsData = null;
|
|
60
61
|
let countriesData = null;
|
|
61
62
|
let paymentData = null;
|
|
62
63
|
let allMarketPrefixes = [];
|
|
@@ -98,6 +99,7 @@ export const createPages = async (
|
|
|
98
99
|
sports_data: sportsData,
|
|
99
100
|
crypto_exchanges: cryptoExchangesData,
|
|
100
101
|
crypto_brokers: cryptoBrokersData,
|
|
102
|
+
crypto_wallets: cryptoWalletsData,
|
|
101
103
|
countries: countriesData,
|
|
102
104
|
operators_license: licensesData,
|
|
103
105
|
},
|
|
@@ -381,6 +383,7 @@ export const onPreBootstrap = async () => {
|
|
|
381
383
|
countriesData,
|
|
382
384
|
commentsData,
|
|
383
385
|
licensesData,
|
|
386
|
+
cryptoWalletsData,
|
|
384
387
|
} = await fetchSiteSettings(process.env.GATSBY_SITE_NAME));
|
|
385
388
|
};
|
|
386
389
|
|
package/package.json
CHANGED
|
@@ -26,20 +26,29 @@ const LeaveCommentForm = ({
|
|
|
26
26
|
const formData = new FormData(form);
|
|
27
27
|
const data = Object.fromEntries(formData.entries());
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
const cleanedData = isReply
|
|
30
|
+
? Object.entries(data).reduce((acc, [key, value]) => {
|
|
31
|
+
if (key.startsWith('post_anonymously_')) acc.post_anonymously = value;
|
|
32
|
+
else if (key.startsWith('tnc_')) acc.tnc = value;
|
|
33
|
+
else acc[key] = value;
|
|
34
|
+
return acc;
|
|
35
|
+
}, {})
|
|
36
|
+
: data;
|
|
31
37
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
data.rate = parseInt(data.rate);
|
|
38
|
+
if(cleanedData?.["g-recaptcha-response"] === '' || !cleanedData?.tnc) return;
|
|
39
|
+
if(parentCommentID) cleanedData.parent_id = parentCommentID;
|
|
35
40
|
|
|
36
|
-
|
|
41
|
+
cleanedData.reference_id = page?.id;
|
|
42
|
+
cleanedData.site_id = parseInt(process.env.SITE_ID);
|
|
43
|
+
cleanedData.rate = parseInt(data.rate);
|
|
44
|
+
|
|
45
|
+
cleanedData.market_short_code = activeMarket;
|
|
37
46
|
|
|
38
|
-
if(!
|
|
39
|
-
if(!
|
|
47
|
+
if(!cleanedData?.post_anonymously) cleanedData.author_name = cleanedData?.name;
|
|
48
|
+
if(!cleanedData?.rate) delete cleanedData?.rate;
|
|
40
49
|
|
|
41
|
-
delete
|
|
42
|
-
delete
|
|
50
|
+
delete cleanedData?.post_anonymously;
|
|
51
|
+
delete cleanedData?.tnc;
|
|
43
52
|
|
|
44
53
|
const headers = {
|
|
45
54
|
headers: {
|
|
@@ -50,7 +59,7 @@ const LeaveCommentForm = ({
|
|
|
50
59
|
|
|
51
60
|
return new Promise((resolve, reject) => {
|
|
52
61
|
axios
|
|
53
|
-
.post('/api/post-comment',
|
|
62
|
+
.post('/api/post-comment', cleanedData, headers)
|
|
54
63
|
.then((response) => {
|
|
55
64
|
response.ok = response.status === 200;
|
|
56
65
|
if (response.ok) resetForm();
|
package/src/constants/forms.js
CHANGED
|
@@ -170,7 +170,7 @@ export const commentForm = {
|
|
|
170
170
|
{
|
|
171
171
|
id: 'tnc',
|
|
172
172
|
label:
|
|
173
|
-
'By checking this box, I agree to the Comments
|
|
173
|
+
'By checking this box, I agree to the Comments Terms and Conditions.',
|
|
174
174
|
link: {
|
|
175
175
|
url: '/privacy-policy',
|
|
176
176
|
text: 'Link',
|
|
@@ -231,7 +231,7 @@ export const replyForm = {
|
|
|
231
231
|
required: true,
|
|
232
232
|
},
|
|
233
233
|
{
|
|
234
|
-
id:
|
|
234
|
+
id: `post_anonymously_${Math.floor(Math.random() * 1000000)}`,
|
|
235
235
|
type: 'checkbox',
|
|
236
236
|
required: false,
|
|
237
237
|
switch: true,
|
|
@@ -239,7 +239,7 @@ export const replyForm = {
|
|
|
239
239
|
twoCol: false,
|
|
240
240
|
options: [
|
|
241
241
|
{
|
|
242
|
-
id:
|
|
242
|
+
id: `post_anonymously_${Math.floor(Math.random() * 1000000)}`,
|
|
243
243
|
label:
|
|
244
244
|
'Post comment anonymously.',
|
|
245
245
|
translationKey: 'post_anonymously_translation',
|
|
@@ -247,16 +247,16 @@ export const replyForm = {
|
|
|
247
247
|
],
|
|
248
248
|
},
|
|
249
249
|
{
|
|
250
|
-
id:
|
|
250
|
+
id: `tnc_${Math.floor(Math.random() * 1000000)}`,
|
|
251
251
|
type: 'checkbox',
|
|
252
252
|
required: true,
|
|
253
253
|
translationKey: 'checkbox_label',
|
|
254
254
|
twoCol: false,
|
|
255
255
|
options: [
|
|
256
256
|
{
|
|
257
|
-
id:
|
|
257
|
+
id: `tnc_${Math.floor(Math.random() * 1000000)}`,
|
|
258
258
|
label:
|
|
259
|
-
'By checking this box, I agree to the Comments
|
|
259
|
+
'By checking this box, I agree to the Comments Terms and Conditions.',
|
|
260
260
|
link: {
|
|
261
261
|
url: '/privacy-policy',
|
|
262
262
|
text: 'Link',
|
package/src/resolver/cryptos.mjs
CHANGED
|
@@ -19,10 +19,10 @@ export function sanitizeCryptoData(data) {
|
|
|
19
19
|
|
|
20
20
|
export function transformCryptosData(jsonData, relationsData) {
|
|
21
21
|
const cryptos = {};
|
|
22
|
-
|
|
22
|
+
// TODO: After alpha implement the site data we need to do more logic here
|
|
23
23
|
Object.values(jsonData).forEach(crypto => {
|
|
24
24
|
const newCryptoData = {
|
|
25
|
-
...crypto,
|
|
25
|
+
...crypto.general_data,
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
// OPERATOR LOGO (temp fix included and will be removed)
|
|
@@ -11,10 +11,10 @@ describe("Transform Cryptos Data", () => {
|
|
|
11
11
|
const transformedCryptoExchanges = transformCryptosData(exchangesData, {payments: {}, currencies: getCurrenciesData(), countries: {}});
|
|
12
12
|
|
|
13
13
|
// values before transforming
|
|
14
|
-
expect(Object.values(
|
|
15
|
-
expect(Object.values(
|
|
16
|
-
expect(Object.values(
|
|
17
|
-
expect(Object.values(
|
|
14
|
+
expect(Object.values(transformedCryptoExchanges)[0].name).toBe('Crypto Exchange 1');
|
|
15
|
+
expect(Object.values(transformedCryptoExchanges)[2].name).toBe('Crypto Exchange 3');
|
|
16
|
+
expect(Object.values(transformedCryptoExchanges)[1].crypto_currencies.length).toBe(2);
|
|
17
|
+
expect(Object.values(transformedCryptoExchanges)[1].crypto_currencies[0].name).toBe('Bitcoin');
|
|
18
18
|
|
|
19
19
|
// values after transforming
|
|
20
20
|
expect(Object.values(transformedCryptoExchanges)[0].name).toBe('Crypto Exchange 1');
|
|
@@ -87,6 +87,12 @@ export const processRelations = (
|
|
|
87
87
|
data.relations.crypto_brokers[page.relation_id];
|
|
88
88
|
}
|
|
89
89
|
break;
|
|
90
|
+
case "crypto_wallets":
|
|
91
|
+
if (!hasRelation) {
|
|
92
|
+
transformedPages[market][pageType][index].relation =
|
|
93
|
+
data.relations.crypto_wallets[page.relation_id];
|
|
94
|
+
}
|
|
95
|
+
break;
|
|
90
96
|
default:
|
|
91
97
|
break;
|
|
92
98
|
}
|
package/src/services/fetch.mjs
CHANGED
|
@@ -161,6 +161,12 @@ export const fetchSiteSettings = async (siteName, previewPath = null) => {
|
|
|
161
161
|
payments: paymentData,
|
|
162
162
|
})
|
|
163
163
|
|
|
164
|
+
const cryptoWalletsData = transformCryptosData(cryptoWallets, {
|
|
165
|
+
countries: countriesData,
|
|
166
|
+
currencies: currenciesData,
|
|
167
|
+
payments: paymentData,
|
|
168
|
+
})
|
|
169
|
+
|
|
164
170
|
|
|
165
171
|
if (["rage_seo", "rage_ppc", "sports"].includes(siteSettingsData.general[siteId].type)) {
|
|
166
172
|
const teamIds = Object.values(sportsData.teams).map((team) => String(team.livegoals_v2_id));
|
|
@@ -192,6 +198,7 @@ export const fetchSiteSettings = async (siteName, previewPath = null) => {
|
|
|
192
198
|
sportsData,
|
|
193
199
|
cryptoExchangesData,
|
|
194
200
|
cryptoBrokersData,
|
|
201
|
+
cryptoWalletsData,
|
|
195
202
|
commentsData,
|
|
196
203
|
licensesData
|
|
197
204
|
};
|
|
@@ -1,65 +1,69 @@
|
|
|
1
1
|
export const getDefaultCryptoExchangesProps = (index = 1) => ({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
2
|
+
general_data: {
|
|
3
|
+
id: index,
|
|
4
|
+
name: `Crypto Exchange ${index}`,
|
|
5
|
+
short_name: `crypto_exchange_${index}`,
|
|
6
|
+
founded: "2022-11-01 00:00:00",
|
|
7
|
+
headquarters: `Headquarters ${index}`,
|
|
8
|
+
best_for: "Selling",
|
|
9
|
+
url: "http://google.com/test222",
|
|
10
|
+
markets_amount: "3000 +",
|
|
11
|
+
currencies_amount: "3 including 25+",
|
|
12
|
+
rating_security: 1,
|
|
13
|
+
rating_fees: 3,
|
|
14
|
+
rating_usability: 3,
|
|
15
|
+
rating_features: 3,
|
|
16
|
+
rating_support: 3,
|
|
17
|
+
rating_average: 2.6,
|
|
18
|
+
exchange_type: "Decentralized",
|
|
19
|
+
crypto_currencies: [
|
|
20
|
+
1,
|
|
21
|
+
2
|
|
22
|
+
],
|
|
23
|
+
fiat_currencies: [
|
|
24
|
+
3,
|
|
25
|
+
9
|
|
26
|
+
],
|
|
27
|
+
restricted_countries: [
|
|
28
|
+
1,
|
|
29
|
+
254
|
|
30
|
+
],
|
|
31
|
+
selling_points: [
|
|
32
|
+
"800games",
|
|
33
|
+
"1000_games"
|
|
34
|
+
],
|
|
35
|
+
services: [
|
|
36
|
+
{
|
|
37
|
+
name: "g test",
|
|
38
|
+
short_name: "crypto_services_g",
|
|
39
|
+
id: 7
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "kripo",
|
|
43
|
+
short_name: "crypto_services_kripo",
|
|
44
|
+
id: 8
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
licences: [],
|
|
48
|
+
support_types: [
|
|
49
|
+
"support_type_facebook",
|
|
50
|
+
"support_type_faq_section"
|
|
51
|
+
],
|
|
52
|
+
logo: {
|
|
53
|
+
title: "Picking Betting Sites - Step 3: markets",
|
|
54
|
+
filename: "1668091295/step-3-markets-casinotopsonline",
|
|
55
|
+
extension: ".png",
|
|
56
|
+
url: "https://assets-srv.s3.eu-west-1.amazonaws.com/1668091295/step-3-markets-casinotopsonline.png",
|
|
57
|
+
width: "512",
|
|
58
|
+
height: "512",
|
|
59
|
+
alt: "Picking Betting Sites - Step 3: markets",
|
|
60
|
+
color: null,
|
|
61
|
+
id: 97121,
|
|
62
|
+
raw_filename: "1668091295/step-3-markets-casinotopsonline"
|
|
44
63
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"support_type_facebook",
|
|
49
|
-
"support_type_faq_section"
|
|
50
|
-
],
|
|
51
|
-
logo: {
|
|
52
|
-
title: "Picking Betting Sites - Step 3: markets",
|
|
53
|
-
filename: "1668091295/step-3-markets-casinotopsonline",
|
|
54
|
-
extension: ".png",
|
|
55
|
-
url: "https://assets-srv.s3.eu-west-1.amazonaws.com/1668091295/step-3-markets-casinotopsonline.png",
|
|
56
|
-
width: "512",
|
|
57
|
-
height: "512",
|
|
58
|
-
alt: "Picking Betting Sites - Step 3: markets",
|
|
59
|
-
color: null,
|
|
60
|
-
id: 97121,
|
|
61
|
-
raw_filename: "1668091295/step-3-markets-casinotopsonline"
|
|
62
|
-
}
|
|
64
|
+
|
|
65
|
+
},
|
|
66
|
+
|
|
63
67
|
})
|
|
64
68
|
|
|
65
69
|
export const transformedCryptoExchanges = () => ({
|