Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react-core/src/demos/DashboardHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export const DashboardHeader: React.FC<DashboardHeaderProps> = ({ notificationBa
<ToolbarItem>
<NotificationBadge
aria-label="Notifications"
variant={NotificationBadgeVariant.read}
variant={NotificationBadgeVariant.plain}
onClick={() => {}}
/>
</ToolbarItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export const MastheadWithHorizontalNav: React.FunctionComponent = () => {
gap={{ default: 'gapNone', md: 'gapMd' }}
>
<ToolbarItem>
<NotificationBadge aria-label="Notifications" variant={NotificationBadgeVariant.read} onClick={() => {}} />
<NotificationBadge aria-label="Notifications" variant={NotificationBadgeVariant.plain} onClick={() => {}} />
</ToolbarItem>
<ToolbarGroup variant="action-group-plain" visibility={{ default: 'hidden', lg: 'visible' }}>
<ToolbarItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ export const MastheadWithUtilitiesAndUserDropdownMenu: React.FunctionComponent =
gap={{ default: 'gapNone', md: 'gapMd' }}
>
<ToolbarItem>
<NotificationBadge aria-label="Notifications" variant={NotificationBadgeVariant.read} onClick={() => {}} />
<NotificationBadge aria-label="Notifications" variant={NotificationBadgeVariant.plain} onClick={() => {}} />
</ToolbarItem>
<ToolbarGroup variant="action-group-plain" visibility={{ default: 'hidden', lg: 'visible' }}>
<ToolbarItem visibility={{ default: 'hidden', md: 'hidden', lg: 'visible' }}>
Expand Down
2 changes: 1 addition & 1 deletion packages/react-core/src/demos/examples/Nav/NavFlyout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export const NavFlyout: React.FunctionComponent = () => {
gap={{ default: 'gapNone', md: 'gapMd' }}
>
<ToolbarItem>
<NotificationBadge aria-label="Notifications" variant={NotificationBadgeVariant.read} onClick={() => {}} />
<NotificationBadge aria-label="Notifications" variant={NotificationBadgeVariant.plain} onClick={() => {}} />
</ToolbarItem>
<ToolbarGroup variant="action-group-plain" visibility={{ default: 'hidden', lg: 'visible' }}>
<ToolbarItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const NavHorizontal: React.FunctionComponent = () => {
gap={{ default: 'gapNone', md: 'gapMd' }}
>
<ToolbarItem>
<NotificationBadge aria-label="Notifications" variant={NotificationBadgeVariant.read} onClick={() => {}} />
<NotificationBadge aria-label="Notifications" variant={NotificationBadgeVariant.plain} onClick={() => {}} />
</ToolbarItem>
<ToolbarGroup variant="action-group-plain" visibility={{ default: 'hidden', lg: 'visible' }}>
<ToolbarItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export const NavHorizontalWithSubnav: React.FunctionComponent = () => {
gap={{ default: 'gapNone', md: 'gapMd' }}
>
<ToolbarItem>
<NotificationBadge aria-label="Notifications" variant={NotificationBadgeVariant.read} onClick={() => {}} />
<NotificationBadge aria-label="Notifications" variant={NotificationBadgeVariant.plain} onClick={() => {}} />
</ToolbarItem>
<ToolbarGroup variant="action-group-plain" visibility={{ default: 'hidden', lg: 'visible' }}>
<ToolbarItem>
Expand Down
2 changes: 1 addition & 1 deletion packages/react-core/src/demos/examples/Nav/NavManual.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export const NavManual: React.FunctionComponent = () => {
gap={{ default: 'gapNone', md: 'gapMd' }}
>
<ToolbarItem>
<NotificationBadge aria-label="Notifications" variant={NotificationBadgeVariant.read} onClick={() => {}} />
<NotificationBadge aria-label="Notifications" variant={NotificationBadgeVariant.plain} onClick={() => {}} />
</ToolbarItem>
<ToolbarGroup variant="action-group-plain" visibility={{ default: 'hidden', lg: 'visible' }}>
<ToolbarItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
DataListCell,
DataListItemCells,
Label,
LabelStatus,
Toolbar,
ToolbarContent,
ToolbarItem,
Expand Down Expand Up @@ -389,13 +390,13 @@ export const TableColumnManagement: React.FunctionComponent = () => {
const renderLabel = (labelText: string): React.JSX.Element => {
switch (labelText) {
case 'Running':
return <Label color="green">{labelText}</Label>;
return <Label status={LabelStatus.success}>{labelText}</Label>;
case 'Stopped':
return <Label color="orange">{labelText}</Label>;
return <Label status={LabelStatus.warning}>{labelText}</Label>;
case 'Needs maintenance':
return <Label color="blue">{labelText}</Label>;
return <Label status={LabelStatus.info}>{labelText}</Label>;
case 'Down':
return <Label color="red">{labelText}</Label>;
return <Label status={LabelStatus.danger}>{labelText}</Label>;
default:
return <></>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
DataListItemCells,
DataListControl,
Label,
LabelStatus,
Toolbar,
ToolbarContent,
ToolbarItem,
Expand Down Expand Up @@ -284,13 +285,13 @@ export const TableColumnManagement: React.FunctionComponent = () => {
const renderLabel = (labelText: string): React.JSX.Element => {
switch (labelText) {
case 'Running':
return <Label color="green">{labelText}</Label>;
return <Label status={LabelStatus.success}>{labelText}</Label>;
case 'Stopped':
return <Label color="orange">{labelText}</Label>;
return <Label status={LabelStatus.warning}>{labelText}</Label>;
case 'Needs maintenance':
return <Label color="blue">{labelText}</Label>;
return <Label status={LabelStatus.info}>{labelText}</Label>;
case 'Down':
return <Label color="red">{labelText}</Label>;
return <Label status={LabelStatus.danger}>{labelText}</Label>;
default:
return <></>;
}
Expand Down
9 changes: 5 additions & 4 deletions packages/react-table/src/demos/examples/TableCompact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
ToolbarGroup,
ToolbarItem,
Label,
LabelStatus,
PaginationVariant
} from '@patternfly/react-core';
import { Table, TableText, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
Expand Down Expand Up @@ -113,13 +114,13 @@ export const TableCompact: React.FunctionComponent = () => {
const renderLabel = (labelText: string) => {
switch (labelText) {
case 'Running':
return <Label color="green">{labelText}</Label>;
return <Label status={LabelStatus.success}>{labelText}</Label>;
case 'Stopped':
return <Label color="orange">{labelText}</Label>;
return <Label status={LabelStatus.warning}>{labelText}</Label>;
case 'Needs Maintenance':
return <Label color="blue">{labelText}</Label>;
return <Label status={LabelStatus.info}>{labelText}</Label>;
case 'Down':
return <Label color="red">{labelText}</Label>;
return <Label status={LabelStatus.danger}>{labelText}</Label>;
Comment on lines +117 to +123

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Locate demo files and searches:"
for f in \
  packages/react-table/src/demos/examples/TableCompact.tsx \
  packages/react-table/src/demos/examples/TableSortableResponsive.tsx \
  packages/react-table/src/demos/examples/TableStaticBottomPagination.tsx \
  packages/react-table/src/demos/examples/TableStickyHeader.tsx
do
  echo "===== $f ($(wc -l < "$f") lines) ====="
  ast-grep outline "$f" --view compact 2>/dev/null || true
  printf "\n"
  sed -n '1,180p' "$f"
  printf "\n"
done

echo "Search for row.status/status data values:"
rg -n "status|Needs Maintenance|Needs maintenance|Down|Stopped" packages/react-table/src/demos/examples packages -g '*.tsx' -g '*.ts' | head -n 200

Repository: patternfly/patternfly-react

Length of output: 42910


Normalize the Needs maintenance status key across these demos.

These renderers receive row.status from packages/react-table/src/demos/sampleData.tsx, where the status value is Needs maintenance with a lowercase m. The Needs Maintenance switch cases fall through to the empty default/result and won’t render the label in these examples.

  • packages/react-table/src/demos/examples/TableCompact.tsx#L120
  • packages/react-table/src/demos/examples/TableSortableResponsive.tsx#L127
  • packages/react-table/src/demos/examples/TableStaticBottomPagination.tsx#L83
  • packages/react-table/src/demos/examples/TableStickyHeader.tsx#L13
📍 Affects 4 files
  • packages/react-table/src/demos/examples/TableCompact.tsx#L117-L123 (this comment)
  • packages/react-table/src/demos/examples/TableSortableResponsive.tsx#L124-L130
  • packages/react-table/src/demos/examples/TableStaticBottomPagination.tsx#L71-L89
  • packages/react-table/src/demos/examples/TableStickyHeader.tsx#L10-L16
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/react-table/src/demos/examples/TableCompact.tsx` around lines 117 -
123, Normalize the Needs Maintenance switch case to the sample-data key Needs
maintenance so the label renders correctly. Apply this change in the status
renderers at packages/react-table/src/demos/examples/TableCompact.tsx#L117-L123,
TableSortableResponsive.tsx#L124-L130, TableStaticBottomPagination.tsx#L71-L89,
and TableStickyHeader.tsx#L10-L16; leave the associated label statuses
unchanged.

default:
return <></>;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Fragment, ReactNode, useEffect, useState } from 'react';
import { Content, Label, PageSection } from '@patternfly/react-core';
import { Content, Label, LabelStatus, PageSection } from '@patternfly/react-core';
import { Table, Thead, Tbody, Tr, Th, Td, ExpandableRowContent } from '@patternfly/react-table';
import { DashboardWrapper } from '@patternfly/react-table/dist/esm/demos/DashboardWrapper';

Expand All @@ -20,7 +20,7 @@ const serverData: Server[] = [
threads: 18,
applications: 42,
workspaces: 7,
status: { title: <Label color="green">Running</Label> },
status: { title: <Label status={LabelStatus.success}>Running</Label> },
details: (
<Content>
<p>
Expand All @@ -40,7 +40,7 @@ const serverData: Server[] = [
threads: 9,
applications: 24,
workspaces: 17,
status: { title: <Label color="red">Down</Label> },
status: { title: <Label status={LabelStatus.danger}>Down</Label> },
details: (
<Content>
<p>
Expand All @@ -60,7 +60,7 @@ const serverData: Server[] = [
threads: 8,
applications: 47,
workspaces: 3,
status: { title: <Label color="green">Running</Label> },
status: { title: <Label status={LabelStatus.success}>Running</Label> },
details: (
<Content>
<p>
Expand All @@ -80,7 +80,7 @@ const serverData: Server[] = [
threads: 6,
applications: 4,
workspaces: 15,
status: { title: <Label color="blue">Needs Maintenance</Label> },
status: { title: <Label status={LabelStatus.info}>Needs Maintenance</Label> },
details: (
<Content>
<p>
Expand All @@ -100,7 +100,7 @@ const serverData: Server[] = [
threads: 9,
applications: 24,
workspaces: 17,
status: { title: <Label color="orange">Stopped</Label> },
status: { title: <Label status={LabelStatus.warning}>Stopped</Label> },
details: (
<Content>
<p>
Expand Down
9 changes: 5 additions & 4 deletions packages/react-table/src/demos/examples/TableFilterable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
EmptyStateBody,
EmptyStateFooter,
Label,
LabelStatus,
MenuToggle,
MenuToggleElement,
Toolbar,
Expand Down Expand Up @@ -326,13 +327,13 @@ export const TableFilterable: React.FunctionComponent = () => {
const renderLabel = (labelText: string) => {
switch (labelText) {
case 'Running':
return <Label color="green">{labelText}</Label>;
return <Label status={LabelStatus.success}>{labelText}</Label>;
case 'Stopped':
return <Label color="orange">{labelText}</Label>;
return <Label status={LabelStatus.warning}>{labelText}</Label>;
case 'Needs maintenance':
return <Label color="blue">{labelText}</Label>;
return <Label status={LabelStatus.info}>{labelText}</Label>;
case 'Down':
return <Label color="red">{labelText}</Label>;
return <Label status={LabelStatus.danger}>{labelText}</Label>;
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
OverflowMenuDropdownItem,
PaginationVariant,
Label,
LabelStatus,
Select,
OverflowMenu,
OverflowMenuContent,
Expand Down Expand Up @@ -120,13 +121,13 @@ export const TableSortableResponsive: React.FunctionComponent = () => {
const renderLabel = (labelText: string) => {
switch (labelText) {
case 'Running':
return <Label color="green">{labelText}</Label>;
return <Label status={LabelStatus.success}>{labelText}</Label>;
case 'Stopped':
return <Label color="orange">{labelText}</Label>;
return <Label status={LabelStatus.warning}>{labelText}</Label>;
case 'Needs Maintenance':
return <Label color="blue">{labelText}</Label>;
return <Label status={LabelStatus.info}>{labelText}</Label>;
case 'Down':
return <Label color="red">{labelText}</Label>;
return <Label status={LabelStatus.danger}>{labelText}</Label>;
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
MenuToggle,
MenuToggleElement,
Label,
LabelStatus,
Select,
SelectOption,
PaginationVariant
Expand Down Expand Up @@ -67,25 +68,25 @@ export const TableStaticBottomPagination: React.FunctionComponent = () => {
case 'Running':
return (
<span>
<Label color="green">{labelText}</Label>
<Label status={LabelStatus.success}>{labelText}</Label>
</span>
);
case 'Stopped':
return (
<span>
<Label color="orange">{labelText}</Label>
<Label status={LabelStatus.warning}>{labelText}</Label>
</span>
);
case 'Needs Maintenance':
return (
<span>
<Label color="blue">{labelText}</Label>
<Label status={LabelStatus.info}>{labelText}</Label>
</span>
);
case 'Down':
return (
<span>
<Label color="red">{labelText}</Label>
<Label status={LabelStatus.danger}>{labelText}</Label>
</span>
);
}
Expand Down
10 changes: 5 additions & 5 deletions packages/react-table/src/demos/examples/TableStickyHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Label, PageSection } from '@patternfly/react-core';
import { Label, LabelStatus, PageSection } from '@patternfly/react-core';
import { Table, Thead, Tr, Th, Tbody, Td, TableText } from '@patternfly/react-table';
import { DashboardWrapper } from '@patternfly/react-table/dist/esm/demos/DashboardWrapper';
import { rows, columns } from '@patternfly/react-table/dist/esm/demos/sampleData';
Expand All @@ -7,13 +7,13 @@ export const TableStickyHeader: React.FunctionComponent = () => {
const renderLabel = (labelText: string) => {
switch (labelText) {
case 'Running':
return <Label color="green">{labelText}</Label>;
return <Label status={LabelStatus.success}>{labelText}</Label>;
case 'Stopped':
return <Label color="orange">{labelText}</Label>;
return <Label status={LabelStatus.warning}>{labelText}</Label>;
case 'Needs Maintenance':
return <Label color="blue">{labelText}</Label>;
return <Label status={LabelStatus.info}>{labelText}</Label>;
case 'Down':
return <Label color="red">{labelText}</Label>;
return <Label status={LabelStatus.danger}>{labelText}</Label>;
}
};

Expand Down
Loading