66 ActionGroup ,
77 Button ,
88 PageSection ,
9- Title ,
109 Alert ,
1110 NumberInput ,
1211 FormHelperText ,
@@ -18,14 +17,18 @@ import {
1817 useK8sModel ,
1918 k8sCreate ,
2019 useActiveNamespace ,
21- YAMLEditor ,
20+ CodeEditor ,
2221} from "@openshift-console/dynamic-plugin-sdk" ;
2322import { useNavigate } from "react-router-dom-v5-compat" ;
2423import { useCronTabTranslation } from "@crontab-utils/hooks/useCronTabTranslation" ;
2524import { cronTabGroupVersionKind } from "src/utils/utils" ;
2625import { CronTabKind } from "@crontab-model/types" ;
2726import yaml from "js-yaml" ;
2827import { defaultCronTabYamlTemplate } from "src/templates/crontab-yaml" ;
28+ import {
29+ PageHeader ,
30+ PageHeaderLinkProps ,
31+ } from "@patternfly/react-component-groups" ;
2932
3033export const CronTabForm : React . FC = ( ) => {
3134 const [ model ] = useK8sModel ( cronTabGroupVersionKind ) ;
@@ -136,22 +139,25 @@ export const CronTabForm: React.FC = () => {
136139 } ;
137140
138141 return (
139- < PageSection >
140- < Title headingLevel = "h1" data-test = "page-heading" >
141- { t ( "Create CronTab" ) }
142- </ Title >
143- < Button variant = "link" onClick = { ( ) => setShowYaml ( ! showYaml ) } >
144- { showYaml ? t ( "Form View" ) : t ( "YAML Editor" ) }
145- </ Button >
142+ < PageSection isFilled = { true } height = "sizeToFit" >
143+ < PageHeader
144+ title = { t ( "Create CronTab" ) }
145+ linkProps = {
146+ {
147+ label : showYaml ? t ( "Form View" ) : t ( "YAML Editor" ) ,
148+ onClick : ( ) => setShowYaml ( ! showYaml ) ,
149+ } as PageHeaderLinkProps
150+ }
151+ />
146152
147153 { showYaml ? (
148154 < >
149- < YAMLEditor
155+ < CodeEditor
150156 value = { yamlContent }
151- language = "yaml"
152- onChange = { ( _e , val ) => setYamlContent ( val as string ) }
153- minHeight = "0"
157+ onChange = { ( val ) => setYamlContent ( val ) }
158+ // @ts -expect-error TODO: fix this
154159 height = "500px"
160+ language = "yaml"
155161 options = { {
156162 wordWrap : "on" ,
157163 formatOnPaste : true ,
0 commit comments