gatsby-core-theme 30.0.70 → 30.0.71

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,25 @@
1
+ ## [30.0.71](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.70...v30.0.71) (2024-02-05)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * a create default settings ([3db433d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3db433da9baa56881aedf974cf100eb85f45780d))
7
+ * fix test ([60f0901](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/60f09017d212f526f41d7463640637bdd577ccd7))
8
+ * fix the logic ([371fbed](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/371fbed1770f8521ca7d39360fb29d8ce796388c))
9
+ * search bug ([f073d49](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/f073d495a89627b52c7dac1844f280ced97cc06a))
10
+ * tracker and gatsby browser ([b065517](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b065517545eb411bcce7121651881a797a450091))
11
+ * tracker and gatsby browser ([a2ff710](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a2ff7101a31901023c52f8cc5ae7c4a63ac53754))
12
+
13
+
14
+ ### Code Refactoring
15
+
16
+ * enable app-ssr page types ([78be6b5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/78be6b5d2cb459b0c4bbdb849ca6db7b4d2a59e9))
17
+
18
+
19
+ * Merge branch 'search' into 'master' ([1982bda](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/1982bdae3986ff205c55c15394a0ab39ec6dce9d))
20
+ * Merge branch 'tm-3984-sportstake' into 'master' ([56558ef](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/56558efe05a592c224ec785dea4c41dd8f3f4189))
21
+ * Merge branch 'defaultSettings' into 'master' ([27c2c5d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/27c2c5d38de3869223ae79797f1511a2c2bcd2a3))
22
+
1
23
  ## [30.0.70](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.69...v30.0.70) (2024-02-01)
2
24
 
3
25
 
package/gatsby-browser.js CHANGED
@@ -101,11 +101,17 @@ function scrollEvent(event) {
101
101
 
102
102
  if (process.env.ENABLE_CRAZYEGG === 'true' && !document.getElementById('crazy-egg')) crazyEgg();
103
103
 
104
- event.currentTarget.removeEventListener(event.type, scrollEvent); // remove the event listener that got triggered
104
+ if (event) {
105
+ event.currentTarget.removeEventListener(event.type, scrollEvent); // remove the event listener that got triggered
106
+ }
105
107
  }
106
108
 
107
109
  exports.onClientEntry = () => {
108
- document.addEventListener('scroll', scrollEvent);
109
- document.addEventListener('mousemove', scrollEvent);
110
- document.addEventListener('touchstart', scrollEvent, { passive: true });
110
+ if (process.env.PPC === 'true') {
111
+ scrollEvent(null);
112
+ } else {
113
+ document.addEventListener('scroll', scrollEvent);
114
+ document.addEventListener('mousemove', scrollEvent);
115
+ document.addEventListener('touchstart', scrollEvent, { passive: true });
116
+ }
111
117
  };
package/gatsby-node.mjs CHANGED
@@ -14,6 +14,7 @@ import { getData, getLocalData } from './src/helpers/api.mjs';
14
14
  import { generateTrackerLink } from './src/helpers/generators.mjs';
15
15
  import processor, { processSitemapPages } from './src/helpers/processor/index.mjs';
16
16
  import { pickAuthorsPageKeys } from './src/constants/pick-keys.mjs';
17
+ import settings from './src/constants/settings.mjs';
17
18
  import { translate } from './src/helpers/getters.mjs';
18
19
  import { groupBy } from './src/helpers/processor/common.mjs';
19
20
 
@@ -298,8 +299,7 @@ export const createPages = async ({ actions: { createPage } }, themeOptions) =>
298
299
  });
