diff --git a/packages/module/patternfly-docs/content/extensions/react-console/examples/AccessConsoles.md b/packages/module/patternfly-docs/content/extensions/react-console/examples/AccessConsoles.md index 66d90d2..25a799b 100644 --- a/packages/module/patternfly-docs/content/extensions/react-console/examples/AccessConsoles.md +++ b/packages/module/patternfly-docs/content/extensions/react-console/examples/AccessConsoles.md @@ -1,6 +1,7 @@ --- id: Access consoles section: extensions +source: react propComponents: ['AccessConsoles'] ouia: false beta: true diff --git a/packages/module/patternfly-docs/content/extensions/react-console/examples/DesktopViewer.md b/packages/module/patternfly-docs/content/extensions/react-console/examples/DesktopViewer.md index 4015283..1e62eb1 100644 --- a/packages/module/patternfly-docs/content/extensions/react-console/examples/DesktopViewer.md +++ b/packages/module/patternfly-docs/content/extensions/react-console/examples/DesktopViewer.md @@ -1,6 +1,7 @@ --- id: DesktopViewer section: consoles +source: react propComponents: ['DesktopViewer'] ouia: false beta: true diff --git a/packages/module/patternfly-docs/generated/consoles/desktopviewer/react.js b/packages/module/patternfly-docs/generated/consoles/desktopviewer/react.js new file mode 100644 index 0000000..7c6b88f --- /dev/null +++ b/packages/module/patternfly-docs/generated/consoles/desktopviewer/react.js @@ -0,0 +1,172 @@ +import React from 'react'; +import { AutoLinkHeader, Example, Link as PatternflyThemeLink } from '@patternfly/documentation-framework/components'; +import { DesktopViewer } from '@patternfly/react-console'; +const pageData = { + "id": "DesktopViewer", + "section": "consoles", + "source": "react", + "slug": "/consoles/desktopviewer/react", + "sourceLink": "https://github.com/patternfly/patternfly-react/blob/main/packages/module/patternfly-docs/content/extensions/react-console/examples/DesktopViewer.md", + "propComponents": [ + { + "name": "DesktopViewer", + "description": "", + "props": [ + { + "name": "children", + "type": "React.ReactNode", + "description": "Custom content of more-info section", + "defaultValue": "null" + }, + { + "name": "rdp", + "type": "ConsoleDetailPropType", + "description": "Connection details for RDP", + "defaultValue": "null" + }, + { + "name": "spice", + "type": "ConsoleDetailPropType", + "description": "Connection details for Spice", + "defaultValue": "null" + }, + { + "name": "textAddress", + "type": "string", + "description": "" + }, + { + "name": "textConnectWith", + "type": "string", + "description": "" + }, + { + "name": "textConnectWithRDP", + "type": "string", + "description": "" + }, + { + "name": "textConnectWithRemoteViewer", + "type": "string", + "description": "" + }, + { + "name": "textManualConnection", + "type": "string", + "description": "" + }, + { + "name": "textMoreInfo", + "type": "string", + "description": "Text that appears in the toggle" + }, + { + "name": "textMoreInfoContent", + "type": "string | React.ReactNode", + "description": "The information content appearing above the description list for guidelines to install virt-viewer" + }, + { + "name": "textMoreRDPInfo", + "type": "string", + "description": "Text that appears in the toggle" + }, + { + "name": "textMoreRDPInfoContent", + "type": "string | React.ReactNode", + "description": "The information content appearing above the description list for guidelines to install virt-viewer" + }, + { + "name": "textNoProtocol", + "type": "string", + "description": "" + }, + { + "name": "textRdpAddress", + "type": "string", + "description": "" + }, + { + "name": "textRDPPort", + "type": "string", + "description": "" + }, + { + "name": "textSpiceAddress", + "type": "string", + "description": "" + }, + { + "name": "textSpicePort", + "type": "string", + "description": "" + }, + { + "name": "textSpiceTlsPort", + "type": "string", + "description": "" + }, + { + "name": "textVNCAddress", + "type": "string", + "description": "" + }, + { + "name": "textVNCPort", + "type": "string", + "description": "" + }, + { + "name": "textVNCTlsPort", + "type": "string", + "description": "" + }, + { + "name": "vnc", + "type": "ConsoleDetailPropType", + "description": "Connection details for VNC", + "defaultValue": "null" + } + ] + } + ], + "beta": true, + "examples": [ + "Basic Usage" + ] +}; +pageData.liveContext = { + DesktopViewer +}; +pageData.relativeImports = { + +}; +pageData.examples = { + 'Basic Usage': props => + ","title":"Basic Usage","lang":"js"}}> + + +}; + +const Component = () => ( + + + {`Note`} + +

+ {`DesktopViewer lives in its own package at `} + + + {`@patternfly/react-console`} + + +

+ + {`Examples`} + + {React.createElement(pageData.examples["Basic Usage"])} +
+); +Component.displayName = 'ConsolesDesktopviewerReactDocs'; +Component.pageData = pageData; + +export default Component; diff --git a/packages/module/patternfly-docs/generated/extensions/access-consoles/react.js b/packages/module/patternfly-docs/generated/extensions/access-consoles/react.js new file mode 100644 index 0000000..ce32b5f --- /dev/null +++ b/packages/module/patternfly-docs/generated/extensions/access-consoles/react.js @@ -0,0 +1,88 @@ +import React from 'react'; +import { AutoLinkHeader, Example, Link as PatternflyThemeLink } from '@patternfly/documentation-framework/components'; +import { AccessConsoles, SerialConsole, VncConsole, DesktopViewer } from '@patternfly/react-console'; +import { SerialConsoleCustom } from '../../../content/extensions/react-console/examples/./SerialConsoleCustom.jsx'; +const pageData = { + "id": "Access consoles", + "section": "extensions", + "source": "react", + "slug": "/extensions/access-consoles/react", + "sourceLink": "https://github.com/patternfly/patternfly-react/blob/main/packages/module/patternfly-docs/content/extensions/react-console/examples/AccessConsoles.md", + "propComponents": [ + { + "name": "AccessConsoles", + "description": "", + "props": [ + { + "name": "preselectedType", + "type": "No type info", + "defaultValue": "null" + }, + { + "name": "textDesktopViewerConsole", + "type": "No type info", + "defaultValue": "'Desktop viewer'" + }, + { + "name": "textSelectConsoleType", + "type": "No type info", + "defaultValue": "'Select console type'" + }, + { + "name": "textSerialConsole", + "type": "No type info", + "defaultValue": "'Serial console'" + }, + { + "name": "textVncConsole", + "type": "No type info", + "defaultValue": "'VNC console'" + } + ] + } + ], + "beta": true, + "examples": [ + "Basic Usage" + ] +}; +pageData.liveContext = { + AccessConsoles, + SerialConsole, + VncConsole, + DesktopViewer, + SerialConsoleCustom +}; +pageData.relativeImports = { + +}; +pageData.examples = { + 'Basic Usage': props => + {\n const [status, setStatus] = React.useState('disconnected');\n const setConnected = React.useRef(debounce(() => setStatus('connected'), 3000)).current;\n const ref = React.createRef();\n\n return (\n \n \n {\n setStatus('loading');\n setConnected();\n }}\n status={status}\n onDisconnect={() => setStatus('disconnected')}\n onData={data => {\n ref.current.onDataReceived(data);\n }}\n ref={ref}\n />\n \n \n \n );\n};","title":"Basic Usage","lang":"js"}}> + + +}; + +const Component = () => ( + + + {`Note`} + +

