Skip to content

Commit

Permalink
Merge pull request #1585 from rszwajko/consolePF4
Browse files Browse the repository at this point in the history
Migrate to PF4 based react-console
  • Loading branch information
sjd78 authored Jun 14, 2022
2 parents bfd825b + 5949d9d commit cdfd137
Show file tree
Hide file tree
Showing 10 changed files with 389 additions and 385 deletions.
41 changes: 0 additions & 41 deletions src/components/Toolbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ import {
} from '@patternfly/react-core'
import { RouterPropTypeShapes } from '_/propTypeShapes'
import VmActions from '../VmActions'
import VmConsoleSelector from '../VmConsole/VmConsoleSelector'
import VmConsoleInstructionsModal from '../VmConsole/VmConsoleInstructionsModal'
import VmsListToolbar from './VmsListToolbar'
import { NATIVE_VNC, SPICE } from '_/constants'

const VmDetailToolbar = ({ match, vms }) => {
if (vms.getIn(['vms', match.params.id])) {
Expand Down Expand Up @@ -43,48 +40,10 @@ const VmDetailToolbarConnected = connect(
})
)(VmDetailToolbar)

const VmConsoleToolbar = ({ match: { params: { id, consoleType } } = {}, vms }) => {
if (!vms.getIn(['vms', id])) {
return <Toolbar/>
}

return (
<Toolbar className='portaled-toolbars-padding'>
<ToolbarContent >
<ToolbarGroup variant="button-group">
<VmConsoleSelector
vmId={id}
consoleType={consoleType}
isConsolePage
/>
<VmConsoleInstructionsModal
disabled={![NATIVE_VNC, SPICE].includes(consoleType)}
/>
</ToolbarGroup>
<ToolbarGroup variant="button-group" alignment={{ default: 'alignRight' }}>
<div id='vm-console-toolbar-sendkeys' />
</ToolbarGroup>
</ToolbarContent>
</Toolbar>
)
}

VmConsoleToolbar.propTypes = {
vms: PropTypes.object.isRequired,
match: RouterPropTypeShapes.match.isRequired,
}

const VmConsoleToolbarConnected = connect(
(state) => ({
vms: state.vms,
})
)(VmConsoleToolbar)

const SettingsToolbar = () => <div id='settings-toolbar' />

export {
VmDetailToolbarConnected as VmDetailToolbar,
VmConsoleToolbarConnected as VmConsoleToolbar,
VmsListToolbar,
SettingsToolbar,
}
62 changes: 0 additions & 62 deletions src/components/VmConsole/VmConsoleInstructionsModal.js

This file was deleted.

77 changes: 0 additions & 77 deletions src/components/VmConsole/VmConsoleSelector.js

This file was deleted.

Loading

0 comments on commit cdfd137

Please sign in to comment.