gatsby-core-theme 2.2.6 → 5.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.
Files changed (86) hide show
  1. package/CHANGELOG.md +145 -0
  2. package/__mocks__/gatsby.js +16 -4
  3. package/gatsby-node.esm.js +12 -15
  4. package/jest.config.js +8 -1
  5. package/package.json +1 -1
  6. package/src/components/app.js +1 -17
  7. package/src/components/atoms/author/author.test.js +12 -5
  8. package/src/components/atoms/author-box/index.js +8 -6
  9. package/src/components/atoms/breadcrumbs/breadcrumbs.test.js +8 -0
  10. package/src/components/atoms/carousel/pagination-item/pagination-item.test.js +18 -3
  11. package/src/components/atoms/collapse/collapse.test.js +10 -0
  12. package/src/components/atoms/collapse/index.js +3 -1
  13. package/src/components/atoms/content-box/content-box.test.js +9 -6
  14. package/src/components/atoms/content-box/index.js +13 -12
  15. package/src/components/atoms/custom-select/index.js +31 -30
  16. package/src/components/atoms/disclaimer/disclaimer.test.js +16 -1
  17. package/src/components/atoms/iframe/iframe.module.scss +3 -0
  18. package/src/components/atoms/iframe/iframe.test.js +6 -0
  19. package/src/components/atoms/iframe/index.js +1 -1
  20. package/src/components/atoms/image/image.test.js +19 -6
  21. package/src/components/atoms/image/index.js +2 -4
  22. package/src/components/atoms/info-grid/index.js +10 -12
  23. package/src/components/atoms/label/index.js +2 -2
  24. package/src/components/atoms/label/label.test.js +4 -0
  25. package/src/components/atoms/module-title/index.js +9 -9
  26. package/src/components/atoms/module-title/module-title.test.js +76 -0
  27. package/src/components/atoms/open-graph/open-graph.test.js +34 -5
  28. package/src/components/atoms/operator-cta/operator-cta.test.js +26 -3
  29. package/src/components/atoms/scroll-to-top/scroll-to-top.test.js +6 -0
  30. package/src/components/atoms/search/autocomplete/operator.js +1 -1
  31. package/src/components/atoms/sitemap/index.js +1 -1
  32. package/src/components/atoms/spotlights/index.js +59 -54
  33. package/src/components/atoms/spotlights/spotlights.module.scss +25 -37
  34. package/src/components/atoms/spotlights/spotlights.test.js +13 -15
  35. package/src/components/molecules/carousel/default-slide/index.js +3 -1
  36. package/src/components/molecules/content/content.test.js +127 -0
  37. package/src/components/molecules/content/index.js +0 -1
  38. package/src/components/molecules/header/header.test.js +6 -0
  39. package/src/components/molecules/main/main.test.js +48 -12
  40. package/src/components/molecules/menu/menu.test.js +27 -0
  41. package/src/components/molecules/module/module.test.js +134 -0
  42. package/src/components/molecules/operator-banner/operator-banner.test.js +7 -1
  43. package/src/components/molecules/pagination/pagination-with-midpoints.module.scss +48 -49
  44. package/src/components/molecules/slider/index.js +6 -0
  45. package/src/components/organisms/anchor/index.js +14 -11
  46. package/src/components/organisms/carousel/index.js +16 -3
  47. package/src/components/organisms/cookie-consent/cookie-consent.test.js +7 -1
  48. package/src/components/organisms/form/form.test.js +21 -0
  49. package/src/components/organisms/form/index.js +5 -1
  50. package/src/components/organisms/navigation/index.js +9 -1
  51. package/src/components/organisms/search/index.js +0 -1
  52. package/src/components/organisms/toplist/list/index.js +1 -1
  53. package/src/components/organisms/toplist/list/list.test.js +30 -0
  54. package/src/components/pages/body/index.js +22 -5
  55. package/src/components/pages/tracker/index.js +1 -1
  56. package/src/constants/settings.js +1 -1
  57. package/src/helpers/getters.js +10 -6
  58. package/src/helpers/getters.test.js +1 -3
  59. package/src/helpers/processor/common.test.js +7 -1
  60. package/src/helpers/processor/index.js +2 -3
  61. package/src/helpers/processor/index.test.js +21 -0
  62. package/src/helpers/schema.js +14 -6
  63. package/src/helpers/schema.test.js +17 -14
  64. package/src/hooks/gatsby-img/index.js +1 -1
  65. package/src/hooks/lazy-image/index.js +23 -11
  66. package/src/hooks/lazy-image/lazy-image.test.js +39 -0
  67. package/src/hooks/lazy-picture/index.js +1 -1
  68. package/src/hooks/link/link.test.js +42 -1
  69. package/src/hooks/tabs/tab/tab.test.js +41 -0
  70. package/src/styles/utils/variables/_main.scss +3 -1
  71. package/tests/envVars.js +1 -1
  72. package/tests/factories/modules/content.factory.js +6 -3
  73. package/tests/factories/modules/modules.factory.js +152 -0
  74. package/tests/factories/modules/schema.factory.js +87 -0
  75. package/tests/factories/pages/list.factory.js +2 -1
  76. package/tests/factories/pages/pages.factory.js +192 -0
  77. package/tests/factories/sections/header.factory.js +8 -2
  78. package/src/components/atoms/logo/index.js +0 -36
  79. package/src/components/atoms/logo/logo.module.scss +0 -4
  80. package/src/components/atoms/logo/logo.stories.js +0 -57
  81. package/src/components/atoms/logo/logo.test.js +0 -30
  82. package/src/components/molecules/section/index.js +0 -24
  83. package/src/components/molecules/section/section.test.js +0 -16
  84. package/src/components/molecules/sidebar/index.js +0 -25
  85. package/src/components/molecules/sidebar/sidebar.module.scss +0 -3
  86. package/src/components/molecules/sidebar/sidebar.test.js +0 -30
