Skip to content

Commit 6f2f652

Browse files
rhamiltologonoff
andauthored
CONSOLE-4549: Remove and/or replace Bootstrap styles with PatternFly equivalents where possible (#14962)
* CONSOLE-4549: Remove and/or replace Bootstrap styles with PatternFly equivalents where possible * Remove `text-capitalize` as it is orphaned * Remove `.table` as it is no longer in use * Replace `text-muted`, `text-secondary` with `pf-v6-u-text-color-subtle` * Update `form-group` to use PatternFly values * Update `help-block` to use PatternFly values * Update `label` to use PatternFly values * Update `list-group*` to use PatternFly values * Update `checkbox`, `radio` to use PatternFly values * Correct size of `small` to actually be smaller than default * Remove `box-shadow`, `text-overflow` mixins * Remove `container`, `container-fluid` * Update `row`, `col-*` to use PatternFly values * Remove orphaned variables * Remove orphaned `control-label` * Remove orphaned `help-text` * run `yarn generate` --------- Co-authored-by: logonoff <[email protected]>
1 parent b9dda90 commit 6f2f652

File tree

164 files changed

+456
-579
lines changed

Some content is hidden

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

164 files changed

+456
-579
lines changed

frontend/__tests__/components/graphs/graph-empty.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('<GraphEmpty />', () => {
1010

1111
it('should render an empty state', () => {
1212
const wrapper = shallow(<GraphEmpty />);
13-
expect(wrapper.find('.text-secondary').exists()).toBe(true);
13+
expect(wrapper.find('.pf-v6-u-text-color-subtle').exists()).toBe(true);
1414
expect(wrapper.text()).toEqual('No datapoints found.');
1515
});
1616
});

frontend/packages/console-app/src/components/modals/clone/clone-pvc-modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ const ClonePVCModal = withHandlePromise((props: ClonePVCModalProps) => {
210210
)}
211211
</FormGroup>
212212
<div className="co-clone-pvc-modal__details">
213-
<p className="text-muted">{t('console-app~PVC details')}</p>
213+
<p className="pf-v6-u-text-color-subtle">{t('console-app~PVC details')}</p>
214214
<div className="co-clone-pvc-modal__details-section">
215215
<div>
216216
<div>

frontend/packages/console-app/src/components/modals/restore-pvc/restore-pvc-modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ const RestorePVCModal = withHandlePromise<RestorePVCModalProps>(
231231
)}
232232
</FormGroup>
233233
<div className="co-restore-pvc-modal__details-section">
234-
<p className="text-muted">
234+
<p className="pf-v6-u-text-color-subtle">
235235
{t('console-app~{{resourceKind}} details', {
236236
resourceKind: VolumeSnapshotModel.label,
237237
})}

