gatsby-core-theme 41.1.15 → 41.1.17
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 +31 -0
- package/gatsby-node.mjs +30 -8
- package/package.json +1 -1
- package/src/components/molecules/content/content.test.js +5 -7
- package/src/components/organisms/anchor/template-one/index.js +5 -3
- package/src/helpers/processor/index.test.js +2 -2
- package/src/helpers/processor/modules.test.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
## [41.1.17](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v41.1.16...v41.1.17) (2025-01-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* resolve conflicts ([500e726](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/500e726aab2504fe86e3359946791018137fb77e))
|
|
7
|
+
* sitemap advanced ([89efde7](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/89efde77f7f1e9100553697ce013dc39633caf8b))
|
|
8
|
+
* sitemap by page type ([8839924](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/8839924d6412c9a048f19e604f73fe2f213bb2b2))
|
|
9
|
+
* typo ([46cbaf2](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/46cbaf2266c5cdcdff76f12efce6a72b2b2bab81))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* Merge branch 'tm-5013-sitemap-page-type' into 'master' ([aa26169](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/aa26169d8fa745da46a80cbcfff88047818e3180))
|
|
13
|
+
* Merge branch 'master' into tm-5013-sitemap-page-type ([3ba402f](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/3ba402f94112ff22d33bfef2b094df51fb93ea80))
|
|
14
|
+
|
|
15
|
+
## [41.1.16](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v41.1.15...v41.1.16) (2025-01-03)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* deploy user ([b634f7e](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/b634f7eff91ef67d2005da557464c4a2850a7744))
|
|
21
|
+
* deploy user ([5211f50](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/5211f507098ff840c9c07d3250b05f07a4a52061))
|
|
22
|
+
* deploy user ([8c2fe8b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/8c2fe8b1212f5465fd450691bd37665534cc612e))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Code Refactoring
|
|
26
|
+
|
|
27
|
+
* changes to adding an anchor for operator review summary ([2551c2e](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/2551c2e85173d6c45a3f7ffb76fca92153008c56))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
* Merge branch 'tm-5018-anchor-operator-review-summary' into 'master' ([085235a](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/085235a1e25deb9c5c1c66556425e13ee6086482))
|
|
31
|
+
|
|
1
32
|
## [41.1.15](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v41.1.14...v41.1.15) (2024-12-27)
|
|
2
33
|
|
|
3
34
|
|
package/gatsby-node.mjs
CHANGED
|
@@ -385,8 +385,8 @@ export const createPages = async (
|
|
|
385
385
|
const tracker = trackerLinks.map((key) =>
|
|
386
386
|
operator.links[key]
|
|
387
387
|
? generateTrackerLink(operator, key, false, pageTemplate)
|
|
388
|
-
|
|
389
|
-
|
|
388
|
+
.toLowerCase()
|
|
389
|
+
.replace(" ", "_")
|
|
390
390
|
: null
|
|
391
391
|
);
|
|
392
392
|
const marketOperator = operator.market.match(/_(\w+)/)[1];
|
|
@@ -544,12 +544,19 @@ export const sourceNodes = async ({
|
|
|
544
544
|
});
|
|
545
545
|
});
|
|
546
546
|
|
|
547
|
-
//
|
|
548
|
-
Object.keys(pagesData).
|
|
547
|
+
// Create SitemapGroup + page type
|
|
548
|
+
Object.keys(pagesData).forEach((pageId) => {
|
|
549
549
|
const page = pagesData[pageId];
|
|
550
|
+
|
|
550
551
|
if (page && page.robot_options && page.robot_options.page_index) {
|
|
552
|
+
const pathPrefix = allMarketsData[page.market].path_prefix
|
|
553
|
+
? `${allMarketsData[page.market].path_prefix}/`
|
|
554
|
+
: null;
|
|
555
|
+
|
|
556
|
+
const path = `${pathPrefix || '' }${page.path === '/' && pathPrefix ? '' : page.path}`;
|
|
557
|
+
|
|
551
558
|
const pageSitemap = {
|
|
552
|
-
path
|
|
559
|
+
path,
|
|
553
560
|
updated_at: page.updated_at,
|
|
554
561
|
market: page.market,
|
|
555
562
|
language: page.language,
|
|
@@ -557,6 +564,19 @@ export const sourceNodes = async ({
|
|
|
557
564
|
};
|
|
558
565
|
|
|
559
566
|
const nodeMeta = {
|
|
567
|
+
id: createNodeId(`sitemap-${pageId}`),
|
|
568
|
+
parent: null,
|
|
569
|
+
children: [],
|
|
570
|
+
internal: {
|
|
571
|
+
type: `SitemapGroup${page.type.charAt(0).toUpperCase() + page.type.slice(1)}`,
|
|
572
|
+
contentDigest: createContentDigest(page),
|
|
573
|
+
},
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
const node = { ...pageSitemap, ...nodeMeta };
|
|
577
|
+
createNode(node);
|
|
578
|
+
|
|
579
|
+
const nodeMeta2 = {
|
|
560
580
|
id: createNodeId(keygen()),
|
|
561
581
|
parent: null,
|
|
562
582
|
children: [],
|
|
@@ -566,11 +586,13 @@ export const sourceNodes = async ({
|
|
|
566
586
|
contentDigest: createContentDigest(pageId),
|
|
567
587
|
},
|
|
568
588
|
};
|
|
569
|
-
const
|
|
570
|
-
createNode(
|
|
589
|
+
const node2 = { ...pageSitemap, ...nodeMeta2 };
|
|
590
|
+
createNode(node2);
|
|
571
591
|
}
|
|
572
592
|
});
|
|
573
|
-
|
|
593
|
+
|
|
594
|
+
}
|
|
595
|
+
|
|
574
596
|
|
|
575
597
|
export const onCreateWebpackConfig = ({ actions, stage, getConfig }) => {
|
|
576
598
|
if (stage === "build-javascript") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render, cleanup, fireEvent
|
|
3
|
-
import { generatePlaceholderString } from '../../../helpers/generators';
|
|
2
|
+
import { render, cleanup, fireEvent } from '@testing-library/react';
|
|
4
3
|
import '@testing-library/jest-dom/extend-expect';
|
|
5
4
|
import { getSingleContentData } from '~tests/factories/modules/content.factory';
|
|
6
5
|
import Content from '.';
|
|
@@ -29,7 +28,6 @@ describe('Content Component', () => {
|
|
|
29
28
|
test('render content props', () => {
|
|
30
29
|
const correctData = getSingleContentData('h4');
|
|
31
30
|
const { container } = render(<Content module={correctData} />);
|
|
32
|
-
expect(container).toBeTruthy();
|
|
33
31
|
expect(container.querySelectorAll('div.content')).toHaveLength(1);
|
|
34
32
|
|
|
35
33
|
// HTML parse
|
|
@@ -164,7 +162,7 @@ describe('Content Component', () => {
|
|
|
164
162
|
};
|
|
165
163
|
const { container } = render(<Content module={iframeModule} />);
|
|
166
164
|
|
|
167
|
-
expect(container.querySelectorAll('iframe')).
|
|
165
|
+
expect(container.querySelectorAll('iframe')).toHaveLength(2);
|
|
168
166
|
});
|
|
169
167
|
|
|
170
168
|
test('test Show more content', () => {
|
|
@@ -213,17 +211,17 @@ describe('Content Component', () => {
|
|
|
213
211
|
`,
|
|
214
212
|
};
|
|
215
213
|
const { container, getByText } = render(<Content module={iframeModule} />);
|
|
216
|
-
expect(getByText('show more test')).
|
|
214
|
+
expect(getByText('show more test')).toBeInTheDocument();
|
|
217
215
|
|
|
218
216
|
const showMorebutton = container.querySelector('button');
|
|
219
217
|
fireEvent.click(showMorebutton);
|
|
220
218
|
|
|
221
|
-
expect(getByText('More COntent test')).
|
|
219
|
+
expect(getByText('More COntent test')).toBeInTheDocument();
|
|
222
220
|
});
|
|
223
221
|
|
|
224
222
|
test('renders content with placeholder string for h2', () => {
|
|
225
223
|
const { container } = render(<Content module={module} page={page} />);
|
|
226
|
-
expect(container.querySelector('h2')).toHaveTextContent(
|
|
224
|
+
expect(container.querySelector('h2')).toHaveTextContent('2024');
|
|
227
225
|
});
|
|
228
226
|
|
|
229
227
|
test('renders content without placeholder string for h2', () => {
|
|
@@ -41,14 +41,16 @@ function Anchor({
|
|
|
41
41
|
let numberOfCharacters = 0;
|
|
42
42
|
const anchorList = items.map((anchor) => {
|
|
43
43
|
numberOfCharacters += anchor?.label?.length;
|
|
44
|
+
const generatedLabel = generatePlaceholderString(anchor?.label?.toLowerCase().trim(),null, page?.relation);
|
|
45
|
+
|
|
44
46
|
return {
|
|
45
47
|
id: `${
|
|
46
48
|
anchor.label &&
|
|
47
|
-
removeSymbols(anchorLink(
|
|
49
|
+
removeSymbols(anchorLink(generatedLabel))
|
|
48
50
|
}`,
|
|
49
|
-
label:
|
|
51
|
+
label: generatedLabel,
|
|
50
52
|
slug: `${
|
|
51
|
-
anchor.label && anchorLink(
|
|
53
|
+
anchor.label && anchorLink(generatedLabel)
|
|
52
54
|
}`,
|
|
53
55
|
};
|
|
54
56
|
});
|
|
@@ -67,7 +67,7 @@ describe('Index Processor', () => {
|
|
|
67
67
|
|
|
68
68
|
processExtraFields(extraField);
|
|
69
69
|
|
|
70
|
-
expect(extraField.logos).toContain('
|
|
70
|
+
expect(extraField.logos).toContain('2025');
|
|
71
71
|
});
|
|
72
72
|
|
|
73
73
|
test('processExtraFields text', () => {
|
|
@@ -77,7 +77,7 @@ describe('Index Processor', () => {
|
|
|
77
77
|
|
|
78
78
|
processExtraFields(extraField);
|
|
79
79
|
|
|
80
|
-
expect(extraField.logos).toContain(
|
|
80
|
+
expect(extraField.logos).toContain(new Date().getFullYear().toString());
|
|
81
81
|
});
|
|
82
82
|
|
|
83
83
|
test('processExtraFields operator', () => {
|
|
@@ -256,7 +256,7 @@ describe("Modules Helper", () => {
|
|
|
256
256
|
test("Process Content function", () => {
|
|
257
257
|
const module = contentPlaceholders;
|
|
258
258
|
processContentModule(module, {}, {});
|
|
259
|
-
expect(module.value).toContain(
|
|
260
|
-
expect(module.show_more_content).toContain(
|
|
259
|
+
expect(module.value).toContain(new Date().getFullYear().toString());
|
|
260
|
+
expect(module.show_more_content).toContain(new Date().getFullYear().toString());
|
|
261
261
|
});
|
|
262
262
|
});
|