Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fully built out v6 demo #209

Open
wants to merge 44 commits into
base: v6-penta-demo
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
53be3ff
converting html demo to react
evwilkin Feb 7, 2024
c90cf46
pathways card
evwilkin Feb 13, 2024
73afaee
pull from card demos
evwilkin Feb 13, 2024
603d9e8
built final 2 cards
evwilkin Feb 13, 2024
7234728
lint cleanup
evwilkin Feb 14, 2024
af06584
bump versions
evwilkin Feb 14, 2024
06412ed
feat: add inventory and resource pages, get tests running
nicolethoen Feb 21, 2024
9b07013
attempt to fix build
nicolethoen Feb 22, 2024
c511423
more build fixes
nicolethoen Feb 22, 2024
bd9c146
add dark theme switcher
nicolethoen Feb 22, 2024
0e28819
fix build
nicolethoen Feb 22, 2024
84b3cfb
fix: upgrade @patternfly/react-core from 5.1.2 to 5.2.0
snyk-bot Feb 24, 2024
19cb1b3
chore(penta-demo): PR feedback - updated colors per core recs
Mar 15, 2024
ad775d7
fix lint & update snapshot
Mar 16, 2024
ba2220c
added RTL switch
Mar 16, 2024
9ec1790
update favicon
Mar 22, 2024
87c72a5
chore(demo): Core PR feedback
evwilkin Mar 26, 2024
04c7b3b
chore(demo): update snapshot
evwilkin Mar 26, 2024
c398986
updated snapshots for timestamp
evwilkin Mar 26, 2024
389a6f1
Merge pull request #210 from patternfly/snyk-upgrade-ad708d72a30e61b2…
nicolethoen Mar 26, 2024
10642cd
chore(deps): bump PF versions to latest alphas
wise-king-sullyman Apr 2, 2024
766c221
chore(deps): bump to latest PF alpha versions
wise-king-sullyman Apr 2, 2024
b3abc9c
Merge branch 'main' into v6
wise-king-sullyman Apr 3, 2024
758d2ae
fix: Patternfly brand name
safarcik Apr 24, 2024
975db3e
Merge pull request #221 from thybit/main
dlabaj Apr 24, 2024
3561e61
Merge branch 'main' into v6
dlabaj May 1, 2024
be48bc3
Merge pull request #192 from patternfly/v6
dlabaj May 1, 2024
31f6e84
fix: update to alpha2 versions
nicolethoen Jun 4, 2024
248be19
fix: update deps starting with PF
nicolethoen Jun 4, 2024
992d4b0
fix: update storybook deps
nicolethoen Jun 4, 2024
63e153f
update lint & jest deps
nicolethoen Jun 4, 2024
0537b0c
more updates related to lint
nicolethoen Jun 4, 2024
168610d
update rest of minor version bumps
nicolethoen Jun 4, 2024
bb409eb
update lock file
nicolethoen Jun 4, 2024
70473c8
Merge pull request #225 from nicolethoen/clean_up_main
nicolethoen Jun 4, 2024
b6bf004
chore(deps): bump express from 4.18.0 to 4.19.2
dependabot[bot] Jun 4, 2024
51a433c
Merge pull request #215 from patternfly/dependabot/npm_and_yarn/expre…
nicolethoen Jun 4, 2024
53a4311
fix: remove storybook
nicolethoen Jun 6, 2024
703aa17
some fixes
nicolethoen Jun 6, 2024
5315ff9
Merge pull request #226 from nicolethoen/remove_storybook
nicolethoen Jun 6, 2024
22b54e2
feat: bump to lastest alpha2 - tests failing
nicolethoen Jun 6, 2024
c7648ae
bump to latest alphas
nicolethoen Jun 12, 2024
07eb373
merge v6 branch into this demo
nicolethoen Jun 12, 2024
1b71e91
it's all working with alpha2
nicolethoen Jun 12, 2024
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
12,823 changes: 3,368 additions & 9,455 deletions package-lock.json

Large diffs are not rendered by default.

