Skip to content

Commit d354905

Browse files
authored
APPDUX-228: Fixes to incorporate latest PF4 breaking change release (#596)
* fixes to incorporate latest pf4 * update to latest PF versions * style changes from code review
1 parent bab3d79 commit d354905

File tree

14 files changed

+266
-1102
lines changed

14 files changed

+266
-1102
lines changed

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
{
22
"name": "integreatly-web-app",
3-
"version": "2.26.0",
3+
"version": "2.26.1",
44
"private": true,
55
"proxy": "http://localhost:5001/",
66
"dependencies": {
77
"@fortawesome/fontawesome-free": "5.7.2",
8-
"@patternfly/patternfly": "2.43.1",
9-
"@patternfly/react-core": "3.124.1",
10-
"@patternfly/react-icons": "^3.14.23",
8+
"@patternfly/patternfly": "4.16.7",
9+
"@patternfly/react-core": "4.23.1",
1110
"asciidoctor.js": "1.5.7",
1211
"axios": "^0.19.0",
1312
"body-parser": "^1.18.3",

src/components/aboutModal/__tests__/__snapshots__/aboutModal.test.js.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ exports[`AboutModal Component should render a non-connected component: hidden mo
2929
containerInfo={<div />}
3030
>
3131
<AboutModalContainer
32-
ariaDescribedById="pf-about-modal-content-0"
33-
ariaLabelledbyId="pf-about-modal-title-0"
32+
aboutModalBoxContentId="pf-about-modal-content-0"
33+
aboutModalBoxHeaderId="pf-about-modal-title-0"
3434
backgroundImageSrc="PF4DownstreamBG.svg"
3535
brandImageAlt="Red Hat logo"
3636
brandImageSrc=""
@@ -75,8 +75,8 @@ exports[`AboutModal Component should render a non-connected component: show moda
7575
containerInfo={<div />}
7676
>
7777
<AboutModalContainer
78-
ariaDescribedById="pf-about-modal-content-0"
79-
ariaLabelledbyId="pf-about-modal-title-0"
78+
aboutModalBoxContentId="pf-about-modal-content-0"
79+
aboutModalBoxHeaderId="pf-about-modal-title-0"
8080
backgroundImageSrc="PF4DownstreamBG.svg"
8181
brandImageAlt="Red Hat logo"
8282
brandImageSrc=""

src/components/breadcrumb/__tests__/__snapshots__/breadcrumb.test.js.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`Breadcrumb component should handle home clicked 1`] = `
4-
<Component
4+
<Breadcrumb
55
aria-label="Breadcrumb"
66
>
77
<BreadcrumbItem
@@ -22,11 +22,11 @@ exports[`Breadcrumb component should handle home clicked 1`] = `
2222
>
2323
Task 1 of 3
2424
</BreadcrumbItem>
25-
</Component>
25+
</Breadcrumb>
2626
`;
2727

2828
exports[`Breadcrumb component should render breadcrumb with props 1`] = `
29-
<Component
29+
<Breadcrumb
3030
aria-label="Breadcrumb"
3131
>
3232
<BreadcrumbItem
@@ -47,11 +47,11 @@ exports[`Breadcrumb component should render breadcrumb with props 1`] = `
4747
>
4848
Task 1 of 3
4949
</BreadcrumbItem>
50-
</Component>
50+
</Breadcrumb>
5151
`;
5252

5353
exports[`Breadcrumb component should render default breadcrumb 1`] = `
54-
<Component
54+
<Breadcrumb
5555
aria-label="Breadcrumb"
5656
>
5757
<BreadcrumbItem
@@ -61,5 +61,5 @@ exports[`Breadcrumb component should render default breadcrumb 1`] = `
6161
>
6262
Home
6363
</BreadcrumbItem>
64-
</Component>
64+
</Breadcrumb>
6565
`;

src/components/masthead/masthead.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import {
88
DropdownItem,
99
DropdownSeparator,
1010
PageHeader,
11-
Toolbar,
12-
ToolbarGroup,
13-
ToolbarItem,
11+
PageHeaderTools,
12+
PageHeaderToolsGroup,
13+
PageHeaderToolsItem,
1414
Tooltip,
1515
TooltipPosition
1616
} from '@patternfly/react-core';
@@ -239,9 +239,9 @@ class Masthead extends React.Component {
239239

240240
const MastheadToolbar = (
241241
<React.Fragment>
242-
<Toolbar>
243-
<ToolbarGroup className={css(accessibleStyles.screenReader, accessibleStyles.visibleOnLg)}>
244-
<ToolbarItem className={css(accessibleStyles.screenReader, accessibleStyles.visibleOnMd)}>
242+
<PageHeaderTools>
243+
<PageHeaderToolsGroup className={css(accessibleStyles.screenReader, accessibleStyles.visibleOnLg)}>
244+
<PageHeaderToolsItem className={css(accessibleStyles.screenReader, accessibleStyles.visibleOnMd)}>
245245
{isAdmin ? (
246246
<Button
247247
className="pf-c-button pf-m-plain"
@@ -263,16 +263,16 @@ class Masthead extends React.Component {
263263
</Button>
264264
</Tooltip>
265265
)}
266-
</ToolbarItem>
267-
<ToolbarItem className={css(accessibleStyles.screenReader, accessibleStyles.visibleOnMd)}>
266+
</PageHeaderToolsItem>
267+
<PageHeaderToolsItem className={css(accessibleStyles.screenReader, accessibleStyles.visibleOnMd)}>
268268
<Dropdown
269269
isPlain
270270
position="right"
271271
onSelect={this.onHelpDropdownSelect}
272272
isOpen={isHelpDropdownOpen}
273273
toggle={
274274
<DropdownToggle
275-
iconComponent={null}
275+
toggleIndicator={null}
276276
onToggle={this.onHelpDropdownToggle}
277277
aria-label="Link to Help page"
278278
>
@@ -282,10 +282,10 @@ class Masthead extends React.Component {
282282
autoFocus={false}
283283
dropdownItems={this.getDeveloperResources(gsUrl, riUrl, csUrl)}
284284
/>
285-
</ToolbarItem>
286-
</ToolbarGroup>
287-
<ToolbarGroup className={css(accessibleStyles.screenReader, accessibleStyles.visibleOnSm)}>
288-
<ToolbarItem className={css(accessibleStyles.screenReader, accessibleStyles.visibleOnSm)}>
285+
</PageHeaderToolsItem>
286+
</PageHeaderToolsGroup>
287+
<PageHeaderToolsGroup className={css(accessibleStyles.screenReader, accessibleStyles.visibleOnSm)}>
288+
<PageHeaderToolsItem className={css(accessibleStyles.screenReader, accessibleStyles.visibleOnSm)}>
289289
<Dropdown
290290
className="pf-c-dropdown pf-c-dropdown--user"
291291
isPlain
@@ -300,9 +300,9 @@ class Masthead extends React.Component {
300300
autoFocus={false}
301301
dropdownItems={this.getUserMenuResources(isAdmin)}
302302
/>
303-
</ToolbarItem>
304-
</ToolbarGroup>
305-
</Toolbar>
303+
</PageHeaderToolsItem>
304+
</PageHeaderToolsGroup>
305+
</PageHeaderTools>
306306
{showAboutModal && <AboutModal isOpen={showAboutModal} closeAboutModal={this.closeAboutModal} />}
307307
</React.Fragment>
308308
);
@@ -311,7 +311,7 @@ class Masthead extends React.Component {
311311
<PageHeader
312312
logo={<Brand src={this.getLogo()} alt="Red Hat Solution Explorer" />}
313313
logoProps={logoProps}
314-
toolbar={MastheadToolbar}
314+
headerTools={MastheadToolbar}
315315
/>
316316
);
317317
}

src/components/tutorialCard/tutorialCard.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import React from 'react';
22
import {
33
Button,
44
Card,
5-
CardHeader,
65
CardBody,
76
CardFooter,
7+
CardTitle,
88
Progress,
99
ProgressMeasureLocation
1010
} from '@patternfly/react-core';
@@ -25,9 +25,9 @@ const TutorialCard = props => (
2525
props.history.push(props.getStartedLink);
2626
}}
2727
>
28-
<CardHeader>
28+
<CardTitle>
2929
<h3 className="pf-c-title pf-m-xl">{props.title}</h3>
30-
</CardHeader>
30+
</CardTitle>
3131
<CardBody>{props.children}</CardBody>
3232
<CardFooter>
3333
<div className="integr8ly-c-card__info pf-u-w-100">

src/components/tutorialDashboard/tutorialDashboard.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,7 @@ const TutorialDashboard = props => {
128128
</div>
129129
);
130130
htmlSnippet.push(
131-
<Gallery
132-
gutter="md"
133-
key={`gallery-${allRepos[i]}`}
134-
className="pf-u-mt-sm pf-u-mb-md integr8ly-gallery-override"
135-
>
131+
<Gallery hasGutter key={`gallery-${allRepos[i]}`} className="pf-u-mt-sm pf-u-mb-md integr8ly-gallery-override">
136132
{cards}
137133
</Gallery>
138134
);

src/pages/devResources/devResources.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import {
55
Grid,
66
GridItem,
77
Card,
8-
CardHeader,
98
CardBody,
109
CardFooter,
10+
CardTitle,
1111
ClipboardCopy,
1212
Page,
1313
PageSection,
@@ -78,16 +78,16 @@ class DevResourcesPage extends React.Component {
7878
<RoutedConnectedMasthead />
7979
<PageSection variant={PageSectionVariants.default}>
8080
<Breadcrumb homeClickedCallback={() => {}} threadName="Developer resources" />
81-
<Grid gutter="md">
81+
<Grid hasGutter>
8282
<GridItem mdOffset={4} md={12}>
8383
<h1 id="main-content" className="pf-c-title pf-m-2xl pf-u-mt-sm">
8484
Developer resources
8585
</h1>
8686
<Card className="pf-u-w-50 pf-u-my-xl">
8787
<div className="integr8ly-dev-resources-content">
88-
<CardHeader>
88+
<CardTitle>
8989
<h2 className="pf-m-lg integr8ly-dev-resources-title">Cluster URLs</h2>
90-
</CardHeader>
90+
</CardTitle>
9191
<CardBody>
9292
<h4 className="pf-m-lg integr8ly-dev-resources-resource-title">
9393
Logging

src/pages/error/error.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ErrorPage extends React.Component {
3535
<Bullseye>
3636
<EmptyState variant={EmptyStateVariant.full}>
3737
<img src={errorImage} alt="" className="integr8ly-error-image pf-u-mb-2xl" />
38-
<Title id="main-content" size="lg">
38+
<Title headingLevel="h2" id="main-content" size="lg">
3939
Error 404
4040
</Title>
4141
<EmptyStateBody>Requested page not found:</EmptyStateBody>

src/pages/landing/landingPage.js

Lines changed: 62 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import PropTypes from 'prop-types';
3-
import { Grid, GridItem, Page, PageSection, PageSectionVariants, Tabs, Tab } from '@patternfly/react-core';
3+
import { Grid, GridItem, Page, PageSection, PageSectionVariants, Tabs, Tab, TabContent } from '@patternfly/react-core';
44
import { noop } from '../../common/helpers';
55
import TutorialDashboard from '../../components/tutorialDashboard/tutorialDashboard';
66
import InstalledAppsView from '../../components/installedAppsView/InstalledAppsView';
@@ -85,55 +85,76 @@ class LandingPage extends React.Component {
8585
const { walkthroughServices, middlewareServices, user } = this.props;
8686
const launchFn = isOpenShift4() ? this.handleServiceLaunchV4.bind(this) : this.handleServiceLaunch.bind(this);
8787
const openshiftHost = getOpenshiftHost(middlewareServices);
88+
this.contentRef1 = React.createRef();
89+
this.contentRef2 = React.createRef();
8890

8991
return (
90-
<React.Fragment>
91-
<Page className="pf-u-h-100vh" onLoad={this.handleLoad}>
92-
<RoutedConnectedMasthead currentUserName={this.state.currentUserName} />
93-
<PageSection variant={PageSectionVariants.light} className="pf-u-py-0 pf-u-pl-lg pf-u-pr-0">
94-
<h1 className="pf-c-title pf-m-4xl pf-c-landing__heading">Welcome to the Solution Explorer</h1>
95-
<p className="pf-c-landing__content">
96-
Quickly access consoles for all your Red Hat managed services, and learn how to easily implement
97-
integrations with Solution Pattern examples.
98-
</p>
99-
</PageSection>
92+
<Page className="pf-u-h-100vh" onLoad={this.handleLoad}>
93+
<RoutedConnectedMasthead currentUserName={this.state.currentUserName} />
94+
<PageSection variant={PageSectionVariants.light} className="pf-u-py-0 pf-u-pl-lg pf-u-pr-0">
95+
<h1 className="pf-c-title pf-m-4xl pf-c-landing__heading">Welcome to the Solution Explorer</h1>
96+
<p className="pf-c-landing__content">
97+
Quickly access consoles for all your Red Hat managed services, and learn how to easily implement
98+
integrations with Solution Pattern examples.
99+
</p>
100100
<Tabs activeKey={this.state.activeTabKey} onSelect={this.handleTabClick}>
101-
<Tab id="servicesTab" eventKey={0} title="All services" tabContentId="servicesTabSection">
102-
<PageSection className="pf-u-py-0 pf-u-pl-lg pf-u-pr-0">
103-
<div>
104-
<Grid>
105-
<GridItem sm={12} md={12}>
106-
<InstalledAppsView
107-
apps={Object.values(middlewareServices.data)}
108-
username={this.state.currentUserName}
109-
openshiftHost={openshiftHost}
110-
enableLaunch={!window.OPENSHIFT_CONFIG.mockData}
111-
showUnready={middlewareServices.customServices.showUnreadyServices || DISPLAY_SERVICES}
112-
customApps={middlewareServices.customServices.services}
113-
handleLaunch={svcName => launchFn(svcName)}
114-
/>
115-
</GridItem>
116-
</Grid>
117-
</div>
118-
</PageSection>
119-
</Tab>
101+
<Tab
102+
id="servicesTab"
103+
eventKey={0}
104+
title="All services"
105+
tabContentId="servicesTabSection"
106+
tabContentRef={this.contentRef1}
107+
/>
120108
<Tab
121109
id="solutionPatternsTab"
122110
eventKey={1}
123111
title="All Solution Patterns"
124112
tabContentId="solutionPatternsTabSection"
125-
>
126-
<PageSection className="pf-u-py-0 pf-u-pl-lg pf-u-pr-0">
127-
<Grid gutter="md">
128-
<GridItem sm={12} md={12}>
129-
<TutorialDashboard userProgress={user.userProgress} walkthroughs={walkthroughServices.data} />
130-
</GridItem>
131-
</Grid>
132-
</PageSection>
133-
</Tab>
113+
tabContentRef={this.contentRef2}
114+
/>
134115
</Tabs>
135-
</Page>
136-
</React.Fragment>
116+
</PageSection>
117+
<PageSection className="pf-u-py-0 pf-u-pl-lg pf-u-pr-lg">
118+
<React.Fragment>
119+
<TabContent
120+
className="integr8ly__tab-content"
121+
eventKey={0}
122+
id="refTab1Section"
123+
ref={this.contentRef1}
124+
aria-label="Tab item 1"
125+
>
126+
<Grid>
127+
<GridItem sm={12} md={12}>
128+
<InstalledAppsView
129+
apps={Object.values(middlewareServices.data)}
130+
username={this.state.currentUserName}
131+
openshiftHost={openshiftHost}
132+
enableLaunch={!window.OPENSHIFT_CONFIG.mockData}
133+
showUnready={middlewareServices.customServices.showUnreadyServices || DISPLAY_SERVICES}
134+
customApps={middlewareServices.customServices.services}
135+
handleLaunch={svcName => launchFn(svcName)}
136+
/>
137+
</GridItem>
138+
</Grid>
139+
</TabContent>
140+
141+
<TabContent
142+
className="integr8ly__tab-content"
143+
eventKey={1}
144+
id="refTab2Section"
145+
ref={this.contentRef2}
146+
aria-label="Tab item 2"
147+
hidden
148+
>
149+
<Grid hasGutter>
150+
<GridItem sm={12} md={12}>
151+
<TutorialDashboard userProgress={user.userProgress} walkthroughs={walkthroughServices.data} />
152+
</GridItem>
153+
</Grid>
154+
</TabContent>
155+
</React.Fragment>
156+
</PageSection>
157+
</Page>
137158
);
138159
}
139160
}

0 commit comments

Comments
 (0)