Skip to content

Commit a6b4f71

Browse files
rhamiltologonoff
andauthored
CONSOLE-4492,CONSOLE-4514: Align spacing of page elements with PatternFly and remove border after PageHeading (#14875)
* Replace `co-m-page__body` with PatternFly's `Flex` component * Use PatternFly's `PageBreadcrumb` * Replace `div#app-content` with PatternFly's `Flex` component * Replace `co-m-pane__body` and `co-m-nav-title` with PatternFly's `PageSection` component * Update docs * Plugin fix * Update comment to include link to PatternFly bug * Use `isFilled` prop instead of `pf-v6-u-h-100` * Remove unnecessary nodes * Fix regression where actions can be misaligned * Fix Project Access content layout * Update dynamic-demo-plugin/src/components/ListPage.tsx Co-authored-by: logonoff <[email protected]> * Update Cypress to latest * CONSOLE-4514: remove border after PageHeading, above HorizontalNav --------- Co-authored-by: logonoff <[email protected]>
1 parent 3bc8cb9 commit a6b4f71

File tree

229 files changed

+2205
-1992
lines changed

Some content is hidden

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

229 files changed

+2205
-1992
lines changed

dynamic-demo-plugin/src/components/ListPage.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type PodsTableProps = {
2626
};
2727

2828
const PodsTable: React.FC<PodsTableProps> = ({ data, unfilteredData, loaded, loadError }) => {
29-
const { t } = useTranslation("plugin__console-demo-plugin");
29+
const { t } = useTranslation('plugin__console-demo-plugin');
3030

3131
const columns: TableColumn<K8sResourceCommon>[] = [
3232
{
@@ -96,7 +96,7 @@ const ListPage = () => {
9696
isList: true,
9797
namespaced: true,
9898
});
99-
const { t } = useTranslation("plugin__console-demo-plugin");
99+
const { t } = useTranslation('plugin__console-demo-plugin');
100100

101101
const [data, filteredData, onFilterChange] = useListPageFilter(pods, filters, {
102102
name: { selected: ['openshift'] },
@@ -124,7 +124,9 @@ const ListPage = () => {
124124
</ListPageBody>
125125
<ListPageBody>
126126
<p>{t('Sample ResourceIcon')}</p>
127-
<ResourceIcon kind="Pod" />
127+
<p>
128+
<ResourceIcon kind="Pod" />
129+
</p>
128130
</ListPageBody>
129131
</>
130132
);

frontend/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@
263263
"comment-json": "4.x",
264264
"copy-webpack-plugin": "^12.0.2",
265265
"css-loader": "^5.2.7",
266-
"cypress": "^13.10.0",
266+
"cypress": "^14.2.1",
267267
"cypress-axe": "^1.5.0",
268268
"cypress-cucumber-preprocessor": "latest",
269269
"cypress-file-upload": "^5.0.8",

frontend/packages/console-app/src/components/cluster-configuration/ClusterConfigurationPage.scss

-10
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,6 @@
33
flex-direction: column;
44
min-height: 100%;
55

6-
// Fix missing white background color above the header.
7-
.ocs-page-layout__title {
8-
margin-top: 0;
9-
padding-top: var(--pf-t--global--spacer--lg);
10-
}
11-
12-
.ocs-page-layout__content {
13-
display: inline;
14-
}
15-
166
.pf-v6-c-empty-state {
177
background-color: var(--pf-t--global--background--color--primary--default);
188
flex: 1;

frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ import {
5454
GreenCheckCircleIcon,
5555
YellowExclamationTriangleIcon,
5656
} from '@console/shared';
57+
import PaneBody from '@console/shared/src/components/layout/PaneBody';
5758
import {
5859
boolComparator,
5960
localeComparator,
@@ -226,7 +227,7 @@ const ConsolePluginsTable: React.FC<ConsolePluginsTableProps> = ({ obj, rows, lo
226227
return !loaded ? (
227228
<LoadingBox />
228229
) : (
229-
<div className="co-m-pane__body">
230+
<PaneBody>
230231
{obj.spec?.managementState === 'Unmanaged' && (
231232
<Alert
232233
className="co-alert"
@@ -290,7 +291,7 @@ const ConsolePluginsTable: React.FC<ConsolePluginsTableProps> = ({ obj, rows, lo
290291
) : (
291292
<EmptyBox label={t('console-app~Console plugins')} />
292293
)}
293-
</div>
294+
</PaneBody>
294295
);
295296
};
296297

frontend/packages/console-app/src/components/console-operator/ConsolePluginManifestPage.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as React from 'react';
22
import { useTranslation } from 'react-i18next';
33
import { PageComponentProps, CopyToClipboard, EmptyBox } from '@console/internal/components/utils';
44
import { usePluginStore } from '@console/plugin-sdk/src/api/usePluginStore';
5+
import PaneBody from '@console/shared/src/components/layout/PaneBody';
56

67
export const ConsolePluginManifestPage: React.FC<PageComponentProps> = ({ obj }) => {
78
const { t } = useTranslation();
@@ -14,12 +15,12 @@ export const ConsolePluginManifestPage: React.FC<PageComponentProps> = ({ obj })
1415
]);
1516

1617
return (
17-
<div className="co-m-pane__body">
18+
<PaneBody>
1819
{pluginManifest ? (
1920
<CopyToClipboard value={JSON.stringify(pluginManifest, null, 2)} />
2021
) : (
2122
<EmptyBox label={t('console-app~Plugin manifest')} />
2223
)}
23-
</div>
24+
</PaneBody>
2425
);
2526
};

frontend/packages/console-app/src/components/network-policies/network-policy-form.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { MultiNetworkPolicyModel, NetworkPolicyModel } from '@console/internal/m
2828
import { k8sCreate, NetworkPolicyKind } from '@console/internal/module/k8s';
2929
import { useClusterNetworkFeatures } from '@console/internal/module/k8s/network';
3030
import { FLAGS, YellowExclamationTriangleIcon } from '@console/shared';
31+
import PaneBody from '@console/shared/src/components/layout/PaneBody';
3132
import { useFlag } from '@console/shared/src/hooks/flag';
3233
import NADsSelector from './NADsSelector';
3334
import { NetworkPolicyConditionalSelector } from './network-policy-conditional-selector';
@@ -81,7 +82,7 @@ export const NetworkPolicyForm: React.FC<NetworkPolicyFormProps> = ({ formData,
8182
// Note, this case is not expected to happen. Validity of the network policy for form should have been checked prior to showing this form.
8283
// When used with the SyncedEditor, an error is thrown when the data is invalid, that should prevent the user from opening the form with invalid data, hence not running into this conditional block.
8384
return (
84-
<div className="co-m-pane__body">
85+
<PaneBody>
8586
<Alert
8687
variant={AlertVariant.danger}
8788
title={t(
@@ -90,7 +91,7 @@ export const NetworkPolicyForm: React.FC<NetworkPolicyFormProps> = ({ formData,
9091
>
9192
{networkPolicy.error}
9293
</Alert>
93-
</div>
94+
</PaneBody>
9495
);
9596
}
9697

@@ -204,7 +205,7 @@ export const NetworkPolicyForm: React.FC<NetworkPolicyFormProps> = ({ formData,
204205
};
205206

206207
return (
207-
<div className="co-m-pane__body co-m-pane__form">
208+
<PaneBody className="co-m-pane__form">
208209
<Form onSubmit={save} className="co-create-networkpolicy">
209210
{showSDNAlert &&
210211
networkFeaturesLoaded &&
@@ -417,6 +418,6 @@ export const NetworkPolicyForm: React.FC<NetworkPolicyFormProps> = ({ formData,
417418
</ActionGroup>
418419
</ButtonBar>
419420
</Form>
420-
</div>
421+
</PaneBody>
421422
);
422423
};

frontend/packages/console-app/src/components/nodes/NodeDetailsConditions.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next';
44
import { CamelCaseWrap } from '@console/dynamic-plugin-sdk';
55
import { SectionHeading, Timestamp } from '@console/internal/components/utils';
66
import { NodeKind } from '@console/internal/module/k8s';
7+
import PaneBody from '@console/shared/src/components/layout/PaneBody';
78

89
type NodeDetailsConditionsProps = {
910
node: NodeKind;
@@ -12,7 +13,7 @@ type NodeDetailsConditionsProps = {
1213
const NodeDetailsConditions: React.FC<NodeDetailsConditionsProps> = ({ node }) => {
1314
const { t } = useTranslation();
1415
return (
15-
<div className="co-m-pane__body">
16+
<PaneBody>
1617
<SectionHeading text={t('console-app~Node conditions')} />
1718
<div className="co-table-container">
1819
<table className="pf-v6-c-table pf-m-compact pf-m-border-rows">
@@ -46,7 +47,7 @@ const NodeDetailsConditions: React.FC<NodeDetailsConditionsProps> = ({ node }) =
4647
</tbody>
4748
</table>
4849
</div>
49-
</div>
50+
</PaneBody>
5051
);
5152
};
5253

frontend/packages/console-app/src/components/nodes/NodeDetailsImages.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as _ from 'lodash';
33
import { useTranslation } from 'react-i18next';
44
import { SectionHeading, units } from '@console/internal/components/utils';
55
import { NodeKind } from '@console/internal/module/k8s';
6+
import PaneBody from '@console/shared/src/components/layout/PaneBody';
67

78
type NodeDetailsImagesProps = {
89
node: NodeKind;
@@ -12,7 +13,7 @@ const NodeDetailsImages: React.FC<NodeDetailsImagesProps> = ({ node }) => {
1213
const images = _.filter(node.status.images, 'names');
1314
const { t } = useTranslation();
1415
return (
15-
<div className="co-m-pane__body">
16+
<PaneBody>
1617
<SectionHeading text={t('console-app~Images')} />
1718
<div className="co-table-container">
1819
<table className="pf-v6-c-table pf-m-compact pf-m-border-rows">
@@ -38,7 +39,7 @@ const NodeDetailsImages: React.FC<NodeDetailsImagesProps> = ({ node }) => {
3839
</tbody>
3940
</table>
4041
</div>
41-
</div>
42+
</PaneBody>
4243
);
4344
};
4445

frontend/packages/console-app/src/components/nodes/NodeDetailsOverview.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
import { DetailsItem } from '@console/internal/components/utils/details-item';
1717
import { NodeModel, MachineModel } from '@console/internal/models';
1818
import { NodeKind, referenceForModel } from '@console/internal/module/k8s';
19+
import PaneBody from '@console/shared/src/components/layout/PaneBody';
1920
import { useLabelsModal } from '@console/shared/src/hooks/useLabelsModal';
2021
import {
2122
getNodeMachineNameAndNamespace,
@@ -42,7 +43,7 @@ const NodeDetailsOverview: React.FC<NodeDetailsOverviewProps> = ({ node }) => {
4243
const { t } = useTranslation();
4344

4445
return (
45-
<div className="co-m-pane__body">
46+
<PaneBody>
4647
<SectionHeading text={t('console-app~Node details')} />
4748
<div className="row">
4849
<div className="col-md-6 col-xs-12">
@@ -165,7 +166,7 @@ const NodeDetailsOverview: React.FC<NodeDetailsOverviewProps> = ({ node }) => {
165166
</dl>
166167
</div>
167168
</div>
168-
</div>
169+
</PaneBody>
169170
);
170171
};
171172

frontend/packages/console-app/src/components/nodes/NodeLogs.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import {
2929
} from '@console/internal/components/utils';
3030
import { modelFor, NodeKind, resourceURL } from '@console/internal/module/k8s';
3131
import { useUserSettings } from '@console/shared';
32+
import PaneBody from '@console/shared/src/components/layout/PaneBody';
3233
import { LOG_WRAP_LINES_USERSETTINGS_KEY } from '@console/shared/src/constants';
3334
import NodeLogsUnitFilter from './NodeLogsUnitFilter';
3435
import './node-logs.scss';
@@ -348,7 +349,7 @@ const NodeLogs: React.FC<NodeLogsProps> = ({ obj: node }) => {
348349
);
349350

350351
return (
351-
<div className="co-m-pane__body co-m-pane__body--full-height">
352+
<PaneBody fullHeight>
352353
<div className="log-window-wrapper">
353354
{(isLoadingLog || errorExists) && logControls}
354355
{trimmedContent?.length > 0 && !isLoadingLog && (
@@ -403,7 +404,7 @@ const NodeLogs: React.FC<NodeLogsProps> = ({ obj: node }) => {
403404
/>
404405
)}
405406
</div>
406-
</div>
407+
</PaneBody>
407408
);
408409
};
409410

frontend/packages/console-app/src/components/nodes/NodeTerminal.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
LoadingBox,
99
} from '@console/internal/components/utils';
1010
import { NodeKind, PodKind } from '@console/internal/module/k8s';
11+
import PaneBody from '@console/shared/src/components/layout/PaneBody';
1112
import { PodExecLoader } from '../../../../../public/components/pod';
1213
import { ImageStreamTagModel, NamespaceModel, PodModel } from '../../../../../public/models';
1314
import { k8sCreate, k8sGet, k8sKillByName } from '../../../../../public/module/k8s';
@@ -120,9 +121,9 @@ const getDebugPod = async (
120121

121122
const NodeTerminalError: React.FC<NodeTerminalErrorProps> = ({ error }) => {
122123
return (
123-
<div className="co-m-pane__body">
124+
<PaneBody>
124125
<Alert variant="danger" isInline title={error} data-test="node-terminal-error" />
125-
</div>
126+
</PaneBody>
126127
);
127128
};
128129

frontend/packages/console-app/src/components/oauth-config/OAuthConfigDetails.tsx

+28-24
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
} from '@console/internal/components/utils';
1919
import { ClusterOperatorModel } from '@console/internal/models';
2020
import { OAuthKind } from '@console/internal/module/k8s';
21+
import PaneBody from '@console/shared/src/components/layout/PaneBody';
2122
import { IDP_TYPES } from '@console/shared/src/constants/auth';
2223
import { useQueryParams } from '@console/shared/src/hooks/useQueryParams';
2324
import { IdentityProviders } from './IdentityProviders';
@@ -77,7 +78,7 @@ export const OAuthConfigDetails: React.FC<OAuthDetailsProps> = ({ obj }: { obj:
7778

7879
return (
7980
<>
80-
<div className="co-m-pane__body">
81+
<PaneBody>
8182
<SectionHeading text={t('console-app~OAuth details')} />
8283
<div className="row">
8384
<div className="col-md-6">
@@ -91,8 +92,8 @@ export const OAuthConfigDetails: React.FC<OAuthDetailsProps> = ({ obj }: { obj:
9192
</ResourceSummary>
9293
</div>
9394
</div>
94-
</div>
95-
<div className="co-m-pane__body">
95+
</PaneBody>
96+
<PaneBody>
9697
<SectionHeading text={t('console-app~Identity providers')} />
9798
<p className="co-m-pane__explanation co-m-pane__explanation--alt">
9899
{t('console-app~Identity providers determine how users log into the cluster.')}
@@ -114,29 +115,32 @@ export const OAuthConfigDetails: React.FC<OAuthDetailsProps> = ({ obj }: { obj:
114115
</>
115116
</Alert>
116117
)}
117-
<Dropdown
118-
isOpen={isIDPOpen}
119-
onSelect={() => setIDPOpen(false)}
120-
onOpenChange={(isOpen: boolean) => setIDPOpen(isOpen)}
121-
toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
122-
<MenuToggle
123-
id="idp-dropdown"
124-
data-test-id="dropdown-button"
125-
ref={toggleRef}
126-
onClick={() => setIDPOpen(!isIDPOpen)}
127-
isExpanded={isIDPOpen}
128-
>
129-
{t('console-app~Add')}
130-
</MenuToggle>
131-
)}
132-
shouldFocusToggleOnSelect
133-
id="idp"
134-
>
135-
<DropdownList>{IDPDropdownItems}</DropdownList>
136-
</Dropdown>
118+
<div>
119+
<Dropdown
120+
isOpen={isIDPOpen}
121+
onSelect={() => setIDPOpen(false)}
122+
onOpenChange={(isOpen: boolean) => setIDPOpen(isOpen)}
123+
toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
124+
<MenuToggle
125+
id="idp-dropdown"
126+
data-test-id="dropdown-button"
127+
ref={toggleRef}
128+
onClick={() => setIDPOpen(!isIDPOpen)}
129+
isExpanded={isIDPOpen}
130+
>
131+
{t('console-app~Add')}
132+
</MenuToggle>
133+
)}
134+
shouldFocusToggleOnSelect
135+
id="idp"
136+
popperProps={{}}
137+
>
138+
<DropdownList>{IDPDropdownItems}</DropdownList>
139+
</Dropdown>
140+
</div>
137141

138142
<IdentityProviders identityProviders={identityProviders} />
139-
</div>
143+
</PaneBody>
140144
</>
141145
);
142146
};

0 commit comments

Comments
 (0)