-
Notifications
You must be signed in to change notification settings - Fork 53
feat(ws): Introduce drawer to workspace creation wizard #310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import React, { Ref } from 'react'; | ||
import { | ||
Drawer, | ||
DrawerPanelContent, | ||
DrawerContent, | ||
DrawerContentBody, | ||
DrawerHead, | ||
DrawerActions, | ||
DrawerCloseButton, | ||
Title, | ||
} from '@patternfly/react-core'; | ||
|
||
interface WorkspaceCreationDrawerProps { | ||
children: React.ReactNode; | ||
title: string; | ||
info: React.ReactNode; | ||
isExpanded: boolean; | ||
drawerRef?: Ref<HTMLSpanElement>; | ||
onCloseClick: () => void; | ||
onExpand: () => void; | ||
} | ||
|
||
export const WorkspaceCreationDrawer: React.FC<WorkspaceCreationDrawerProps> = ({ | ||
children, | ||
isExpanded, | ||
drawerRef, | ||
title, | ||
info, | ||
onCloseClick, | ||
onExpand, | ||
}) => { | ||
const panelContent = ( | ||
<DrawerPanelContent> | ||
<DrawerHead> | ||
<span role="button" tabIndex={isExpanded ? 0 : -1} ref={drawerRef as Ref<HTMLSpanElement>}> | ||
<Title headingLevel="h6">{title}</Title> | ||
</span> | ||
<DrawerActions> | ||
<DrawerCloseButton onClick={onCloseClick} /> | ||
</DrawerActions> | ||
</DrawerHead> | ||
{info} | ||
</DrawerPanelContent> | ||
); | ||
|
||
return ( | ||
<> | ||
<Drawer isExpanded={isExpanded} isInline onExpand={onExpand}> | ||
<DrawerContent panelContent={panelContent}> | ||
<DrawerContentBody>{children}</DrawerContentBody> | ||
</DrawerContent> | ||
</Drawer> | ||
</> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -772,6 +772,11 @@ | |
flex-grow: 0; | ||
} | ||
|
||
// TODO: Remove when https://github.com/patternfly/patternfly-react/issues/11826 is resolved. | ||
.pf-v6-c-page__main-section .pf-v6-c-page__main-body { | ||
height: 100%; | ||
} | ||
|
||
Comment on lines
+776
to
+779
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given that we've created our own custom implementation of a "Wizard", for the Workspace Creation, this may be the best we can do right now. We really shouldn't have to apply a CSS override for the Drawer to render at full height though. I've opened patternfly/patternfly-react#11826 so Patternfly can handle custom component integration in Wizards better, since our use case has some pretty specific instances of components that the Wizard isn't currently built to support. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great idea! I'll follow the issue as well. Thank you for opening it! |
||
.mui-theme .pf-v6-c-pagination { | ||
--pf-v6-c-pagination__total-items--Display: block; | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.