gatsby-matrix-theme 53.28.20 → 53.28.22
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 +26 -0
- package/package.json +2 -2
- package/src/components/molecules/header/variants/operator/template-five/index.js +1 -1
- package/src/components/molecules/header/variants/operator/template-four/index.js +1 -1
- package/src/components/molecules/header/variants/operator/template-three/index.js +1 -1
- package/src/components/molecules/operator-details/index.js +1 -1
- package/src/components/molecules/operator-exclusive/index.js +1 -1
- package/src/gatsby-core-theme/components/molecules/module/module-registry.js +10 -6
- package/src/gatsby-core-theme/helpers/server-data.js +50 -16
- package/src/gatsby-core-theme/helpers/server-data.test.js +75 -0
- package/storybook/public/{251.65dbf339.iframe.bundle.js → 251.0e172cd7.iframe.bundle.js} +4 -4
- package/storybook/public/{251.65dbf339.iframe.bundle.js.map → 251.0e172cd7.iframe.bundle.js.map} +1 -1
- package/storybook/public/iframe.html +1 -1
- package/storybook/public/main.748041de.iframe.bundle.js +1 -0
- package/storybook/public/project.json +1 -1
- package/storybook/public/main.21695da0.iframe.bundle.js +0 -1
- /package/storybook/public/{251.65dbf339.iframe.bundle.js.LICENSE.txt → 251.0e172cd7.iframe.bundle.js.LICENSE.txt} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
## [53.28.22](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v53.28.21...v53.28.22) (2026-11-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* update core version ([dcb3d26](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/dcb3d26dd45de0e854638890f87bc5b6f1485e92))
|
|
7
|
+
|
|
8
|
+
## [53.28.21](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v53.28.20...v53.28.21) (2026-11-04)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* algin slots ([90145be](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/90145be30a8f78ecec787222a18f68e5ba87a808))
|
|
14
|
+
* fix standardise fields ([b4f657d](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/b4f657ddde950a98006161828743ccc708cf27fd))
|
|
15
|
+
* fix the deploy ([54a6a6a](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/54a6a6ad786bcd1afc4e0697be0520cb0bd884ce))
|
|
16
|
+
* test build ([5e3566e](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/5e3566ea1d86d7723e9267aa15fa3301d3146500))
|
|
17
|
+
* udpate theme ([2ca16c4](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/2ca16c44db75ea45d45968e67bb2623b6e193418))
|
|
18
|
+
* update server data helper ([f348548](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/f348548c5cd64794497b42cfe336c44c9ac3ba92))
|
|
19
|
+
* update site name to irishluck ([a50a037](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/a50a037791737fee4bf19b8ab8b804d12fb992a6))
|
|
20
|
+
* update theme ([eeab79a](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/eeab79afc9b4c42aa0df5d645dcd25635b3d7d40))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
* Merge branch 'en-708-search-update' into 'master' ([2f0f313](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/2f0f313696b5d2000ed00aa8d4ebd92b4c861a18))
|
|
24
|
+
* Merge branch 'EN-699/slots-launch-api' into 'master' ([5e1a556](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/5e1a556155b3f203d32e397722b645409eac9b49))
|
|
25
|
+
* Merge branch 'EN-707/standardise-tapi-fields' into 'master' ([fc24645](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/fc2464552f2dcd0ff01d56eabd2ad8c12527c4ef))
|
|
26
|
+
|
|
1
27
|
## [53.28.20](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v53.28.19...v53.28.20) (2026-10-26)
|
|
2
28
|
|
|
3
29
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-matrix-theme",
|
|
3
|
-
"version": "53.28.
|
|
3
|
+
"version": "53.28.22",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"description": "Matrix Theme NPM Package",
|
|
6
6
|
"author": "",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@gigmedia/enigma-utils": "^1.20.0",
|
|
27
27
|
"@react-icons/all-files": "^4.1.0",
|
|
28
28
|
"gatsby": "^5.11.0",
|
|
29
|
-
"gatsby-core-theme": "44.37.
|
|
29
|
+
"gatsby-core-theme": "44.37.3",
|
|
30
30
|
"gatsby-plugin-sharp": "^5.11.0",
|
|
31
31
|
"gatsby-plugin-sitemap": "^6.13.1",
|
|
32
32
|
"gatsby-transformer-sharp": "^5.11.0",
|
|
@@ -70,7 +70,7 @@ const OperatorDetails = ({
|
|
|
70
70
|
const rating = item?.rating || item?.relation?.rating;
|
|
71
71
|
|
|
72
72
|
// eslint-disable-next-line react/prop-types
|
|
73
|
-
const Tag = ({ children, classStyle = '', clickedElement = '
|
|
73
|
+
const Tag = ({ children, classStyle = '', clickedElement = 'logo' }) =>
|
|
74
74
|
prettyLinkTracker ? (
|
|
75
75
|
<PrettyLink
|
|
76
76
|
operator={item?.relation || item}
|
|
@@ -51,7 +51,7 @@ const Banner = ({ bonus = {}, template, closeButtonIcon = true, width = 48, heig
|
|
|
51
51
|
tracker="banner"
|
|
52
52
|
gtmClass="banner-operator-cta-gtm"
|
|
53
53
|
pageTemplate={template}
|
|
54
|
-
clickedElement="
|
|
54
|
+
clickedElement="logo"
|
|
55
55
|
className="banner-gtm logo-cta"
|
|
56
56
|
>
|
|
57
57
|
<LazyImage
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { lazy } from 'react';
|
|
2
|
-
import { getSectionExtraField } from 'gatsby-core-theme/src/helpers/getters';
|
|
2
|
+
import { getGameIframe, getSectionExtraField } from 'gatsby-core-theme/src/helpers/getters';
|
|
3
3
|
import Content from 'gatsby-core-theme/src/components/molecules/content';
|
|
4
4
|
import Toplist from 'gatsby-core-theme/src/components/organisms/toplist';
|
|
5
5
|
import Anchor from 'gatsby-core-theme/src/components/organisms/anchor/template-one';
|
|
@@ -61,6 +61,13 @@ const lottoEntries = Object.fromEntries(
|
|
|
61
61
|
])
|
|
62
62
|
);
|
|
63
63
|
|
|
64
|
+
// Mirrors core module iframe props: Slots Launch iframe falls back to the page relation
|
|
65
|
+
const getIframeProps = ({ module, page }) => ({
|
|
66
|
+
src: module?.iframe_source || getGameIframe(page?.relation) || '',
|
|
67
|
+
title: page?.relation?.name || page?.title,
|
|
68
|
+
lazyLoad: false,
|
|
69
|
+
});
|
|
70
|
+
|
|
64
71
|
const iframeResolver = (ctx) => {
|
|
65
72
|
if (ctx.module?.value_type === 'template_block') {
|
|
66
73
|
return lazy(() => import('../../../../components/molecules/game-iframe'));
|
|
@@ -135,11 +142,8 @@ export const MODULE_REGISTRY = {
|
|
|
135
142
|
review_disclaimer: {
|
|
136
143
|
load: () => import('../../../../components/atoms/disclaimer/review-disclaimer'),
|
|
137
144
|
},
|
|
138
|
-
game_iframe: { resolveComponent: iframeResolver },
|
|
139
|
-
iframe: {
|
|
140
|
-
resolveComponent: iframeResolver,
|
|
141
|
-
getProps: ({ module }) => ({ src: module?.iframe_source }),
|
|
142
|
-
},
|
|
145
|
+
game_iframe: { resolveComponent: iframeResolver, getProps: getIframeProps },
|
|
146
|
+
iframe: { resolveComponent: iframeResolver, getProps: getIframeProps },
|
|
143
147
|
info_grid: {
|
|
144
148
|
component: InfoGrid,
|
|
145
149
|
suspense: false,
|
|
@@ -18,7 +18,28 @@ import {
|
|
|
18
18
|
import loadSource from '~helpers/search-source';
|
|
19
19
|
import { deparam } from '~helpers/strings';
|
|
20
20
|
import { groupBy } from '~helpers/getters';
|
|
21
|
-
import { filterSearchResults } from
|
|
21
|
+
import { filterSearchResults, readSearchCookie } from '~helpers/search';
|
|
22
|
+
|
|
23
|
+
const SEARCH_PAGE_CACHE_CONTROL = 'private, no-store';
|
|
24
|
+
|
|
25
|
+
function cleanSearchPath(pagePath = '') {
|
|
26
|
+
const normalized = pagePath.startsWith('/') ? pagePath : `/${pagePath}`;
|
|
27
|
+
if (process.env.TRAILING_SLASH && !normalized.endsWith('/')) {
|
|
28
|
+
return `${normalized}/`;
|
|
29
|
+
}
|
|
30
|
+
return normalized;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function cookieHeaderFrom(headers) {
|
|
34
|
+
if (!headers) return '';
|
|
35
|
+
if (typeof headers.get === 'function') return headers.get('cookie') || '';
|
|
36
|
+
return headers.cookie || headers.Cookie || '';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async function getSearchResults(market, searchTerm) {
|
|
40
|
+
const results = await loadSource(market, 'data.json');
|
|
41
|
+
return groupBy(filterSearchResults(results, searchTerm), 'pageType');
|
|
42
|
+
}
|
|
22
43
|
|
|
23
44
|
export async function getAPIData(page, url, header, preview) {
|
|
24
45
|
if (preview) {
|
|
@@ -88,27 +109,40 @@ export async function getAPIData(page, url, header, preview) {
|
|
|
88
109
|
return { props: {} };
|
|
89
110
|
}
|
|
90
111
|
|
|
91
|
-
if (page.path.endsWith('/s') || page.path === 's'
|
|
92
|
-
|
|
93
|
-
if (
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
urlParams = deparam(`${url.split('?')[1]}`);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const hasSearchParam = Boolean(urlParams && urlParams.hasOwnProperty("s"));
|
|
100
|
-
|
|
101
|
-
const searchData = hasSearchParam
|
|
102
|
-
? groupBy(filterSearchResults(results, urlParams.s), "pageType")
|
|
103
|
-
: null;
|
|
112
|
+
if (page.path.endsWith('/s') || page.path === 's') {
|
|
113
|
+
let urlParams = null;
|
|
114
|
+
if (url && url.split('?').length === 2) {
|
|
115
|
+
urlParams = deparam(`${url.split('?')[1]}`);
|
|
116
|
+
}
|
|
104
117
|
|
|
105
118
|
|
|
119
|
+
if (urlParams && Object.prototype.hasOwnProperty.call(urlParams, 's')) {
|
|
106
120
|
return {
|
|
121
|
+
status: 301,
|
|
122
|
+
headers: {
|
|
123
|
+
Location: cleanSearchPath(page.path),
|
|
124
|
+
'Cache-Control': SEARCH_PAGE_CACHE_CONTROL,
|
|
125
|
+
},
|
|
107
126
|
props: {
|
|
108
|
-
data:
|
|
109
|
-
searchParam:
|
|
127
|
+
data: null,
|
|
128
|
+
searchParam: null,
|
|
129
|
+
},
|
|
110
130
|
};
|
|
111
131
|
}
|
|
132
|
+
|
|
133
|
+
const searchTerm = readSearchCookie(cookieHeaderFrom(header));
|
|
134
|
+
const hasSearch = searchTerm !== null;
|
|
135
|
+
const searchData = hasSearch ? await getSearchResults(page.market, searchTerm) : null;
|
|
136
|
+
|
|
137
|
+
return {
|
|
138
|
+
headers: {
|
|
139
|
+
'Cache-Control': SEARCH_PAGE_CACHE_CONTROL,
|
|
140
|
+
},
|
|
141
|
+
props: {
|
|
142
|
+
data: searchData,
|
|
143
|
+
searchParam: hasSearch ? searchTerm : null,
|
|
144
|
+
},
|
|
145
|
+
};
|
|
112
146
|
}
|
|
113
147
|
|
|
114
148
|
try {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getAPIData } from './server-data';
|
|
2
|
+
import loadSource from '~helpers/search-source';
|
|
2
3
|
import {
|
|
3
4
|
getResultsById,
|
|
4
5
|
getLatestResults,
|
|
@@ -85,6 +86,80 @@ describe('getAPIData', () => {
|
|
|
85
86
|
]);
|
|
86
87
|
});
|
|
87
88
|
|
|
89
|
+
describe('search page', () => {
|
|
90
|
+
const originalTrailingSlash = process.env.TRAILING_SLASH;
|
|
91
|
+
const results = [
|
|
92
|
+
{
|
|
93
|
+
title: 'Active Casino',
|
|
94
|
+
type: 'operator',
|
|
95
|
+
relation: { status: 'active' },
|
|
96
|
+
pageType: 'operator',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
title: 'Inactive Casino',
|
|
100
|
+
type: 'operator',
|
|
101
|
+
relation: { status: 'inactive' },
|
|
102
|
+
pageType: 'operator',
|
|
103
|
+
},
|
|
104
|
+
{ title: 'Blackjack Game', type: 'game', pageType: 'game' },
|
|
105
|
+
];
|
|
106
|
+
const searchPage = { path: 's', market: 'ie_en' };
|
|
107
|
+
|
|
108
|
+
beforeEach(() => {
|
|
109
|
+
loadSource.mockReset();
|
|
110
|
+
loadSource.mockResolvedValue(results);
|
|
111
|
+
delete process.env.TRAILING_SLASH;
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
afterEach(() => {
|
|
115
|
+
process.env.TRAILING_SLASH = originalTrailingSlash;
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
test('no cookie renders the blank search page', async () => {
|
|
119
|
+
const response = await getAPIData(searchPage, '/s', {});
|
|
120
|
+
|
|
121
|
+
expect(response.props).toEqual({ data: null, searchParam: null });
|
|
122
|
+
expect(response.headers['Cache-Control']).toBe('private, no-store');
|
|
123
|
+
expect(loadSource).not.toHaveBeenCalled();
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
test('a search cookie filters on the server and does not read the url', async () => {
|
|
127
|
+
const response = await getAPIData(
|
|
128
|
+
searchPage,
|
|
129
|
+
'/s',
|
|
130
|
+
new Map([['cookie', 'matrixSearch=casino']])
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
expect(response.props.searchParam).toBe('casino');
|
|
134
|
+
expect(response.props.data.operator.map((item) => item.title)).toEqual([
|
|
135
|
+
'Active Casino',
|
|
136
|
+
'Inactive Casino',
|
|
137
|
+
]);
|
|
138
|
+
expect(response.headers['Cache-Control']).toBe('private, no-store');
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
test('a query string search redirects to the clean path and is not rendered', async () => {
|
|
142
|
+
process.env.TRAILING_SLASH = 'true';
|
|
143
|
+
|
|
144
|
+
const response = await getAPIData(searchPage, '/s?s=best+casino+telegram', {
|
|
145
|
+
cookie: 'matrixSearch=casino',
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
expect(response).toEqual({
|
|
149
|
+
status: 301,
|
|
150
|
+
headers: {
|
|
151
|
+
Location: '/s/',
|
|
152
|
+
'Cache-Control': 'private, no-store',
|
|
153
|
+
},
|
|
154
|
+
props: {
|
|
155
|
+
data: null,
|
|
156
|
+
searchParam: null,
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
expect(loadSource).not.toHaveBeenCalled();
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
|
|
88
163
|
test('returns empty lottery props instead of throwing on an unexpected error', async () => {
|
|
89
164
|
mockApiDown();
|
|
90
165
|
getCalendarData.mockRejectedValue(new Error('boom'));
|