Skip to content

Commit 1087850

Browse files
committed
fix: all feedback incorporated need to insert pngs in overview and empty state
1 parent ae41f60 commit 1087850

11 files changed

Lines changed: 901 additions & 194 deletions

packages/react-core/src/demos/Animations/Animations.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ import { AnimationsStartTourModal } from '@patternfly/react-core/dist/esm/demos/
3232
import { AnimationsEndTourModal } from '@patternfly/react-core/dist/esm/demos/Animations/AnimationsEndTourModal';
3333
import { AnimationsCreateDatabaseForm } from '@patternfly/react-core/dist/esm/demos/Animations/AnimationsCreateDatabaseForm';
3434
import { GuidedTourProvider, useGuidedTour } from '@patternfly/react-core/dist/esm/demos/Animations/GuidedTourContext';
35+
import BoltIcon from '@patternfly/react-icons/dist/esm/icons/bolt-icon';
36+
import { Table, Thead, Tbody, Tr, Th, Td, ExpandableRowContent } from '@patternfly/react-table';
37+
import PendingIcon from '@patternfly/react-icons/dist/esm/icons/pending-icon';
38+
import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
39+
import InfoIcon from '@patternfly/react-icons/dist/esm/icons/info-icon';
40+
import ResourcesFullIcon from '@patternfly/react-icons/dist/esm/icons/resources-full-icon';
41+
import openshiftLogo from '../assets/Summit-collage-depoying-openshift-product-icon-RH.png'
42+
43+
44+
3545

3646
## Demos
3747

