gatsby-core-theme 6.1.8 → 7.0.1

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,65 @@
1
+ ## [7.0.1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v7.0.0...v7.0.1) (2022-05-05)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add alt from image_object ([c1e7c23](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c1e7c232bbc41b250d99104feaa7ec248408bf50))
7
+ * add alt text, and also for operator added object logo_url_object ([64b0313](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/64b0313acc9e505191395b36896bf1886992b4f4))
8
+ * add image_object for payment and software ([f848229](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/f84822911c11c053f92e5a16cf80542a13781ffb))
9
+ * add tests ([467919e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/467919e5b0f2b0ead4bdfb122d4c8278c9c2b0df))
10
+ * added standardized logo attribute and added label in rating component ([7bf1cbe](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7bf1cbe9e15e91e210840bd32237f07bb90f7453))
11
+ * fix error ([77e329d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/77e329d348be706dc040f28985e579cb4f29ff9b))
12
+ * fix error ([736f9ec](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/736f9ec86df1f2d09a0597002551efb198138538))
13
+ * tests fixes ([0972b4d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0972b4d37d368c5eef1d77b891b9ec531fa61254))
14
+
15
+
16
+ ### Code Refactoring
17
+
18
+ * remove archive robot_options and update head meta robots ([b0f5e6c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b0f5e6ce03fa7bc07d5966351f7a40b41eee922a))
19
+ * reorder author component ([282243f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/282243fdd41f2e1e70d2c04b76a3f1901a1a0d9b))
20
+ * update archive robot_options ([9adf990](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9adf990fca081bed88eea6c2444fb39ed5fd36b2))
21
+
22
+
23
+ * Merge branch 'tm-2834-logos-rating' into 'master' ([34e951b](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/34e951b45c41cf37bd3acd99d0171819c40875ed))
24
+ * Merge branch 'tm-2801-fact-checker' into 'master' ([55eda9f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/55eda9f01ef37f388168fcd7abab21fdd82fbc71))
25
+ * Merge branch 'tm-2829-image-alt-text' into 'master' ([47ca5e5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/47ca5e5aa7d45df9ee7922aecc8ee05ef73f5d68))
26
+ * Merge branch 'tm-2831-update-archive-noindex-nofollow' into 'master' ([c5a42f2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c5a42f21ab694af4c3d27c779fe1fc247bd2bdcb))
27
+ * Merge branch 'tm-2829-image-alt-text' into 'master' ([9297107](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9297107e6e2667529c812d798ebbd99841be969f))
28
+
29
+
30
+ ### Tests
31
+
32
+ * changes to test scripts ([8a7d401](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/8a7d401eeda89e344fa8d54663fa759e80cb1cba))
33
+
34
+ # [7.0.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v6.1.9...v7.0.0) (2022-05-03)
35
+
36
+
37
+ ### Code Refactoring
38
+
39
+ * add factor checker ([cdc5192](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cdc519230240daf883b1de48ccd7297a88cb81eb))
40
+ * add reviewer object to page and change test script to reflect ([ac16823](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/ac16823efc52a33fa3a6e2c613929eb590c1a909))
41
+ * align spotlight links ([235cb3e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/235cb3e8dbdcea6459b23ddaa21ef29b6eaccaf6))
42
+ * remove matrix specific schema and update tests ([4401079](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/4401079658c2cb922b0d7a909331c39039667f8e))
43
+
44
+
45
+ * Merge branch 'tm-2801-fact-checker' into 'master' ([03be105](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/03be105386f4462e6b367cb50a858831729f44ba))
46
+ * Merge branch 'tm-2880-spotlight-links' into 'master' ([4f89cfb](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/4f89cfb955dc9e906f7285835776d8db185d93ec))
47
+ * Merge branch 'master' into tm-2801-fact-checker ([2b769fd](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2b769fd65099798d4edf621dc262db154707e698))
48
+ * Merge branch 'tm-2708-remove-matrix-specific-schema' into 'master' ([cb883ed](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cb883ed7504aaddc24bf25e33d7aef4698097818))
49
+
50
+ ## [6.1.9](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v6.1.8...v6.1.9) (2022-04-28)
51
+
52
+
53
+ ### Bug Fixes
54
+
55
+ * add getRoundMinutes function in gatsby theme ([e74c629](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/e74c62918852b7ee9fe304fc8c6b633e75e543a9))
56
+ * add getRoundMinutes function in getters and testes && updated the project with git pull ([5b61f4b](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/5b61f4b0b912b4be7eee3eb9dbb9b2ad42b66bd9))
57
+ * added new field in toplist keys ([fbe30a9](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/fbe30a9072c58022b914c1e0c21a4652dce6e557))
58
+
59
+
60
+ * Merge branch 'tm-2814-launch-date' into 'master' ([0c48e60](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0c48e601a1364155b84727eab3c8781493528ae7))
61
+ * Merge branch 'tm-2832-fix-time-to-read-in-OG' into 'master' ([6792364](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/67923641c04f38e10a514e93b4db7bcd8140fac9))
62
+
1
63
  ## [6.1.8](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v6.1.7...v6.1.8) (2022-04-26)
