Skip to content
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

Backport the new styling to 1.2.x #909

Merged
merged 14 commits into from
May 7, 2024
Merged
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
1 change: 1 addition & 0 deletions packages/hawtio/src/plugins/camel/Camel.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.camel-split {
display: flex;
flex-direction: row;
height: calc(100vh - 85px);
}

.gutter {
Expand Down
4 changes: 3 additions & 1 deletion packages/hawtio/src/plugins/camel/CamelContent.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
#camel-content-main .pf-c-page__main {
overflow-x: auto;
}

#camel-content {
height: 100%;
}
#camel-content-header > #camel-contexts-toolbar {
float: right;
padding-top: 0;
Expand Down
33 changes: 21 additions & 12 deletions packages/hawtio/src/plugins/camel/CamelContent.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { eventService } from '@hawtiosrc/core'
import { AttributeValues, Attributes, Chart, JmxContentMBeans, MBeanNode, Operations } from '@hawtiosrc/plugins/shared'
import {
Divider,
EmptyState,
EmptyStateIcon,
EmptyStateVariant,
Nav,
NavItem,
NavList,
PageGroup,
PageNavigation,
PageSection,
PageSectionVariants,
Text,
Expand Down Expand Up @@ -159,17 +159,26 @@ export const CamelContent: React.FunctionComponent = () => {
const camelNavRoutes = navItems.map(nav => <Route key={nav.id} path={nav.id} element={nav.component} />)

return (
<React.Fragment>
<PageGroup>
<PageSection id='camel-content-header' variant={PageSectionVariants.light}>
{camelService.isContext(selectedNode) && <CamelContentContextToolbar />}
<Title headingLevel='h1'>{selectedNode.name}</Title>
{selectedNode.objectName && <Text component='small'>{selectedNode.objectName}</Text>}
<PageGroup id='camel-content'>
<PageSection id='camel-content-header' variant={PageSectionVariants.light}>
{camelService.isContext(selectedNode) && <CamelContentContextToolbar />}
<Title headingLevel='h1'>{selectedNode.name}</Title>
{selectedNode.objectName && <Text component='small'>{selectedNode.objectName}</Text>}
</PageSection>
<Divider />
{navItems.length > 1 && (
<PageSection type={'tabs'} variant={PageSectionVariants.light} hasShadowBottom>
{camelNav}
</PageSection>
{navItems.length > 1 && <PageNavigation>{camelNav}</PageNavigation>}
</PageGroup>

<PageSection id='camel-content-main'>
)}
<Divider />
<PageSection
id='camel-content-main'
variant={pathname.includes('chart') ? PageSectionVariants.default : PageSectionVariants.light}
padding={{ default: pathname.includes('chart') ? 'padding' : 'noPadding' }}
hasOverflowScroll
aria-label='camel-content-main'
>
{navItems.length > 0 && (
<Routes>
{camelNavRoutes}
Expand All @@ -178,7 +187,7 @@ export const CamelContent: React.FunctionComponent = () => {
)}
{navItems.length === 0 && !selectedNode.objectName && <JmxContentMBeans />}
</PageSection>
</React.Fragment>
</PageGroup>
)
}

Expand Down
4 changes: 2 additions & 2 deletions packages/hawtio/src/plugins/camel/contexts/Contexts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const Contexts: React.FunctionComponent = () => {
}

return (
<Card isFullHeight>
<React.Fragment>
<ContextToolbar
contexts={contexts.filter(c => selectedCtx.includes(c.node.name))}
deleteCallback={handleDeletedContexts}
Expand Down Expand Up @@ -159,6 +159,6 @@ export const Contexts: React.FunctionComponent = () => {
))}
</Tbody>
</TableComposable>
</Card>
</React.Fragment>
)
}
5 changes: 5 additions & 0 deletions packages/hawtio/src/plugins/camel/debug/Debug.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
overflow: auto;
margin-top: 1.5em;
}
#debug-header-container {
display: flex;
justify-content: space-between;
align-items: center;
}