package/CHANGELOG.md CHANGED
@@ -1,3 +1,148 @@
1
+ # [5.0.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v4.0.0...v5.0.0) (2022-03-01)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add slidetitle alt to images ([669ebdf](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/669ebdf4f352558569ac5d122f1d790ae5f1a4e1))
7
+ * add src name as a title ([71afdbf](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/71afdbf9a6c2de26022978aecc9313f1132981fa))
8
+ * add src name as a title ([4e4cae2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/4e4cae288a80364c2d824673c08abb6cd7ea2738))
9
+ * added no script tag for all images even when using native lazy loading ([513dd8b](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/513dd8b8501fbb0ea0a7e4210503826da942828a))
10
+ * author box alt tag ([7a1a76c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7a1a76c8ad1cbde35952e0eb12bcbbcce030cb47))
11
+ * fix html for anchor ([11518ca](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/11518caa9246edb373e2a6b590c2e6d371426d7e))
12
+ * schema fixes ([95f3adf](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/95f3adf1ca366ed01184d5b93bcb7c721bf38177))
13
+ * schema fixes ([c684519](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c6845195c7b37f02cf09d795db27ccfd31f9c5bf))
14
+ * set interface of cssstyledeclaration on each render ([7c0060a](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7c0060af75a13409a36ce67243f9afd92642a7f4))
15
+
16
+
17
+ ### Code Refactoring
18
+
19
+ * added image cdn urls ([1eeba30](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/1eeba30c042b85ff0a814944484f33ad814dcb92))
20
+ * changes to image cdn url ([052df45](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/052df45ad2eb9e38c9b147b3477cd6b3f82ec505))
21
+ * changes to image cdn url ([c3eb17e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c3eb17e4f71e50aaacaf1eb5845d472ca9f188c2))
22
+ * create fileName getter fnc ([a1dc8ac](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a1dc8acbd40c362e73aafa19eecf7814ba9df17f))
23
+ * remove cross-env ([a12e65b](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a12e65b4f7d5fc277103f860dd702195b1bda97c))
24
+ * remove test data ([657abde](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/657abdeef0ad948c64c1120e055db8d0a924106e))
25
+ * remove test data ([04649e6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/04649e649b2e1a4ca497f61e520bf2b1cc032f4f))
26
+
27
+
28
+ * Merge branch 'tm-2729-alt-tags' into 'master' ([f2776f2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/f2776f2c31520822848b7b811df38405df26bef5))
29
+ * Merge branch 'tm-2743-noscript-tag' into 'master' ([26bc7d2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/26bc7d296af7175f31eac582d031b3bc7eb5fe6b))
30
+ * Merge branch 'tm-2740-carousel-fix' into 'master' ([a537f2f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a537f2f41d665e661e1486015f99ceb47d59fbce))
31
+ * Merge branch 'test-schema' into 'master' ([29641f7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/29641f7e2142ff0fb0a4b76f4201e758cf150aed))
32
+ * Merge branch 'tm-2706-custom-demo-deployment' into 'master' ([7383e0d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7383e0daddf51de0901dd4c441e6016c61d60224))
33
+ * Merge branch 'master' into tm-2706-custom-demo-deployment ([8a3d1ed](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/8a3d1ed442250caa2be532138dba244b95cb1378))
34
+ * Merge branch 'tm-2721-fixhtml-anchor' into 'master' ([39a160c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/39a160cb88d7a352427e99a90fb4dc6655e9a877))
35
+
36
+
37
+ ### Tests
38
+
39
+ * schema changes ([c59116f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c59116f5d2122c97b2dd18e62b85358685cca277))
40
+ * temp test ([fb1bb3f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/fb1bb3f44d07e2e8d96a8bdf4008e9d58c16e233))
41
+ * temp test ([11a0b99](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/11a0b99c235cabb9f11831c8647f2ba0aa0c7f31))
42
+ * temp test ([f81d84a](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/f81d84a3114d7ff4159a482e2db23dd8872c70ab))
43
+ * temp test ([03ab914](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/03ab914910aeb4180448f66f5abd09a92af087a5))
44
+ * temp test ([ec052c0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/ec052c0dc395b8428e214db526c0000dcc8b2b68))
45
+ * temp test ([b2227b0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b2227b0170703795fce93e6d4ecfe6d1b8dd4446))
46
+
47
+ # [4.0.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v3.0.0...v4.0.0) (2022-02-21)
48
+
49
+
50
+ ### Bug Fixes
51
+
52
+ * add global variable for pagination border ([6046cad](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/6046cad5a846f41220e3a6a7cbf5105c04d2f9a1))
53
+ * added custom styles ([9d4f51c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9d4f51cf96fba24b50b60dce92565c86b9f21334))
54
+ * fix conflicts ([b5fb9c6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b5fb9c6972488ece497a2d5b50a63d7799f63358))
55
+ * fix unit testing ([66f57d3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/66f57d3d4e8192eeb72f852d9834e0d58077a48a))
56
+ * fix unit testing ([88abd13](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/88abd1380c574cadd4c064580e458a862da71590))
57
+ * fix unit testing ([0497042](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0497042d8dc9aadae5f0d49e34ab8d1b3fa0663e))
58
+ * fixed prelive path condition ([b7bf68f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b7bf68fc29de038bf23988d0a16eca3ef5ef9f52))
59
+ * fixed unit testing ([8837446](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/88374469c79e64b7e9f04a1ab3c18bc011adc99f))
60
+ * improve test for cookie and lazy ([7cc8a7d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7cc8a7da3bc8ffcaffb3b7326eecc0606c648f8c))
61
+ * improve unit testing ([0fbf8fc](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0fbf8fcd9e7a1df4d67bfc8e1b82eb433975850c))
62
+ * make unit testing ([7938019](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/793801915c7ccd835ca1976b83824416b86b8126))
63
+ * spotlight tests ([13f617c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/13f617c25ce7a2df84aec7acda9783c63890f59e))
64
+
65
+
66
+ ### Code Refactoring
67
+
68
+ * add variables to pipeline ([3c7b842](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3c7b8422769ffbc4196fc01770e2fd6df8f29923))
69
+ * changes to variables ([3b5a5a3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3b5a5a31a9de8430e611615b885c387b0f2551b9))
70
+ * cleaning up spotlights module ([9b8c181](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9b8c181311b0dbd5cee0748e239b6ea96c713dea))
71
+ * merge master to branch ([c4de93c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c4de93c2151a1f681bc7b93515c3e0e7ea606185))
72
+ * remove some unneeded components ([d29df5d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d29df5d0d112ed70fd56da3c5d749daf8e3c9008))
73
+ * remove test data ([8e3c0d6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/8e3c0d60652e6a9f9b8541cccebc107c2d14a33d))
74
+ * remove unneeded check ([8007c96](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/8007c967a82f5c216bc9196e35b67c1372e882a5))
75
+ * remove unused pipeline ([f4ba474](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/f4ba474b9aa4bda20f1dae293888ee6869823023))
76
+ * test new pipeline ([afbda7c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/afbda7c3885959cebb2a3e1194dbad352b96a50d))
77
+ * test new pipeline ([74b1667](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/74b1667773a1bbf68e221dc9d990375b4efd61d1))
78
+ * test new pipeline ([0070134](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0070134d06fc8ef0ab8bb59dd82ff9a9a8bbf41f))
79
+ * test new pipeline ([8e4a07f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/8e4a07f910753d911b02b8e71d01f357ac98b3d0))
80
+ * test new pipeline ([918dede](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/918dede9f7bcac0dbc89d8a01797765732039b90))
81
+ * test new pipeline ([38f1572](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/38f15727f255602e46fad0deef41a80a07b2b5e8))
82
+ * update getPageImage conditionals for readability ([3026c02](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3026c02141ec1eb84e4347309571fa22fcf258c4))
83
+ * update img alt tags ([234ae5e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/234ae5eb892fc437197b79393508da69bc5b768e))
84
+ * update schema publisher logo check ([9cffb56](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9cffb5661157b3b7e8b549682b72628f4ce3aa04))
85
+ * update tracker pages pageImage generation ([6c6c86f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/6c6c86f2eaab60d580f05d9a1c79e19ff1523adf))
86
+
87
+
88
+ ### Config
89
+
90
+ * increased threshold ([ef1c310](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/ef1c31023312841b11af983dab5a5a189124e06a))
91
+
92
+
93
+ * Merge branch 'tm-2624-spotlight-custom-styles' into 'master' ([18d168b](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/18d168befd09fd279bc4a0e775f6a230df303fa0))
94
+ * Merge branch 'tm-2738-trackers-page-image' into 'master' ([cfc1fb4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cfc1fb413ca4350e2b9b73f72b58e688966eb108))
95
+ * Merge branch 'tm-2715-update-img-alt-tags' into 'master' ([fbbbad6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/fbbbad60e6abc08cfc9c971519023177bbb61ad1))
96
+ * Merge branch 'master' into 'tm-2715-update-img-alt-tags' ([b27f85f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b27f85faeb6e843a0d12733635c1524239176b85))
97
+ * Merge branch 'tm-2716-html-cleanup' into 'master' ([83ff1de](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/83ff1de24d90207235833f43093c58edb519d0c4))
98
+ * Merge branch 'master' into 'tm-2715-update-img-alt-tags' ([ab98ebd](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/ab98ebd2ac7a220b4dcaa54ff87d68c1d23529c8))
99
+ * Merge branch 'tm-2706-custom-demo-deployment' into 'master' ([006e13d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/006e13d08f2bb435e99fb35f1bfec76f3f0c2590))
100
+ * Merge branch 'master' into tm-2706-custom-demo-deployment ([eb2483d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/eb2483d76b494627555568ee2213ea7b8c6264a7))
101
+ * Merge branch 'tm-2699-unit-testing' into 'master' ([e36d06d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/e36d06d8cd96bb92468047c319cb467ecdbd9980))
102
+ * Merge branch 'tm-2681-canary-tokens' into 'master' ([d70add6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d70add68ba2ba599f6e44d6686f108c68490168c))
103
+ * Merge branch 'tm-2705-gatsby-deployment-refactor' into 'master' ([d8dbeb2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d8dbeb238502552d90e7092bca277a3f8873104a))
104
+ * Merge branch 'master' into tm-2705-gatsby-deployment-refactor ([2a11b10](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2a11b1015cf497661cc05ff3eb447921236fe0cc))
105
+
106
+ # [3.0.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.2.6...v3.0.0) (2022-02-08)
107
+
108
+
109
+ ### Bug Fixes
110
+
111
+ * added canarty token ([4f038a9](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/4f038a9f580fdd4cf7fe113e7a3bac981e5958a8))
112
+ * final fixes ([5ff5dbe](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/5ff5dbe6954d55406e562a6dc92aba29f180e649))
113
+ * final fixes ([d6ab5b4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d6ab5b43137c9e86ed700e9835546081e5a281cc))
114
+ * final fixes ([3e0b2c2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3e0b2c24bd1ecb4788adff18499c8be08e4571f9))
115
+ * fixed issues ([41c60c3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/41c60c3cd190b6c8bc1ea3f3ffe78dd116bc4f06))
116
+ * fixed issues ([5cb7d46](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/5cb7d464ea4f41259ff2429fe47df85401300a89))
117
+ * fixed paths ([69d1319](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/69d131999cd7713bbfec58101adac95f1f626f19))
118
+ * fixed paths ([55f6c1b](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/55f6c1b4805aae0a7fc502e00430ddf3e5e7f15f))
119
+ * fixed paths ([893e1f9](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/893e1f94c60a57abe6575abbe81fbb8f9d7e04f9))
120
+ * image cdn links ([dfa9b65](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/dfa9b65f57dec6b0c5456f06c566d157f259df8f))
121
+ * small fix ([77ccc9a](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/77ccc9a3425a3d23c68bf29aa7761b8738263b1a))
122
+ * updated config CDN image ([7a53e9c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7a53e9c7be4b443019e980a1229e030265b69001))
123
+
124
+
125
+ ### Code Refactoring
126
+
127
+ * add keep_releases to gatsby theme ([8b39c85](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/8b39c85cae696ba1f39074a27ad1e244a84cf23f))
128
+ * add keep_releases to gatsby theme ([d5743c3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d5743c363920f5b6c6b36c2a19518297557871ca))
129
+ * remove unnecessary gtmclass on DOM element ([89ad28e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/89ad28ebe2b010ce25af7f7bb1c34f81b897bb0e))
130
+
131
+
132
+ ### Config
133
+
134
+ * added authors in pageContext ([a8cc96d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a8cc96de8ce015412116ef45c331742c66b8af87))
135
+
136
+
137
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/gatsby-themes ([250e76c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/250e76cbda63a6b7d77429bd447e56c17fb466af))
138
+ * Merge branch 'tm-2681-canary-tokens' into 'master' ([552a8c7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/552a8c783d388a32b363e2415ee17481987e9d70))
139
+ * Merge branch 'tm-2705-gatsby-deployment-refactor' into 'master' ([008231a](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/008231af369ad5bed03f2f9e5d7e2b72557ada99))
140
+ * Merge branch 'master' into tm-2705-gatsby-deployment-refactor ([2a545dc](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2a545dc4d670dd4ba5e48611487db066ac790a71))
141
+ * Merge branch 'tm-2695-image_cdn' into 'master' ([a650c11](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a650c11d73b3b96e455c4295b5f746f055656d32))
142
+ * Update index.js ([393bd40](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/393bd40075c31591e75ea1e9196f04c2d36254f1))
143
+ * Update index.js ([06001ff](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/06001ffff715c6484c4684d188c38e76a3db7804))
144
+ * Update index.js ([e6c40c8](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/e6c40c8756da47a1275687cee35712522f671f3f))
145
+
1
146
  ## [2.2.6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.2.5...v2.2.6) (2022-02-02)
