gatsby-core-theme 10.0.2-beta.1 → 11.0.0

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
@@ -14,9 +14,9 @@ Theme Tests:
14
14
  - gatsby-theme/coverage/
15
15
  coverage: /All files\s*\|\s*([\d\.]+)/
16
16
  rules:
17
- - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "beta"'
17
+ - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
18
18
  - if: '$CI_COMMIT_BRANCH == "master" && $PIPELINE == "automated"'
19
- - if: '$CI_PIPELINE_SOURCE == "push" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "beta") && $PIPELINE == "automated"'
19
+ - if: '$CI_PIPELINE_SOURCE == "push" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" && $PIPELINE == "automated"'
20
20
 
21
21
  Theme Publish:
22
22
  image: git.ilcd.rocks:4567/team-floyd/themes/gatsby-themes:node14
@@ -37,27 +37,5 @@ Theme Publish:
37
37
  only:
38
38
  refs:
39
39
  - master
40
- variables:
41
- - $PIPELINE != "content-trigger"
42
-
43
- Theme Beta Publish:
44
- image: git.ilcd.rocks:4567/team-floyd/themes/gatsby-themes:node14
45
- stage: publish-beta
46
- tags:
47
- - floyd-runner-test
48
- before_script:
49
- - git config --global http.sslverify false
50
- - git config --global user.email "floyd@gig.com"
51
- - git config --global user.name "floyd"
52
- script:
53
- - export HUSKY=0
54
- - yarn config set cache-folder .yarn
55
- - yarn
56
- - cd gatsby-theme/
57
- - npx semantic-release
58
- when: manual
59
- only:
60
- refs:
61
- - beta
62
40
  variables:
63
41
  - $PIPELINE != "content-trigger"
@@ -5,7 +5,6 @@ module.exports = {
5
5
  '../../**/**/src/**/*.stories.@(js|jsx|ts|tsx)',
6
6
  ],
7
7
  addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
8
- framework: '@storybook/react',
9
8
  core: {
10
9
  builder: 'webpack5',
11
10
  },
@@ -48,11 +47,11 @@ module.exports = {
48
47
  'gatsby-page-utils': path.resolve(__dirname, '../../node_modules/gatsby-page-utils/dist'),
49
48
  };
50
49
 
51
- config.resolve.alias['$virtual/lazy-client-sync-requires'] = path.resolve(
52
- `./__mocks__/virtual-lazy-client-sync-requires.js`
53
- );
50
+ // config.resolve.alias['$virtual/lazy-client-sync-requires'] = path.resolve(
51
+ // `./__mocks__/virtual-lazy-client-sync-requires.js`
52
+ // );
54
53
 
55
- config.resolve.mainFields = ['browser', 'module', 'main'];
54
+ // config.resolve.mainFields = ['browser', 'module', 'main'];
56
55
  return config;
57
56
  },
58
57
  };
package/CHANGELOG.md CHANGED
@@ -1,27 +1,32 @@
1
- ## [10.0.2-beta.1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v10.0.1...v10.0.2-beta.1) (2022-08-11)
1
+ # [11.0.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v10.0.1...v11.0.0) (2022-08-17)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
- * aithor box ([7e01efc](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7e01efc0683664102bf31fa9f9a517433fc993d3))
7
- * aithor box ([a6fe211](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a6fe211c04d8e9aab0f1c9e0538a1d4907b92cd9))
6
+ * add a check in modules in order to avoid the error ([8336e0f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/8336e0fc75ed225db5bc36f5658a04d615f29cc7))
7
+ * add a test for manually filtering inactive casinos ([b6c3277](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b6c3277d34394445d5dbd0baaa8fabd11235199f))
8
8
  * archive load more translation ([913b7ed](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/913b7eddb4eb31b0e0bec3ee7d2e8f394dd6dcab))