.react-flow {
background-color: white !important;
Expand Down
142 changes: 71 additions & 71 deletions packages/hawtio/src/plugins/camel/debug/Debug.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { isBlank } from '@hawtiosrc/util/strings'
import { childText, parseXML } from '@hawtiosrc/util/xml'
import {
Button,
Card,
CardActions,
CardBody,
CardHeader,
CardTitle,
PanelMainBody,
Text,
Toolbar,
ToolbarContent,
ToolbarItem,
PanelHeader,
PanelMain,
Panel,
Title,
} from '@patternfly/react-core'
import {
BanIcon,
Expand Down Expand Up @@ -481,71 +481,71 @@ export const Debug: React.FunctionComponent = () => {
)

return (
<Card isFullHeight>
<CardHeader>
<CardTitle>Debug</CardTitle>
<CardActions>
<Button
variant='primary'
isSmall
icon={!isDebugging ? React.createElement(PlayIcon) : React.createElement(BanIcon)}
onClick={onDebugging}
isDisabled={!camelService.canGetBreakpoints(selectedNode)}
>
{!isDebugging ? 'Start Debugging' : 'Stop Debugging'}
</Button>
</CardActions>
</CardHeader>
<CardBody>
{!isDebugging && (
<Text data-testid='no-debugging' component='p'>
Debugging allows you to step through camel routes to diagnose issues.
</Text>
)}
{isDebugging && (
<React.Fragment>
<Toolbar id='toolbar-items'>
<ToolbarContent>{toolbarButtons}</ToolbarContent>
</Toolbar>

<MessageDrawer
messages={messages}
expanded={debugPanelExpanded}
setExpanded={setDebugPanelExpanded}
extraPanel={{
id: 'debug-panel-tab-breakpoints',
label: 'Breakpoints',
panelFn: debugPanelBreakpointsTab,
}}
>
<div id='route-diagram-breakpoint-view'>
<RouteDiagramContext.Provider
value={{
graphNodeData,
setGraphNodeData,
graphSelection,
setGraphSelection,
setShowStatistics,
doubleClickAction,
setDoubleClickAction,
annotations,
setAnnotations,
}}
>
<RouteDiagram />
</RouteDiagramContext.Provider>
</div>
</MessageDrawer>
</React.Fragment>
)}
<ConditionalBreakpointModal
selectedNode={selectedNode}
selection={graphSelection}
isConditionalBreakpointOpen={isConditionalBreakpointOpen}
onAddConditionalBreakpointToggle={onAddConditionalBreakpointToggle}
addConditionalBreakpoint={handleAddConditionalBreakpoint}
/>
</CardBody>
</Card>
<Panel>
<PanelHeader id='debug-header-container'>
<Title headingLevel='h3'>Debug</Title>
<Button
variant='primary'
isSmall
icon={!isDebugging ? React.createElement(PlayIcon) : React.createElement(BanIcon)}
onClick={onDebugging}
isDisabled={!camelService.canGetBreakpoints(selectedNode)}
>
{!isDebugging ? 'Start Debugging' : 'Stop Debugging'}
</Button>
</PanelHeader>
<PanelMain>
<PanelMainBody>
{!isDebugging && (
<Text data-testid='no-debugging' component='p'>
Debugging allows you to step through camel routes to diagnose issues.
</Text>
)}
{isDebugging && (
<React.Fragment>
<Toolbar id='toolbar-items'>
<ToolbarContent>{toolbarButtons}</ToolbarContent>
</Toolbar>

<MessageDrawer
messages={messages}
expanded={debugPanelExpanded}
setExpanded={setDebugPanelExpanded}
extraPanel={{
id: 'debug-panel-tab-breakpoints',
label: 'Breakpoints',
panelFn: debugPanelBreakpointsTab,
}}
>
<div id='route-diagram-breakpoint-view'>
<RouteDiagramContext.Provider
value={{
graphNodeData,
setGraphNodeData,
graphSelection,
setGraphSelection,
setShowStatistics,
doubleClickAction,
setDoubleClickAction,
annotations,
setAnnotations,
}}
>
<RouteDiagram />
</RouteDiagramContext.Provider>
</div>
</MessageDrawer>
</React.Fragment>
)}
<ConditionalBreakpointModal
selectedNode={selectedNode}
selection={graphSelection}
isConditionalBreakpointOpen={isConditionalBreakpointOpen}
onAddConditionalBreakpointToggle={onAddConditionalBreakpointToggle}
addConditionalBreakpoint={handleAddConditionalBreakpoint}
/>
</PanelMainBody>
</PanelMain>
</Panel>
)
}
Loading
Loading