2
147
 
3
148
 
@@ -1,12 +1,23 @@
1
- const React = require('react')
2
- const gatsby = jest.requireActual('gatsby')
1
+ const React = require('react');
2
+
3
+ const gatsby = jest.requireActual('gatsby');
3
4
 
4
5
  module.exports = {
5
6
  ...gatsby,
6
7
  graphql: jest.fn(),
7
8
  Link: jest.fn().mockImplementation(
8
9
  // these props are invalid for an `a` tag
9
- ({ activeClassName, activeStyle, getProps, innerRef, partiallyActive, ref, replace, to, ...rest }) =>
10
+ ({
11
+ activeClassName,
12
+ activeStyle,
13
+ getProps,
14
+ innerRef,
15
+ partiallyActive,
16
+ ref,
17
+ replace,
18
+ to,
19
+ ...rest
20
+ }) =>
10
21
  React.createElement('a', {
11
22
  ...rest,
12
23
  href: to,
@@ -14,4 +25,5 @@ module.exports = {
14
25
  ),
15
26
  StaticQuery: jest.fn(),
16
27
  useStaticQuery: jest.fn(),
17
- }
28
+ navigate: jest.fn(),
29
+ };
@@ -220,20 +220,11 @@ exports.createPages = async ({ actions: { createPage } }, themeOptions) => {
220
220
  prefilledModules,
221
221
  siteInfo,
222
222
  translations,
223
+ authors,
223
224
  ...themeOptions,
224
225
  };
225
226
 
226
- if (page.path === 'contact-us') {
227
- createPage({
228
- path: `/${page.path}`,
229
- component: require.resolve('./src/components/app.js'),
230
- context: {
231
- ...contextData,
232
- siteSchema,
233
- authors,
234
- },
235
- });
236
- } else if (page.path === '404') {
227
+ if (page.path === '404') {
237
228
  context404 = contextData;
238
229
  } else if (page.path === 'sitemap') {
239
230
  createPage({
@@ -260,8 +251,8 @@ exports.createPages = async ({ actions: { createPage } }, themeOptions) => {
260
251
  Object.keys(
261
252
  (processed.relations &&
262
253
  processed.relations.sports_data &&
263
- processed.relations.sports_data.providers)
264
- || {}
254
+ processed.relations.sports_data.providers) ||
255
+ {}
265
256
  ).forEach((providerId) => {
266
257
  const provider = processed.relations.sports_data.providers[providerId];
267
258
  const tracker = generateTrackerLink(provider, 'main');
@@ -279,7 +270,8 @@ exports.createPages = async ({ actions: { createPage } }, themeOptions) => {
279
270
  component: require.resolve('./src/components/app.js'),
280
271
  context: {
281
272
  page: trackerPageObject,
282
- provider: provider,
273
+ siteInfo,
274
+ provider,
283
275
  isTracker: true,
284
276
  },
285
277
  });
@@ -308,7 +300,12 @@ exports.createPages = async ({ actions: { createPage } }, themeOptions) => {
308
300
  createPage({
309
301
  path: trackerPath,
310
302
  component: require.resolve('./src/components/app.js'),
311
- context: { page: trackerPageObject, operator, isTracker: true },
303
+ context: {
304
+ page: trackerPageObject,
305
+ siteInfo,
306
+ operator,
307
+ isTracker: true,
308
+ },
312
309
  });
313
310
  }
314
311
  });
package/jest.config.js CHANGED
@@ -20,6 +20,13 @@ module.exports = {
20
20
  'data.json': '<rootDir>/__mocks__/search-data.json',
21
21
  },
22
22
  // testPathIgnorePatterns: [`node_modules`, `\\.cache`, `<rootDir>.*/public`],
23
+ coveragePathIgnorePatterns: [
24
+ 'tests/helpers',
25
+ 'src/components/organisms/search',
26
+ 'src/components/molecules/search',
27
+ 'src/components/app.js',
28
+ // ''
29
+ ],
23
30
  transformIgnorePatterns: [`node_modules/(?!(gatsby)/)`],
24
31
  globals: {
25
32
  __PATH_PREFIX__: ``,
@@ -29,7 +36,7 @@ module.exports = {
29
36
  collectCoverage: true,
30
37
  coverageThreshold: {
31
38
  global: {
32
- statements: 70,
39
+ statements: 80,
33
40
  },
34
41
  },
35
42
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "2.2.6",
3
+ "version": "5.0.0",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "main": "index.js",
6
6
  "GATSBY_RECAPTCHA_SITEKEY": "6LfoyvMUAAAAAO4nl_MQnqHb4XdHxEiu5cXgIqeB",
@@ -8,7 +8,7 @@ import Body from '~pages/body';
8
8
  import Head from '~organisms/head';
9
9
 
10
10
  const App = ({ pageContext }) => {
11
- const { translations, isTracker, isPreview } = pageContext;
11
+ const { translations = {}, isTracker, isPreview } = pageContext;
12
12
  const [previewContext, setPreviewContext] = useState({});
13
13
  const [isLoading, setIsLoading] = useState({});
14
14
 
@@ -33,26 +33,10 @@ const App = ({ pageContext }) => {
33
33
  window.location = `${window.location.origin}/preview?path=/`;
34
34
  }
35
35
  getData(searchParams);
36
- // let { hi, bye } = await import('./say.js');
37
- // getPreview(pageContext.siteName, searchParams.get('path') || '/', pageContext).then(
38
- // (previewResponse) => {
39
- // setPreviewContext(previewResponse);
40
- // setIsLoading(false);
41
- // }
42
- // );
43
-
44
36
  globalHistory.listen(({ location }) => {
45
37
  setIsLoading(true);
46
38
 
47
39
  getData(null, location.search.replace('?path=', ''));
48
- // getPreview(pageContext.siteName, location.search.replace('?path=', ''), pageContext)
49
- // .then((previewResponse) => {
50
- // setPreviewContext(previewResponse);
51
- // setIsLoading(false);
52
- // })
53
- // .catch(() => {
54
- // alert('failed to load..');
55
- // });
56
40
  });
57
41
  }
58
42
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -10,30 +10,37 @@ describe('Author Component', () => {
10
10
  <Author
11
11
  name="mohsen"
12
12
  prefix="by"
13
+ authorProfile="/author"
13
14
  link="https://twitter.com/name"
14
15
  icon={<i className="twitter" />}
15
16
  />
16
17
  );
17
18
  expect(container.querySelector('.authorInfo')).toBeTruthy();
18
- const info = getByText('by mohsen');
19
+ const info = getByText('mohsen');
19
20
  expect(info).toBeTruthy();
20
21
  expect(container.querySelector('a').getAttribute('href')).toEqual('https://twitter.com/name');
21
22
  expect(container.querySelector('i.twitter')).toBeTruthy();
22
23
  });
23
24
 
24
25
  test('without link and icon', () => {
25
- const { container, getByText } = render(<Author name="mohsen" prefix="with" />);
26
+ const { container } = render(<Author name="mohsen" />);
26
27
  expect(container.querySelector('.authorInfo')).toBeTruthy();
27
- const info = getByText('with mohsen');
28
- expect(info).toBeTruthy();
29
28
  expect(container.querySelector('a')).toBeFalsy();
30
29
  });
31
30
 
32
31
  test('with date', () => {
33
- const { container, getByText } = render(<Author name="mohsen" prefix="with" date="2020-04-24 15:37:42" />);
32
+ const { container, getByText } = render(
33
+ <Author
34
+ name="mohsen"
35
+ icon={<i className="twitter" />}
36
+ prefix="with"
37
+ date="2020-04-24 15:37:42"
38
+ />
39
+ );
34
40
  expect(container.querySelector('.date')).toBeTruthy();
35
41
  const info = getByText('with mohsen');
36
42
  expect(info).toBeTruthy();
43
+ expect(container.querySelector('i')).toBeTruthy();
37
44
  expect(container.querySelector('a')).toBeFalsy();
38
45
  });
39
46
  });
@@ -1,7 +1,8 @@
1
+ /* eslint-disable react/no-danger */
1
2
  import React, { useContext } from 'react';
2
3
  import { FaInstagram, FaFacebookSquare, FaTwitter, FaLinkedin } from 'react-icons/fa';
3
4
  import PropTypes from 'prop-types';
4
- import { translate } from '~helpers/getters';
5
+ import { translate, imagePrettyUrl } from '~helpers/getters';
5
6
  import styles from './author-box.module.scss';
6
7
  import LazyImage from '~hooks/lazy-image';
7
8
  import Link from '~hooks/link';
@@ -15,19 +16,19 @@ export default function AuthorBox({ author }) {
15
16
  { id: 'li', link: author.linkedin_profile, icon: <FaLinkedin /> },
16
17
  { id: 'tw', link: author.twitter_profile, icon: <FaTwitter /> },
17
18
  ];
19
+
18
20
  return (
19
21
  <div className={styles.container}>
20
22
  <div className={styles.innerContainer}>
21
23
  <div className={styles.information}>
22
- <div>
23
- {' '}
24
+ {author.image_object && (
24
25
  <LazyImage
25
- src={author.image_object?.url}
26
- alt={author.image_alt}
26
+ src={imagePrettyUrl(author.image_object.filename)}
27
+ alt={author.image_alt || author.name}
27
28
  width={author.image_object?.width}
28
29
  height={author.image_object?.height}
29
30
  />
30
- </div>
31
+ )}
31
32
  <span className={styles.name}>{author.name}</span>
32
33
  <p className={styles.title}>{author.author_title}</p>
33
34
  </div>
@@ -108,6 +109,7 @@ AuthorBox.propTypes = {
108
109
  url: PropTypes.string,
109
110
  width: PropTypes.number,
110
111
  height: PropTypes.number,
112
+ filename: PropTypes.string,
111
113
  }),
112
114
  image_alt: PropTypes.string,
113
115
  name: PropTypes.string,
@@ -20,6 +20,14 @@ describe('Show Breadcrumbs in a page', () => {
20
20
  const { container } = render(<Breadcrumbs page={page} />);
21
21
  expect(container).toBeEmptyDOMElement();
22
22
  });
23
+ test('Breadcrumb when we dont have link', () => {
24
+ const page = {
25
+ ...getPageData(),
26
+ breadcrumbs: [{ label: 'Sport', path: null }],
27
+ };
28
+ const { container } = render(<Breadcrumbs page={page} />);
29
+ expect(container.querySelectorAll('a')).toHaveLength(1);
30
+ });
23
31
  test('Vanity label', () => {
24
32
  const page = {
25
33
  vanity_label: 'Alternative title',
@@ -9,18 +9,33 @@ const currentSlide = 3;
9
9
 
10
10
  describe('Pagination Item Component', () => {
11
11
  test('render pagination item', () => {
12
- const { container } = render(<PaginationItem slideIndex={currentSlide} type="dots" totalSlides={5} />);
12
+ const { container } = render(
13
+ <PaginationItem slideIndex={currentSlide} type="dots" totalSlides={5} />
14
+ );
13
15
  expect(container.querySelectorAll('button.paginationItem')).toHaveLength(5);
14
16
  expect(container.querySelectorAll('button.paginationItem.active')).toHaveLength(1);
15
17
  });
16
18
  test('on click', () => {
17
19
  const paginationClick = jest.fn();
18
20
 
19
- const { container } = render(<PaginationItem slideIndex={currentSlide} type="dots" totalSlides={5} paginationHandler={paginationClick} />);
21
+ const { container } = render(
22
+ <PaginationItem
23
+ slideIndex={currentSlide}
24
+ type="dots"
25
+ totalSlides={5}
26
+ paginationHandler={paginationClick}
27
+ />
28
+ );
20
29
  const paginationItemBtn = container.querySelector('button.paginationItem.active');
21
30
  fireEvent.click(paginationItemBtn);
31
+ fireEvent.keyDown(paginationItemBtn);
22
32
  expect(paginationClick).toHaveBeenCalled();
23
- expect(paginationClick).toHaveBeenCalledWith(3)
33
+ expect(paginationClick).toHaveBeenCalledWith(3);
34
+ });
35
+
36
+ test('render empty', () => {
37
+ const { container } = render(<PaginationItem totalSlides={0} />);
38
+ expect(container.querySelector('button')).toBeFalsy();
24
39
  });
25
40
  });
26
41
  afterEach(() => {
@@ -27,6 +27,16 @@ describe('Collapse Component', () => {
27
27
  // jest does not render the component, hence testing the actual layout cannot be done due to the collapse using scrollHeight.
28
28
  });
29
29
 
30
+ test('Open collapse with different initial height', () => {
31
+ const { container } = render(
32
+ <Collapse buttonText="Open" maxHeight={20} contentText="Content Text" />
33
+ );
34
+
35
+ const button = container.querySelector('button');
36
+ fireEvent.click(button);
37
+ expect(button.classList.contains('active')).toBeFalsy();
38
+ });
39
+
30
40
  test('Only Mobile', () => {
31
41
  const { container } = render(
32
42
  <Collapse buttonText="Open" contentText="Content Text" onlyMobile />
@@ -10,8 +10,9 @@ const Collapse = ({
10
10
  onlyMobile = false,
11
11
  onlyDesktop = false,
12
12
  initOpen = false,
13
+ maxHeight = 0,
13
14
  }) => {
14
- const [maxHeightStyle, setMaxHeightStyle] = useState(0);
15
+ const [maxHeightStyle, setMaxHeightStyle] = useState(maxHeight);
15
16
  const contentRef = useRef(React.createRef());
16
17
  let showButton = true;
17
18
  const isMobile = useIsMobile();
@@ -68,6 +69,7 @@ Collapse.propTypes = {
68
69
  onlyMobile: PropTypes.bool,
69
70
  onlyDesktop: PropTypes.bool,
70
71
  initOpen: PropTypes.bool,
72
+ maxHeight: PropTypes.number,
71
73
  };
72
74
 
73
75
  export default Collapse;
@@ -8,20 +8,17 @@ const info = [
8
8
  {
9
9
  title: 'Fully licensed casinos',
10
10
  image: '../../../images/content-1.png',
11
- text:
12
- 'We only list and review fully licensed and legally operating casinos so you can be sure where you end up playing will be safe and secure.',
11
+ text: 'We only list and review fully licensed and legally operating casinos so you can be sure where you end up playing will be safe and secure.',
13
12
  },
14
13
  {
15
14
  title: 'Get the most for your money',
16
15
  image: '../../../images/content-2.png',
17
- text:
18
- 'We list all the features the Casinos have to offer so you can make an educated decision about where to place your money for maximum gains!',
16
+ text: 'We list all the features the Casinos have to offer so you can make an educated decision about where to place your money for maximum gains!',
19
17
  },
20
18
  {
21
19
  title: 'Authenticly written articles',
22
20
  image: '../../../images/content-3.png',
23
- text:
24
- 'All our Authors are professional writers with industry know-how, so you can depend on what we say is the truth!',
21
+ text: 'All our Authors are professional writers with industry know-how, so you can depend on what we say is the truth!',
25
22
  },
26
23
  ];
27
24
 
@@ -32,6 +29,12 @@ describe('ContentBox Component', () => {
32
29
  expect(getByText('Authenticly written articles')).toBeTruthy();
33
30
  expect(container.querySelectorAll('.icon')).toHaveLength(3);
34
31
  });
32
+
33
+ test('render without props', () => {
34
+ const { container } = render(<ContentBox data={[]} />);
35
+
36
+ expect(container.querySelector('li')).toBeFalsy();
37
+ });
35
38
  });
36
39
  afterEach(() => {
37
40
  cleanup();
@@ -8,19 +8,20 @@ import styles from './content-box.module.scss';
8
8
  const ContentBox = ({ data = [] }) => (
9
9
  <div className={styles.contentBoxContainer}>
10
10
  <ul className={styles.contentBoxList}>
11
- {data.map((item) => (
12
- <li key={keygen()}>
13
- <div className={styles.item}>
14
- <div className={styles.icon}>
15
- <LazyImage alt={item.title} src={item.image} />
11
+ {data &&
12
+ data.map((item) => (
13
+ <li key={keygen()}>
14
+ <div className={styles.item}>
15
+ <div className={styles.icon}>
16
+ <LazyImage alt={item.title} src={item.image} />
17
+ </div>
18
+ <div className={styles.body}>
19
+ <div className="h2">{item.title}</div>
20
+ <p>{item.text}</p>
21
+ </div>
16
22
  </div>
17
- <div className={styles.body}>
18
- <div className="h2">{item.title}</div>
19
- <p>{item.text}</p>
20
- </div>
21
- </div>
22
- </li>
23
- ))}
23
+ </li>
24
+ ))}
24
25
  </ul>
25
26
  </div>
26
27
  );
@@ -35,39 +35,40 @@ const CustomSelect = ({
35
35
  onClick={showDropdown}
36
36
  data-id="select-button"
37
37
  >
38
- {selectedOption[itemsLabel]}
38
+ {selectedOption && selectedOption[itemsLabel]}
39
39
  </button>
40
40
  <ol ref={selectList} className={styles.list} data-id="select-list">
41
- {options.map((item) => {
42
- if (item[itemsValue] === selectedOption[itemsValue]) return null;
43
- const currentItem = item;
44
- if (currentItem[itemsValue] === undefined) {
45
- currentItem[itemsValue] = 'id';
46
- }
47
- if (currentItem.type === undefined) {
48
- currentItem.type = 'type';
49
- }
50
- return (
51
- <li
52
- className={styles.selectListItem}
53
- key={keygen()}
54
- data-value={currentItem[itemsValue]}
55
- data-type={currentItem.type}
56
- >
57
- <button
58
- type="button"
59
- className="custom-select-gtm btn-cta"
60
- onClick={() => {
61
- onClick(currentItem[itemsValue], currentItem[itemsLabel], currentItem.type);
62
- setSelectedOption(currentItem);
63
- showDropdown();
64
- }}
41
+ {options &&
42
+ options.map((item) => {
43
+ if (item[itemsValue] === selectedOption[itemsValue]) return null;
44
+ const currentItem = item;
45
+ if (currentItem[itemsValue] === undefined) {
46
+ currentItem[itemsValue] = 'id';
47
+ }
48
+ if (currentItem.type === undefined) {
49
+ currentItem.type = 'type';
50
+ }
51
+ return (
52
+ <li
53
+ className={styles.selectListItem}
54
+ key={keygen()}
55
+ data-value={currentItem[itemsValue]}
56
+ data-type={currentItem.type}
65
57
  >
66
- {currentItem[itemsLabel]}
67
- </button>
68
- </li>
69
- );
70
- })}
58
+ <button
59
+ type="button"
60
+ className="custom-select-gtm btn-cta"
61
+ onClick={() => {
62
+ onClick(currentItem[itemsValue], currentItem[itemsLabel], currentItem.type);
63
+ setSelectedOption(currentItem);
64
+ showDropdown();
65
+ }}
66
+ >
67
+ {currentItem[itemsLabel]}
68
+ </button>
69
+ </li>
70
+ );
71
+ })}
71
72
  </ol>
72
73
  </div>
73
74
  );