Skip to content

Commit a08451c

Browse files
authored
Merge branch 'main' into iss4795
2 parents ae0de10 + 8a0fdd3 commit a08451c

File tree

162 files changed

+1095
-668
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+1095
-668
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
- uses: actions/setup-node@v4
2+
with:
3+
node-version: 22
4+
- run: corepack enable
5+
- run: yarn install --immutable
6+
- uses: actions/cache@v4
7+
id: site-cache
8+
name: Load rspack cache
9+
with:
10+
path: "packages/documentation-site/.cache"
11+
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
12+
- run: yarn build:doc-core
13+
name: Build astro docs

.github/workflows-src/partials/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
node-version: 22
44
- run: corepack enable
55
- run: yarn install --immutable
6-
# v5 build
76
- uses: actions/cache@v4
87
id: site-cache
98
name: Load rspack cache

.github/workflows-src/pr-preview.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
88
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
99
GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }}
10-
GH_PR_NUM: ${{ github.event.number }}
10+
GH_PR_NUM: ${{ github.event.number }}
1111
steps:
1212
- uses: actions/checkout@v2
1313
# Yes, we really want to checkout the PR
@@ -18,3 +18,17 @@ jobs:
1818
%build%
1919
- run: node .github/upload-preview.js build/patternfly-org/site site
2020
name: Upload docs
21+
build-upload-astro:
22+
runs-on: ubuntu-latest
23+
env:
24+
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
25+
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
26+
GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }}
27+
GH_PR_NUM: ${{ github.event.number }}
28+
steps:
29+
- uses: actions/checkout@v2
30+
- run: |
31+
git fetch origin pull/$GH_PR_NUM/head:tmp
32+
git checkout tmp
33+
# Injected by generate-workflows.js
34+
%build-astro%

.github/workflows/pr-preview.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### WARNING -- this file was generated by generate-workflows
1+
### WARNING -- this file was generated by generate-workflows.js
22
name: pr-preview
33
on: pull_request_target
44
jobs:
@@ -21,7 +21,6 @@ jobs:
2121
node-version: 22
2222
- run: corepack enable
2323
- run: yarn install --immutable
24-
# build
2524
- uses: actions/cache@v4
2625
id: site-cache
2726
name: Load rspack cache
@@ -32,3 +31,29 @@ jobs:
3231
name: Build docs
3332
- run: node .github/upload-preview.js build/patternfly-org/site site
3433
name: Upload docs
34+
build-upload-astro:
35+
runs-on: ubuntu-latest
36+
env:
37+
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
38+
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
39+
GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }}
40+
GH_PR_NUM: ${{ github.event.number }}
41+
steps:
42+
- uses: actions/checkout@v2
43+
- run: |
44+
git fetch origin pull/$GH_PR_NUM/head:tmp
45+
git checkout tmp
46+
# Injected by generate-workflows.js
47+
- uses: actions/setup-node@v4
48+
with:
49+
node-version: 22
50+
- run: corepack enable
51+
- run: yarn install --immutable
52+
- uses: actions/cache@v4
53+
id: site-cache
54+
name: Load rspack cache
55+
with:
56+
path: "packages/documentation-site/.cache"
57+
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
58+
- run: yarn build:doc-core
59+
name: Build astro docs

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
"nanoid": "3.3.8",
6868
"@patternfly/react-code-editor": "^6.5.0-prerelease.13",
6969
"@patternfly/react-core": "^6.5.0-prerelease.13",
70-
"@patternfly/react-table": "^6.5.0-prerelease.13",
71-
"monaco-editor": "0.54.0"
70+
"@patternfly/react-table": "^6.5.0-prerelease.13"
7271
}
7372
}

packages/ast-helpers/CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,33 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# 1.4.0-alpha.322 (2025-11-21)
7+
8+
9+
### Bug Fixes
10+
11+
* Updates overview pages across website. ([#4880](https://github.com/patternfly/patternfly-org/issues/4880)) ([7871f1c](https://github.com/patternfly/patternfly-org/commit/7871f1c47d4a1b91b5cd1b16b4017aaf80252812))
12+
13+
14+
15+
16+
17+
# 1.4.0-alpha.321 (2025-11-20)
18+
19+
**Note:** Version bump only for package @patternfly/ast-helpers
20+
21+
22+
23+
24+
25+
# 1.4.0-alpha.320 (2025-11-20)
26+
27+
**Note:** Version bump only for package @patternfly/ast-helpers
28+
29+
30+
31+
32+
633
# 1.4.0-alpha.319 (2025-11-18)
734

835

packages/ast-helpers/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@patternfly/ast-helpers",
33
"description": "Acorn AST helpers for working with live code",
4-
"version": "1.4.0-alpha.319",
4+
"version": "1.4.0-alpha.322",
55
"author": "Red Hat",
66
"license": "MIT",
77
"publishConfig": {

packages/documentation-framework/CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,33 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## 6.31.13 (2025-11-21)
7+
8+
9+
### Bug Fixes
10+
11+
* Updates overview pages across website. ([#4880](https://github.com/patternfly/patternfly-org/issues/4880)) ([7871f1c](https://github.com/patternfly/patternfly-org/commit/7871f1c47d4a1b91b5cd1b16b4017aaf80252812))
12+
13+
14+
15+
16+
17+
## 6.31.12 (2025-11-20)
18+
19+
**Note:** Version bump only for package @patternfly/documentation-framework
20+
21+
22+
23+
24+
25+
## 6.31.11 (2025-11-20)
26+
27+
**Note:** Version bump only for package @patternfly/documentation-framework
28+
29+
30+
31+
32+
633
## 6.31.10 (2025-11-18)
734

835

packages/documentation-framework/components/sectionGallery/sectionGallery.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ export const SectionGallery = ({
3535
hasGridImages = true,
3636
hasListText = true,
3737
hasListImages = true,
38-
isFullWidth = true
38+
isFullWidth = true,
39+
onlyShowInGalleryData = false
3940
}) => (
4041
<SectionGalleryWrapper
4142
illustrations={illustrations}
@@ -46,6 +47,7 @@ export const SectionGallery = ({
4647
galleryItemsData={galleryItemsData}
4748
initialLayout={initialLayout}
4849
isFullWidth={isFullWidth}
50+
onlyShowInGalleryData={onlyShowInGalleryData}
4951
>
5052
{(sectionGalleryItems, searchTerm, setSearchTerm, layoutView, setLayoutView) => (
5153
<>

packages/documentation-framework/components/sectionGallery/sectionGalleryWrapper.js

Lines changed: 138 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@ import React from 'react';
22
import { useLocation } from '@reach/router';
33
import { groupedRoutes } from '../../routes';
44

5+
/**
6+
* Converts a hyphenated or lowercase string to sentence case
7+
* Example: "design-tokens" -> "Design tokens"
8+
* Example: "colors" -> "Colors"
9+
*/
10+
const toSentenceCase = (str) => {
11+
if (!str) return str;
12+
return str
13+
.split('-')
14+
.map((word, index) => {
15+
if (index === 0) {
16+
// Capitalize first letter of first word only
17+
return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
18+
}
19+
// Keep all other words lowercase
20+
return word.toLowerCase();
21+
})
22+
.join(' ');
23+
};
24+
525
export const SectionGalleryWrapper = ({
626
section,
727
subsection,
@@ -11,6 +31,7 @@ export const SectionGalleryWrapper = ({
1131
parseSubsections,
1232
initialLayout,
1333
isFullWidth,
34+
onlyShowInGalleryData = false,
1435
children,
1536
}) => {
1637
let sectionRoutes = subsection
@@ -24,12 +45,50 @@ export const SectionGalleryWrapper = ({
2445
</div>
2546
);
2647
}
27-
if (!includeSubsections || parseSubsections) {
48+
49+
// If includeSubsections is true and we're at the section level (not a specific subsection),
50+
// we need to include subsections themselves as items (not their contents)
51+
if (includeSubsections && !subsection && groupedRoutes[section]) {
52+
const allRoutes = {};
53+
// First, add top-level items (non-subsections)
54+
Object.entries(sectionRoutes).forEach(([navName, routeData]) => {
55+
if (navName === 'isSubsection' || navName === 'sortValue' || navName === 'subsectionSortValue') {
56+
return;
57+
}
58+
if (typeof routeData !== 'object' || routeData === null) {
59+
return;
60+
}
61+
// Only add if it's not a subsection
62+
if (!routeData.isSubsection) {
63+
allRoutes[navName] = routeData;
64+
}
65+
});
66+
67+
// Then, add subsections themselves as single items (not their contents)
68+
Object.entries(groupedRoutes[section]).forEach(([navName, routeData]) => {
69+
if (navName === 'isSubsection' || navName === 'sortValue' || navName === 'subsectionSortValue') {
70+
return;
71+
}
72+
if (typeof routeData !== 'object' || routeData === null) {
73+
return;
74+
}
75+
// If this is a subsection, add the subsection itself as an item
76+
if (routeData.isSubsection) {
77+
allRoutes[navName] = routeData;
78+
}
79+
});
80+
81+
sectionRoutes = allRoutes;
82+
} else if (!includeSubsections || parseSubsections) {
2883
const sectionRoutesArr = Object.entries(sectionRoutes);
2984
// loop through galleryItems object and build new object to handle subsections
3085
sectionRoutes = sectionRoutesArr.reduce((acc, [navName, routeData]) => {
31-
// exit immediately if current item is isSubsection flag
32-
if (navName === 'isSubsection') {
86+
// exit immediately if current item is isSubsection flag or other metadata properties
87+
if (navName === 'isSubsection' || navName === 'sortValue' || navName === 'subsectionSortValue') {
88+
return acc;
89+
}
90+
// Skip primitive values (metadata properties like sortValue are numbers)
91+
if (typeof routeData !== 'object' || routeData === null) {
3392
return acc;
3493
}
3594
// add current item
@@ -40,8 +99,11 @@ export const SectionGalleryWrapper = ({
4099
if (parseSubsections && routeData.isSubsection) {
41100
// loop through each subsection item & add
42101
Object.entries(routeData).map(([subitemName, subitemData]) => {
43-
if (subitemName !== 'isSubsection') {
44-
acc[subitemName] = subitemData;
102+
if (subitemName !== 'isSubsection' && subitemName !== 'sortValue' && subitemName !== 'subsectionSortValue') {
103+
// Skip primitive values
104+
if (typeof subitemData === 'object' && subitemData !== null) {
105+
acc[subitemName] = subitemData;
106+
}
45107
}
46108
});
47109
}
@@ -53,11 +115,32 @@ export const SectionGalleryWrapper = ({
53115
const [searchTerm, setSearchTerm] = React.useState('');
54116
const [layoutView, setLayoutView] = React.useState(initialLayout);
55117
const filteredItems = Object.entries(sectionRoutes).filter(
56-
([itemName, { slug }]) =>
118+
([itemName, itemData]) => {
119+
// Skip metadata properties
120+
if (itemName === 'isSubsection' || itemName === 'sortValue' || itemName === 'subsectionSortValue') {
121+
return false;
122+
}
123+
// Skip primitive values (metadata properties)
124+
if (typeof itemData !== 'object' || itemData === null) {
125+
return false;
126+
}
127+
// For subsections, slug will be computed later from first page
128+
// For regular items, they must have a slug
129+
if (!itemData.isSubsection && !itemData.slug) {
130+
return false;
131+
}
132+
const slug = itemData.slug;
133+
// For subsections without slug yet, we'll compute it later, so don't filter by slug
134+
if (!slug) {
135+
return itemName.toLowerCase().includes(searchTerm.toLowerCase());
136+
}
57137
// exclude current gallery page from results - check for trailing /
58-
!location.pathname.endsWith(slug) &&
59-
!location.pathname.endsWith(`${slug}/`) &&
60-
itemName.toLowerCase().includes(searchTerm.toLowerCase())
138+
return (
139+
!location.pathname.endsWith(slug) &&
140+
!location.pathname.endsWith(`${slug}/`) &&
141+
itemName.toLowerCase().includes(searchTerm.toLowerCase())
142+
);
143+
}
61144
);
62145
const sectionGalleryItems = filteredItems
63146
.sort(([itemName1], [itemName2]) => itemName1.localeCompare(itemName2))
@@ -76,8 +159,35 @@ export const SectionGalleryWrapper = ({
76159
}
77160
const { sources, isSubsection = false } = itemData;
78161
// Subsections don't have title or id, default to itemName aka sidenav text
79-
const title = itemData.title || itemName;
80-
const id = itemData.id || title;
162+
// Convert itemName to sentence case if no title is provided
163+
let title = itemData.title || toSentenceCase(itemName);
164+
let id = itemData.id || title;
165+
166+
// For extensions section, try to extract extension name from slug to match JSON keys
167+
// This handles cases where extensions have id: Overview or other IDs but we need to match JSON keys
168+
// The JSON keys are dasherized (e.g., "component-groups"), so we extract from slug
169+
if (section === 'extensions' && itemData.slug && galleryItemsData) {
170+
// Extract extension name from slug like /extensions/topology/overview -> topology
171+
// or /extensions/component-groups/overview -> component-groups
172+
// Also handle /extensions/react-topology/... -> topology (remove react- prefix)
173+
const slugParts = itemData.slug.split('/').filter(Boolean);
174+
if (slugParts.length >= 2 && slugParts[0] === 'extensions') {
175+
let extensionName = slugParts[1]; // e.g., "component-groups" or "react-topology"
176+
// Remove "react-" prefix if present (e.g., "react-topology" -> "topology")
177+
if (extensionName.startsWith('react-')) {
178+
extensionName = extensionName.replace(/^react-/, '');
179+
}
180+
// Check if this extension name exists in galleryItemsData
181+
if (galleryItemsData[extensionName]) {
182+
// Use extension name as id for JSON lookup (TextSummary converts to dasherized)
183+
id = extensionName;
184+
// Update title to extension name in sentence case if id was "Overview" or matches itemName
185+
if (itemData.id === 'Overview' || itemName === 'Overview' || !itemData.title) {
186+
title = toSentenceCase(extensionName);
187+
}
188+
}
189+
}
190+
}
81191
// Display beta label if tab other than a '-next' tab is marked Beta
82192
const isDeprecated =
83193
!isSubsection &&
@@ -138,6 +248,23 @@ export const SectionGalleryWrapper = ({
138248
id,
139249
galleryItemsData,
140250
};
251+
})
252+
.filter((item) => {
253+
// If onlyShowInGalleryData is true, filter to only items that exist in galleryItemsData
254+
if (!onlyShowInGalleryData || !galleryItemsData) {
255+
return true;
256+
}
257+
// Try matching by itemName first (already in dasherized format from routes)
258+
if (galleryItemsData[item.itemName]) {
259+
return true;
260+
}
261+
// Convert id to dasherized format to match JSON keys (lowercase, spaces to hyphens)
262+
const dasherizedId = item.id
263+
.split(' ')
264+
.join('-')
265+
.toLowerCase();
266+
// Check if this item exists in galleryItemsData
267+
return galleryItemsData[dasherizedId] !== undefined;
141268
});
142269

143270
return (

0 commit comments

Comments
 (0)