gatsby-core-theme 1.2.0 → 1.2.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/.ci.yml CHANGED
@@ -19,6 +19,7 @@ Theme Publish:
19
19
  tags:
20
20
  - floyd-runner-test
21
21
  before_script:
22
+ - git config --global http.sslverify false
22
23
  - git config --global user.email "floyd@gig.com"
23
24
  - git config --global user.name "floyd"
24
25
  script:
package/CHANGELOG.md CHANGED
@@ -1,3 +1,52 @@
1
+ ## [1.2.4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.2.3...v1.2.4) (2021-10-11)
2
+
3
+
4
+ ### Config
5
+
6
+ * settings update for playcasino ([c258327](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c2583274f107254c9089cae2adc4f1807bc5787b))
7
+
8
+
9
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/gatsby-themes ([2e516a2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2e516a23c2b2b177aeb3c03accf732c7c1c4bd48))
10
+
11
+ ## [1.2.3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.2.2...v1.2.3) (2021-10-08)
12
+
13
+
14
+ ### Code Refactoring
15
+
16
+ * removing all style/css props in components ([a99ca6d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a99ca6dd8637fbec5edcf68924c33c300ce13106))
17
+
18
+
19
+ * Merge branch 'tm-1222-style-prop-fix' into 'master' ([a3b5323](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a3b5323a1e99ed86d6b4cf79bed0cd7de28049ee))
20
+
21
+ ## [1.2.2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.2.1...v1.2.2) (2021-10-07)
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * changed logic of featured cards ([203089c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/203089c73aa388647b4f0bab30460a390865759f))
27
+ * pagination translations ([678f43d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/678f43d1505a0a93ec2f5c817bfa482040d8ed74))
28
+ * test ([c4b6188](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c4b618865bc997831e1ef1fe28af3202da5fa986))
29
+ * tests fail ([94a4b2d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/94a4b2d28542c109536f3d223e462390ba76fabe))
30
+
31
+
32
+ * Merge branch 'tm-2525-pagination-translation' into 'master' ([6a16891](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/6a1689153c085d068484ef1c5a81e91731bd24ee))
33
+ * Merge branch 'tm-2493-featured-cards' into 'master' ([3429da5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3429da516da5e3980933c89bf90f95c5d45c2f76))
34
+
35
+ ## [1.2.1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.2.0...v1.2.1) (2021-10-06)
36
+
37
+
38
+ ### Bug Fixes
39
+
40
+ * clonePageForCards function ([da416c4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/da416c496d8c0ab260d4ef8c994ea30166620c77))
41
+ * pipeline fix ([d7c1f7c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d7c1f7c23364ab70838a6e5cc2398248421e854d))
42
+ * sitename fixes ([e1687e6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/e1687e65353cb9be3e3c37099ac9e85a9213580d))
43
+ * sitename fixes ([8f9fe74](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/8f9fe7424c5e8777ffba959792df23b08ae4e732))
44
+ * tests ([1cfd370](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/1cfd37021444bee5ff36bd3e87ca2318d597a1ee))
45
+
46
+
47
+ * Merge branch 'hot-fix-cards' into 'master' ([b0117a2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b0117a2ff7f3172d923ad6b63e21a129837d8eb5))
48
+ * Merge branch 'hot-fix-cards' into 'master' ([5c390d3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/5c390d341e6c8c8f384159774ee67014650036cf))
49
+
1
50
  # [1.2.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.1.0...v1.2.0) (2021-09-29)
2
51
 
3
52
 
@@ -15,7 +15,6 @@ const path = require('path');
15
15
 
16
16
  let preconnectLinks = null;
17
17
  let pages = null;
18
- let siteName = null;
19
18
  let marketSections = [];
20
19
  let prefilledModules = [];
21
20
  let siteInfo = null;
