feat(environments): create async edge [EE-4480] (#8527)

This commit is contained in:
Chaim Lev-Ari
2023-03-01 20:33:05 +02:00
committed by GitHub
parent bc6a667a6b
commit c819d4e7f7
59 changed files with 880 additions and 586 deletions

View File

@@ -1,4 +1,5 @@
import { Formik } from 'formik';
import { PropsWithChildren } from 'react';
import { OsSelector } from './OsSelector';
import { CommandTab } from './scripts';
@@ -21,15 +22,16 @@ interface Props {
edgeInfo: EdgeInfo;
commands: CommandTab[] | Partial<Record<OS, CommandTab[]>>;
isNomadTokenVisible?: boolean;
hideAsyncMode?: boolean;
asyncMode?: boolean;
}
export function EdgeScriptForm({
edgeInfo,
commands,
isNomadTokenVisible,
hideAsyncMode,
}: Props) {
asyncMode,
children,
}: PropsWithChildren<Props>) {
const showOsSelector = !(commands instanceof Array);
return (
@@ -41,6 +43,8 @@ export function EdgeScriptForm({
>
{({ values, setFieldValue }) => (
<>
{children}
<EdgeScriptSettingsFieldset
isNomadTokenVisible={
isNomadTokenVisible && values.platform === 'nomad'
@@ -63,7 +67,7 @@ export function EdgeScriptForm({
onPlatformChange={(platform) =>
setFieldValue('platform', platform)
}
hideAsyncMode={hideAsyncMode}
asyncMode={asyncMode}
/>
</div>
</>