Skip to content

Commit

Permalink
Fix tag filter and notifications drawer PF6 migration issues (#3020)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyperkid123 authored Feb 25, 2025
2 parents 8316ad7 + efdd675 commit 6edb223
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/components/GlobalFilter/GlobalFilterMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export const GlobalFilterDropdown: React.FunctionComponent<GlobalFilterDropdownP
{!isDisabled && (
<Button
variant="link"
className="pf-v6-u-ml-sm"
ouiaId="global-filter-clear"
onClick={() => {
setValue(() => ({}));
Expand Down
18 changes: 11 additions & 7 deletions src/components/Header/Tools.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
import React, { memo, useContext, useEffect, useState } from 'react';
import React, { Fragment, memo, useContext, useEffect, useState } from 'react';
import { useAtom, useAtomValue, useSetAtom } from 'jotai';
import { Button } from '@patternfly/react-core/dist/dynamic/components/Button';
import { Divider } from '@patternfly/react-core/dist/dynamic/components/Divider';
Expand Down Expand Up @@ -59,6 +59,11 @@ const ExpandedSettingsButton = ({ settingsMenuDropdownGroups }: ExpandedSettings
</Tooltip>
);

type NotificationBellProps = {
isNotificationDrawerExpanded: boolean;
toggleDrawer: () => void;
};

const Tools = () => {
const [{ isDemoAcc, isInternal, isRhosakEntitled }, setState] = useState({
isInternal: true,
Expand Down Expand Up @@ -237,16 +242,15 @@ const Tools = () => {
setIsNotificationsDrawerExpanded((prev) => !prev);
};

type NotificationBellProps = {
isNotificationDrawerExpanded: boolean;
toggleDrawer: () => void;
};

const drawerBellProps: ScalprumComponentProps & NotificationBellProps = {
const drawerBellProps: ScalprumComponentProps<Record<string, unknown>, NotificationBellProps> = {
scope: 'notifications',
module: './NotificationsDrawerBell',
fallback: null,
isNotificationDrawerExpanded,
// Do not show the error component if module fails to load
// Prevents broken layout
// @ts-ignore
ErrorComponent: Fragment,
toggleDrawer,
};

Expand Down
3 changes: 2 additions & 1 deletion src/components/NotificationsDrawer/DrawerPanelContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ const DrawerPanelBase: React.FC<DrawerPanelProps> = ({ panelRef, toggleDrawer })
const { DrawerPanel } = useNotificationsScope();

return (
<NotificationDrawer ref={panelRef}>
// Need the v5 styles here in order for pf5 nested child drawer nodes to be properly styled until pf6 migration is finished
<NotificationDrawer className="pf-v5-c-notification-drawer" ref={panelRef}>
<DrawerPanel {...notificationProps} />
</NotificationDrawer>
);
Expand Down

0 comments on commit 6edb223

Please sign in to comment.