packages/react-core/src/demos/Animations/AnimationsCreateDatabaseForm.tsx

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import {
88
FormHelperText,
99
FormAlert,
1010
FormGroupLabelHelp,
11-
FormSelect,
12-
FormSelectOption,
1311
HelperText,
1412
HelperTextItem,
1513
TextInput,
@@ -26,8 +24,6 @@ export const AnimationsCreateDatabaseForm: FunctionComponent<Props> = ({ onClose
2624
// State variables
2725
const [name, setName] = useState('');
2826
const [email, setEmail] = useState('');
29-
const [version, setVersion] = useState('');
30-
const [selectedTimeZone, setSelectedTimeZone] = useState('');
3127
const [password, setPassword] = useState('');
3228
// Submit state variables
3329
const [isSuccess, setIsSuccess] = useState(false);
@@ -43,7 +39,6 @@ export const AnimationsCreateDatabaseForm: FunctionComponent<Props> = ({ onClose
4339
const [isNameValid, setIsNameValid] = useState('default');
4440
const [isPasswordValid, setIsPasswordValid] = useState('default');
4541
const [isEmailValid, setIsEmailValid] = useState('default');
46-
const [isTimeZoneValid, setIsTimeZoneValid] = useState('default');
4742

4843
const handleNameChange = (_event: React.FormEvent<HTMLInputElement>, name: string) => {
4944
setName(name);
@@ -53,22 +48,13 @@ export const AnimationsCreateDatabaseForm: FunctionComponent<Props> = ({ onClose
5348
setEmail(email);
5449
};
5550

56-
const handleVersionChange = (_event: React.FormEvent<HTMLInputElement>, version: string) => {
57-
setVersion(version);
58-
};
59-
6051
const handlePasswordChange = (_event: React.FormEvent<HTMLInputElement>, password: string) => {
6152
setPassword(password);
6253
};
6354

64-
const handleTimeZoneChange = (event: React.FormEvent<HTMLSelectElement>, value: string) => {
65-
setSelectedTimeZone(value);
66-
};
67-
6855
const validateName = (value: string) => /^[a-z0-9-]+$/.test(value) && value.length > 0;
6956
const validatePassword = (value: string) => value.length >= 12 && /[0-9]/.test(value) && /[A-Z]/.test(value);
7057
const validateEmail = (value: string) => value.includes('@');
71-
const validateTimeZone = (value: string) => value !== '';
7258

7359
const handleNameBlur = () => {
7460
setIsNameValid(validateName(name) ? 'success' : 'error');
@@ -82,23 +68,16 @@ export const AnimationsCreateDatabaseForm: FunctionComponent<Props> = ({ onClose
8268
setIsEmailValid(validateEmail(email) ? 'success' : 'error');
8369
};
8470

85-
const handleTimeZoneBlur = () => {
86-
setIsTimeZoneValid(validateTimeZone(selectedTimeZone) ? 'success' : 'error');
87-
};
88-
8971
const handleSubmit = () => {
9072
const isNameCurrentValid = validateName(name);
9173
const isPasswordCurrentValid = validatePassword(password);
9274
const isEmailCurrentValid = validateEmail(email);
93-
const isTimeZoneCurrentValid = validateTimeZone(selectedTimeZone);
9475

9576
setIsNameValid(isNameCurrentValid ? 'success' : 'error');
9677
setIsPasswordValid(isPasswordCurrentValid ? 'success' : 'error');
9778
setIsEmailValid(isEmailCurrentValid ? 'success' : 'error');
98-
setIsTimeZoneValid(isTimeZoneCurrentValid ? 'success' : 'error');
9979

100-
const allFieldsValid =
101-
isNameCurrentValid && isPasswordCurrentValid && isEmailCurrentValid && isTimeZoneCurrentValid;
80+
const allFieldsValid = isNameCurrentValid && isPasswordCurrentValid && isEmailCurrentValid;
10281

10382
setActionCompleted(true);
10483
setIsSuccess(allFieldsValid);
@@ -108,7 +87,6 @@ export const AnimationsCreateDatabaseForm: FunctionComponent<Props> = ({ onClose
10887
setIsNameValid('default');
10988
setIsPasswordValid('default');
11089
setIsEmailValid('default');
111-
setIsTimeZoneValid('default');
11290
};
11391

11492
return renderTourStepElement(
@@ -190,38 +168,6 @@ export const AnimationsCreateDatabaseForm: FunctionComponent<Props> = ({ onClose
190168
</FormHelperText>
191169
)}
192170
</FormGroup>
193-
<FormGroup label="Database version" fieldId="simple-form-version-01">
194-
<TextInput
195-
type="text"
196-
id="simple-form-version-01"
197-
name="simple-form-version-01"
198-
placeholder="e.g. 12c"
199-
value={version}
200-
onChange={handleVersionChange}
201-
/>
202-
</FormGroup>
203-
<FormGroup isRequired label="Time zone" fieldId="timezone-select">
204-
<FormSelect
205-
id="timezone-select"
206-
value={selectedTimeZone}
207-
onChange={handleTimeZoneChange}
208-
aria-label="Select time zone"
209-
onBlur={handleTimeZoneBlur}
210-
validated={isTimeZoneValid as validationStatus}
211-
>
212-
<FormSelectOption isPlaceholder value="" label="Select a time zone" />
213-
<FormSelectOption value="Eastern" label="Eastern" />
214-
<FormSelectOption value="Central" label="Central" />
215-
<FormSelectOption value="Pacific" label="Pacific" />
216-
</FormSelect>
217-
{isTimeZoneValid === 'error' && (
218-
<FormHelperText>
219-
<HelperText>
220-
<HelperTextItem variant={isTimeZoneValid as validationStatus}>Please select a time zone</HelperTextItem>
221-
</HelperText>
222-
</FormHelperText>
223-
)}
224-
</FormGroup>
225171
<FormGroup label="Admin password" isRequired fieldId="simple-form-password-01">
226172
<TextInput
227173
isRequired

packages/react-core/src/demos/Animations/AnimationsOverview.tsx

Lines changed: 64 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Fragment, FunctionComponent } from 'react';
1+
import { Fragment, FunctionComponent, useState } from 'react';
22
import {
33
Button,
44
Content,
@@ -15,148 +15,107 @@ import {
1515
Divider,
1616
Grid,
1717
GridItem,
18-
Icon,
19-
Label,
2018
PageSection,
2119
Title
2220
} from '../..';
2321
import ArrowRightIcon from '@patternfly/react-icons/dist/esm/icons/arrow-right-icon';
24-
import PowerOffIcon from '@patternfly/react-icons/dist/esm/icons/power-off-icon';
25-
import PortIcon from '@patternfly/react-icons/dist/esm/icons/port-icon';
26-
import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
27-
import AutomationIcon from '@patternfly/react-icons/dist/esm/icons/automation-icon';
22+
import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
2823
import MultiContentCard from '@patternfly/react-component-groups/dist/dynamic/MultiContentCard';
29-
import AnimationsOverviewCardStatus from './AnimationsOverviewCardStatus';
30-
import AnimationsOverviewEventsCard from './AnimationsOverviewEventsCard';
24+
import AnimationsOverviewClusterInventory from './AnimationsOverviewClusterInventory';
25+
import AnimationsOverviewNetworkActivity from './AnimationsOverviewNetworkActivity';
26+
import AnimationsOverviewStorage from './AnimationsOverviewStorage';
27+
import AnimationsOverviewMemoryUtilization from './AnimationsOverviewMemoryUtilization';
28+
import openshiftLogo from './assets/Summit-collage-depoying-openshift-product-icon-RH.png';
29+
30+
interface AnimationsOverviewProps {
31+
recentActivityCard?: React.ReactNode;
32+
}
33+
34+
export const AnimationsOverview: FunctionComponent<AnimationsOverviewProps> = ({ recentActivityCard }) => {
35+
const [displayMultiContentCard, setDisplayMultiContentCard] = useState(true);
36+
37+
const handleCloseMultiContentCard = () => {
38+
setDisplayMultiContentCard(false);
39+
};
3140

32-
export const AnimationsOverview: FunctionComponent = () => {
3341
const cards = [
3442
// Card 1: Performance
3543
<Card isFullHeight isPlain key="card-1">
3644
<CardHeader>
37-
<Content>
38-
<Label variant="outline" color="blue" icon={<PortIcon />}>
39-
Performance
40-
</Label>
41-
</Content>
45+
<Content component={ContentVariants.h3}>Animations</Content>
4246
</CardHeader>
4347
<CardBody>
4448
<Content component={ContentVariants.p} className="pf-v6-u-mb-sm">
45-
Upgrade your kernel version to remediate ntpd time sync issues, kernel panics, network instabilities and
46-
issues with system performance
47-
</Content>
48-
<Content className="pf-v6-u-mb-md">
49-
<a href="#">378 systems</a>
50-
</Content>
51-
<Content className="pf-v6-u-mb-md">
52-
<Label status="danger" variant="outline">
53-
Incident
54-
</Label>
55-
</Content>
56-
<Content className="pf-v6-u-mb-md">
57-
<Icon size="md" isInline>
58-
<PowerOffIcon />
59-
</Icon>
60-
<span>
61-
{' '}
62-
System reboot <b>is not</b> required
63-
</span>
49+
Animations are a new way to interact with your data. They are a way to visualize your data in a way that is
50+
easy to understand and use.
6451
</Content>
6552
</CardBody>
6653
<CardFooter>
6754
<Button variant="link" icon={<ArrowRightIcon />} iconPosition="end" isInline>
68-
View pathway
55+
They're everywhere
6956
</Button>
7057
</CardFooter>
7158
</Card>,
7259
// Card 2: Stability
7360
<Card isFullHeight isPlain key="card-2">
7461
<CardHeader>
75-
<Content>
76-
<Label variant="outline" color="blue" icon={<CubeIcon />}>
77-
Stability
78-
</Label>
79-
</Content>
62+
<Content component={ContentVariants.h3}>Network security</Content>
8063
</CardHeader>
8164
<CardBody>
8265
<Content component={ContentVariants.p} className="pf-v6-u-mb-sm">
83-
Adjust your networking configuration to get ahead of network performance degradations and packet losses.
84-
</Content>
85-
<Content className="pf-v6-u-mb-md">
86-
<a href="#">211 systems</a>
87-
</Content>
88-
<Content className="pf-v6-u-mb-md">
89-
<Label status="danger" variant="outline">
90-
Incident
91-
</Label>
92-
</Content>
93-
<Content className="pf-v6-u-mb-md">
94-
<Icon size="md" isInline>
95-
<PowerOffIcon />
96-
</Icon>
97-
<span>
98-
{' '}
99-
System reboot <b>is</b> required
100-
</span>
66+
Network security is a critical part of any organization's security posture.
10167
</Content>
10268
</CardBody>
10369
<CardFooter>
10470
<Button variant="link" icon={<ArrowRightIcon />} iconPosition="end" isInline>
105-
View pathway
71+
Security updates
10672
</Button>
10773
</CardFooter>
10874
</Card>,
10975
// Card 3: Availability
11076
<Card isFullHeight isPlain key="card-3">
11177
<CardHeader>
112-
<Content>
113-
<Label variant="outline" color="blue" icon={<AutomationIcon />}>
114-
Availability
115-
</Label>
116-
</Content>
78+
<Content component={ContentVariants.h3}>Cluster alerting</Content>
11779
</CardHeader>
11880
<CardBody>
11981
<Content component={ContentVariants.p} className="pf-v6-u-mb-sm">
120-
Fine tune your Oracle DB configuration to improve database performance and avoid process failure
121-
</Content>
122-
<Content className="pf-v6-u-mb-md">
123-
<a href="#">166 systems</a>
124-
</Content>
125-
<Content className="pf-v6-u-mb-md">
126-
<Label status="danger" variant="outline">
127-
Incident
128-
</Label>
129-
</Content>
130-
<Content className="pf-v6-u-mb-md">
131-
<Icon size="md" isInline>
132-
<PowerOffIcon />
133-
</Icon>
134-
<span>
135-
{' '}
136-
System reboot <b>is not</b> required
137-
</span>
82+
Cluster alerting is a critical part of any organization's security posture.
13883
</Content>
13984
</CardBody>
14085
<CardFooter>
14186
<Button variant="link" icon={<ArrowRightIcon />} iconPosition="end" isInline>
142-
View pathway
87+
View logs
14388
</Button>
14489
</CardFooter>
90+
</Card>,
91+
// Card 4: Image
92+
<Card isFullHeight isPlain key="card-4">
93+
<CardBody>
94+
<img src={openshiftLogo} alt="OpenShift Logo" />
95+
</CardBody>
14596
</Card>
14697
];
14798

14899
return (
149100
<Fragment>
150-
<PageSection id="overview">
151-
<MultiContentCard isExpandable={true} cards={cards} toggleText="Improve recommended pathways" />
152-
</PageSection>
101+
{displayMultiContentCard && (
102+
<PageSection id="overview">
103+
<MultiContentCard
104+
isExpandable={true}
105+
withDividers
106+
cards={cards}
107+
toggleText="What's new in OpenShift?"
108+
actions={<Button icon={<TimesIcon />} variant="plain" onClick={handleCloseMultiContentCard} />}
109+
/>
110+
</PageSection>
111+
)}
153112
<PageSection aria-label="Detail status events">
154-
<Grid hasGutter xl2={4}>
155-
<GridItem>
156-
<Card>
113+
<Grid hasGutter>
114+
<GridItem span={3} rowSpan={4}>
115+
<Card isFullHeight>
157116
<CardTitle>
158117
<Title headingLevel="h4" size="xl">
159-
Details
118+
Cluster Details
160119
</Title>
161120
</CardTitle>
162121
<CardBody>
@@ -191,12 +150,23 @@ export const AnimationsOverview: FunctionComponent = () => {
191150
</CardFooter>
192151
</Card>
193152
</GridItem>
194-
<GridItem>
195-
<AnimationsOverviewCardStatus />
153+
<GridItem span={3} rowSpan={2}>
154+
<AnimationsOverviewClusterInventory />
155+
</GridItem>
156+
<GridItem span={2} rowSpan={2}>
157+
<AnimationsOverviewStorage />
158+
</GridItem>
159+
<GridItem span={4} rowSpan={2}>
160+
<AnimationsOverviewMemoryUtilization />
196161
</GridItem>
197-
<GridItem>
198-
<AnimationsOverviewEventsCard />
162+
<GridItem span={4} rowSpan={2}>
163+
<AnimationsOverviewNetworkActivity />
199164
</GridItem>
165+
{recentActivityCard && (
166+
<GridItem span={5} rowSpan={2}>
167+
{recentActivityCard}
168+
</GridItem>
169+
)}
200170
</Grid>
201171
</PageSection>
202172
</Fragment>

0 commit comments

Comments
 (0)