27 changes: 24 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,33 @@
"webpack-merge": "^5.9.0"
},
"dependencies": {
"@patternfly/react-core": "6.0.0-alpha.28",
"@patternfly/react-icons": "6.0.0-alpha.11",
"@patternfly/react-styles": "6.0.0-alpha.11",
"@patternfly/react-core": "6.0.0-alpha.35",
"@patternfly/react-icons": "6.0.0-alpha.13",
"@patternfly/react-styles": "6.0.0-alpha.13",
"@patternfly/react-charts": "8.0.0-alpha.13",
"@patternfly/react-table": "6.0.0-alpha.35",
"@storybook/builder-webpack5": "^7.5.3",
"react": "^18",
"react-dom": "^18",
"sirv-cli": "^2.0.2"
},
"overrides": {
"victory-area": "36.6.11",
"victory-axis": "36.6.11",
"victory-bar": "36.6.11",
"victory-box-plot": "36.6.11",
"victory-chart": "36.6.11",
"victory-core": "36.6.11",
"victory-create-container": "36.6.11",
"victory-cursor-container": "36.6.11",
"victory-group": "36.6.11",
"victory-legend": "36.6.11",
"victory-line": "36.6.11",
"victory-pie": "36.6.11",
"victory-scatter": "36.6.11",
"victory-stack": "36.6.11",
"victory-tooltip": "36.6.11",
"victory-voronoi-container": "36.6.11",
"victory-zoom-container": "36.6.11"
}
}
114 changes: 90 additions & 24 deletions src/app/AppLayout/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,50 @@ import * as React from 'react';
import { NavLink, useLocation } from 'react-router-dom';
import {
Button,
Icon,
Masthead,
MastheadBrand,
MastheadContent,
MastheadMain,
MastheadToggle,
Nav,
Nav,
NavExpandable,
NavItem,
NavList,
Page,
PageSidebar,
NavList,
Page,
PageSidebar,
PageSidebarBody,
SkipToContent
SkipToContent,
Switch,
ToggleGroup,
ToggleGroupItem,
Toolbar,
ToolbarContent,
ToolbarItem,
} from '@patternfly/react-core';
import { IAppRoute, IAppRouteGroup, routes } from '@app/routes';
import { BarsIcon } from '@patternfly/react-icons';
import { BarsIcon, MoonIcon, SunIcon } from '@patternfly/react-icons';

interface IAppLayout {
children: React.ReactNode;
}

