Skip to content

Commit 79379cf

Browse files
Merge pull request #14815 from rhamilto/CONSOLE-4498
CONSOLE-4498: Replace checkboxes with Switch in ResourceLog
2 parents 2db56dc + 39f2566 commit 79379cf

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import * as React from 'react';
22
import {
33
Alert,
4-
Checkbox,
54
EmptyState,
65
EmptyStateBody,
76
EmptyStateVariant,
@@ -15,6 +14,7 @@ import {
1514
ToolbarContent,
1615
ToolbarGroup,
1716
ToolbarItem,
17+
Switch,
1818
} from '@patternfly/react-core';
1919
import { LogViewer, LogViewerSearch } from '@patternfly/react-log-viewer';
2020
import classnames from 'classnames';
@@ -94,7 +94,7 @@ const LogControls: React.FC<LogControlsProps> = ({
9494
const { t } = useTranslation();
9595

9696
return (
97-
<Toolbar className="co-toolbar-empty-state">
97+
<Toolbar>
9898
<ToolbarContent>
9999
<ToolbarGroup>
100100
<ToolbarItem>
@@ -151,7 +151,7 @@ const LogControls: React.FC<LogControlsProps> = ({
151151
)}
152152
</ToolbarGroup>
153153
<ToolbarItem className="pf-v6-u-flex-fill pf-v6-u-align-self-center pf-v6-u-justify-content-flex-end">
154-
<Checkbox
154+
<Switch
155155
label={t('public~Wrap lines')}
156156
id="wrapLogLines"
157157
isChecked={isWrapLines}

frontend/packages/integration-tests-cypress/tests/app/resource-log.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('Pod log viewer tab', () => {
2222
// Verify the default log buffer size
2323
cy.byTestID('no-log-lines').contains('1000 lines');
2424
// Verify the log exceeds the default log buffer size
25-
cy.byTestID('show-full-log').check();
25+
cy.byTestID('show-full-log').check({ force: true }); // force as checkbox is hidden (from Switch)
2626
// eslint-disable-next-line cypress/no-unnecessary-waiting
2727
cy.wait(5000);
2828
cy.byTestID('no-log-lines').should('not.contain', '1000 lines');

frontend/public/components/utils/resource-log.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
Alert,
88
AlertActionLink,
99
Button,
10-
Checkbox,
1110
Divider,
1211
Dropdown,
1312
DropdownGroup,
@@ -18,6 +17,7 @@ import {
1817
Select,
1918
SelectList,
2019
SelectOption,
20+
Switch,
2121
Tooltip,
2222
} from '@patternfly/react-core';
2323
import { LogViewer, LogViewerSearch } from '@patternfly/react-log-viewer';
@@ -313,7 +313,7 @@ export const LogControls: React.FC<LogControlsProps> = ({
313313
<Tooltip
314314
content={t('public~Select to view the entire log. Default view is the last 1,000 lines.')}
315315
>
316-
<Checkbox
316+
<Switch
317317
label={t('public~Show full log')}
318318
id="showFullLog"
319319
data-test="show-full-log"
@@ -328,7 +328,7 @@ export const LogControls: React.FC<LogControlsProps> = ({
328328
);
329329

330330
const wrapLines = (
331-
<Checkbox
331+
<Switch
332332
label={t('public~Wrap lines')}
333333
id="wrapLogLines"
334334
isChecked={isWrapLines}
@@ -481,7 +481,7 @@ export const LogControls: React.FC<LogControlsProps> = ({
481481
default: 'vertical',
482482
}}
483483
/>
484-
{wrapLines}
484+
<div>{wrapLines}</div>
485485
<Divider
486486
orientation={{
487487
default: 'vertical',

frontend/public/style/_overrides.scss

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ form.pf-v6-c-form {
3232
max-width: 100%;
3333
min-width: 50px; // prevent collapsed state before img loads
3434
width: fit-content;
35-
:where(.pf-v6-theme-dark) & { // custom styling needed to provide extra padding on dark mode due to white background imgs
35+
:where(.pf-v6-theme-dark) & {
36+
// custom styling needed to provide extra padding on dark mode due to white background imgs
3637
margin-left: 0;
3738
margin-top: 0;
3839
}
@@ -79,11 +80,6 @@ form.pf-v6-c-form {
7980
vertical-align: top; // PF defaults to baseline which doesn't align correctly when Operator logos are within the table
8081
}
8182

82-
.co-toolbar-empty-state .pf-v6-c-toolbar__content {
83-
--pf-v6-c-toolbar__content--PaddingLeft: 0;
84-
--pf-v6-c-toolbar__content--PaddingRight: 0;
85-
}
86-
8783
// fix bug where monaco-aria-container is visible in Firefox but shouldn't be
8884
// bug occurs only if the suggestions overlay has been enabled
8985
.monaco-aria-container {

0 commit comments

Comments
 (0)