frontend/packages/console-app/src/components/volume-snapshot/create-volume-snapshot/create-volume-snapshot.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ const CreateSnapshotForm = withHandlePromise<SnapshotResourceProps>((props) => {
276276
) : (
277277
/* eslint-disable jsx-a11y/label-has-associated-control */
278278
<>
279-
<label className="control-label co-required" html-for="claimName">
279+
<label className="co-required" html-for="claimName">
280280
{t('console-app~PersistentVolumeClaim')}
281281
</label>
282282
<PVCDropdown
@@ -292,7 +292,7 @@ const CreateSnapshotForm = withHandlePromise<SnapshotResourceProps>((props) => {
292292
</>
293293
)}
294294
<div className="form-group co-volume-snapshot__form">
295-
<label className="control-label co-required" htmlFor="snapshot-name">
295+
<label className="co-required" htmlFor="snapshot-name">
296296
{t('console-app~Name')}
297297
</label>
298298
<span className="pf-v6-c-form-control">
@@ -308,7 +308,7 @@ const CreateSnapshotForm = withHandlePromise<SnapshotResourceProps>((props) => {
308308
</div>
309309
{pvcObj && (
310310
<div className="form-group co-volume-snapshot__form">
311-
<label className="control-label co-required" htmlFor="snapshot-class">
311+
<label className="co-required" htmlFor="snapshot-class">
312312
{t('console-app~Snapshot Class')}
313313
</label>
314314
{vscErr || scObjListErr ? (

frontend/packages/console-app/src/components/volume-snapshot/volume-snapshot-class.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ const Row: React.FC<RowProps<VolumeSnapshotClassKind>> = ({ obj }) => {
4848
<TableData {...tableColumnInfo[0]}>
4949
<ResourceLink name={name} kind={referenceForModel(VolumeSnapshotClassModel)}>
5050
{isDefaultSnapshotClass(obj) && (
51-
<span className="small text-muted co-resource-item__help-text">&ndash; Default</span>
51+
<span className="small pf-v6-u-text-color-subtle co-resource-item__help-text">
52+
&ndash; Default
53+
</span>
5254
)}
5355
</ResourceLink>
5456
</TableData>

frontend/packages/console-dynamic-plugin-sdk/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ This section documents notable changes in the Console provided shared modules ac
193193
- Removed `co-m-nav-title` spacing styling. Use
194194
[PatternFly PageSection](https://www.patternfly.org/components/page#pagesection) instead.
195195
- Removed `co-button-help-icon`, `co-inline`, `co-resource-list*`, `co-toolbar*` styling.
196+
- Removed Bootstrap `table`, `text-muted`, `text-secondary` styling.
196197
- Removed `co-m-pane__details` and `details-item` styling. Use
197198
[PatternFly DescriptionList](https://www.patternfly.org/components/description-list) instead.
198199

frontend/packages/console-dynamic-plugin-sdk/docs/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,7 @@ Component that shows the status in a popup window. Can be used when building `co
13881388
firstColumn={
13891389
<>
13901390
<span>{title}</span>
1391-
<span className="text-secondary">
1391+
<span className="pf-v6-u-text-color-subtle">
13921392
My Example Item
13931393
</span>
13941394
</>

frontend/packages/console-dynamic-plugin-sdk/src/api/dynamic-core-api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ export {
422422
* firstColumn={
423423
* <>
424424
* <span>{title}</span>
425-
* <span className="text-secondary">
425+
* <span className="pf-v6-u-text-color-subtle">
426426
* My Example Item
427427
* </span>
428428
* </>

frontend/packages/console-plugin-shared/src/components/OverviewPage/OverviewDetailItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const OverviewDetailItem: React.FC<OverviewDetailItemProps> = ({
3131
let status: React.ReactNode;
3232

3333
if (error) {
34-
status = <span className="text-secondary">{error}</span>;
34+
status = <span className="pf-v6-u-text-color-subtle">{error}</span>;
3535
} else if (isLoading) {
3636
status = <div className="skeleton-text" />;
3737
} else {

frontend/packages/console-shared/src/components/catalog/catalog-view/CatalogCategories.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as React from 'react';
22
import { VerticalTabs, VerticalTabsTab } from '@patternfly/react-catalog-view-extension';
3-
import * as cx from 'classnames';
43
import * as _ from 'lodash';
54
import { Link } from 'react-router-dom-v5-compat';
65
import { isModifiedEvent } from '@console/shared/src/utils';
@@ -30,16 +29,13 @@ const CatalogCategories: React.FC<CatalogCategoriesProp> = ({
3029
) => {
3130
if (!categorizedIds[category.id]) return null;
3231

33-
const { id, label, subcategories, numItems } = category;
32+
const { id, label, subcategories } = category;
3433
const active = id === selectedCategory;
3534

36-
const tabClasses = cx('text-capitalize', { 'co-catalog-tab__empty': !numItems });
37-
3835
return (
3936
<VerticalTabsTab
4037
key={id}
4138
active={active}
42-
className={tabClasses}
4339
hasActiveDescendant={hasActiveDescendant(selectedCategory, category)}
4440
shown={toplevelCategory}
4541
data-test={`tab ${id}`}

frontend/packages/console-shared/src/components/dashboard/activity-card/ActivityBody.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const Activity: React.FC<ActivityProps> = ({ timestamp, children }) => {
2424
return (
2525
<div className="co-activity-item__ongoing" data-test="activity">
2626
{timestamp && (
27-
<span className="text-secondary">
27+
<span className="pf-v6-u-text-color-subtle">
2828
{t('console-shared~Started')}{' '}
2929
<span data-test="timestamp">
3030
<Timestamp simple timestamp={timestamp.toString()} />
@@ -95,7 +95,9 @@ export const RecentEventsBodyContent: React.FC<RecentEventsBodyContentProps> = (
9595
if (sortedEvents.length === 0) {
9696
return (
9797
<Activity>
98-
<div className="text-secondary">{t('console-shared~There are no recent events.')}</div>
98+
<div className="pf-v6-u-text-color-subtle">
99+
{t('console-shared~There are no recent events.')}
100+
</div>
99101
</Activity>
100102
);
101103
}
@@ -204,7 +206,9 @@ export const OngoingActivityBody: React.FC<OngoingActivityBodyProps> = ({
204206
allActivities
205207
) : (
206208
<Activity>
207-
<div className="text-secondary">{t('console-shared~There are no ongoing activities.')}</div>
209+
<div className="pf-v6-u-text-color-subtle">
210+
{t('console-shared~There are no ongoing activities.')}
211+
</div>
208212
</Activity>
209213
);
210214
}

frontend/packages/console-shared/src/components/dashboard/activity-card/EventItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const EventItem: React.FC<EventItemProps> = React.memo(({ event, isExpanded, onT
3131
})}
3232
>
3333
<div className="co-recent-item__title">
34-
<div className="co-recent-item__title-timestamp text-secondary">
34+
<div className="co-recent-item__title-timestamp pf-v6-u-text-color-subtle">
3535
{lastTime ? (
3636
<span title={lastTime}>{timeFormatter.format(new Date(lastTime))}</span>
3737
) : (

frontend/packages/console-shared/src/components/dashboard/inventory-card/InventoryCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const InventoryItemBody: React.FC<InventoryItemBodyProps> = ({ error, chi
2323
return (
2424
<div className="co-inventory-card__item-status">
2525
{error ? (
26-
<div className="co-dashboard-text--small text-secondary">
26+
<div className="co-dashboard-text--small pf-v6-u-text-color-subtle">
2727
{t('console-shared~Not available')}
2828
</div>
2929
) : (

frontend/packages/console-shared/src/components/dashboard/inventory-card/InventoryItem.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ export const InventoryItem: React.FC<InventoryItemProps> = React.memo(
110110
{!expanded && (error || !isLoading) && (
111111
<div className="co-inventory-card__item-status">
112112
{error ? (
113-
<div className="text-secondary">{t('console-shared~Not available')}</div>
113+
<div className="pf-v6-u-text-color-subtle">
114+
{t('console-shared~Not available')}
115+
</div>
114116
) : (
115117
children
116118
)}

frontend/packages/console-shared/src/components/dashboard/resource-quota-card/ResourceQuotaBody.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ const ResourceQuotaBody: React.FC<ResourceQuotaBodyProps> = ({
1212
let body: React.ReactNode;
1313
const { t } = useTranslation();
1414
if (error) {
15-
body = <div className="text-secondary">{t('console-shared~Not available')}</div>;
15+
body = <div className="pf-v6-u-text-color-subtle">{t('console-shared~Not available')}</div>;
1616
} else if (isLoading) {
1717
body = <div className="skeleton-quota" />;
1818
} else if (!React.Children.count(children)) {
19-
body = <div className="text-secondary">{noText || t('console-shared~No ResourceQuotas')}</div>;
19+
body = (
20+
<div className="pf-v6-u-text-color-subtle">
21+
{noText || t('console-shared~No ResourceQuotas')}
22+
</div>
23+
);
2024
}
2125

2226
return <>{body || children}</>;

frontend/packages/console-shared/src/components/dashboard/status-card/AlertItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const StatusItem: React.FC<StatusItemProps> = ({
5050
{name && <span className="co-status-card__alert-item-header">{name}</span>}
5151
{timestamp && (
5252
<div
53-
className="co-health-card__alert-item-timestamp co-status-card__health-item-text text-secondary"
53+
className="co-health-card__alert-item-timestamp co-status-card__health-item-text pf-v6-u-text-color-subtle"
5454
data-test="timestamp"
5555
>
5656
<Timestamp simple timestamp={timestamp} />

frontend/packages/console-shared/src/components/dashboard/status-card/OperatorStatusBody.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const OperatorsSection: React.FC<OperatorsSectionProps> = ({
3636
firstColumn={
3737
<>
3838
<span>{title}</span>
39-
<span className="text-secondary co-status__operator-detail">
39+
<span className="pf-v6-u-text-color-subtle co-status__operator-detail">
4040
{' '}
4141
{t('console-shared~({{operatorStatusLength}} installed)', {
4242
operatorStatusLength: operatorStatuses.length,
@@ -47,7 +47,7 @@ export const OperatorsSection: React.FC<OperatorsSectionProps> = ({
4747
secondColumn={t('console-shared~Status')}
4848
>
4949
{error ? (
50-
<div className="text-secondary">{t('console-shared~Not available')}</div>
50+
<div className="pf-v6-u-text-color-subtle">{t('console-shared~Not available')}</div>
5151
) : (
5252
!operatorsHealthy &&
5353
sortedOperatorStatuses.map((operatorStatus) => (

frontend/packages/console-shared/src/components/dashboard/status-card/StatusPopup.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const StatusPopupSection: React.FC<StatusPopupSectionProps> = ({
1414
<>
1515
<div className="co-status-popup__row">
1616
<div className="co-status-popup__text--bold">{firstColumn}</div>
17-
{secondColumn && <div className="text-secondary">{secondColumn}</div>}
17+
{secondColumn && <div className="pf-v6-u-text-color-subtle">{secondColumn}</div>}
1818
</div>
1919
{children}
2020
</>
@@ -25,7 +25,7 @@ const Status: React.FC<StatusPopupItemProps> = ({ value, icon, children }) => (
2525
{children}
2626
{(value || icon) && (
2727
<div className="co-status-popup__status">
28-
{value && <div className="text-secondary">{value}</div>}
28+
{value && <div className="pf-v6-u-text-color-subtle">{value}</div>}
2929
{icon && <div className="co-status-popup__icon">{icon}</div>}
3030
</div>
3131
)}

frontend/packages/console-shared/src/components/dashboard/utilization-card/TopConsumerPopover.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export const PopoverBody = withDashboardResources<DashboardItemProps & PopoverBo
202202

203203
let body: React.ReactNode;
204204
if (error || consumersLoadError) {
205-
body = <div className="text-secondary">{t('console-shared~Not available')}</div>;
205+
body = <div className="pf-v6-u-text-color-subtle">{t('console-shared~Not available')}</div>;
206206
} else if (!consumerLoaded || !data) {
207207
body = (
208208
<ul className="co-utilization-card-popover__consumer-list">

frontend/packages/console-shared/src/components/dashboard/utilization-card/UtilizationItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export const MultilineUtilizationItem: React.FC<MultilineUtilizationItemProps> =
126126
{title}
127127
</Title>
128128
{error || (!isLoading && !(data.length && data.every((datum) => datum.length))) ? (
129-
<div className="text-secondary">{t('console-shared~Not available')}</div>
129+
<div className="pf-v6-u-text-color-subtle">{t('console-shared~Not available')}</div>
130130
) : (
131131
<div className="co-utilization-card__item-description">{currentValue}</div>
132132
)}
@@ -265,7 +265,7 @@ export const UtilizationItem: React.FC<UtilizationItemProps> = React.memo(
265265
</FlexItem>
266266
<FlexItem>
267267
{error || (!isLoading && !utilizationData?.length) ? (
268-
<div className="text-secondary">{t('console-shared~Not available')}</div>
268+
<div className="pf-v6-u-text-color-subtle">{t('console-shared~Not available')}</div>
269269
) : (
270270
<div>
271271
{LimitIcon && <LimitIcon className="co-utilization-card__item-icon" />}

frontend/packages/console-shared/src/components/dropdown/ResourceDropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const DropdownItem: React.FC<DropdownItemProps> = ({ model, name, namespace }) =
3232
<span className="co-resource-item__resource-name">
3333
<span>{name}</span>
3434
{namespace && (
35-
<div className="text-muted co-truncate co-nowrap small co-resource-item__resource-namespace">
35+
<div className="pf-v6-u-text-color-subtle co-truncate co-nowrap small co-resource-item__resource-namespace">
3636
{namespace}
3737
</div>
3838
)}

frontend/packages/console-shared/src/components/dynamic-form/styles.scss

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,24 @@
1919
--pf-v6-c-accordion__toggle--PaddingRight: 0.9375rem !important;
2020
--pf-v6-c-accordion__toggle--m-expanded--BorderLeftColor: none !important;
2121
--pf-v6-c-accordion__expanded-content-body--PaddingLeft: 0.9375rem !important;
22-
--pf-v6-c-accordion__expanded-content--Color: var(--pf-t--global--text--color--regular) !important;
23-
--pf-v6-c-accordion__toggle-text--active--Color: var(--pf-t--global--text--color--regular) !important;
22+
--pf-v6-c-accordion__expanded-content--Color: var(
23+
--pf-t--global--text--color--regular
24+
) !important;
25+
--pf-v6-c-accordion__toggle-text--active--Color: var(
26+
--pf-t--global--text--color--regular
27+
) !important;
2428
--pf-v6-c-accordion__toggle-text--active--FontWeight: 600 !important;
25-
--pf-v6-c-accordion__toggle-text--expanded--Color: var(--pf-t--global--text--color--regular) !important;
29+
--pf-v6-c-accordion__toggle-text--expanded--Color: var(
30+
--pf-t--global--text--color--regular
31+
) !important;
2632
--pf-v6-c-accordion__toggle-text--expanded--FontWeight: 600 !important;
27-
--pf-v6-c-accordion__toggle-text--focus--Color: var(--pf-t--global--text--color--regular) !important;
33+
--pf-v6-c-accordion__toggle-text--focus--Color: var(
34+
--pf-t--global--text--color--regular
35+
) !important;
2836
--pf-v6-c-accordion__toggle-text--focus--FontWeight: 600 !important;
29-
--pf-v6-c-accordion__toggle-text--hover--Color: var(--pf-t--global--text--color--regular) !important;
37+
--pf-v6-c-accordion__toggle-text--hover--Color: var(
38+
--pf-t--global--text--color--regular
39+
) !important;
3040
--pf-v6-c-accordion__toggle-text--hover--FontWeight: 600 !important;
3141
margin-bottom: 0.5rem;
3242

@@ -43,7 +53,7 @@
4353
}
4454

4555
.help-block {
46-
margin-bottom: 8px;
56+
margin-bottom: var(--pf-t--global--spacer--sm);
4757
margin-top: 0;
4858
}
4959
}

frontend/packages/console-shared/src/components/modals/CreateNamespaceModal.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export const CreateNamespaceModal: ModalComponent<CreateProjectModalProps> = ({
181181
>
182182
<form onSubmit={submit} name="form" className="modal-content">
183183
<div className="form-group">
184-
<label htmlFor="input-name" className="control-label co-required">
184+
<label htmlFor="input-name" className="co-required">
185185
{t('console-shared~Name')}
186186
</label>
187187
<FieldLevelHelp>
@@ -211,9 +211,7 @@ export const CreateNamespaceModal: ModalComponent<CreateProjectModalProps> = ({
211211
</div>
212212
</div>
213213
<div className="form-group">
214-
<label htmlFor="tags-input" className="control-label">
215-
{t('console-shared~Labels')}
216-
</label>
214+
<label htmlFor="tags-input">{t('console-shared~Labels')}</label>
217215
<div className="modal-body__field">
218216
<SelectorInput
219217
labelClassName="co-m-namespace"
@@ -223,9 +221,7 @@ export const CreateNamespaceModal: ModalComponent<CreateProjectModalProps> = ({
223221
</div>
224222
</div>
225223
<div className="form-group">
226-
<label htmlFor="network-policy" className="control-label">
227-
{t('console-shared~Default network policy')}
228-
</label>
224+
<label htmlFor="network-policy">{t('console-shared~Default network policy')}</label>
229225
<div className="modal-body__field ">
230226
<Select
231227
id="dropdown-selectbox"

frontend/packages/console-shared/src/components/modals/CreateProjectModal.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ const DefaultCreateProjectModal: ModalComponent<CreateProjectModalProps> = ({
143143
</Content>
144144
)}
145145
<div className="form-group">
146-
<label htmlFor="input-name" className="control-label co-required">
146+
<label htmlFor="input-name" className="co-required">
147147
{t('console-shared~Name')}
148148
</label>{' '}
149149
<FieldLevelHelp>
@@ -173,9 +173,7 @@ const DefaultCreateProjectModal: ModalComponent<CreateProjectModalProps> = ({
173173
</div>
174174
</div>
175175
<div className="form-group">
176-
<label htmlFor="input-display-name" className="control-label">
177-
{t('console-shared~Display name')}
178-
</label>
176+
<label htmlFor="input-display-name">{t('console-shared~Display name')}</label>
179177
<div className="modal-body__field">
180178
<span className="pf-v6-c-form-control">
181179
<input
@@ -189,9 +187,7 @@ const DefaultCreateProjectModal: ModalComponent<CreateProjectModalProps> = ({
189187
</div>
190188
</div>
191189
<div className="form-group">
192-
<label htmlFor="input-description" className="control-label">
193-
{t('console-shared~Description')}
194-
</label>
190+
<label htmlFor="input-description">{t('console-shared~Description')}</label>
195191
<div className="modal-body__field">
196192
<span className="pf-v6-c-form-control pf-m-resize-vertical">
197193
<textarea

0 commit comments

Comments
 (0)