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:
parent
0ebfe047d1
commit
81c5f4acc3
27 changed files with 2046 additions and 36 deletions
|
@ -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}
|
||||
/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue