Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion packages/react-docs/patternfly-a11y.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,25 @@ const urls = Object.keys(fullscreenRoutes)
if (fullscreenRoutes[key].isFullscreenOnly) {
return key;
} else {
// the default tab for each component/pattern does not have a trailing 'react-demo' or 'react' string in the url
// so we strip the trailing string from those paths.
const path = fullscreenRoutes[key].path;
if (path.match(/\/demos\/.*\/react-demos$/g)) {
if (path.match(/\/patterns\/.*\/react-demos$/g)) {
return path.replace(/\/react-demos$/, '');
} else {
// some demos have been moved to the component section, so their default tab has a trailing 'react-demos'
if (path.match(/\/components\/.*\/react-demos$/g)){
if (path.includes('/application-launcher/') ||
path.includes('/context-selector/') ||
path.includes('/date-and-time-picker/') ||
path.includes('/password-generator/') ||
path.includes('/password-strength/') ||
path.includes('/custom-menus/') ||
path.includes('/options-menu/')) {
return path.replace(/\/react-demos$/, '');
}
}
// all other pages in the components section have a trailing 'react' string in their default tab
return path.replace(/\/react$/, '');
}
}
Expand Down