9
- * changed site ([802a65d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/802a65de7f800cf0dfe24078509e94ce5dc1a7f8))
10
- * publish beta pipeline ([adf73e8](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/adf73e89ff71d9d610d98f0b6e898ad12192834e))
11
- * publish beta pipeline ([9cd3923](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9cd3923d690b6e7ab846fd3fc6aaf7b81c776ae6))
12
- * publish beta pipeline ([fe158b3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/fe158b3908b53a489d48a76ba53f8dd979983e51))
13
- * publish beta pipeline ([e0ba3e6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/e0ba3e61fb80906de6563199d09a51eff1db9c65))
14
- * publish beta pipeline ([b6bf4a0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b6bf4a0b5ab08c276fbfb95039f40e81b22e1245))
15
- * publish beta pipeline ([edbd377](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/edbd3777ca3a86edb5517969a6de875f8ab39915))
16
9
  * publish beta pipeline ([6b9c7b1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/6b9c7b180ff314c903fd5f7efd835bb5f47a2fe8))
17
10
  * publish beta pipeline ([b87e75e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b87e75e771a1cdc7dbcd2cb7eb99cb88165189a7))
18
- * tests fixes after upgrade ([d43145a](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d43145a5fbbb69f9b07489399dc4d07b97ced7e6))
19
- * updated gatsby version ([7cc884b](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7cc884b8fba89c62374d4ada6895daec25a4ad8b))
20
- * upgrade tests fix ([6b42efb](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/6b42efb251d96430a7318ca129e7b3118a219f4a))
21
- * upgraded gatsby, storbook ([d499750](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d49975004563aab2e7f0b5a7eea6b815bdff086c))
11
+ * remove tag when we dont have data and make style ([980c7c1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/980c7c176c92287d7d9214e390818aff8f5dafbc))
12
+ * update filtering for cardv2 in order to remove closed casinos when using the manual filter ([b26d1f5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b26d1f55cadc296f187c967bd53dd8cc0c3733fe))
13
+ * update tests ([0bd6ab8](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0bd6ab82ede9a4415dddfdb80688bef48e022e83))
14
+ * update the logic for cardv2 filtering manually ([c54f41a](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c54f41a988f280a10d75286585309d968bf99682))
22
15
 
23
16
 
24
- * Merge branch 'tm-2987-gatsby-upgrade' into 'beta' ([59f9b28](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/59f9b288f99cd61f3a3064480861efc9f1263559))
17
+ ### Code Refactoring
18
+
19
+ * bug fixes on anchor module ([04372b3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/04372b345f1523e52b17dbeae5865b77fc354aeb))
20
+ * set active anchor if available ([5bfcc97](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/5bfcc97f0aabb4524d62d8275035e0a7dc5dd393))
21
+
22
+
23
+ * Merge branch 'tm-2970-cardv2-module' into 'master' ([5361b56](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/5361b56ee79497fe4d956c0c1a0625057e48849c))
24
+ * Merge branch 'master' into 'tm-2970-cardv2-module' ([c78d173](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c78d173563117a8764e316caf88007ec5ded31e4))
25
+ * Merge branch 'tm-2943-anchor-module' into 'master' ([185de44](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/185de443a8da578512cdf1b58ce9ed23f08a465d))
26
+ * Merge branch 'master' into tm-2943-anchor-module ([e61c128](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/e61c1281a96b35206d15788482475f9c260dc168))
27
+ * Merge branch 'tm-2971-updating-core' into 'master' ([0212134](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0212134aeaefcaa2950ae13e0683453d43eb0dc8))
28
+ * Merge branch 'master' into tm-2943-anchor-module ([07450d5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/07450d564e5256b52478d2360a15c7f4cada2e4d))
29
+ * Merge branch 'fix-small-issues' into 'master' ([4b5165e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/4b5165e9f8df9c7453a1b6b28f80c6d16b3cf5fc))
25
30
 
26
31
  ## [10.0.1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v10.0.0...v10.0.1) (2022-08-09)
27
32
 
package/gatsby-config.js CHANGED
@@ -23,6 +23,7 @@ module.exports = {
23
23
  disable: true,
24
24
  },
25
25
  },
26
+ `gatsby-plugin-react-helmet`,
26
27
  {
27
28
  resolve: `gatsby-plugin-manifest`,
28
29
  options: {
@@ -41,7 +42,7 @@ module.exports = {
41
42
  ],
42
43
  },
43
44
  },
