gatsby-core-theme 11.0.4 → 11.0.7
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 +44 -0
- package/gatsby-config.js +1 -0
- package/package.json +1 -1
- package/src/components/atoms/author-box/index.js +53 -48
- package/src/components/atoms/button/index.js +5 -0
- package/src/components/atoms/sitemap/sitemap.module.scss +14 -8
- package/src/components/atoms/spotlights/index.js +10 -24
- package/src/helpers/getters.js +10 -0
- package/src/helpers/getters.test.js +9 -0
- package/src/helpers/processor/modules.js +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,47 @@
|
|
|
1
|
+
## [11.0.7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v11.0.6...v11.0.7) (2022-09-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add style for link sitemap ([d9f1c9b](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d9f1c9bafe5ba9861c0bde30dbebda83b8e0915b))
|
|
7
|
+
* added checks to prevent useless p and div elements ([85e2197](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/85e2197b7dc8d5bedf5c9ce9d9fb0b3f1efa4ae5))
|
|
8
|
+
* remove cache ([e973acd](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/e973acdaac3fd6e81785631957ded2265e3adcf4))
|
|
9
|
+
* sitemap span style ([c421c88](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c421c880339d6cc1f02a64e3561977ca8b4fe676))
|
|
10
|
+
* sitemap style ([246b6c6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/246b6c639c82a9db26851a67396a3d7cdc6ffe29))
|
|
11
|
+
* spotlight buttons ([7d06a40](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7d06a4030033f6e80de5a34d7ff15e5cab2d2540))
|
|
12
|
+
* the external link spotlights bug ([0162af5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0162af5db9d5c9c092deabebbf6124570ed48f4b))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
* Merge branch 'sitemap-style' into 'master' ([821234b](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/821234b22fe13324901f4a59fc00d1e2516b81a7))
|
|
16
|
+
* Merge branch 'sitemap-style' into 'master' ([7fef715](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7fef7153121ad4fcb76fc84d4ef0f0eeff76d6d3))
|
|
17
|
+
* Merge branch 'spotlights-bug' into 'master' ([ed68b36](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/ed68b3670a4d4841426e8f1beb4fbfc8883f69c7))
|
|
18
|
+
* Merge branch 'tm-3042-favicon' into 'master' ([237bb9d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/237bb9dbed6af789d097383cc9fc9aa13c3c1cac))
|
|
19
|
+
* Merge branch 'sitemap-style' into 'master' ([0508ad6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0508ad6b9c1ea34ef5e6876ccaa52b6364e1c378))
|
|
20
|
+
|
|
21
|
+
## [11.0.6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v11.0.5...v11.0.6) (2022-09-02)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* update button and author-box ([3eec6da](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3eec6da80b37568a47ead1a15ad1811612b10828))
|
|
27
|
+
* update button component ([60cd4d1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/60cd4d1148517bdd4ef51cc265561b8137cfdcfa))
|
|
28
|
+
* update button component in order to accept props ([25cc1e3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/25cc1e31df9e468be966e3b1a7414e84dc5bace3))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
* Merge branch 'tm-3024-contact-us' into 'master' ([46e0b23](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/46e0b238e9c0c4da12a90c2dd072e6fc0fb039c7))
|
|
32
|
+
|
|
33
|
+
## [11.0.5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v11.0.4...v11.0.5) (2022-08-31)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Bug Fixes
|
|
37
|
+
|
|
38
|
+
* added placeholders for cards v2 module title ([d2ec6d7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d2ec6d7a05ab6efa4e55378e4fd40401c06e290a))
|
|
39
|
+
* removed log ([49b46e5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/49b46e55cad7686151b4bfdd4f70076d3078f370))
|
|
40
|
+
* tests ([85dcc20](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/85dcc20c53a4ca8b7dd82624bdb226037190ab8e))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
* Merge branch 'tm-2998-cardsv2-title-placeholders' into 'master' ([4dc5b17](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/4dc5b1730b5c70d618a52929cf81610ee9044e82))
|
|
44
|
+
|
|
1
45
|
## [11.0.4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v11.0.3...v11.0.4) (2022-08-29)
|
|
2
46
|
|
|
3
47
|
|
package/gatsby-config.js
CHANGED
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@ import PropTypes from 'prop-types';
|
|
|
9
9
|
import { translate, imagePrettyUrl, getAltText } from '~helpers/getters';
|
|
10
10
|
import styles from './author-box.module.scss';
|
|
11
11
|
import LazyImage from '~hooks/lazy-image';
|
|
12
|
-
import
|
|
12
|
+
import Button from '~atoms/button';
|
|
13
13
|
import { Context } from '~context/TranslationsProvider';
|
|
14
14
|
|
|
15
15
|
export default function AuthorBox({ author, preElement = null }) {
|
|
@@ -35,72 +35,77 @@ export default function AuthorBox({ author, preElement = null }) {
|
|
|
35
35
|
/>
|
|
36
36
|
)}
|
|
37
37
|
<span className={styles.name}>{author.name}</span>
|
|
38
|
-
<p className={styles.title}>{author.author_title}</p>
|
|
38
|
+
{author.author_title && <p className={styles.title}>{author.author_title}</p>}
|
|
39
39
|
</div>
|
|
40
40
|
<div className={styles.description}>
|
|
41
41
|
<div className={styles.links}>
|
|
42
|
-
|
|
43
|
-
{
|
|
44
|
-
|
|
45
|
-
href={`mailto:${author.email_address}`}
|
|
46
|
-
className="author-gtm"
|
|
47
|
-
target="_blank"
|
|
48
|
-
rel="nofollow noreferrer"
|
|
49
|
-
>
|
|
50
|
-
{translate(translations, 'email', 'Email')}
|
|
51
|
-
</a>
|
|
52
|
-
)}
|
|
53
|
-
{author.personal_website && (
|
|
54
|
-
<a
|
|
55
|
-
href={author.personal_website}
|
|
56
|
-
className="author-gtm"
|
|
57
|
-
target="_blank"
|
|
58
|
-
rel="nofollow noreferrer"
|
|
59
|
-
>
|
|
60
|
-
{translate(translations, 'website', 'Website')}
|
|
61
|
-
</a>
|
|
62
|
-
)}
|
|
63
|
-
{author.additional_url && (
|
|
64
|
-
<a
|
|
65
|
-
href={author.additional_url}
|
|
66
|
-
className="author-gtm"
|
|
67
|
-
target="_blank"
|
|
68
|
-
rel="nofollow noreferrer"
|
|
69
|
-
>
|
|
70
|
-
{translate(translations, 'contact', 'Contact')}
|
|
71
|
-
</a>
|
|
72
|
-
)}
|
|
73
|
-
</p>
|
|
74
|
-
<p className={styles.socialIcons}>
|
|
75
|
-
{socialLinks
|
|
76
|
-
.filter((socialLink) => socialLink.link)
|
|
77
|
-
.map((filteredLinks) => (
|
|
78
|
-
// eslint-disable-next-line jsx-a11y/control-has-associated-label
|
|
42
|
+
{(author.email_address || author.personal_website || author.additional_url) && (
|
|
43
|
+
<p className={styles.contactLinks}>
|
|
44
|
+
{author.email_address && (
|
|
79
45
|
<a
|
|
80
|
-
href={
|
|
46
|
+
href={`mailto:${author.email_address}`}
|
|
81
47
|
className="author-gtm"
|
|
82
48
|
target="_blank"
|
|
83
49
|
rel="nofollow noreferrer"
|
|
84
|
-
key={`author-box-link-${filteredLinks.id}`}
|
|
85
|
-
aria-label={`${filteredLinks.id} Link`}
|
|
86
50
|
>
|
|
87
|
-
{
|
|
51
|
+
{translate(translations, 'email', 'Email')}
|
|
88
52
|
</a>
|
|
89
|
-
)
|
|
90
|
-
|
|
53
|
+
)}
|
|
54
|
+
{author.personal_website && (
|
|
55
|
+
<a
|
|
56
|
+
href={author.personal_website}
|
|
57
|
+
className="author-gtm"
|
|
58
|
+
target="_blank"
|
|
59
|
+
rel="nofollow noreferrer"
|
|
60
|
+
>
|
|
61
|
+
{translate(translations, 'website', 'Website')}
|
|
62
|
+
</a>
|
|
63
|
+
)}
|
|
64
|
+
{author.additional_url && (
|
|
65
|
+
<a
|
|
66
|
+
href={author.additional_url}
|
|
67
|
+
className="author-gtm"
|
|
68
|
+
target="_blank"
|
|
69
|
+
rel="nofollow noreferrer"
|
|
70
|
+
>
|
|
71
|
+
{translate(translations, 'contact', 'Contact')}
|
|
72
|
+
</a>
|
|
73
|
+
)}
|
|
74
|
+
</p>
|
|
75
|
+
)}
|
|
76
|
+
{socialLinks.length > 0 && (
|
|
77
|
+
<p className={styles.socialIcons}>
|
|
78
|
+
{socialLinks
|
|
79
|
+
.filter((socialLink) => socialLink.link)
|
|
80
|
+
.map((filteredLinks) => (
|
|
81
|
+
// eslint-disable-next-line jsx-a11y/control-has-associated-label
|
|
82
|
+
<a
|
|
83
|
+
href={filteredLinks.link}
|
|
84
|
+
className="author-gtm"
|
|
85
|
+
target="_blank"
|
|
86
|
+
rel="nofollow noreferrer"
|
|
87
|
+
key={`author-box-link-${filteredLinks.id}`}
|
|
88
|
+
aria-label={`${filteredLinks.id} Link`}
|
|
89
|
+
>
|
|
90
|
+
{filteredLinks.icon}
|
|
91
|
+
</a>
|
|
92
|
+
))}
|
|
93
|
+
</p>
|
|
94
|
+
)}
|
|
91
95
|
<div
|
|
92
96
|
className={styles.biography}
|
|
93
97
|
dangerouslySetInnerHTML={{ __html: author.biography }}
|
|
94
98
|
/>
|
|
95
99
|
</div>
|
|
96
100
|
{author.profile_page_path && (
|
|
97
|
-
<
|
|
101
|
+
<Button
|
|
102
|
+
primaryColor={false}
|
|
98
103
|
to={author.profile_page_path}
|
|
99
|
-
|
|
104
|
+
btnText="Read More"
|
|
100
105
|
className={`${styles.button} author-gtm`}
|
|
101
106
|
>
|
|
102
107
|
{translate(translations, 'read_more', 'Read More')}
|
|
103
|
-
</
|
|
108
|
+
</Button>
|
|
104
109
|
)}
|
|
105
110
|
</div>
|
|
106
111
|
</div>
|
|
@@ -18,6 +18,7 @@ function Button({
|
|
|
18
18
|
disabled = false,
|
|
19
19
|
tertiary = false,
|
|
20
20
|
noStyle = false,
|
|
21
|
+
icon = null,
|
|
21
22
|
gtmClass = '',
|
|
22
23
|
}) {
|
|
23
24
|
const classes = `${styles.ctaBtn} ${primaryColor ? styles.primary : styles.secondary} ${
|
|
@@ -37,6 +38,7 @@ function Button({
|
|
|
37
38
|
disabled={disabled}
|
|
38
39
|
>
|
|
39
40
|
{btnText}
|
|
41
|
+
{icon && icon}
|
|
40
42
|
</button>
|
|
41
43
|
);
|
|
42
44
|
}
|
|
@@ -45,6 +47,7 @@ function Button({
|
|
|
45
47
|
return (
|
|
46
48
|
<Link className={`${classes} ${gtmClass}`} to={to} title={btnTitle} aria-label={btnTitle}>
|
|
47
49
|
{btnText}
|
|
50
|
+
{icon && icon}
|
|
48
51
|
</Link>
|
|
49
52
|
);
|
|
50
53
|
}
|
|
@@ -60,12 +63,14 @@ function Button({
|
|
|
60
63
|
rel="nofollow noreferrer"
|
|
61
64
|
>
|
|
62
65
|
{btnText}
|
|
66
|
+
{icon && icon}
|
|
63
67
|
</a>
|
|
64
68
|
);
|
|
65
69
|
}
|
|
66
70
|
|
|
67
71
|
Button.propTypes = {
|
|
68
72
|
to: PropTypes.string,
|
|
73
|
+
icon: PropTypes.func,
|
|
69
74
|
btnText: PropTypes.oneOfType([PropTypes.string, PropTypes.any]),
|
|
70
75
|
primaryColor: PropTypes.bool,
|
|
71
76
|
invertColors: PropTypes.bool,
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
text-transform: capitalize;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
> div {
|
|
50
|
+
> div {
|
|
51
51
|
position: relative;
|
|
52
52
|
display: flex;
|
|
53
53
|
align-items: center;
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
span {
|
|
56
56
|
@include flex-align(center, center);
|
|
57
57
|
position: absolute;
|
|
58
|
-
top: -1.2rem;
|
|
58
|
+
top: var(--sitemap-span-top, -1.2rem);
|
|
59
59
|
background-color: var(--page-number-background, green);
|
|
60
60
|
border-radius: 1.2rem;
|
|
61
61
|
border: var(--page-number-border, 0.2rem solid white);
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
font-size: 1rem;
|
|
64
64
|
color: var(--page-number-color, white);
|
|
65
65
|
font-weight: 700;
|
|
66
|
-
width: 2.4rem;
|
|
67
|
-
height: 2.4rem;
|
|
66
|
+
width: var(--sitemap-span-width, 2.4rem);
|
|
67
|
+
height: var(--sitemap-span-height, 2.4rem);
|
|
68
68
|
left: 3.2rem;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
|
|
79
79
|
&:before {
|
|
80
80
|
content: ' ';
|
|
81
|
-
border-left: var(--sitemap-connector-border,dashed 1px #e3e6ef);
|
|
81
|
+
border-left: var(--sitemap-connector-border, dashed 1px #e3e6ef);
|
|
82
82
|
left: 0;
|
|
83
83
|
position: absolute;
|
|
84
84
|
top: 0;
|
|
@@ -89,8 +89,8 @@
|
|
|
89
89
|
li {
|
|
90
90
|
display: grid;
|
|
91
91
|
grid-template-columns: 0.1fr 1fr;
|
|
92
|
-
gap: 0.5rem;
|
|
93
|
-
padding-bottom: 1rem;
|
|
92
|
+
gap: var(--sitemap-gap, 0.5rem);
|
|
93
|
+
padding-bottom: var(--sitemap-padding-bottom, 1rem);
|
|
94
94
|
position: relative;
|
|
95
95
|
|
|
96
96
|
&:before {
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
|
|
105
105
|
&:after {
|
|
106
106
|
content: ' ';
|
|
107
|
-
border-left: var(--sitemap-connector-border,dashed 1px #e3e6ef);
|
|
107
|
+
border-left: var(--sitemap-connector-border, dashed 1px #e3e6ef);
|
|
108
108
|
left: -2.7rem;
|
|
109
109
|
position: absolute;
|
|
110
110
|
top: 0;
|
|
@@ -112,6 +112,10 @@
|
|
|
112
112
|
bottom: 0;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
&:last-child {
|
|
116
|
+
padding-bottom: var(--sitemap-last-child-padding, 1rem);
|
|
117
|
+
}
|
|
118
|
+
|
|
115
119
|
&:last-child:after {
|
|
116
120
|
content: ' ';
|
|
117
121
|
bottom: auto;
|
|
@@ -128,7 +132,9 @@
|
|
|
128
132
|
}
|
|
129
133
|
|
|
130
134
|
a {
|
|
135
|
+
color: var(--sitemap-link-text-color, #295dd6);
|
|
131
136
|
padding-left: 0.3rem;
|
|
137
|
+
font-size: var(--sitemap-link-font-size, 1.6rem);
|
|
132
138
|
font-weight: var(--sitemap-link-text-font-weight, normal);
|
|
133
139
|
text-decoration: var(--sitemap-link-text-decoration, none);
|
|
134
140
|
}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
/* eslint-disable camelcase */
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
-
import { GrFormNextLink } from '@react-icons/all-files/gr/GrFormNextLink';
|
|
8
7
|
import Button from '~atoms/button';
|
|
9
8
|
import imgSize from '~constants/spotlight-image-dimensions.js';
|
|
10
9
|
import LazyImage from '~hooks/lazy-image';
|
|
@@ -85,29 +84,16 @@ const Spotlights = ({ module, themeStyles = {} }) => {
|
|
|
85
84
|
(item.link && item.link.value ? (
|
|
86
85
|
<div className={styles.spotlightsTextCTA}>
|
|
87
86
|
{item?.text && <div dangerouslySetInnerHTML={{ __html: item.text }} />}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
</a>
|
|
99
|
-
) : (
|
|
100
|
-
<Button
|
|
101
|
-
btnText={item.link_text ? item.link_text : 'Read More'}
|
|
102
|
-
invertColors
|
|
103
|
-
isAnchorLink
|
|
104
|
-
isInternalLink={item.link.type !== 'external'}
|
|
105
|
-
targetBlank={item.link.type === 'external'}
|
|
106
|
-
to={item.link.value}
|
|
107
|
-
primaryColor={false}
|
|
108
|
-
gtmClass="spotlights-gtm btn-cta"
|
|
109
|
-
/>
|
|
110
|
-
)}
|
|
87
|
+
<Button
|
|
88
|
+
to={item.link.value}
|
|
89
|
+
isAnchorLink
|
|
90
|
+
isInternalLink={!(item.link.type === 'external')}
|
|
91
|
+
rel={item.link.type === 'external' ? 'noreferrer' : ''}
|
|
92
|
+
invertColors
|
|
93
|
+
primaryColor={false}
|
|
94
|
+
gtmClass="spotlights-gtm"
|
|
95
|
+
btnText={item.link_text ? item.link_text : 'Read More'}
|
|
96
|
+
/>
|
|
111
97
|
</div>
|
|
112
98
|
) : (
|
|
113
99
|
item.text && <div dangerouslySetInnerHTML={{ __html: item.text }} />
|
package/src/helpers/getters.js
CHANGED
|
@@ -374,6 +374,16 @@ export function shiftFirstOperator(pageId, module, pagesMappedById) {
|
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
|
|
377
|
+
export const getModuleTitle = (module, page) => {
|
|
378
|
+
if (page && page.type === 'operator') {
|
|
379
|
+
return (
|
|
380
|
+
module.module_title && module.module_title.replace('[operator_name]', page.relation.name)
|
|
381
|
+
);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
return module.title;
|
|
385
|
+
};
|
|
386
|
+
|
|
377
387
|
export const getRoundMinutes = (time) => {
|
|
378
388
|
const [minutes, seconds] = time.split(':');
|
|
379
389
|
const value = seconds > 30 ? Number(minutes) + 1 : Number(minutes);
|
|
@@ -29,6 +29,15 @@ describe('Getters Helper', () => {
|
|
|
29
29
|
expect(Getters.getExtraField({ name: 'foo' }, 'name', 'def')).toEqual('foo');
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
+
test('getModuleTitle()', () => {
|
|
33
|
+
expect(
|
|
34
|
+
Getters.getModuleTitle(
|
|
35
|
+
{ module_title: 'Test [operator_name] test' },
|
|
36
|
+
{ type: 'operator', relation: { name: 'test name' } }
|
|
37
|
+
)
|
|
38
|
+
).toEqual('Test test name test');
|
|
39
|
+
});
|
|
40
|
+
|
|
32
41
|
test('getSection()', () => {
|
|
33
42
|
expect(Getters.getSection('short_code', { page: {}, marketSections: {} })).toBeNull();
|
|
34
43
|
expect(
|
|
@@ -5,7 +5,7 @@ import { clonePageForCards, groupBy, removeDuplicates } from './common';
|
|
|
5
5
|
import settings from '../../constants/settings';
|
|
6
6
|
import ModuleValue from '../../constants/module-value';
|
|
7
7
|
import { topListPickKeys } from '../../constants/pick-keys';
|
|
8
|
-
import { shiftFirstOperator } from '../getters';
|
|
8
|
+
import { shiftFirstOperator, getModuleTitle } from '../getters';
|
|
9
9
|
import { generatePlaceholderString } from '../generators';
|
|
10
10
|
|
|
11
11
|
const pagesGroupedByTemplateId = [];
|
|
@@ -223,6 +223,11 @@ export function processCardsV2(module, pagesCloned, pagesMappedById, pageId) {
|
|
|
223
223
|
shiftFirstOperator(pageId, module, pagesMappedById);
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
+
// Check for module title placeholders
|
|
227
|
+
if (pageId !== null) {
|
|
228
|
+
module.module_title = getModuleTitle(module, pagesMappedById[pageId]);
|
|
229
|
+
}
|
|
230
|
+
|
|
226
231
|
// modify page so it doesn't have too much data
|
|
227
232
|
module.items = module.items.map((item) => clonePageForCards(cloneDeep(item), module.style));
|
|
228
233
|
}
|