diff --git a/frontend/packages/console-app/src/components/user-preferences/UserPreferenceForm.scss b/frontend/packages/console-app/src/components/user-preferences/UserPreferenceForm.scss deleted file mode 100644 index 39d46e6275a..00000000000 --- a/frontend/packages/console-app/src/components/user-preferences/UserPreferenceForm.scss +++ /dev/null @@ -1,13 +0,0 @@ -.co-user-preference__form { - @media (min-width: 769px) { - max-width: 100%; - } - - @media (min-width: 992px) { - min-width: 650px; - } - - @media (min-width: 1200px) { - max-width: 50%; - } - } \ No newline at end of file diff --git a/frontend/packages/console-app/src/components/user-preferences/UserPreferenceForm.tsx b/frontend/packages/console-app/src/components/user-preferences/UserPreferenceForm.tsx index a3a8bc62c3c..6f3479c4e38 100644 --- a/frontend/packages/console-app/src/components/user-preferences/UserPreferenceForm.tsx +++ b/frontend/packages/console-app/src/components/user-preferences/UserPreferenceForm.tsx @@ -3,17 +3,11 @@ import { Form } from '@patternfly/react-core'; import type { ResolvedUserPreferenceItem } from './types'; import UserPreferenceField from './UserPreferenceField'; -import './UserPreferenceForm.scss'; - type UserPreferenceFormProps = { items: ResolvedUserPreferenceItem[] }; const UserPreferenceForm: FC = ({ items }) => items && items.length > 0 ? ( -
event.preventDefault()} - className="co-user-preference__form" - role="form" - > + event.preventDefault()} role="form"> {items.map((item) => ( ))} diff --git a/frontend/packages/console-app/src/components/user-preferences/UserPreferencePage.scss b/frontend/packages/console-app/src/components/user-preferences/UserPreferencePage.scss index dd92d2f7fb8..f4cfc0819cd 100644 --- a/frontend/packages/console-app/src/components/user-preferences/UserPreferencePage.scss +++ b/frontend/packages/console-app/src/components/user-preferences/UserPreferencePage.scss @@ -1,35 +1,6 @@ -.co-user-preference-page { - display: flex; - min-height: 100%; - overflow-y: auto; - flex-direction: column; -} - -.co-user-preference-page-content { - display: flex; - flex-direction: row; - background-color: var(--pf-t--global--background--color--primary--default); - min-height: 100%; - &__tabs { - @media (min-width: 769px) { - max-width: 100%; - } - - @media (min-width: 992px) { - min-width: 220px; - } - - @media (min-width: 1200px) { - max-width: 220px; - } - } - &__tab-content { - margin: var(--pf-t--global--spacer--lg); - max-width: 100%; - } - - //workaround for patternfly bug which causes the buttons to show even when isVertical prop is true - .pf-v6-c-tabs__scroll-button { - display: none; - } +// Workaround: SidebarPanel and MenuToggle both use --pf-t--global--z-index--xs, +// so menu-toggles render above the sticky panel when content scrolls at mobile width. +// TODO: Remove when fixed upstream in PatternFly. See: https://github.com/patternfly/patternfly/issues/8323 +.co-user-preferences__sidebar-panel { + --pf-v6-c-sidebar__panel--ZIndex: var(--pf-t--global--z-index--sm); } diff --git a/frontend/packages/console-app/src/components/user-preferences/UserPreferencePage.tsx b/frontend/packages/console-app/src/components/user-preferences/UserPreferencePage.tsx index f39c4635cb1..fbc68407149 100644 --- a/frontend/packages/console-app/src/components/user-preferences/UserPreferencePage.tsx +++ b/frontend/packages/console-app/src/components/user-preferences/UserPreferencePage.tsx @@ -1,7 +1,16 @@ import { useMemo, useState, useEffect, createRef } from 'react'; import type { FC, ReactElement, JSXElementConstructor, MouseEvent } from 'react'; import type { TabProps, TabContentProps } from '@patternfly/react-core'; -import { Tabs, Tab, TabTitleText, TabContent, PageSection } from '@patternfly/react-core'; +import { + Tabs, + Tab, + TabTitleText, + TabContent, + PageSection, + Sidebar, + SidebarContent, + SidebarPanel, +} from '@patternfly/react-core'; import { useTranslation } from 'react-i18next'; import { useParams, useNavigate } from 'react-router'; import { @@ -19,6 +28,7 @@ import { useQueryParams } from '@console/shared/src/hooks/useQueryParams'; import { orderExtensionBasedOnInsertBeforeAndAfter } from '@console/shared/src/utils/order-extensions'; import { isModifiedEvent } from '@console/shared/src/utils/utils'; import { USER_PREFERENCES_BASE_URL } from './const'; +import './UserPreferencePage.scss'; import type { UserPreferenceTabGroup, ResolvedUserPreferenceItem, @@ -26,7 +36,6 @@ import type { } from './types'; import UserPreferenceForm from './UserPreferenceForm'; import { getUserPreferenceGroups } from './utils/getUserPreferenceGroups'; -import './UserPreferencePage.scss'; const UserPreferencePage: FC = () => { // resources and calls to hooks @@ -78,6 +87,7 @@ const UserPreferencePage: FC = () => { ); acc[1].push( { }; const activeTab = sortedUserPreferenceGroups.find((group) => group.id === activeTabId)?.label; return ( -
+ <> {activeTab ? t('console-app~User Preferences {{activeTab}}', { activeTab }) @@ -131,8 +141,8 @@ const UserPreferencePage: FC = () => { /> {userPreferenceItemResolved ? ( -
-
+ + { > {userPreferenceTabs} -
-
+ + {userPreferenceTabContents} {spotlight && spotlightElement && } -
-
+ + ) : ( )}
-
+ ); };