2
64
 
3
65
 
@@ -72,6 +72,7 @@ function createArchivePage(pageObject, marketSections, prefilledModules, createP
72
72
  ? pageObject.path
73
73
  : `${pageObject.path}/page/${archive.currentPage}`;
74
74
  page.sections.main.modules[archiveModuleIndex] = archive;
75
+
75
76
  createPage({
76
77
  path: page.path,
77
78
  component: require.resolve(appName),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "6.1.8",
3
+ "version": "7.0.1",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "main": "index.js",
6
6
  "GATSBY_RECAPTCHA_SITEKEY": "6LfoyvMUAAAAAO4nl_MQnqHb4XdHxEiu5cXgIqeB",
@@ -1,6 +1,5 @@
1
1
  .authorInfo {
2
2
  font-size: 1.5rem;
3
- margin-right: 2rem;
4
3
  }
5
4
  .date {
6
5
  font-size: 1.5rem;
@@ -10,7 +9,7 @@
10
9
  font-size: 1.8rem;
11
10
  }
12
11
  .authorIcon,
13
- .date,
12
+ .dateTimeWrapper,
14
13
  .authorInfo {
15
14
  height: 2rem;
16
15
  display: inline-block;
@@ -20,3 +19,16 @@
20
19
  color: #09f;
21
20
  }
22
21
  }
22
+
23
+ .authorWrapper {
24
+ display: flex;
25
+ flex-direction: column;
26
+ column-gap: 0.5rem;
27
+
28
+ > div {
29
+ display: flex;
30
+ justify-content: flex-end;
31
+ flex-wrap: wrap;
32
+ column-gap: 0.5rem;
33
+ }
34
+ }
@@ -37,7 +37,7 @@ describe('Author Component', () => {
37
37
  date="2020-04-24 15:37:42"
38
38
  />
39
39
  );
40
- expect(container.querySelector('.date')).toBeTruthy();
40
+ expect(container.querySelector('.dateTimeWrapper')).toBeTruthy();
41
41
  const info = getByText('with mohsen');
42
42
  expect(info).toBeTruthy();
43
43
  expect(container.querySelector('i')).toBeTruthy();
@@ -15,42 +15,66 @@ const Author = ({
15
15
  date = '',
16
16
  dateFormat = 'DD.MM.YYYY',
17
17
  dateSeparator = '.',
18
+ readingTime = '',
19
+ reviewer = {},
18
20
  }) => {
19
21
  return (
20
- <>
21
- {link && icon && (
22
- <div className={styles.authorIcon}>
23
- <a
24
- href={link}
25
- target="_blank"
26
- rel="noreferrer"
27
- aria-label={`${name} Link`}
28
- className="author-gtm"
29
- >
30
- {icon}
31
- </a>
32
- </div>
33
- )}
34
- {!link && icon && <div className={styles.authorIcon}>{icon}</div>}
22
+ <div className={styles.authorWrapper}>
23
+ <div>
24
+ {link && icon && (
25
+ <div className={styles.authorIcon}>
26
+ <a
27
+ href={link}
28
+ target="_blank"
29
+ rel="noreferrer"
30
+ aria-label={`${name} Link`}
31
+ className="author-gtm"
32
+ >
33
+ {icon}
34
+ </a>
35
+ </div>
36
+ )}
37
+ {!link && icon && <div className={styles.authorIcon}>{icon}</div>}
35
38
 
36
- <div className={styles.authorInfo}>
37
- {name &&
38
- (authorProfile ? (
39
- <>
40
- {`${prefix} `}
41
- <Link to={authorProfile} className="author-gtm" title={name}>
42
- {name}
43
- </Link>
44
- </>
45
- ) : (
46
- `${prefix} ${name}`
47
- ))}
39
+ <div className={styles.authorInfo}>
40
+ {name &&
41
+ (authorProfile ? (
42
+ <>
43
+ {`${prefix} `}
44
+ <Link to={authorProfile} className="author-gtm" title={name}>
45
+ {name}
46
+ </Link>
47
+ </>
48
+ ) : (
49
+ `${prefix} ${name}`
50
+ ))}
51
+ </div>
52
+ {readingTime && (
53
+ <div className={date && styles.readingWithBorder}>
54
+ <span>Reading time</span>
55
+ {` ${readingTime} min`}
56
+ </div>
57
+ )}
48
58
  </div>
49
-
50
- {date && (
51
- <div className={styles.date}>{formatDate(date, dateFormat, dateSeparator, 'en-GB')}</div>
52
- )}
53
- </>
59
+ <div>
60
+ {reviewer.name && (
61
+ <div className={date && styles.reviewer}>
62
+ <span>Fact checked by</span>
63
+ {` `}
64
+ <Link to={reviewer.profile_page_path} title={reviewer.name}>
65
+ {reviewer.name}
66
+ </Link>
67
+ </div>
68
+ )}
69
+ {date && (
70
+ <div className={styles.dateTimeWrapper}>
71
+ <span>Published on</span>
72
+ {` `}
73
+ {formatDate(date, dateFormat, dateSeparator, 'en-GB')}
74
+ </div>
75
+ )}
76
+ </div>
77
+ </div>
54
78
  );
55
79
  };
56
80
 
@@ -63,6 +87,8 @@ Author.propTypes = {
63
87
  date: PropTypes.string,
64
88
  dateFormat: PropTypes.string,
65
89
  dateSeparator: PropTypes.string,
90
+ readingTime: PropTypes.string,
91
+ reviewer: PropTypes.shape({}),
66
92
  };
67
93
 
68
94
  export default Author;
@@ -2,7 +2,7 @@
2
2
  import React, { useContext } from 'react';
3
3
  import { FaInstagram, FaFacebookSquare, FaTwitter, FaLinkedin } from 'react-icons/fa';
4
4
  import PropTypes from 'prop-types';
5
- import { translate, imagePrettyUrl } from '~helpers/getters';
5
+ import { translate, imagePrettyUrl, getAltText } from '~helpers/getters';
6
6
  import styles from './author-box.module.scss';
7
7
  import LazyImage from '~hooks/lazy-image';
8
8
  import Link from '~hooks/link';
@@ -24,7 +24,7 @@ export default function AuthorBox({ author }) {
24
24
  {author.image_object && (
25
25
  <LazyImage
26
26
  src={imagePrettyUrl(author.image_object.filename)}
27
- alt={author.image_alt || author.name}
27
+ alt={getAltText(author?.image_object, author.image_alt || author.name)}
28
28
  width={author.image_object?.width}
29
29
  height={author.image_object?.height}
30
30
  />
@@ -110,6 +110,7 @@ AuthorBox.propTypes = {
110
110
  width: PropTypes.number,
111
111
  height: PropTypes.number,
112
112
  filename: PropTypes.string,
113
+ alt: PropTypes.string,
113
114
  }),
114
115
  image_alt: PropTypes.string,
115
116
  name: PropTypes.string,
@@ -7,7 +7,7 @@ import { GrFormNextLink } from 'react-icons/gr';
7
7
  import Button from '~atoms/button';
8
8
  import LazyImage from '~hooks/lazy-image';
9
9
  import keygen from '~helpers/keygen';
10
- import { imagePrettyUrl, getImageFilename } from '~helpers/getters';
10
+ import { imagePrettyUrl, getImageFilename, getAltText } from '~helpers/getters';
11
11
  import Link from '~hooks/link';
12
12
  import styles from './spotlights.module.scss';
13
13
 
@@ -18,14 +18,13 @@ const Spotlights = ({ module, themeStyles = {} }) => {
18
18
  const img = mode === 'icon' ? item.icon : item.image;
19
19
  const imageSrc = imagePrettyUrl(img);
20
20
  const fileName = getImageFilename(imageSrc);
21
-
22
21
  return (
23
22
  <>
24
23
  {img && (
25
24
  <LazyImage
26
25
  width={100}
27
26
  height={50}
28
- alt={item.label || item?.link_text || fileName}
27
+ alt={getAltText(item?.image_object, item.label || item?.link_text || fileName)}
29
28
  src={imageSrc}
30
29
  />
31
30
  )}
@@ -75,7 +74,7 @@ const Spotlights = ({ module, themeStyles = {} }) => {
75
74
 
76
75
  {mode === 'image_text' &&
77
76
  (item.link.value ? (
78
- <div>
77
+ <div className={styles.spotlightsTextCTA}>
79
78
  <div dangerouslySetInnerHTML={{ __html: item.text }} />
80
79
  {item.link.type === 'external' ? (
81
80
  <a
@@ -47,7 +47,11 @@
47
47
  display: block;
48
48
  }
49
49
 
50
- > div {
50
+ .spotlightsTextCTA {
51
+ display: flex;
52
+ flex-direction: column;
53
+ flex: 1;
54
+ justify-content: space-between;
51
55
  font-size: 1.4rem;
52
56
  color: #777;
53
57
  }
@@ -4,7 +4,7 @@ import React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
 
6
6
  import LazyImage from '~hooks/lazy-image';
7
- import { imagePrettyUrl } from '~helpers/getters';
7
+ import { imagePrettyUrl, getAltText } from '~helpers/getters';
8
8
  import Button from '~atoms/button';
9
9
  import styles from './default-slide.module.scss';
10
10
 
@@ -22,7 +22,7 @@ const Slide = ({
22
22
  <LazyImage
23
23
  className={styles.image}
24
24
  src={imagePrettyUrl(item.image, imageSizes.width, imageSizes.height)}
25
- alt={item.title || slideTitle}
25
+ alt={getAltText(item?.image_object, item.title || slideTitle)}
26
26
  />
27
27
  )}
28
28
  {item.content && <p className={styles.content}>{item.content}</p>}
@@ -26,9 +26,18 @@
26
26
  z-index: 1;
27
27
  padding: 2.4rem;
28
28
 
29
- .readingTime {
30
- > span {
31
- font-weight: bold;
29
+ .topSection {
30
+ display: flex;
31
+ justify-content: space-between;
32
+
33
+ > div {
34
+ padding-top: 1rem;
35
+ }
36
+
37
+ .readingTime {
38
+ > span {
39
+ font-weight: bold;
40
+ }
32
41
  }
33
42
  }
34
43
  }
@@ -14,7 +14,7 @@ describe('header component', () => {
14
14
  expect(container.querySelectorAll('.headerContent')).toHaveLength(1);
15
15
 
16
16
  // Inner HTML
17
- expect(container.querySelectorAll('p')).toHaveLength(2);
17
+ expect(container.querySelectorAll('p')).toHaveLength(1);
18
18
  expect(container.querySelectorAll('i')).toHaveLength(1);
19
19
 
20
20
  // Testing image
@@ -62,6 +62,8 @@ function Header({ section, content = null, backgroundImage = true }) {
62
62
  authorProfile={section.page.author?.profile_page_path}
63
63
  name={section.page.author?.name}
64
64
  date={section.page.updated_at ? section.page.updated_at : section.page.created_at}
65
+ readingTime={section.page.reading_time}
66
+ reviewer={section.page.reviewer}
65
67
  />
66
68
  </div>
67
69
  )}
@@ -72,9 +74,6 @@ function Header({ section, content = null, backgroundImage = true }) {
72
74
  section.page.template !== 'article_casino' &&
73
75
  section.page.template !== 'article_sports' &&
74
76
  section.page.template !== 'game_review' && <h1>{section.page.title}</h1>}
75
- <p className={styles.readingTime}>
76
- Reading Time: <span>{section.page.reading_time}</span>
77
- </p>
78
77
  <div className={!content && styles.headerText}>{headerContent()}</div>
79
78
  </div>
80
79
  </header>
@@ -90,10 +89,12 @@ Header.propTypes = {
90
89
  updated_at: PropTypes.string,
91
90
  created_at: PropTypes.string,
92
91
  reading_time: PropTypes.string,
92
+ reviewer: PropTypes.string,
93
93
  author: PropTypes.shape({
94
94
  name: PropTypes.string,
95
95
  profile_page_path: PropTypes.string,
96
96
  }),
97
+ authors: PropTypes.shape([PropTypes.shape({})]),
97
98
  sections: PropTypes.shape({
98
99
  header: PropTypes.shape({
99
100
  extra_fields: PropTypes.shape({
@@ -4,7 +4,7 @@ import React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
 
6
6
  import keygen from '~helpers/keygen';
7
- import { imagePrettyUrl } from '~helpers/getters';
7
+ import { imagePrettyUrl, getAltText } from '~helpers/getters';
8
8
  import Link from '~hooks/link';
9
9
  import LazyImage from '~hooks/lazy-image';
10
10
 
@@ -29,7 +29,7 @@ const LinkList = ({
29
29
  const LinkImage = () => (
30
30
  <LazyImage
31
31
  src={imagePrettyUrl(item.image)}
32
- alt={item.title}
32
+ alt={getAltText(item?.image_object, item.title)}
33
33
  width={width}
34
34
  height={height}
35
35
  loading={disableLazyLoad ? 'eager' : 'lazy'}
@@ -1,20 +1,30 @@
1
- import React from 'react';
1
+ import React, { useContext } from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ import { Context } from '~context/TranslationsProvider';
3
4
  import { getRating } from '~helpers/rating';
5
+ import { translate } from '~helpers/getters';
4
6
 
5
7
  import styles from './one-star.module.scss';
6
8
 
7
- const OneStar = ({ numOfStars, rating, active = true }) => (
8
- <div className={`${styles.starRatingContainer} ${!active && styles.inactive}`}>
9
- <span className={styles.fullStar} />
10
- <span className={styles.rateNr}>{`${getRating(rating)}/${numOfStars}`}</span>
11
- </div>
12
- );
9
+ const OneStar = ({ numOfStars, rating, active = true, showLabel = false }) => {
10
+ const { translations } = useContext(Context) || {};
11
+
12
+ return (
13
+ <div className={`${styles.starRatingContainer} ${!active && styles.inactive}`}>
14
+ {showLabel && (
15
+ <span className={styles.text}>{translate(translations, 'rating', 'Rating')}</span>
16
+ )}
17
+ <span className={styles.fullStar} />
18
+ <span className={styles.text}>{`${getRating(rating)}/${numOfStars}`}</span>
19
+ </div>
20
+ );
21
+ };
13
22
 
14
23
  OneStar.propTypes = {
15
24
  numOfStars: PropTypes.oneOf([5, 10]).isRequired,
16
25
  rating: PropTypes.oneOfType([PropTypes.array, PropTypes.number, PropTypes.string]).isRequired,
17
26
  active: PropTypes.bool,
27
+ showLabel: PropTypes.bool,
18
28
  };
19
29
 
20
30
  export default OneStar;
@@ -7,22 +7,23 @@
7
7
  line-height: 2.1rem;
8
8
  border-radius: 0.4rem;
9
9
  border: 1px solid var(--main-star-wrapper-color);
10
-
11
- .fullStar {
12
- @include star(var(--full-star-fill-color), var(--full-star-border-color), unset, 2.1rem);
13
- }
14
-
15
- .rateNr {
16
- color: #17182f;
17
- font-weight: 700;
18
- font-size: 1.3rem;
19
- margin-left: 0.33rem;
20
- line-height: 2.1rem;
21
- }
22
-
10
+
23
11
  &.inactive {
24
12
  .fullStar {
25
13
  @include star(var(--empty-star-border-color), var(--empty-star-border-color), unset, 2.1rem);
26
14
  }
27
15
  }
28
16
  }
17
+
18
+ .fullStar {
19
+ @include star(var(--full-star-fill-color), var(--full-star-border-color), unset, 2.1rem);
20
+ }
21
+
22
+ .text {
23
+ color: #17182f;
24
+ font-weight: 700;
25
+ font-size: 1.3rem;
26
+ margin: 0 0.33rem;
27
+ line-height: 2.1rem;
28
+ }
29
+
@@ -4,10 +4,10 @@ import { MdCheck } from 'react-icons/md';
4
4
  import Bonus from '~atoms/bonus';
5
5
  import { Context } from '~context/TranslationsProvider';
6
6
  import SellingPoints from '~atoms/selling-points';
7
- import StarRating from '~molecules/star-rating';
7
+ import StarRating from '~molecules/star-rating/one-star';
8
8
  import Link from '~hooks/link';
9
9
  import OperatorCta from '~atoms/operator-cta';
10
- import { prettyTracker, imagePrettyUrl, translate } from '~helpers/getters';
10
+ import { prettyTracker, imagePrettyUrl, translate, getAltText } from '~helpers/getters';
11
11
  import LazyImage from '~hooks/lazy-image';
12
12
 
13
13
  import styles from './default-row.module.scss';
@@ -17,6 +17,8 @@ const Row = ({ item, oneliner = 'main', layout = 'list', tracker = 'main' }) =>
17
17
  const itemRating = item.rating;
18
18
  const { translations } = useContext(Context) || {};
19
19
 
20
+ const imageObject = item?.standardised_logo_url_object || item?.logo_url_object;
21
+
20
22
  return (
21
23
  <div className={`${styles.row} ${styles[layout]}`}>
22
24
  <a
@@ -37,10 +39,10 @@ const Row = ({ item, oneliner = 'main', layout = 'list', tracker = 'main' }) =>
37
39
  aria-label={`${item.name} Link`}
38
40
  >
39
41
  <LazyImage
40
- alt={item.name}
41
- src={imagePrettyUrl(item.logo_url, 100)}
42
- width={150}
43
- height={40}
42
+ alt={getAltText(imageObject, item.name)}
43
+ src={imagePrettyUrl(imageObject?.filename || item?.logo_url, 100)}
44
+ width={100}
45
+ height={100}
44
46
  />
45
47
  </a>
46
48
  <a
@@ -51,7 +53,7 @@ const Row = ({ item, oneliner = 'main', layout = 'list', tracker = 'main' }) =>
51
53
  >
52
54
  <Bonus item={item} tracker={oneliner} />
53
55
  </a>
54
- <StarRating numOfStars={5} rating={itemRating} />
56
+ <StarRating numOfStars={5} rating={itemRating} showLabel />
55
57
  <SellingPoints icon={<MdCheck />} sellingPoints={item.selling_points} />
56
58
  <div>
57
59
  <Link className={`${styles.reviewLink} toplist-variant-one-gtm`} to={item.review_link}>
@@ -80,6 +82,12 @@ Row.propTypes = {
80
82
  one_liner: PropTypes.string,
81
83
  }),
82
84
  }),
85
+ logo_url_object: PropTypes.shape({
86
+ filename: PropTypes.string,
87
+ }),
88
+ standardised_logo_url_object: PropTypes.shape({
89
+ filename: PropTypes.string,
90
+ }),
83
91
  bonus: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
84
92
  }).isRequired,
85
93
  };
@@ -49,10 +49,7 @@ const Head = ({ page = {}, siteInfo }) => {
49
49
  <meta name="robots" content={page.meta_robots.join()} />
50
50
  )}
51
51
 
52
- {page.robot_options && !page.path.includes('/page/') && (
53
- <meta name="robots" content={getRobotOptions(page.robot_options)} />
54
- )}
55
- {page.path.includes('/page/') && <meta name="robots" content="noindex,follow" />}
52
+ {page.robot_options && <meta name="robots" content={getRobotOptions(page.robot_options)} />}
56
53
 
57
54
  {process.env.GATSBY_ACTIVE_ENV === 'development' && (
58
55
  <meta name="googlebot" content="noindex,follow" />
@@ -12,6 +12,8 @@ export const pickPageKeys = [
12
12
  ];
13
13
 
14
14
  export const topListPickKeys = [
15
+ 'standardised_logo_url_object',
16
+ 'logo_url_object',
15
17
  'logo_url',
16
18
  'one_liner',
17
19
  'one_liners',
@@ -29,11 +31,14 @@ export const topListPickKeys = [
29
31
  'selling_points',
30
32
  'short_name',
31
33
  'status',
34
+ 'founded',
32
35
  ];
33
36
 
34
37
  export const pickRelationKeys = {
35
38
  tournament: ['tournaments'],
36
39
  operator: [
40
+ 'standardised_logo_url_object',
41
+ 'logo_url_object',
37
42
  'logo_url',
38
43
  'one_liner',
39
44
  'one_liners',
@@ -59,9 +64,10 @@ export const pickRelationKeys = {
59
64
  'third_rating',
60
65
  'fourth_rating',
61
66
  'thumbnail_filename',
67
+ 'thumbnail_filename_object',
62
68
  ],
63
- software_provider: ['logo', 'games_count', 'name'],
64
- payment_method: ['logo', 'name'],
69
+ software_provider: ['logo_object', 'logo', 'games_count', 'name'],
70
+ payment_method: ['logo_object', 'logo', 'name'],
65
71
  };
66
72
 
67
73
  export const pickHTMLSitemapPageKeys = ['title', 'path', 'template_id'];
@@ -362,3 +362,13 @@ export function shiftFirstOperator(pageId, module, pagesMappedById) {
362
362
  pagesMappedById[pageId] && module.items.unshift(pagesMappedById[pageId]);
363
363
  }
364
364
  }
365
+
366
+ export const getRoundMinutes = (time) => {
367
+ const [minutes, seconds] = time.split(':');
368
+ const value = seconds > 30 ? Number(minutes) + 1 : Number(minutes);
369
+ return value === 0 ? 1 : value;
370
+ };
371
+
372
+ export function getAltText(imageObject, defaultAlt = 'missing alt') {
373
+ return imageObject && imageObject.alt ? imageObject.alt : defaultAlt;
374
+ }
@@ -245,12 +245,32 @@ describe('Getters Helper', () => {
245
245
  Getters.shiftFirstOperator(11607, module, pagesMappedById);
246
246
  expect(module.items[0].id).toBe(11607);
247
247
  });
248
+
248
249
  test('move opeartor first postion', () => {
249
250
  Getters.shiftFirstOperator(13212, module, pagesMappedById);
250
251
  expect(module.items[0].id).toBe(13212);
251
252
  });
253
+
252
254
  test('check when we have the operator in first postion', () => {
253
255
  Getters.shiftFirstOperator(13212, module, pagesMappedById);
254
256
  expect(module.items[0].id).toBe(13212);
255
257
  });
258
+
259
+ test('If the reading time is bigger than half, it should return the next number ', () => {
260
+ expect(Getters.getRoundMinutes('3:52')).toBe(4);
261
+ });
262
+
263
+ test('If reading time is less than half, it should return the last number ', () => {
264
+ expect(Getters.getRoundMinutes('3:29')).toBe(3);
265
+ });
266
+
267
+ test('Test altText', () => {
268
+ const alt = Getters.getAltText({ alt: 'imageAlt' }, 'default');
269
+ expect(alt).toEqual('imageAlt');
270
+ });
271
+
272
+ test('Test without altText', () => {
273
+ const altText = Getters.getAltText(null, 'default');
274
+ expect(altText).toEqual('default');
275
+ });
256
276
  });
@@ -15,6 +15,7 @@ import { shouldSavePrefilled, processModule } from './modules';
15
15
  import { clonePageForCards, groupBy, removeTags } from './common';
16
16
  import { prepareSportsData, addSportsDataToPage, addExtraFieldsToShowcaseEvents } from './sports';
17
17
  import { zeroPadding } from '../schedule';
18
+ import { getRoundMinutes } from '../getters';
18
19
 
19
20
  const previewMode = process.env.GATSBY_PREVIEW_MODE || false;
20
21
  const postSectionsMap = {
@@ -135,7 +136,7 @@ export function processSections(sections, skipPost = false, page) {
135
136
  }
136
137
 
137
138
  if (page) {
138
- page.reading_time = `${zeroPadding(minutes, 2)}:${zeroPadding(seconds, 2)}`;
139
+ page.reading_time = getRoundMinutes(`${zeroPadding(minutes, 2)}:${zeroPadding(seconds, 2)}`);
139
140
  }
140
141
 
141
142
  return sections;
@@ -247,6 +248,13 @@ export default {
247
248
  transformedPages[market][pageType][index].author = data.authors[page.author_id];
248
249
  }
249
250
 
251
+ // add reviewer object to page
252
+ if (page.reviewer !== null && Object.values(data.authors).length) {
253
+ transformedPages[market][pageType][index].reviewer = Object.values(data.authors).find(
254
+ (each) => each.name === page.reviewer
255
+ );
256
+ }
257
+
250
258
  // add breadcrumbs array to page
251
259
  const pageBreadcrumbIds = transformedPages[market][pageType][index].breadcrumb_ids;
252
260
  if (pageBreadcrumbIds) {
@@ -2,45 +2,6 @@ import { getGameRating, getUrl, getLanguage } from './getters';
2
2
  import { cleanHTML } from './strings';
3
3
 
4
4
  /* HardCoded Start */
5
- const isIL = process.env.GATSBY_SITE_NAME === 'irishluck.ie';
6
- const isNSA = process.env.GATSBY_SITE_NAME === 'norskespilleautomater.com';
7
- const publishingPrinciples = isIL
8
- ? 'https://www.irishluck.ie/editorial-principles'
9
- : 'https://www.norskespilleautomater.com/om-oss/prinsipper';
10
- const knowsAbout = [
11
- {
12
- '@type': 'Thing',
13
- name: 'Norway',
14
- sameAs: [
15
- 'https://no.wikipedia.org/wiki/Norge',
16
- 'https://www.google.no/search?q=Norge&pws=0&nord=1&hl=no&gl=NO',
17
- ],
18
- },
19
- {
20
- '@type': 'Thing',
21
- name: 'LottStift',
22
- sameAs: [
23
- 'https://no.wikipedia.org/wiki/Lotteri-_og_stiftelsestilsynet',
24
- 'https://www.google.no/search?q=lottstift&pws=0&nord=1&hl=no&gl=NO',
25
- ],
26
- },
27
- {
28
- '@type': 'Thing',
29
- name: 'Kasino',
30
- sameAs: [
31
- 'https://no.wikipedia.org/wiki/Kasino',
32
- 'https://www.google.no/search?q=Kasino&pws=0&nord=1&hl=no&gl=NO',
33
- ],
34
- },
35
- {
36
- '@type': 'Thing',
37
- name: 'Norsk Tipping Kommisjonær',
38
- sameAs: [
39
- 'https://no.wikipedia.org/wiki/Norsk_Tipping',
40
- 'https://www.google.no/search?q=norsk+tipping&pws=0&nord=1&hl=no&gl=NO',
41
- ],
42
- },
43
- ];
44
5
  const customSchema = {
45
6
  // Matrix
46
7
  'playcasino.co.za': 'Playcasino',
@@ -60,7 +21,6 @@ const customSchema = {
60
21
  'verfutbolonline.net': 'Ver Futbol Online',
61
22
  'watchsport.gr': 'Watch Sport',
62
23
  };
63
- /* HardCoded End */
64
24
 
65
25
  const socialLinks = [
66
26
  'facebook',
@@ -71,6 +31,7 @@ const socialLinks = [
71
31
  'wikipedia',
72
32
  'youtube',
73
33
  ];
34
+ /* HardCoded End */
74
35
 
75
36
  function checkSchemaProp(prop) {
76
37
  return (
@@ -138,8 +99,7 @@ export function webPageSchema(page, pageImage) {
138
99
  name: page.siteSchema?.site_name || '',
139
100
  alternateName: page.siteSchema?.alias_site_name || '',
140
101
  foundingDate: page.siteSchema?.organization_founding_date || '',
141
- publishingPrinciples:
142
- page.siteSchema?.publishing_principles || (isIL || isNSA ? publishingPrinciples : null),
102
+ publishingPrinciples: page.siteSchema?.publishing_principles,
143
103
  logo: {
144
104
  '@type': 'ImageObject',
145
105
  url: pageImage,
@@ -154,7 +114,7 @@ export function webPageSchema(page, pageImage) {
154
114
  sameAs: socialLinks
155
115
  .map((socialLink) => page.siteSchema?.[socialLink])
156
116
  .filter((socialLink) => socialLink),
157
- ...(isNSA ? { knowsAbout } : {}),
117
+ ...(page.knowsAbout ? { knowsAbout: page.knowsAbout } : {}),
158
118
  },
159
119
  };
160
120
 
@@ -9,8 +9,6 @@ const parseCheckSchema = (schema) => {
9
9
  return json;
10
10
  };
11
11
  const pageImage = 'pageImage/pageImage.jpg';
12
- const isIL = process.env.GATSBY_SITE_NAME === 'irishluck.ie';
13
- const isNSA = process.env.GATSBY_SITE_NAME === 'norskespilleautomater.com';
14
12
 
15
13
  describe('Schema Helper', () => {
16
14
  test('breadcrumbsSchema()', () => {
@@ -97,15 +95,7 @@ describe('Schema Helper', () => {
97
95
  expect(json.author.name).toEqual('Site Name');
98
96
  expect(json.author.alternateName).toEqual('Alias Site Name');
99
97
  expect(json.author.foundingDate).toEqual('01/02/03');
100
- if (isIL || isNSA) {
101
- expect(json.author.publishingPrinciples).toEqual(
102
- isNSA
103
- ? 'https://www.norskespilleautomater.com/om-oss/prinsipper'
104
- : 'https://www.irishluck.ie/editorial-principles'
105
- );
106
- } else {
107
- expect(json.author.publishingPrinciples).toEqual(null);
108
- }
98
+ expect(json.author.publishingPrinciples).toEqual(undefined);
109
99
 
110
100
  expect(Object.prototype.toString.call(json.author.logo)).toEqual('[object Object]');
111
101
  expect(json.author.logo['@type']).toEqual('ImageObject');
@@ -131,16 +121,7 @@ describe('Schema Helper', () => {
131
121
  expect(json.author.sameAs[0]).toEqual('author_linkedin');
132
122
  expect(json.author.sameAs[1]).toEqual('author_spotify');
133
123
  expect(json.author.sameAs[2]).toEqual('author_wikipedia');
134
-
135
- if (isNSA) {
136
- expect(Object.prototype.toString.call(json.author.knowsAbout)).toEqual('[object Array]');
137
- expect(json.author.knowsAbout).toHaveLength(4);
138
- expect(Object.prototype.toString.call(json.author.knowsAbout[0])).toEqual('[object Object]');
139
- expect(json.author.knowsAbout[0]['@type']).toEqual('Thing');
140
- expect(json.author.knowsAbout[0].name).toEqual('Norway');
141
- } else {
142
- expect(json.author.knowsAbout).toEqual(undefined);
143
- }
124
+ expect(json.author.knowsAbout).toEqual(undefined);
144
125
 
145
126
  expect(Object.prototype.toString.call(json.keywords)).toEqual('[object Array]');
146
127
  expect(json.keywords).toHaveLength(2);
@@ -174,6 +155,13 @@ describe('Schema Helper', () => {
174
155
  expect(json.sameAs[2]).toEqual('organization_wikipedia');
175
156
  });
176
157
 
158
+ test('moduleSchemas(null)', () => {
159
+ const output = Schema.moduleSchemas([{ name: 'other' }], '/');
160
+
161
+ expect(output).toHaveLength(0);
162
+ expect(output[0]).toEqual(undefined);
163
+ });
164
+
177
165
  test('moduleSchemas(faq)', () => {
178
166
  const output = Schema.moduleSchemas(
179
167
  [
@@ -221,6 +209,15 @@ describe('Schema Helper', () => {
221
209
  expect(json.mainEntity[2].acceptedAnswer.text).toEqual('Answer C');
222
210
  });
223
211
 
212
+ test('templateSchemas(null)', () => {
213
+ const output = Schema.templateSchemas({
214
+ type: 'other',
215
+ path: 'other_page',
216
+ });
217
+
218
+ expect(output).toEqual(null);
219
+ });
220
+
224
221
  test('templateSchemas(article)', () => {
225
222
  const output = Schema.templateSchemas({
226
223
  type: 'article',
@@ -22,6 +22,13 @@ export default function getHeaderSection() {
22
22
  image_alt: null,
23
23
  image_asset_id: 37728,
24
24
  },
25
+ reviewer: {
26
+ name: 'Cameron Murphy',
27
+ image: 'cameron-murphy.jpeg',
28
+ image_alt: null,
29
+ image_asset_id: 37728,
30
+ profile_page_path: 'about-us/cameron-murphy',
31
+ },
25
32
  },
26
33
  };
27
34