gatsby-core-theme 41.1.2 → 41.1.4
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 +15 -0
- package/package.json +1 -1
- package/src/components/atoms/admin/bar/layout-section/index.js +1 -1
- package/src/components/atoms/admin/button/index.js +1 -1
- package/src/constants/pick-keys.mjs +3 -1
- package/src/constants/tracking-api.js +1 -1
- package/src/helpers/api.mjs +4 -0
- package/src/helpers/fetch-site-settings.mjs +9 -0
- package/src/helpers/processor/operators.mjs +10 -0
- package/src/helpers/processor/providers.mjs +18 -0
- package/src/helpers/processor/relations.mjs +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [41.1.4](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v41.1.3...v41.1.4) (2024-12-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* added software providers ([03e870d](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/03e870dc300bf5d529fcdfe893c493e33818fbf3))
|
|
7
|
+
* tracking small typo ([b9fcb56](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/b9fcb569963ebc74f3521b26acb90ae2f85a0de1))
|
|
8
|
+
|
|
9
|
+
## [41.1.3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v41.1.2...v41.1.3) (2024-12-03)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* payment relation bug ([fdc4e10](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/fdc4e109c1bc6777655315c50a36ec06f31fe7c9))
|
|
15
|
+
|
|
1
16
|
## [41.1.2](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v41.1.1...v41.1.2) (2024-12-03)
|
|
2
17
|
|
|
3
18
|
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ const getDMSLink = (module) => {
|
|
|
15
15
|
linkText = "Edit Toplist";
|
|
16
16
|
break;
|
|
17
17
|
case "bonus":
|
|
18
|
-
hercLink += `operators/${module.value?.operator_id}/sites-data
|
|
18
|
+
hercLink += `operators/${module.value?.operator_id}/sites-data/edit/${module.value?.id}`;
|
|
19
19
|
linkText = "Edit Operator";
|
|
20
20
|
break;
|
|
21
21
|
default:
|
|
@@ -107,7 +107,8 @@ export const pickRelationKeys = {
|
|
|
107
107
|
"support_email",
|
|
108
108
|
"min_deposit",
|
|
109
109
|
"max_withdrawal",
|
|
110
|
-
"license_objects"
|
|
110
|
+
"license_objects",
|
|
111
|
+
"launch_date"
|
|
111
112
|
],
|
|
112
113
|
game: [
|
|
113
114
|
"id",
|
|
@@ -136,6 +137,7 @@ export const pickRelationKeys = {
|
|
|
136
137
|
software_provider: [
|
|
137
138
|
"logo_filename_object",
|
|
138
139
|
"logo_filename",
|
|
140
|
+
"logo",
|
|
139
141
|
"games_count",
|
|
140
142
|
"name",
|
|
141
143
|
"standardised_logo_filename_object",
|
package/src/helpers/api.mjs
CHANGED
|
@@ -102,6 +102,10 @@ export async function getPayments(markets = []) {
|
|
|
102
102
|
return callAPIV2(`v0.1/globals/deposit-methods/sorted-v2/?market_short_codes=${markets.toString()}`);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
+
export async function getProviders() {
|
|
106
|
+
return callAPIV2(`v0.1/globals/software-sorted-v2`);
|
|
107
|
+
}
|
|
108
|
+
|
|
105
109
|
export async function getData(siteName, page = null, marketId = null, preview = false) {
|
|
106
110
|
let path = `${API_URL}/sites/v0.1/pages/sorted?site_name=${siteName}`;
|
|
107
111
|
|
|
@@ -10,9 +10,11 @@ import {
|
|
|
10
10
|
getCountries,
|
|
11
11
|
getCurrencies,
|
|
12
12
|
getPayments,
|
|
13
|
+
getProviders
|
|
13
14
|
} from "./api.mjs";
|
|
14
15
|
import { transformOperators } from "./processor/operators.mjs";
|
|
15
16
|
import { transformPayments } from "./processor/payment.mjs";
|
|
17
|
+
import { transformProvider } from "./processor/providers.mjs";
|
|
16
18
|
|
|
17
19
|
export const fetchSiteSettings = async (siteName, isPreview) => {
|
|
18
20
|
const siteSettingsPromise = getSiteSettings(siteName);
|
|
@@ -20,6 +22,7 @@ export const fetchSiteSettings = async (siteName, isPreview) => {
|
|
|
20
22
|
|
|
21
23
|
const currenciesPromise = getCurrencies();
|
|
22
24
|
const countriesPromise = getCountries();
|
|
25
|
+
const providersPromise = getProviders();
|
|
23
26
|
|
|
24
27
|
// Wait for siteSettings to get siteId and then chain other requests
|
|
25
28
|
const siteSettingsData = await siteSettingsPromise;
|
|
@@ -50,6 +53,7 @@ export const fetchSiteSettings = async (siteName, isPreview) => {
|
|
|
50
53
|
countriesData,
|
|
51
54
|
currenciesData,
|
|
52
55
|
payments,
|
|
56
|
+
providers
|
|
53
57
|
] = await Promise.all([
|
|
54
58
|
ribbonsPromise,
|
|
55
59
|
responsableGamingPromise,
|
|
@@ -60,6 +64,7 @@ export const fetchSiteSettings = async (siteName, isPreview) => {
|
|
|
60
64
|
countriesPromise,
|
|
61
65
|
currenciesPromise,
|
|
62
66
|
paymentPromise,
|
|
67
|
+
providersPromise
|
|
63
68
|
]);
|
|
64
69
|
|
|
65
70
|
const allMarketPrefixes = Object.keys(allMarketsData)
|
|
@@ -70,6 +75,8 @@ export const fetchSiteSettings = async (siteName, isPreview) => {
|
|
|
70
75
|
const templatesData = siteSettingsData.templates;
|
|
71
76
|
const allMarketSectionsData = siteSettingsData.market_sections;
|
|
72
77
|
|
|
78
|
+
const providersData = transformProvider(providers);
|
|
79
|
+
|
|
73
80
|
const paymentData = transformPayments(payments);
|
|
74
81
|
|
|
75
82
|
const operatorData = transformOperators(operators, {
|
|
@@ -77,6 +84,7 @@ export const fetchSiteSettings = async (siteName, isPreview) => {
|
|
|
77
84
|
ribbons: ribbonsData,
|
|
78
85
|
countries: countriesData,
|
|
79
86
|
currencies: currenciesData,
|
|
87
|
+
providers: providersData
|
|
80
88
|
});
|
|
81
89
|
|
|
82
90
|
return {
|
|
@@ -96,5 +104,6 @@ export const fetchSiteSettings = async (siteName, isPreview) => {
|
|
|
96
104
|
countriesData,
|
|
97
105
|
currenciesData,
|
|
98
106
|
paymentData,
|
|
107
|
+
providersData
|
|
99
108
|
};
|
|
100
109
|
};
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
processPaymentMethods,
|
|
11
11
|
processCountries,
|
|
12
12
|
processCurrencies,
|
|
13
|
+
processProviders
|
|
13
14
|
} from "./relations.mjs";
|
|
14
15
|
|
|
15
16
|
const { cloneDeep, pick } = loadash;
|
|
@@ -20,6 +21,9 @@ export function sanitizeOperatorData(operator, operatorPage = [], data = []) {
|
|
|
20
21
|
|
|
21
22
|
const { ribbons } = operator;
|
|
22
23
|
|
|
24
|
+
operatorClone.name = operator.operator_name || operator.name;
|
|
25
|
+
operatorClone.url = operator.operator_url || operator.url;
|
|
26
|
+
|
|
23
27
|
// Set Ribbons
|
|
24
28
|
if (ribbons && ribbons.length && data && data.ribbons) {
|
|
25
29
|
ribbons.forEach((res, indexOfRibbon) => {
|
|
@@ -117,6 +121,12 @@ export function transformOperators(jsonData, relationsData) {
|
|
|
117
121
|
relationsData.countries
|
|
118
122
|
);
|
|
119
123
|
|
|
124
|
+
// Providers
|
|
125
|
+
newOperatorData.software = processProviders(
|
|
126
|
+
newOperatorData.game_provider_ids,
|
|
127
|
+
relationsData.providers
|
|
128
|
+
);
|
|
129
|
+
|
|
120
130
|
operators[affiliate.id] = sanitizeOperatorData(
|
|
121
131
|
newOperatorData,
|
|
122
132
|
[],
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
+
/* eslint-disable import/prefer-default-export */
|
|
3
|
+
import loadash from "lodash/index.js";
|
|
4
|
+
import { pickRelationKeys } from "../../constants/pick-keys.mjs";
|
|
5
|
+
|
|
6
|
+
const { pick } = loadash;
|
|
7
|
+
|
|
8
|
+
export function transformProvider(providers) {
|
|
9
|
+
return Object.values(providers).reduce((acc, item) => {
|
|
10
|
+
acc[item.id] = item;
|
|
11
|
+
return acc;
|
|
12
|
+
}, {});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function getProviderData(provider) {
|
|
16
|
+
provider.logo = provider.standardised_logo;
|
|
17
|
+
return pick(provider, pickRelationKeys.software_provider);
|
|
18
|
+
}
|
|
@@ -3,6 +3,7 @@ import loadash from "lodash/index.js";
|
|
|
3
3
|
import { mergeMarketValues } from "./game.mjs";
|
|
4
4
|
import { pickRelationKeys } from "../../constants/pick-keys.mjs";
|
|
5
5
|
import { getPaymentDataByMarket } from "./payment.mjs";
|
|
6
|
+
import { getProviderData } from "./providers.mjs";
|
|
6
7
|
|
|
7
8
|
const { cloneDeep, pick } = loadash;
|
|
8
9
|
|
|
@@ -80,7 +81,7 @@ function removeDomain(url) {
|
|
|
80
81
|
|
|
81
82
|
|
|
82
83
|
export const processPaymentMethods = (ids, market, payments) =>
|
|
83
|
-
ids ? ids.map((id) => getPaymentDataByMarket(payments[id], market)) : [];
|
|
84
|
+
ids ? ids.map((id) => payments[id] ? getPaymentDataByMarket(payments[id], market) : null) : [];
|
|
84
85
|
|
|
85
86
|
export const processCurrencies = (ids, currencies) =>
|
|
86
87
|
ids
|
|
@@ -115,3 +116,6 @@ export const processLogo = (logo, standardisedLogo) =>
|
|
|
115
116
|
...standardisedLogo,
|
|
116
117
|
filename: removeDomain(standardisedLogo ? standardisedLogo.url : null),
|
|
117
118
|
};
|
|
119
|
+
|
|
120
|
+
export const processProviders = (ids, providers) =>
|
|
121
|
+
ids ? ids.map((id) => providers[id] ? getProviderData(providers[id]) : null) : [];
|