299
300
  } else {
300
301
  const component =
301
- (page.relation_type === 'event' || page.relation_type === 'tournament') &&
302
- ['sports'].includes(response.general.type)
302
+ settings.app_ssr.includes(page.template)
303
303
  ? `${__dirname}/src/components/app-ssr.js`
304
304
  : `${__dirname}/src/components/app.js`;
305
305
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "30.0.70",
3
+ "version": "30.0.71",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -62,7 +62,7 @@ describe('OperatorCtaButton Component', () => {
62
62
  expect(affObject.page_type).toEqual('test');
63
63
  expect(affObject.module).toEqual('test2');
64
64
  expect(affObject.request_url).toEqual('http://test.com/');
65
- expect(affObject.facebook_click_id).toEqual('param1');
65
+ // expect(affObject.facebook_click_id).toEqual('param1');
66
66
  expect(affObject.microsoft_click_id).toEqual('param2');
67
67
  expect(affObject.google_click_id).toEqual('param3');
68
68
  expect(affObject.tracker_name).toEqual('testing');
@@ -50,7 +50,7 @@ describe('PrettyLink Component', () => {
50
50
  expect(affObject.page_type).toEqual('test');
51
51
  expect(affObject.module).toEqual('test2');
52
52
  expect(affObject.request_url).toEqual('http://test.com/');
53
- expect(affObject.facebook_click_id).toEqual('param1');
53
+ // expect(affObject.facebook_click_id).toEqual('param1');
54
54
  expect(affObject.microsoft_click_id).toEqual('param2');
55
55
  expect(affObject.google_click_id).toEqual('param3');
56
56
  expect(affObject.tracker_name).toEqual('testing');
@@ -107,6 +107,7 @@ const Navigation = ({
107
107
  searchIcon={searchIcon}
108
108
  pageContext={pageContext}
109
109
  searchURLPageName={searchURLPageName}
110
+ marketPrefix={activeMarket?.path_prefix || '/'}
110
111
  />
111
112
  )}
112
113
  {CustomComponent && <CustomComponent pageContext={pageContext} section={section} />}
@@ -16,6 +16,7 @@ const SearchForm = ({
16
16
  iconWidth = 24,
17
17
  iconHeight = 24,
18
18
  placeholder = null,
19
+ marketPrefix = '/',
19
20
  }) => {
20
21
  const { showSearch, setShowSearch, setShowMenu, showMenu } = useContext(NavigationContext);
21
22
  const [searchBoxQuery, setSearchBoxQuery] = useState();
@@ -44,7 +45,9 @@ const SearchForm = ({
44
45
  if (searchBoxQuery === '') {
45
46
  e.target.querySelector('input').focus();
46
47
  } else {
47
- navigate(`/s?s=${searchBoxQuery}`);
48
+ const searchUrl =
49
+ marketPrefix !== '/' ? `/${marketPrefix}/s?s=${searchBoxQuery}` : `/s?s=${searchBoxQuery}`;
50
+ navigate(searchUrl);
48
51
  }
49
52
  };
50
53
 
@@ -108,6 +111,7 @@ SearchForm.propTypes = {
108
111
  iconHeight: PropTypes.number,
109
112
  pageContext: PropTypes.shape({}),
110
113
  placeholder: PropTypes.string,
114
+ marketPrefix: PropTypes.string,
111
115
  };
112
116
 
113
117
  export default SearchForm;
@@ -5,10 +5,7 @@ export default {
5
5
  'playcasino.co.za': true,
6
6
  },
7
7
  dynamic_prefilled_modules: {
8
- 'Irishluck.ie': ['cards', 'cards_v2'],
9
- 'norskespilleautomater.com': ['cards', 'cards_v2'],
10
- 'playcasino.co.za': ['cards', 'cards_v2'],
11
- 'sporttheme.com': ['cards', 'cards_v2'],
8
+ 'default' : ['cards', 'cards_v2']
12
9
  },
13
10
  filter_cards_modules: {
14
11
  'irishluck.ie': ['inactive', 'blacklisted', 'coming_soon'],
@@ -18,12 +15,7 @@ export default {
18
15
  'onlinegamblingsa.com': ['inactive', 'blacklisted', 'coming_soon', 'not_recommended'],
19
16
  'onlinecasinosouthafrica.net': ['inactive', 'blacklisted', 'coming_soon', 'not_recommended'],
20
17
  'free-casinos.co.za': ['inactive', 'blacklisted', 'coming_soon', 'not_recommended'],
21
- 'sporttheme.com': ['inactive', 'blacklisted'],
22
- 'partnerships.gigmedia.com': ['inactive', 'blacklisted'],
23
- 'habibibet.org': ['inactive', 'blacklisted'],
24
- 'xn--nt-casino-v2a.se': ['inactive', 'blacklisted'],
25
- 'casinomobile.co.za': ['inactive', 'blacklisted'],
26
- 'betamericalatina.com': ['inactive', 'blacklisted'],
18
+ 'default': ['inactive', 'blacklisted']
27
19
  },
28
20
  keep_page_extra_fields: {
29
21
  operator: {
@@ -53,4 +45,11 @@ export default {
53
45
  operator: { 'Irishluck.ie': ['main'] },
54
46
  article: { 'Irishluck.ie': ['main'] },
55
47
  },
48
+ app_ssr: [
49
+ 'event',
50
+ 'tournament',
51
+ 'sportstake_fixtures',
52
+ 'sportstake_results',
53
+ 'lotto',
54
+ ]
56
55
  };
@@ -17,6 +17,9 @@ export function processCardsModule(module, pages, pagesCloned, pagesMappedById)
17
17
  const displayInput = module.display_input;
18
18
  const sortBy = module.sort_by;
19
19
  module.items = [];
20
+ const filterCardsModules = !settings.filter_cards_modules[process?.env?.GATSBY_SITE_NAME]
21
+ ? settings.filter_cards_modules.default
22
+ : settings.filter_cards_modules[process?.env?.GATSBY_SITE_NAME];
20
23
 
21
24
  if (displayInput === 'automatic' && pages[modelType]) {
22
25
  const numOfItems =
@@ -25,11 +28,8 @@ export function processCardsModule(module, pages, pagesCloned, pagesMappedById)
25
28
  const samplePages =
26
29
  module.cards_page_type !== 'operator'
27
30
  ? pagesCloned[modelType]
28
- : pagesCloned[modelType].filter(
29
- (page) =>
30
- !settings.filter_cards_modules[process.env.GATSBY_SITE_NAME].includes(
31
- page.relation && page.relation.status
32
- )
31
+ : pagesCloned[modelType].filter((page) =>
32
+ filterCardsModules.includes(page.relation && page.relation.status)
33
33
  );
34
34
  module.items = sampleSize(samplePages, numOfItems);
35
35
  } else {
@@ -238,7 +238,7 @@ export function processCardsV2(module, pagesCloned, pagesMappedById, pageId) {
238
238
  finalizedFilteredPages = filteredPages;
239
239
  }
240
240
  const uniquePages = removeCurrentPage(removeDuplicates(finalizedFilteredPages, 'id'), pageId);
241
-
241
+
242
242
  // Applying sorting
243
243
  if (sortType === 'random') {
244
244
  module.items = sampleSize(uniquePages, itemLimit);
@@ -248,7 +248,6 @@ export function processCardsV2(module, pagesCloned, pagesMappedById, pageId) {
248
248
  module.items = uniquePages.slice(0, itemLimit);
249
249
  }
250
250
  }
251
-
252
251
  }
253
252
  }
254
253
 
@@ -260,7 +259,7 @@ export function processCardsV2(module, pagesCloned, pagesMappedById, pageId) {
260
259
  if (pageId !== null) {
261
260
  module.module_title = getModuleTitle(module, pagesMappedById[pageId]);
262
261
  }
263
-
262
+
264
263
  // modify page so it doesn't have too much data
265
264
  module.items = module.items.map((item) => clonePageForCards(cloneDeep(item), module.style));
266
265
  }
@@ -332,10 +331,12 @@ export function processTopListModule(module, relations, pages, markets) {
332
331
  }
333
332
 
334
333
  export function shouldSavePrefilled(module = {}, siteName) {
334
+ const dynamicPrefilledModules = settings.dynamic_prefilled_modules[siteName]
335
+ ? settings.dynamic_prefilled_modules[siteName]
336
+ : settings.dynamic_prefilled_modules.default;
335
337
  return (
336
338
  module.value_type === ModuleValue.VALUE_TYPE_PREFILLED_MODULE_MARKET &&
337
- ((settings.dynamic_prefilled_modules[siteName] &&
338
- !settings.dynamic_prefilled_modules[siteName].includes(module.name)) ||
339
+ (!dynamicPrefilledModules.includes(module.name) ||
339
340
  module.sort_by !== 'random')
340
341
  );
341
342
  }
@@ -80,6 +80,7 @@ export async function getAffiliateLink(operator, path, page, headers, url) {
80
80
  user_agent: headers ? headers.get('user-agent') || headers.get('user-agent') : 'N/A',
81
81
  user_uuid: cookie ? cookie.affUUID || 'N/A' : 'N/A',
82
82
  facebook_browser_id: cookie ? cookie._fbp || 'N/A' : 'N/A',
83
+ facebook_click_id: cookie ? cookie._fbc || 'N/A' : 'N/A',
83
84
  facebook_pixel_id: process.env.PIXEL_ID || 'N/A',
84
85
  ...(isJsonString(cookie.affObject) ? JSON.parse(cookie.affObject) : {}),
85
86
  ...(extraParams || {}),
@@ -116,9 +117,9 @@ export function getTrackingAPIParams(pageTemplate, module, tracker, clickedEleme
116
117
  // eslint-disable-next-line prefer-destructuring
117
118
  urlParams.request_url = url.split('?')[0];
118
119
  const extraData = deparam(url.split('?')[1]);
119
- if (extraData.fbclid) {
120
- urlParams.facebook_click_id = extraData.fbclid;
121
- }
120
+ // if (extraData.fbclid) {
121
+ // urlParams.facebook_click_id = extraData.fbclid;
122
+ // }
122
123
  if (extraData.msclkid) {
123
124
  urlParams.microsoft_click_id = extraData.msclkid;
124
125
  }
@@ -72,7 +72,7 @@ describe('Tracker Helper', () => {
72
72
  expect(fetch).toBeCalledWith(
73
73
  `${process.env.GATSBY_TRACKING_API_URL}?${new URLSearchParams(
74
74
  urlParam
75
- ).toString()}&user_agent=N%2FA&user_uuid=N%2FA&facebook_browser_id=N%2FA&facebook_pixel_id=N%2FA`
75
+ ).toString()}&user_agent=N%2FA&user_uuid=N%2FA&facebook_browser_id=N%2FA&facebook_click_id=N%2FA&facebook_pixel_id=N%2FA`
76
76
  );
77
77
  });
78
78
 
@@ -87,7 +87,7 @@ describe('Tracker Helper', () => {
87
87
 
88
88
  expect(fetch).toBeCalledTimes(1);
89
89
  expect(fetch).toBeCalledWith(
90
- `testlink?site_id=82&operator_short_name=rizk&operator_type=sportsbook&language=en&tracker_name=main&market_short_code=ie_en&ip_address=127.0.0.1&user_agent=N%2FA&user_uuid=N%2FA&facebook_browser_id=N%2FA&facebook_pixel_id=N%2FA&extraparam=val&extraparam2=val2`
90
+ `testlink?site_id=82&operator_short_name=rizk&operator_type=sportsbook&language=en&tracker_name=main&market_short_code=ie_en&ip_address=127.0.0.1&user_agent=N%2FA&user_uuid=N%2FA&facebook_browser_id=N%2FA&facebook_click_id=N%2FA&facebook_pixel_id=N%2FA&extraparam=val&extraparam2=val2`
91
91
  );
92
92
  });
93
93
 
@@ -115,7 +115,7 @@ describe('Tracker Helper', () => {
115
115
  'urlValue?fbclid=param1&msclkid=param2&gclid=param3'
116
116
  );
117
117
  expect(params.request_url).toEqual('urlValue');
118
- expect(params.facebook_click_id).toEqual('param1');
118
+ // expect(params.facebook_click_id).toEqual('param1');
119
119
  expect(params.microsoft_click_id).toEqual('param2');
120
120
  expect(params.google_click_id).toEqual('param3');
121
121
  });