const AppLayout: React.FunctionComponent<IAppLayout> = ({ children }) => {
const [sidebarOpen, setSidebarOpen] = React.useState(true);
const [isDarkTheme, setIsDarkTheme] = React.useState(false);

const toggleDarkTheme = (_evt, selected) => {
const darkThemeToggleClicked = !selected === isDarkTheme;
document.querySelector('html')?.classList.toggle('pf-v5-theme-dark', darkThemeToggleClicked);
setIsDarkTheme(darkThemeToggleClicked);
};

const toggleRTL = () => {
const html = document.querySelector('html');
const curDir = html!.dir;
html!.dir = curDir !== 'rtl' ? 'rtl' : 'ltr';
};

const Header = (
<Masthead>
<MastheadToggle>
Expand All @@ -42,7 +64,11 @@ const AppLayout: React.FunctionComponent<IAppLayout> = ({ children }) => {
</linearGradient>
</defs>
<g stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
<g transform="translate(206.000000, 45.750000)" fill="var(--pf-t--global--text--color--regular)" fillRule="nonzero">
<g
transform="translate(206.000000, 45.750000)"
fill="var(--pf-t--global--text--color--regular)"
fillRule="nonzero"
>
<path d="M0,65.25 L0,2.25 L33.21,2.25 C37.35,2.25 41.025,3.135 44.235,4.905 C47.445,6.675 49.98,9.09 51.84,12.15 C53.7,15.21 54.63,18.72 54.63,22.68 C54.63,26.46 53.7,29.865 51.84,32.895 C49.98,35.925 47.43,38.31 44.19,40.05 C40.95,41.79 37.29,42.66 33.21,42.66 L15.48,42.66 L15.48,65.25 L0,65.25 Z M15.48,29.88 L31.41,29.88 C33.69,29.88 35.52,29.22 36.9,27.9 C38.28,26.58 38.97,24.87 38.97,22.77 C38.97,20.61 38.28,18.855 36.9,17.505 C35.52,16.155 33.69,15.48 31.41,15.48 L15.48,15.48 L15.48,29.88 Z"></path>
<path d="M77.04,66.06 C73.68,66.06 70.695,65.43 68.085,64.17 C65.475,62.91 63.435,61.17 61.965,58.95 C60.495,56.73 59.76,54.18 59.76,51.3 C59.76,46.74 61.485,43.215 64.935,40.725 C68.385,38.235 73.2,36.99 79.38,36.99 C83.1,36.99 86.7,37.44 90.18,38.34 L90.18,36 C90.18,31.26 87.15,28.89 81.09,28.89 C77.49,28.89 72.69,30.15 66.69,32.67 L61.47,21.96 C69.15,18.48 76.56,16.74 83.7,16.74 C90.3,16.74 95.43,18.315 99.09,21.465 C102.75,24.615 104.58,29.04 104.58,34.74 L104.58,65.25 L90.18,65.25 L90.18,62.37 C88.26,63.69 86.235,64.635 84.105,65.205 C81.975,65.775 79.62,66.06 77.04,66.06 Z M73.62,51.03 C73.62,52.53 74.28,53.7 75.6,54.54 C76.92,55.38 78.75,55.8 81.09,55.8 C84.69,55.8 87.72,55.05 90.18,53.55 L90.18,47.43 C87.42,46.71 84.54,46.35 81.54,46.35 C79.02,46.35 77.07,46.755 75.69,47.565 C74.31,48.375 73.62,49.53 73.62,51.03 Z"></path>
<path d="M137.25,65.88 C125.73,65.88 119.97,60.84 119.97,50.76 L119.97,29.79 L110.34,29.79 L110.34,17.64 L119.97,17.64 L119.97,5.4 L134.55,2.25 L134.55,17.64 L147.87,17.64 L147.87,29.79 L134.55,29.79 L134.55,47.88 C134.55,49.98 135.015,51.465 135.945,52.335 C136.875,53.205 138.51,53.64 140.85,53.64 C143.01,53.64 145.2,53.31 147.42,52.65 L147.42,64.44 C146.1,64.86 144.42,65.205 142.38,65.475 C140.34,65.745 138.63,65.88 137.25,65.88 Z"></path>
Expand All @@ -55,14 +81,57 @@ const AppLayout: React.FunctionComponent<IAppLayout> = ({ children }) => {
<path d="M429.21,84.69 C428.07,84.69 426.96,84.645 425.88,84.555 C424.8,84.465 423.9,84.33 423.18,84.15 L423.18,71.73 C424.38,71.97 425.88,72.09 427.68,72.09 C432.36,72.09 435.51,70.05 437.13,65.97 L437.13,65.88 L418.86,17.64 L434.97,17.64 L445.5,47.61 L457.74,17.64 L473.49,17.64 L452.16,67.68 C450.42,71.82 448.5,75.135 446.4,77.625 C444.3,80.115 441.87,81.915 439.11,83.025 C436.35,84.135 433.05,84.69 429.21,84.69 Z"></path>
</g>
<g transform="translate(0.000000, 0.000000)">
<path d="M61.826087,0 L158,0 L158,96.173913 L147.695652,96.173913 C100.271201,96.173913 61.826087,57.7287992 61.826087,10.3043478 L61.826087,0 L61.826087,0 Z" fill="#0066CC"></path>
<path d="M158,3.43478261 L65.2608696,158 L138,158 C149.045695,158 158,149.045695 158,138 L158,3.43478261 L158,3.43478261 Z" fill="url(#linearGradient-basic-masthead)"></path>
<path d="M123.652174,-30.9130435 L30.9130435,123.652174 L103.652174,123.652174 C114.697869,123.652174 123.652174,114.697869 123.652174,103.652174 L123.652174,-30.9130435 L123.652174,-30.9130435 Z" fill="url(#linearGradient-basic-masthead)" transform="translate(77.282609, 46.369565) scale(1, -1) rotate(90.000000) translate(-77.282609, -46.369565) "></path>
<path
d="M61.826087,0 L158,0 L158,96.173913 L147.695652,96.173913 C100.271201,96.173913 61.826087,57.7287992 61.826087,10.3043478 L61.826087,0 L61.826087,0 Z"
fill="#0066CC"
></path>
<path
d="M158,3.43478261 L65.2608696,158 L138,158 C149.045695,158 158,149.045695 158,138 L158,3.43478261 L158,3.43478261 Z"
fill="url(#linearGradient-basic-masthead)"
></path>
<path
d="M123.652174,-30.9130435 L30.9130435,123.652174 L103.652174,123.652174 C114.697869,123.652174 123.652174,114.697869 123.652174,103.652174 L123.652174,-30.9130435 L123.652174,-30.9130435 Z"
fill="url(#linearGradient-basic-masthead)"
transform="translate(77.282609, 46.369565) scale(1, -1) rotate(90.000000) translate(-77.282609, -46.369565) "
></path>
</g>
</g>
</svg>
</MastheadBrand>
</MastheadMain>
<MastheadContent>
<Toolbar>
<ToolbarContent>
<ToolbarItem align={{ default: 'alignRight' }}>
<ToggleGroup aria-label="Dark theme toggle group">
<ToggleGroupItem
aria-label="light theme toggle"
icon={
<Icon size="md">
<SunIcon />
</Icon>
}
isSelected={!isDarkTheme}
onChange={toggleDarkTheme}
/>
<ToggleGroupItem
aria-label="dark theme toggle"
icon={
<Icon size="md">
<MoonIcon />
</Icon>
}
isSelected={isDarkTheme}
onChange={toggleDarkTheme}
/>
</ToggleGroup>
</ToolbarItem>
<ToolbarItem>
<Switch id="ws-rtl-switch" label={'RTL'} defaultChecked={false} onChange={() => toggleRTL()} />
</ToolbarItem>
</ToolbarContent>
</Toolbar>
</MastheadContent>
</Masthead>
);

Expand Down Expand Up @@ -91,37 +160,34 @@ const AppLayout: React.FunctionComponent<IAppLayout> = ({ children }) => {
<Nav id="nav-primary-simple">
<NavList id="nav-list-simple">
{routes.map(
(route, idx) => route.label && (!route.routes ? renderNavItem(route, idx) : renderNavGroup(route, idx))
(route, idx) => route.label && (!route.routes ? renderNavItem(route, idx) : renderNavGroup(route, idx)),
)}
</NavList>
</Nav>
);

const Sidebar = (
<PageSidebar>
<PageSidebarBody>
{Navigation}
</PageSidebarBody>
<PageSidebarBody>{Navigation}</PageSidebarBody>
</PageSidebar>
);

const pageId = 'primary-app-container';

const PageSkipToContent = (
<SkipToContent onClick={(event) => {
event.preventDefault();
const primaryContentContainer = document.getElementById(pageId);
primaryContentContainer && primaryContentContainer.focus();
}} href={`#${pageId}`}>
<SkipToContent
onClick={(event) => {
event.preventDefault();
const primaryContentContainer = document.getElementById(pageId);
primaryContentContainer && primaryContentContainer.focus();
}}
href={`#${pageId}`}
>
Skip to Content
</SkipToContent>
);
return (
<Page
mainContainerId={pageId}
header={Header}
sidebar={sidebarOpen && Sidebar}
skipToContent={PageSkipToContent}>
<Page mainContainerId={pageId} header={Header} sidebar={sidebarOpen && Sidebar} skipToContent={PageSkipToContent}>
{children}
</Page>
);
Expand Down
53 changes: 53 additions & 0 deletions src/app/Dashboard/CardDetailsDemo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import React from 'react';
import {
Card,
CardBody,
CardFooter,
CardTitle,
DescriptionList,
DescriptionListDescription,
DescriptionListGroup,
DescriptionListTerm,
Divider,
Title,
} from '@patternfly/react-core';

export const CardDetailsDemo: React.FunctionComponent = () => (
<Card>
<CardTitle>
<Title headingLevel="h4" size="xl">
Details
</Title>
</CardTitle>
<CardBody>
<DescriptionList>
<DescriptionListGroup>
<DescriptionListTerm>Cluster API Address</DescriptionListTerm>
<DescriptionListDescription>
<a href="#">https://api1.devcluster.openshift.com</a>
</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>Cluster ID</DescriptionListTerm>
<DescriptionListDescription>63b97ac1-b850-41d9-8820-239becde9e86</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>Provide</DescriptionListTerm>
<DescriptionListDescription>AWS</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>OpenShift Version</DescriptionListTerm>
<DescriptionListDescription>4.5.0.ci-2020-06-16-015028</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>Update Channel</DescriptionListTerm>
<DescriptionListDescription>stable-4.5</DescriptionListDescription>
</DescriptionListGroup>
</DescriptionList>
</CardBody>
<Divider />
<CardFooter>
<a href="#">View Settings</a>
</CardFooter>
</Card>
);
Loading
Loading