From 4c6f5f961e59536e41772a6b6103281469d637d6 Mon Sep 17 00:00:00 2001 From: cmeng Date: Mon, 6 Mar 2023 10:43:08 +1300 Subject: [PATCH] fix(wizard): fix tunnel add validation [EE-5124] (#8595) --- .../shared/EdgeAgentTab/EdgeAgentForm/EdgeAgentForm.tsx | 2 +- .../EdgeAgentTab/EdgeAgentForm/EdgeAgentForm.validation.ts | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentForm/EdgeAgentForm.tsx b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentForm/EdgeAgentForm.tsx index fe0d5e0fe..58432adbe 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentForm/EdgeAgentForm.tsx +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentForm/EdgeAgentForm.tsx @@ -32,7 +32,7 @@ export function EdgeAgentForm({ onCreate, readonly, asyncMode }: Props) { const settingsQuery = useSettings(); const createMutation = useCreateEdgeAgentEnvironmentMutation(); - const validation = useValidationSchema(asyncMode); + const validation = useValidationSchema(); if (!settingsQuery.data) { return null; diff --git a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentForm/EdgeAgentForm.validation.ts b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentForm/EdgeAgentForm.validation.ts index b34c3fe2f..09fb72517 100644 --- a/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentForm/EdgeAgentForm.validation.ts +++ b/app/react/portainer/environments/wizard/EnvironmentsCreationView/shared/EdgeAgentTab/EdgeAgentForm/EdgeAgentForm.validation.ts @@ -5,7 +5,6 @@ import { EdgeAsyncIntervalsValues, } from '@/react/edge/components/EdgeAsyncIntervalsForm'; import { validation as urlValidation } from '@/react/portainer/common/PortainerTunnelAddrField'; -import { validation as addressValidation } from '@/react/portainer/common/PortainerUrlField'; import { isBE } from '@/react/portainer/feature-flags/feature-flags.service'; import { metadataValidation } from '../../MetadataFieldset/validation'; @@ -13,13 +12,13 @@ import { useNameValidation } from '../../NameField'; import { FormValues } from './types'; -export function useValidationSchema(asyncMode: boolean): SchemaOf { +export function useValidationSchema(): SchemaOf { const nameValidation = useNameValidation(); return object().shape({ name: nameValidation, portainerUrl: urlValidation(), - tunnelServerAddr: asyncMode ? string() : addressValidation(), + tunnelServerAddr: string(), pollFrequency: number().required(), meta: metadataValidation(), edge: isBE