1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 05:19:39 +02:00

feat(editor): provide yaml validation for docker compose in the portainer web editor [BE-11697] (#526)

This commit is contained in:
Ali 2025-03-27 17:11:55 +13:00 committed by GitHub
parent 0ebfe047d1
commit 81c5f4acc3
27 changed files with 2046 additions and 36 deletions

View file

@ -1,11 +1,12 @@
import {
ReactNode,
ComponentProps,
PropsWithChildren,
ReactNode,
useEffect,
useMemo,
useEffect,
} from 'react';
import { useTransitionHook } from '@uirouter/react';
import { JSONSchema7 } from 'json-schema';
import { BROWSER_OS_PLATFORM } from '@/react/constants';
@ -63,6 +64,7 @@ interface Props extends CodeEditorProps {
titleContent?: ReactNode;
hideTitle?: boolean;
error?: string;
schema?: JSONSchema7;
}
export function WebEditorForm({
@ -71,6 +73,7 @@ export function WebEditorForm({
hideTitle,
children,
error,
schema,
...props
}: PropsWithChildren<Props>) {
return (
@ -94,6 +97,8 @@ export function WebEditorForm({
<div className="col-sm-12 col-lg-12">
<CodeEditor
id={id}
type="yaml"
schema={schema as JSONSchema7}
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
/>