44
- // `gatsby-plugin-preact`,
45
+ `gatsby-plugin-preact`,
45
46
  `gatsby-plugin-image`,
46
47
  ],
47
48
  };
package/jest.config.js CHANGED
@@ -30,7 +30,7 @@ module.exports = {
30
30
  'src/components/app.js',
31
31
  // ''
32
32
  ],
33
- transformIgnorePatterns: [`node_modules/(?!(gatsby|gatsby-script|gatsby-link)/)`],
33
+ transformIgnorePatterns: [`node_modules/(?!(gatsby|gatsby-script)/)`],
34
34
  globals: {
35
35
  __PATH_PREFIX__: ``,
36
36
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "10.0.2-beta.1",
3
+ "version": "11.0.0",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "main": "index.js",
6
6
  "GATSBY_RECAPTCHA_SITEKEY": "6LfoyvMUAAAAAO4nl_MQnqHb4XdHxEiu5cXgIqeB",
@@ -29,13 +29,14 @@
29
29
  "dotenv": "^8.2.0",
30
30
  "eslint": "^7.20.0",
31
31
  "esm": "^3.2.25",
32
- "gatsby": "^4.20.0",
32
+ "gatsby": "^4.17.0",
33
33
  "gatsby-image": "^3.11.0",
34
34
  "gatsby-plugin-image": "^2.10.1",
35
35
  "gatsby-plugin-loadable-components-ssr": "^4.2.0",
36
36
  "gatsby-plugin-manifest": "^4.10.2",
37
37
  "gatsby-plugin-postcss": "^5.11.0",
38
- "gatsby-plugin-preact": "^6.20.0",
38
+ "gatsby-plugin-preact": "^6.10.1",
39
+ "gatsby-plugin-react-helmet": "^5.10.0",
39
40
  "gatsby-plugin-sass": "^5.11.0",
40
41
  "gatsby-plugin-sharp": "^4.10.2",
41
42
  "gatsby-plugin-sitemap": "^5.10.2",
@@ -47,12 +48,13 @@
47
48
  "lodash": "^4.17.15",
48
49
  "normalize.css": "^8.0.1",
49
50
  "postcss": "^8.2.10",
50
- "preact": "^10.10.2",
51
- "preact-render-to-string": "^5.2.1",
51
+ "preact": "^10.7.0",
52
+ "preact-render-to-string": "^5.1.20",
52
53
  "prop-types": "15.7.2",
53
- "react": "^18.2.0",
54
- "react-dom": "^18.2.0",
54
+ "react": "^17.0.2",
55
+ "react-dom": "^17.0.2",
55
56
  "react-google-recaptcha": "^2.1.0",
57
+ "react-helmet": "^6.0.0",
56
58
  "react-lazyload": "^3.2.0",
57
59
  "react-masonry-css": "^1.0.16",
58
60
  "sass": "^1.49.9"
@@ -67,12 +69,12 @@
67
69
  "@semantic-release/gitlab-config": "^8.0.0",
68
70
  "@semantic-release/npm": "^7.1.3",
69
71
  "@semantic-release/release-notes-generator": "^9.0.3",
70
- "@storybook/addon-actions": "^6.5.10",
71
- "@storybook/addon-essentials": "^6.5.10",
72
- "@storybook/addon-links": "^6.5.10",
73
- "@storybook/builder-webpack5": "^6.5.10",
74
- "@storybook/manager-webpack5": "^6.5.10",
75
- "@storybook/react": "^6.5.10",
72
+ "@storybook/addon-actions": "^6.4.20",
73
+ "@storybook/addon-essentials": "^6.4.20",
74
+ "@storybook/addon-links": "^6.4.20",
75
+ "@storybook/builder-webpack5": "^6.4.20",
76
+ "@storybook/manager-webpack5": "^6.4.20",
77
+ "@storybook/react": "^6.4.20",
76
78
  "@testing-library/jest-dom": "^5.16.3",
77
79
  "@testing-library/react": "^12.1.4",
78
80
  "babel-jest": "^26.6.3",
@@ -5,7 +5,7 @@ import loadable from '@loadable/component';
5
5
  import { globalHistory } from '@reach/router';
6
6
  import TranslationsProvider from '~context/TranslationsProvider';
7
7
  import Body from '~pages/body';
8
- import MetaData from '~organisms/head';
8
+ import Head from '~organisms/head';
9
9
 
10
10
  const App = ({ pageContext }) => {
11
11
  const { translations = {}, isTracker, isPreview } = pageContext;
@@ -61,39 +61,20 @@ const App = ({ pageContext }) => {
61
61
 
62
62
  return isTracker ? (
63
63
  <>
64
+ <Head page={pageContext.page} siteInfo={pageContext.siteInfo} />
64
65
  <TrackerContent pageContext={pageContext} path={pageContext.page.path} />
65
66
  </>
66
67
  ) : (
67
68
  <TranslationsProvider value={{ translations }}>
69
+ <Head
70
+ page={isPreview ? previewContext.page : pageContext.page}
71
+ siteInfo={isPreview ? previewContext.siteInfo : pageContext.siteInfo}
72
+ />
68
73
  <Body pageContext={isPreview ? previewContext : pageContext} />
69
74
  </TranslationsProvider>
70
75
  );
71
76
  };
72
77
 
73
- // eslint-disable-next-line react/prop-types
74
- export function Head({ pageContext }) {
75
- // eslint-disable-next-line react/prop-types
76
- const { isPreview } = pageContext;
77
-
78
- // eslint-disable-next-line react/prop-types
79
- return isPreview ? <></> : <MetaData page={pageContext.page} siteInfo={pageContext.siteInfo} />;
80
- }
81
-
82
- // Head.propTypes = {
83
- // pageContext: PropTypes.shape({
84
- // isPreview: PropTypes.bool,
85
- // page: PropTypes.shape({
86
- // id: PropTypes.number,
87
- // path: PropTypes.string,
88
- // }),
89
- // siteInfo: PropTypes.shape({
90
- // robots_txt: PropTypes.string,
91
- // site_logo: PropTypes.string,
92
- // site_name: PropTypes.string,
93
- // }),
94
- // }),
95
- // };
96
-
97
78
  App.propTypes = {
98
79
  pageContext: PropTypes.shape({
99
80
  siteName: PropTypes.string,
@@ -1,4 +1,3 @@
1
- /* eslint-disable no-nested-ternary */
2
1
  /* eslint-disable jsx-a11y/label-has-associated-control */
3
2
  /* eslint-disable react/no-danger */
4
3
  /* eslint-disable camelcase */
@@ -33,7 +32,7 @@ const Spotlights = ({ module, themeStyles = {} }) => {
33
32
  src={imageSrc}
34
33
  />
35
34
  )}
36
- <label>{item.label}</label>
35
+ {item?.label && <label>{item.label}</label>}
37
36
  {item.subtitle && <span>{item.subtitle}</span>}
38
37
  </>
39
38
  );
@@ -84,7 +83,7 @@ const Spotlights = ({ module, themeStyles = {} }) => {
84
83
  {mode === 'image_text' &&
85
84
  (item.link && item.link.value ? (
86
85
  <div className={styles.spotlightsTextCTA}>
87
- <div dangerouslySetInnerHTML={{ __html: item.text }} />
86
+ {item?.text && <div dangerouslySetInnerHTML={{ __html: item.text }} />}
88
87
  {item.link.type === 'external' ? (
89
88
  <a
90
89
  href={item.link.value}
@@ -110,7 +109,7 @@ const Spotlights = ({ module, themeStyles = {} }) => {
110
109
  )}
111
110
  </div>
112
111
  ) : (
113
- <div dangerouslySetInnerHTML={{ __html: item.text }} />
112
+ item.text && <div dangerouslySetInnerHTML={{ __html: item.text }} />
114
113
  ))}
115
114
  </li>
116
115
  ))}
@@ -30,13 +30,16 @@
30
30
 
31
31
  img {
32
32
  margin: 0 auto;
33
+ margin-bottom: 1rem;
33
34
  }
34
35
 
35
- > a {
36
+ > div > a {
36
37
  @include flex-direction(column);
37
38
  color: #000;
38
39
  font-size: 2rem;
39
40
  font-weight: 700;
41
+ margin-top: 1rem;
42
+ width: 100%;
40
43
 
41
44
  label {
42
45
  cursor: pointer;
@@ -47,15 +50,6 @@
47
50
  display: block;
48
51
  }
49
52
 
50
- .spotlightsTextCTA {
51
- display: flex;
52
- flex-direction: column;
53
- flex: 1;
54
- justify-content: space-between;
55
- font-size: 1.4rem;
56
- color: #777;
57
- }
58
-
59
53
  svg {
60
54
  display: none;
61
55
  }
@@ -9,7 +9,7 @@ const Main = ({ section = {}, pageContext = {} }) => {
9
9
  const { page } = pageContext;
10
10
  const SearchPage = page.path === 's' ? loadable(() => import(`~pages/search`)) : null;
11
11
  const HtmlSitemap = page.path === 'sitemap' ? loadable(() => import(`~atoms/sitemap`)) : null;
12
- const AuthorBox = page.author_id ? loadable(() => import(`~atoms/author-box`)) : null;
12
+ const AuthorBox = page.author ? loadable(() => import(`~atoms/author-box`)) : null;
13
13
  const NotFound = page?.path?.includes('404') ? loadable(() => import(`~atoms/not-found`)) : null;
14
14
 
15
15
  return (
@@ -45,7 +45,14 @@ function Anchor({
45
45
  }
46
46
  };
47
47
 
48
+ function getWindowDimensions() {
49
+ const { innerWidth: width } = window;
50
+ return width;
51
+ }
52
+
48
53
  const setActiveAnchor = () => {
54
+ anchorContainerRef.current && setOffsetTop(anchorContainerRef.current.offsetTop);
55
+
49
56
  // get element in viewport
50
57
  const currentAnchor = anchorList?.map((el) => {
51
58
  const element = document.getElementById(el.id);
@@ -78,8 +85,12 @@ function Anchor({
78
85
  const elementOffsetLeft = activeElement.offsetLeft;
79
86
 
80
87
  if (elementOffsetLeft > anchorContainerRef.current.offsetWidth - elementOffsetWidth) {
81
- anchorListRef.current.scrollLeft =
82
- elementOffsetWidth + elementOffsetLeft + 5 - anchorContainerRef.current.offsetWidth;
88
+ if (getWindowDimensions() > 960) {
89
+ anchorListRef.current.scrollLeft =
90
+ elementOffsetWidth + elementOffsetLeft + 5 - anchorContainerRef.current.offsetWidth;
91
+ } else {
92
+ anchorListRef.current.scrollLeft = elementOffsetLeft - 5;
93
+ }
83
94
  } else {
84
95
  anchorListRef.current.scrollLeft = 0;
85
96
  }
@@ -89,7 +100,6 @@ function Anchor({
89
100
  };
90
101
 
91
102
  useEffect(() => {
92
- setOffsetTop(anchorContainerRef.current.offsetTop);
93
103
  window.addEventListener('scroll', () => setActiveAnchor());
94
104
 
95
105
  return () => window.removeEventListener('scroll', setActiveAnchor);
@@ -56,7 +56,7 @@ describe('Head Component', () => {
56
56
  expect(container).toBeTruthy();
57
57
  await waitFor(() => {
58
58
  expect(document.title).toEqual('my meta title');
59
- // expect(document.documentElement.lang).toEqual('en');
59
+ expect(document.documentElement.lang).toEqual('en');
60
60
  expect(document.querySelectorAll('link[rel=preconnect]')).toHaveLength(3);
61
61
  expect(document.getElementsByTagName('meta')[0].getAttribute('content')).toEqual(
62
62
  'my meta description'
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { Helmet } from 'react-helmet';
2
3
  import PropTypes from 'prop-types';
3
4
 
4
5
  import { schemaGenerator } from '~helpers/schema';
@@ -40,7 +41,7 @@ const Head = ({ page = {}, siteInfo }) => {
40
41
  const pageImage = getPageImage(page) ? getPageImage(page) : imagePrettyUrl(siteInfo?.site_logo);
41
42
  // When google re-indexes dev NSA and IRL, remove lines 28, 41, 42, 43 and process.env.GATSBY_ACTIVE_ENV !== 'development' from lines 24, 25, 27, 29, 43
42
43
  return (
43
- <>
44
+ <Helmet>
44
45
  <title>{page.meta_title}</title>
45
46
  <html lang={getLanguage(page.language)} />
46
47
  <meta name="description" content={page.meta_description} />
@@ -75,7 +76,7 @@ const Head = ({ page = {}, siteInfo }) => {
75
76
  </script>
76
77
  )
77
78
  )}
78
- </>
79
+ </Helmet>
79
80
  );
80
81
  };
81
82
 
@@ -137,6 +137,8 @@ export function processCardsV2(module, pagesCloned, pagesMappedById, pageId) {
137
137
  // eslint-disable-next-line no-unused-expressions
138
138
  pagesMappedById[page_id] && module.items.push(pagesMappedById[page_id]);
139
139
  });
140
+
141
+ module.items = filterInactiveOperators(module.items);
140
142
  } else if (cardSelector === 'use_filters') {
141
143
  let pagesList = [];
142
144
 
@@ -247,7 +249,7 @@ export function processTopListModule(module, relations, pages) {
247
249
  ? pages.operator.filter((page) => page.relation_id === item.operator_id)
248
250
  : [];
249
251
 
250
- if (operatorPage.length >= 1) {
252
+ if (operatorPage.length >= 1 && operatorPage[0].author) {
251
253
  clone.authorName = operatorPage[0].author.name;
252
254
  clone.authorPath = operatorPage[0].author.profile_page_path;
253
255
  }
@@ -25,7 +25,13 @@ describe('Modules Helper', () => {
25
25
  test('Cards V2 Manual list', () => {
26
26
  const pagesNum = 10;
27
27
  const moduleData = getSampleCardsV2ModuleManual();
28
- processCardsV2(moduleData, null, groupBy(getPageDataList(pagesNum), 'id', true));
28
+ const pageList = getPageDataList(pagesNum);
29
+
30
+ processCardsV2(
31
+ moduleData,
32
+ groupBy(pageList, 'type'),
33
+ groupBy(getPageDataList(pagesNum), 'id', true)
34
+ );
29
35
 
30
36
  expect(moduleData.items).toHaveLength(3);
31
37
 
@@ -35,6 +41,39 @@ describe('Modules Helper', () => {
35
41
  });
36
42
  });
37
43
 
44
+ test('Cards V2 Filter manual list when inactive operator', () => {
45
+ process.env.GATSBY_SITE_NAME = 'irishluck.ie';
46
+ const pagesNum = 13;
47
+ const moduleData = getSampleCardsV2ModuleManual();
48
+ const pageList = getPageDataList(pagesNum).map((page, i) =>
49
+ i % 2
50
+ ? { ...page, type: 'operator', relation: { ...page.relation, status: 'inactive' } }
51
+ : { ...page, type: 'operator', relation: { ...page.relation, status: 'active' } }
52
+ );
53
+ // eslint-disable-next-line global-require
54
+ const { processCardsV2: processCardsV2Clean } = require('./modules');
55
+ processCardsV2Clean(moduleData, groupBy(pageList, 'type'), groupBy(pageList, 'id'));
56
+ // console.log(pageList);
57
+ const item = [];
58
+ moduleData.cards_selector_manual_list.forEach((page) => {
59
+ // eslint-disable-next-line camelcase
60
+ const { page_id } = page;
61
+ pageList.map((operator) => {
62
+ // eslint-disable-next-line camelcase
63
+ if (operator.id === page_id) {
64
+ // eslint-disable-next-line no-unused-expressions
65
+ operator.relation.status === 'active' ? item.push(operator) : null;
66
+ }
67
+ return item;
68
+ });
69
+ });
70
+ item.forEach((element) => {
71
+ expect(element.relation.status).toEqual('active');
72
+ });
73
+ // expect(item.relation.status).toEqual('active');
74
+ expect(moduleData.num_of_items).toEqual(3);
75
+ });
76
+
38
77
  test('Cards V2 FIltered list empty', () => {
39
78
  const pagesNum = 10;
40
79
  const moduleData = getSampleCardsV2Filtered(true);
@@ -56,6 +95,7 @@ describe('Modules Helper', () => {
56
95
  ? { ...page, type: 'operator', relation: { ...page.relation, status: 'inactive' } }
57
96
  : { ...page, type: 'operator', relation: { ...page.relation, status: 'active' } }
58
97
  );
98
+ // eslint-disable-next-line global-require
59
99
  const { processCardsV2: processCardsV2Clean } = require('./modules');
60
100
  processCardsV2Clean(moduleData, groupBy(pageList, 'type'), groupBy(pageList, 'id'));
61
101
 
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  // eslint-disable-next-line import/no-extraneous-dependencies
3
- import { Link } from 'gatsby';
3
+ import GatsbyLink from 'gatsby-link';
4
4
  import { navigate } from '@reach/router';
5
5
  import PropTypes from 'prop-types';
6
6
  import { previewFormat, previewPath, formatPath } from '~helpers/path';
7
7
 
8
- function LinkCustom({
8
+ function Link({
9
9
  children = <></>,
10
10
  to = '',
11
11
  activeClassName = '',
@@ -36,20 +36,20 @@ function LinkCustom({
36
36
  {children}
37
37
  </a>
38
38
  ) : (
39
- <Link
39
+ <GatsbyLink
40
40
  to={formatPath(to)}
41
41
  activeClassName={activeClassName}
42
42
  partiallyActive={partiallyActive}
43
43
  {...other}
44
44
  >
45
45
  {children}
46
- </Link>
46
+ </GatsbyLink>
47
47
  )}
48
48
  </>
49
49
  );
50
50
  }
51
51
 
52
- LinkCustom.propTypes = {
52
+ Link.propTypes = {
53
53
  to: PropTypes.string.isRequired,
54
54
  children: PropTypes.oneOfType([PropTypes.node, PropTypes.element, PropTypes.any]),
55
55
  activeClassName: PropTypes.string,
@@ -57,4 +57,4 @@ LinkCustom.propTypes = {
57
57
  gtmClass: PropTypes.string,
58
58
  };
59
59
 
60
- export default LinkCustom;
60
+ export default Link;
package/storybook/.ci.yml CHANGED
@@ -16,9 +16,9 @@ Storybook Build:
16
16
  paths:
17
17
  - gatsby-theme/storybook/public/
18
18
  rules:
19
- - if: '($CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "beta") && $PIPELINE == "automated"'
20
- - if: '$CI_PIPELINE_SOURCE == "push" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "beta") && $PIPELINE == "automated"'
21
- - if: '($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "beta") && $PIPELINE == "automated"'
19
+ - if: '$CI_COMMIT_BRANCH == "master" && $PIPELINE == "automated"'
20
+ - if: '$CI_PIPELINE_SOURCE == "push" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" && $PIPELINE == "automated"'
21
+ - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" && $PIPELINE == "automated"'
22
22
  - if: '$PIPELINE == "development"'
23
23
 
24
24
  Storybook Deploy:
@@ -45,9 +45,9 @@ Storybook Deploy:
45
45
  - demo/node_modules/
46
46
  policy: pull
47
47
  rules:
48
- - if: '($CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "beta") && $PIPELINE == "automated"'
49
- - if: '($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "beta") && $PIPELINE == "automated"'
48
+ - if: '$CI_COMMIT_BRANCH == "master" && $PIPELINE == "automated"'
49
+ - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" && $PIPELINE == "automated"'
50
50
  when: manual
51
51
  allow_failure: true
52
- - if: '$CI_PIPELINE_SOURCE == "push" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "beta") && $PIPELINE == "automated"'
52
+ - if: '$CI_PIPELINE_SOURCE == "push" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" && $PIPELINE == "automated"'
53
53
  - if: '$PIPELINE == "development"'