+ {`AccessConsoles lives in its own package at `} + + + {`@patternfly/react-console`} + + +

+ + {`Examples`} + + {React.createElement(pageData.examples["Basic Usage"])} +
+); +Component.displayName = 'ExtensionsAccessConsolesReactDocs'; +Component.pageData = pageData; + +export default Component; diff --git a/packages/module/patternfly-docs/generated/index.js b/packages/module/patternfly-docs/generated/index.js index 1dbe3ea..718a406 100644 --- a/packages/module/patternfly-docs/generated/index.js +++ b/packages/module/patternfly-docs/generated/index.js @@ -1,20 +1,20 @@ module.exports = { - '/extensions/access-consoles/extensions': { + '/extensions/access-consoles/react': { id: "Access consoles", title: "Access consoles", toc: [[{"text":"Note"}],{"text":"Examples"},[{"text":"Basic Usage"}]], examples: ["Basic Usage"], section: "extensions", - source: "extensions", - Component: () => import(/* webpackChunkName: "extensions/access-consoles/extensions/index" */ './extensions/access-consoles/extensions') + source: "react", + Component: () => import(/* webpackChunkName: "extensions/access-consoles/react/index" */ './extensions/access-consoles/react') }, - '/consoles/desktopviewer/extensions': { + '/consoles/desktopviewer/react': { id: "DesktopViewer", title: "DesktopViewer", toc: [[{"text":"Note"}],{"text":"Examples"},[{"text":"Basic Usage"}]], examples: ["Basic Usage"], section: "consoles", - source: "extensions", - Component: () => import(/* webpackChunkName: "consoles/desktopviewer/extensions/index" */ './consoles/desktopviewer/extensions') + source: "react", + Component: () => import(/* webpackChunkName: "consoles/desktopviewer/react/index" */ './consoles/desktopviewer/react') } }; \ No newline at end of file diff --git a/packages/module/src/components/SerialConsole/SerialConsole.tsx b/packages/module/src/components/SerialConsole/SerialConsole.tsx index f26f8c8..3f28303 100644 --- a/packages/module/src/components/SerialConsole/SerialConsole.tsx +++ b/packages/module/src/components/SerialConsole/SerialConsole.tsx @@ -48,6 +48,7 @@ export interface SerialConsoleProps extends XTermProps { const SerialConsoleBase: React.FunctionComponent = ({ onConnect, onDisconnect, + // eslint-disable-next-line @typescript-eslint/no-empty-function onTitleChanged = () => {}, onData, cols, diff --git a/packages/module/src/components/VncConsole/VncConsole.test.tsx b/packages/module/src/components/VncConsole/VncConsole.test.tsx index 95d2101..606164b 100644 --- a/packages/module/src/components/VncConsole/VncConsole.test.tsx +++ b/packages/module/src/components/VncConsole/VncConsole.test.tsx @@ -1,4 +1,3 @@ -/* eslint-disable import/no-extraneous-dependencies */ import React from 'react'; import { render } from '@testing-library/react'; import { VncConsole } from './VncConsole'; diff --git a/packages/module/src/components/VncConsole/VncConsole.tsx b/packages/module/src/components/VncConsole/VncConsole.tsx index 40fcbff..3fbcd5c 100644 --- a/packages/module/src/components/VncConsole/VncConsole.tsx +++ b/packages/module/src/components/VncConsole/VncConsole.tsx @@ -87,6 +87,7 @@ export const VncConsole: React.FunctionComponent = ({ vncLogging = 'warn', consoleContainerId, additionalButtons = [] as React.ReactNode[], + // eslint-disable-next-line @typescript-eslint/no-empty-function onDisconnected = () => {}, onInitFailed, onSecurityFailure,