@@ -54,7 +53,7 @@ function createArchivePage(pageObject, marketSections, prefilledModules, createP
54
53
  archive.currentPage = 1 + index; // 0 skip 0
55
54
  archive.numOfPages = numOfPages;
56
55
  archive.rootPath = pageObject.path.charAt(0) !== '/' ? `/${pageObject.path}` : pageObject.path;
57
- archive.items = value.map((item) => processor.clonePage(String(siteName), item));
56
+ archive.items = value.map((item) => processor.clonePage(item));
58
57
  page.path =
59
58
  archive.currentPage === 1
60
59
  ? pageObject.path
@@ -86,7 +85,6 @@ exports.createPages = async ({ actions: { createPage } }, themeOptions) => {
86
85
  }
87
86
  process.env.GATSBY_TRACKER_LINK_PREFIX = trackerLinkPrefix; // hard coded for now
88
87
  process.env.GATSBY_SITE_NAME = String(themeOptions.siteName);
89
- siteName = String(themeOptions.siteName);
90
88
  if (process.env.GATSBY_PREVIEW_MODE === 'true') {
91
89
  console.log(chalk.magenta('info') + chalk.whiteBright(' preview mode enabled'));
92
90
  console.log(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "1.2.0",
3
+ "version": "1.2.4",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "main": "index.js",
6
6
  "GATSBY_RECAPTCHA_SITEKEY": "6LfoyvMUAAAAAO4nl_MQnqHb4XdHxEiu5cXgIqeB",
@@ -3,9 +3,9 @@ import PropTypes from 'prop-types';
3
3
 
4
4
  import LazyImage from '~hooks/lazy-image';
5
5
  import keygen from '~helpers/keygen';
6
- import Css from './content-box.module.scss';
6
+ import styles from './content-box.module.scss';
7
7
 
8
- const ContentBox = ({ data = [], styles = Css }) => (
8
+ const ContentBox = ({ data = [] }) => (
9
9
  <div className={styles.contentBoxContainer}>
10
10
  <ul className={styles.contentBoxList}>
11
11
  {data.map((item) => (
@@ -3,14 +3,9 @@ import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import parse from 'html-react-parser';
5
5
 
6
- import Css from './content-and-custom-module.module.scss';
6
+ import styles from './content-and-custom-module.module.scss';
7
7
 
8
- const ContentAndCustomModule = ({
9
- content = '',
10
- CustomComponent,
11
- customComponentProps,
12
- styles = Css,
13
- }) => (
8
+ const ContentAndCustomModule = ({ content = '', CustomComponent, customComponentProps }) => (
14
9
  <>
15
10
  <div className={styles.contentAndCustomModuleContainer}>
16
11
  {content && <div className={styles.contentBox}>{parse(content)}</div>}
@@ -1,18 +1,19 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { MdLastPage, MdFirstPage, MdChevronRight, MdChevronLeft } from 'react-icons/md';
4
-
4
+ import { translate } from '~helpers/getters';
5
5
  import Link from '~hooks/link';
6
6
  import styles from './pagination-with-midpoints.module.scss';
7
7
 
8
8
  const PaginationWithMidPoints = ({
9
9
  currentPage = 1,
10
10
  pagePath = '#',
11
- totalPages = 5,
11
+ totalPages = 5,
12
12
  previousComp = <MdChevronLeft />,
13
13
  nextComp = <MdChevronRight />,
14
14
  firstComp = <MdFirstPage />,
15
15
  lastComp = <MdLastPage />,
16
+ translations,
16
17
  }) => {
17
18
  const current = Number(currentPage);
18
19
  const total = Number(totalPages);
@@ -32,22 +33,19 @@ const PaginationWithMidPoints = ({
32
33
  <Link to={getPagePath(1)} className={`${styles.button} ${styles.isActive}`}>
33
34
  {firstComp}
34
35
  </Link>
35
- )
36
- :
37
- (<span className={styles.button}>{firstComp}</span>)}
36
+ ) : (
37
+ <span className={styles.button}>{firstComp}</span>
38
+ )}
38
39
  </li>
39
40
  {/* previous button */}
40
41
  <li className={styles.showInAll}>
41
42
  {current > 1 ? (
42
- <Link
43
- to={getPagePath(current - 1)}
44
- className={`${styles.button} ${styles.isActive}`}
45
- >
43
+ <Link to={getPagePath(current - 1)} className={`${styles.button} ${styles.isActive}`}>
46
44
  {previousComp}
47
45
  </Link>
48
- )
49
- :
50
- (<span className={styles.button}>{previousComp}</span>)}
46
+ ) : (
47
+ <span className={styles.button}>{previousComp}</span>
48
+ )}
51
49
  </li>
52
50
 
53
51
  <div className={styles.padd}>
@@ -98,7 +96,7 @@ const PaginationWithMidPoints = ({
98
96
  </li>
99
97
  )}
100
98
  <li className={styles.showInMobile}>
101
- <span> of </span>
99
+ <span>{translate(translations, 'of', 'of')}</span>
102
100
  <Link to={getPagePath(total)}>{total}</Link>
103
101
  </li>
104
102
  </div>
@@ -106,28 +104,22 @@ const PaginationWithMidPoints = ({
106
104
  {/* next button */}
107
105
  <li className={styles.showInAll}>
108
106
  {current < total ? (
109
- <Link
110
- to={getPagePath(current + 1)}
111
- className={`${styles.button} ${styles.isActive}`}
112
- >
107
+ <Link to={getPagePath(current + 1)} className={`${styles.button} ${styles.isActive}`}>
113
108
  {nextComp}
114
109
  </Link>
115
- )
116
- :
117
- (<span className={styles.button}>{nextComp}</span>)}
110
+ ) : (
111
+ <span className={styles.button}>{nextComp}</span>
112
+ )}
118
113
  </li>
119
114
  {/* got to last page */}
120
115
  <li className={styles.showInAll}>
121
116
  {current !== total ? (
122
- <Link
123
- to={getPagePath(total)}
124
- className={`${styles.button} ${styles.isActive}`}
125
- >
117
+ <Link to={getPagePath(total)} className={`${styles.button} ${styles.isActive}`}>
126
118
  {lastComp}
127
119
  </Link>
128
- )
129
- :
130
- (<span className={styles.button}>{lastComp}</span>)}
120
+ ) : (
121
+ <span className={styles.button}>{lastComp}</span>
122
+ )}
131
123
  </li>
132
124
  </ul>
133
125
  );
@@ -141,6 +133,9 @@ PaginationWithMidPoints.propTypes = {
141
133
  previousComp: PropTypes.oneOfType([PropTypes.element, PropTypes.any]),
142
134
  firstComp: PropTypes.oneOfType([PropTypes.element, PropTypes.any]),
143
135
  lastComp: PropTypes.oneOfType([PropTypes.element, PropTypes.any]),
136
+ translations: PropTypes.shape({
137
+ of: PropTypes.string,
138
+ }),
144
139
  };
145
140
 
146
141
  export default PaginationWithMidPoints;
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
 
4
- import Css from './pros-cons.module.scss';
4
+ import styles from './pros-cons.module.scss';
5
5
  import keygen from '~helpers/keygen';
6
6
 
7
- const ProsCons = ({ module = {}, pros = 'Pros', cons = 'Cons', icons, styles = Css }) => (
7
+ const ProsCons = ({ module = {}, pros = 'Pros', cons = 'Cons', icons }) => (
8
8
  <div className={styles.prosCons}>
9
9
  <div className={styles.pros}>
10
10
  {icons && <span className={styles.icon}>{icons[0]}</span>}
@@ -5,7 +5,7 @@ import { FaSearch } from 'react-icons/fa';
5
5
 
6
6
  import LazyImage from '~hooks/lazy-image';
7
7
  import ConditionalWrapper from '~atoms/conditional-wrapper';
8
- import Css from './search.module.scss';
8
+ import styles from './search.module.scss';
9
9
  import Tabs from '~hooks/tabs';
10
10
  import { getURLParam } from '~helpers/getters';
11
11
  import keygen from '~helpers/keygen';
@@ -29,7 +29,6 @@ const Search = ({
29
29
  pageSearchOptions = null,
30
30
  inputPlaceholder = '',
31
31
  children,
32
- styles = Css,
33
32
  }) => {
34
33
  const { setShowSearch } = useContext(NavigationContext);
35
34
  const pageSearchOptionsCopy = pageSearchOptions;
@@ -59,18 +58,14 @@ const Search = ({
59
58
  // FUNCTIONS
60
59
 
61
60
  // Get the types of children provided
62
- const getChildrenTypes = useCallback(() => {
63
- return children(sampleChildRef.current).props.children.map((child) => {
64
- return child.props.type;
65
- });
66
- }, [children]);
61
+ const getChildrenTypes = useCallback(
62
+ () => children(sampleChildRef.current).props.children.map((child) => child.props.type),
63
+ [children]
64
+ );
67
65
 
68
66
  // Get the child by the given type - a data object is required
69
- const getChildType = (item, type) => {
70
- return children(item).props.children.find((child) => {
71
- return child.props.type === type;
72
- });
73
- };
67
+ const getChildType = (item, type) =>
68
+ children(item).props.children.find((child) => child.props.type === type);
74
69
 
75
70
  // Prepare search result for auto complete
76
71
  const loadAutoComplete = useCallback(() => {
@@ -331,9 +326,7 @@ const Search = ({
331
326
  ) {
332
327
  items = searchResultsRef.current
333
328
  .filter((item) => item.type === type)
334
- .map((item) => {
335
- return getChildType(item, type);
336
- });
329
+ .map((item) => getChildType(item, type));
337
330
  } else if (items.length) {
338
331
  items = {
339
332
  items,
@@ -2,12 +2,12 @@
2
2
  import React, { useRef, useEffect } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
 
5
- import Css from './accordion.module.scss';
5
+ import styles from './accordion.module.scss';
6
6
  import keygen from '~helpers/keygen';
7
7
 
8
8
  /* eslint-disable react/no-danger */
9
9
 
10
- const Accordion = ({ module, openAll = false, openItem, closeOthers = false, styles = Css }) => {
10
+ const Accordion = ({ module, openAll = false, openItem, closeOthers = false }) => {
11
11
  const { items } = module;
12
12
  const itemRefs = useRef([]);
13
13
  const btnRefs = useRef([]);
@@ -4,9 +4,9 @@ import PropTypes from 'prop-types';
4
4
  import Slider from '~molecules/slider';
5
5
  import keygen from '~helpers/keygen';
6
6
  import { anchorLink } from '~helpers/strings';
7
- import Css from './anchor.module.scss';
7
+ import styles from './anchor.module.scss';
8
8
 
9
- function Anchor({ module: { items }, headerOffset = 80, sliderGap = 0, styles = Css }) {
9
+ function Anchor({ module: { items }, headerOffset = 80, sliderGap = 0 }) {
10
10
  const handleClick = (event) => {
11
11
  event.preventDefault();
12
12
  const scrollToElementId = event.currentTarget.getAttribute('href').replace('#', '');
@@ -17,13 +17,20 @@ const loadMore = {
17
17
  describe('archive component', () => {
18
18
  test('render items', () => {
19
19
  const { container, getByText } = render(
20
- <Archive module={cardsModule} PaginationComponent={Pagination} loadMore={null} />
20
+ <Archive
21
+ module={cardsModule}
22
+ PaginationComponent={Pagination}
23
+ loadMore={null}
24
+ page={{ page: { translations: {} } }}
25
+ />
21
26
  );
22
27
  expect(container).toBeTruthy();
23
28
  expect(getByText('Card 3')).toBeTruthy();
24
29
  });
25
30
  test('load more', () => {
26
- const { container, getByText } = render(<Archive module={cardsModule} loadMore={loadMore} />);
31
+ const { container, getByText } = render(
32
+ <Archive module={cardsModule} loadMore={loadMore} page={{ page: { translations: {} } }} />
33
+ );
27
34
  expect(container.querySelectorAll('button')).toHaveLength(1);
28
35
  expect(getByText('Load More')).toBeTruthy();
29
36
 
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react/forbid-prop-types */
1
2
  /* eslint-disable no-nested-ternary */
2
3
  import React, { useState, useEffect } from 'react';
3
4
  import PropTypes from 'prop-types';
@@ -48,6 +49,7 @@ const Archive = ({ module, loadMore, PaginationComponent, page }) => {
48
49
  pagePath={module.rootPath}
49
50
  currentPage={module.currentPage}
50
51
  totalPages={module.numOfPages}
52
+ translations={page.translations}
51
53
  />
52
54
  ) : (
53
55
  <Pagination
@@ -76,7 +78,9 @@ Archive.propTypes = {
76
78
  useInvertColors: PropTypes.bool,
77
79
  }),
78
80
  PaginationComponent: PropTypes.oneOfType([PropTypes.element, PropTypes.node, PropTypes.any]),
79
- page: PropTypes.shape({}),
81
+ page: PropTypes.shape({
82
+ translations: PropTypes.object,
83
+ }),
80
84
  };
81
85
 
82
86
  export default Archive;
@@ -15,10 +15,6 @@ describe('cards component', () => {
15
15
  // Default cards
16
16
  expect(getByText('Card 3')).toBeTruthy();
17
17
 
18
- // Featured card
19
- expect(container.querySelectorAll('.featuredCard')).toHaveLength(1);
20
- expect(container.querySelectorAll('.card')).toHaveLength(2);
21
-
22
18
  // Grid styles
23
19
  const innerDiv = container.querySelector('div');
24
20
  expect(innerDiv.getAttribute('style')).toEqual(
@@ -40,34 +40,34 @@ CardsGridStyles.propTypes = {
40
40
  desktopColumns: PropTypes.number,
41
41
  };
42
42
 
43
- const Cards = ({ module, CustomCardComponent, page, desktopColumns = 4 }) => {
44
- return (
45
- <CardsGridStyles module={module} desktopColumns={desktopColumns}>
46
- <div className={styles.cardsContainer}>
47
- {module.items &&
48
- module.items.map((item, index) => (
49
- <div
50
- key={keygen()}
51
- className={
52
- index + 1 === parseInt(module.featured_index) ? styles.featuredCard : styles.card
53
- }
54
- >
55
- {CustomCardComponent !== undefined ? (
56
- <CustomCardComponent item={item} type={item.type} number={index + 1} page={page} />
57
- ) : (
58
- <Card item={item} />
59
- )}
60
- </div>
61
- ))}
62
- </div>
63
- </CardsGridStyles>
64
- );
65
- };
43
+ const Cards = ({ module, CustomCardComponent, page, desktopColumns = 4 }) => (
44
+ <CardsGridStyles module={module} desktopColumns={desktopColumns}>
45
+ <div className={styles.cardsContainer}>
46
+ {module.items &&
47
+ module.items.map((item, index) => (
48
+ <div key={keygen()}>
49
+ {CustomCardComponent !== undefined ? (
50
+ <CustomCardComponent
51
+ featured={module.style === 'featured'}
52
+ item={item}
53
+ type={item.type}
54
+ number={index + 1}
55
+ page={page}
56
+ />
57
+ ) : (
58
+ <Card item={item} />
59
+ )}
60
+ </div>
61
+ ))}
62
+ </div>
63
+ </CardsGridStyles>
64
+ );
66
65
 
67
66
  Cards.propTypes = {
68
67
  module: PropTypes.shape({
69
68
  items: PropTypes.arrayOf(PropTypes.object),
70
69
  featured_index: PropTypes.number,
70
+ style: PropTypes.string,
71
71
  }).isRequired,
72
72
  CustomCardComponent: PropTypes.oneOfType([PropTypes.element, PropTypes.any]),
73
73
  page: PropTypes.shape({}),
@@ -5,7 +5,7 @@ import Button from '~atoms/button';
5
5
  import LazyImage from '~hooks/lazy-image';
6
6
  import { prettyTracker } from '~helpers/getters';
7
7
  import { isMobileDevice } from '~helpers/device-detect';
8
- import Css from './tracker.module.scss';
8
+ import styles from './tracker.module.scss';
9
9
 
10
10
  const Tracker = ({
11
11
  pageContext,
@@ -19,7 +19,6 @@ const Tracker = ({
19
19
  logo = '../../../../../images/logo.svg',
20
20
  counter = false,
21
21
  isStory = false,
22
- styles = Css,
23
22
  }) => {
24
23
  const { operator } = pageContext;
25
24
 
@@ -2,24 +2,28 @@ export default {
2
2
  delete_operator_software: {
3
3
  'Irishluck.ie': true,
4
4
  'norskespilleautomater.com': true,
5
+ 'playcasino.ca.za': true,
5
6
  },
6
7
  keep_page_extra_fields: {
7
8
  operator: {
8
9
  'Irishluck.ie': true, // needed for card background image
9
10
  'norskespilleautomater.com': true, // needed for inoperative / placeholder fields
11
+ 'playcasino.ca.za': true,
10
12
  },
11
13
  article: {
12
14
  'Irishluck.ie': true, // needed for card background image
13
15
  'norskespilleautomater.com': true,
16
+ 'playcasino.ca.za': true,
14
17
  },
15
18
  game: {
16
19
  'Irishluck.ie': true, // needed for card background image
17
20
  'norskespilleautomater.com': true,
21
+ 'playcasino.ca.za': true,
18
22
  },
19
23
  },
20
24
  keep_sections: {
21
- software_provider: { 'norskespilleautomater.com': ['header'] },
22
- payment_method: { 'norskespilleautomater.com': ['header'] },
25
+ software_provider: { 'norskespilleautomater.com': ['header'], 'playcasino.ca.za': ['header'] },
26
+ payment_method: { 'norskespilleautomater.com': ['header'], 'playcasino.ca.za': ['header'] },
23
27
  operator: { 'Irishluck.ie': ['main'] },
24
28
  article: { 'Irishluck.ie': ['main'] },
25
29
  },
@@ -13,10 +13,9 @@ export function getSiteName() {
13
13
  }
14
14
 
15
15
  export function getPageTitle(page) {
16
- const siteName = getSiteName();
17
16
  const searchquery = typeof window !== 'undefined' ? getURLParam('s') : '';
18
17
  if (page.path === 's') {
19
- return `You searched for ${searchquery} - ${siteName}`;
18
+ return `You searched for ${searchquery} - ${process.env.GATSBY_SITE_NAME}`;
20
19
  }
21
20
  return page.meta_title;
22
21
  }
@@ -21,7 +21,7 @@ describe('Getters Helper', () => {
21
21
  test('getPageTitle()', () => {
22
22
  window.location.search = 's=hello';
23
23
  expect(Getters.getPageTitle({ path: 's' })).toEqual(
24
- 'You searched for hello - Norske Spilleautomater'
24
+ 'You searched for hello - norskespilleautomater.com'
25
25
  );
26
26
  });
27
27
 
@@ -23,7 +23,8 @@ export function groupBy(list, keyName = 'author_id', single = false) {
23
23
  return newObj;
24
24
  }
25
25
 
26
- export function clonePageForCards(item, siteName) {
26
+ export function clonePageForCards(item) {
27
+ const siteName = process.env.GATSBY_SITE_NAME;
27
28
  if (item.type === 'operator') {
28
29
  if (settings.delete_operator_software[siteName]) {
29
30
  delete item.relation.software;
@@ -21,7 +21,6 @@ const postSectionsMap = {
21
21
  game: 'post_main_games',
22
22
  };
23
23
 
24
- let siteName = null;
25
24
  let siteType = null;
26
25
  let themeType = null;
27
26
  let pages = null;
@@ -115,7 +114,6 @@ export default {
115
114
  const start = new Date();
116
115
  const transformedPages = transform(data);
117
116
 
118
- siteName = themeOptions.siteName;
119
117
  siteType = themeOptions.siteType ? themeOptions.siteType : null;
120
118
  themeType = themeOptions.themeType ? themeOptions.themeType : null;
121
119
  const searchEnabled =
@@ -181,7 +179,7 @@ export default {
181
179
  // add search data
182
180
  if (SearchTypesEnable.includes(page.type) && searchEnabled) {
183
181
  searchData.push(
184
- clonePageForCards(cloneDeep(transformedPages[market][pageType][index]), siteName)
182
+ clonePageForCards(cloneDeep(transformedPages[market][pageType][index]))
185
183
  );
186
184
  }
187
185
 
@@ -247,8 +245,7 @@ export default {
247
245
  console.log(chalk.green('success') + chalk.whiteBright(` processed module values - %dms`), end);
248
246
  return data;
249
247
  },
250
- clonePage(siteNameParam, item) {
251
- siteName = siteNameParam;
252
- return clonePageForCards(item, siteName);
248
+ clonePage(item) {
249
+ return clonePageForCards(item);
253
250
  },
254
251
  };
@@ -176,11 +176,10 @@ export function processCardsV2(module, pagesCloned, pagesMappedById) {
176
176
  module.items = uniquePages.slice(0, itemLimit);
177
177
  }
178
178
  }
179
-
180
- // modify page so it doesn't have too much data
181
- module.items = module.items.map((item) => clonePageForCards(cloneDeep(item)));
182
179
  }
183
180
  }
181
+ // modify page so it doesn't have too much data
182
+ module.items = module.items.map((item) => clonePageForCards(cloneDeep(item)));
184
183
  }
185
184
 
186
185
  export function processBonus(module, relations) {
@@ -1,4 +1,5 @@
1
- import { getGameRating, getUrl, getLanguage, getSiteName } from './getters';
1
+ /* eslint-disable no-use-before-define */
2
+ import { getGameRating, getUrl, getLanguage } from './getters';
2
3
 
3
4
  export function schemaGenerator(page, pageImage) {
4
5
  let jsonSchema = [];
@@ -70,7 +71,7 @@ export function templateSchemas(page, pageImage) {
70
71
  reviewBody: page.extra_fields?.operator_review_summary,
71
72
  publisher: {
72
73
  '@type': 'Organization',
73
- name: getSiteName(),
74
+ name: process.env.GATSBY_SITE_NAME,
74
75
  },
75
76
  });
76
77
  }
@@ -48,7 +48,7 @@ describe('Schema Helper', () => {
48
48
  expect(jsonOperatorReview.author.name).toEqual('my author');
49
49
  expect(jsonOperatorReview.author['@type']).toEqual('Person');
50
50
  expect(jsonOperatorReview.publisher['@type']).toEqual('Organization');
51
- expect(jsonOperatorReview.publisher.name).toEqual('Norske Spilleautomater');
51
+ expect(jsonOperatorReview.publisher.name).toEqual('norskespilleautomater.com');
52
52
  expect(jsonOperatorReview.reviewBody.value).toEqual('my value');
53
53
  const gameReview = Schema.templateSchemas({
54
54
  type: 'game',
@@ -170,7 +170,7 @@ describe('Schema Helper', () => {
170
170
  expect(typeof output).toEqual('object');
171
171
  expect(output).toHaveLength(5);
172
172
  expect(output[0].seo_json_schema_keys).toEqual('seo json schema');
173
- //Module schema
173
+ // Module schema
174
174
  const moduleSchemas = JSON.parse(output[1]);
175
175
  expect(moduleSchemas['@context']).toEqual('https://schema.org');
176
176
  expect(moduleSchemas['@type']).toEqual('FAQPage');