mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 12:25:22 +02:00
feat(editor): provide yaml validation for docker compose in the portainer web editor [BE-11697] (#526)
This commit is contained in:
parent
0ebfe047d1
commit
81c5f4acc3
27 changed files with 2046 additions and 36 deletions
|
@ -1,5 +1,7 @@
|
|||
import { useFormikContext } from 'formik';
|
||||
|
||||
import { useDockerComposeSchema } from '@/react/hooks/useDockerComposeSchema/useDockerComposeSchema';
|
||||
|
||||
import { TextTip } from '@@/Tip/TextTip';
|
||||
import { WebEditorForm } from '@@/WebEditorForm';
|
||||
|
||||
|
@ -19,6 +21,7 @@ export function ComposeForm({
|
|||
versionOptions: number[] | undefined;
|
||||
}) {
|
||||
const { errors, values } = useFormikContext<FormValues>();
|
||||
const { data: dockerComposeSchema } = useDockerComposeSchema();
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -61,6 +64,7 @@ export function ComposeForm({
|
|||
data-cy="compose-editor"
|
||||
value={values.content}
|
||||
type="yaml"
|
||||
schema={dockerComposeSchema}
|
||||
id="compose-editor"
|
||||
placeholder="Define or paste the content of your docker compose file here"
|
||||
onChange={(value) => handleContentChange(DeploymentType.Compose, value)}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue