From e7ce12772acfe85707aeb630139495b2ab3f0e05 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Sun, 15 Jun 2025 21:40:21 +0800 Subject: [PATCH] refactor: remove zod.trim() validators --- ui/src/components/access/AccessForm.tsx | 1 - .../components/access/AccessForm1PanelConfig.tsx | 3 +-- .../components/access/AccessFormACMECAConfig.tsx | 4 ++-- .../access/AccessFormACMEHttpReqConfig.tsx | 2 -- .../components/access/AccessFormAPISIXConfig.tsx | 2 +- ui/src/components/access/AccessFormAWSConfig.tsx | 6 ++---- .../components/access/AccessFormAliyunConfig.tsx | 2 -- .../components/access/AccessFormAzureConfig.tsx | 9 +++------ .../access/AccessFormBaiduCloudConfig.tsx | 4 +--- .../components/access/AccessFormBaishanConfig.tsx | 3 +-- .../access/AccessFormBaotaPanelConfig.tsx | 2 +- .../access/AccessFormBaotaWAFConfig.tsx | 2 +- .../components/access/AccessFormBunnyConfig.tsx | 7 +------ .../access/AccessFormBytePlusConfig.tsx | 4 +--- .../access/AccessFormCMCCCloudConfig.tsx | 6 ++---- .../access/AccessFormCacheFlyConfig.tsx | 3 +-- .../components/access/AccessFormCdnflyConfig.tsx | 6 ++---- .../components/access/AccessFormClouDNSConfig.tsx | 4 +--- .../access/AccessFormCloudflareConfig.tsx | 4 +--- .../access/AccessFormConstellixConfig.tsx | 4 ++-- .../components/access/AccessFormDNSLAConfig.tsx | 6 ++---- .../components/access/AccessFormDeSECConfig.tsx | 3 +-- .../access/AccessFormDigitalOceanConfig.tsx | 2 +- .../access/AccessFormDingTalkBotConfig.tsx | 2 +- .../access/AccessFormDiscordBotConfig.tsx | 3 +-- .../access/AccessFormDogeCloudConfig.tsx | 6 ++---- .../components/access/AccessFormDuckDNSConfig.tsx | 2 +- .../components/access/AccessFormDynv6Config.tsx | 3 +-- .../components/access/AccessFormEdgioConfig.tsx | 6 ++---- .../components/access/AccessFormFlexCDNConfig.tsx | 4 ++-- .../components/access/AccessFormGcoreConfig.tsx | 3 +-- .../components/access/AccessFormGnameConfig.tsx | 6 ++---- .../components/access/AccessFormGoDaddyConfig.tsx | 6 ++---- .../components/access/AccessFormGoEdgeConfig.tsx | 4 ++-- .../AccessFormGoogleTrustServicesConfig.tsx | 6 ++---- .../components/access/AccessFormHetznerConfig.tsx | 2 +- .../access/AccessFormHuaweiCloudConfig.tsx | 2 -- .../components/access/AccessFormJDCloudConfig.tsx | 6 ++---- .../access/AccessFormKubernetesConfig.tsx | 1 - .../components/access/AccessFormLeCDNConfig.tsx | 4 ++-- ui/src/components/access/AccessFormNS1Config.tsx | 3 +-- .../access/AccessFormNameDotComConfig.tsx | 6 ++---- .../access/AccessFormNameSiloConfig.tsx | 3 +-- .../access/AccessFormNamecheapConfig.tsx | 6 ++---- .../components/access/AccessFormNetcupConfig.tsx | 6 +++--- .../components/access/AccessFormNetlifyConfig.tsx | 2 +- .../components/access/AccessFormPorkbunConfig.tsx | 6 ++---- .../access/AccessFormPowerDNSConfig.tsx | 3 +-- .../access/AccessFormProxmoxVEConfig.tsx | 2 +- .../components/access/AccessFormQiniuConfig.tsx | 6 ++---- .../components/access/AccessFormRainYunConfig.tsx | 3 +-- .../access/AccessFormRatPanelConfig.tsx | 2 +- .../components/access/AccessFormSSLComConfig.tsx | 6 ++---- .../access/AccessFormSafeLineConfig.tsx | 3 +-- .../access/AccessFormSlackBotConfig.tsx | 3 +-- .../access/AccessFormTelegramBotConfig.tsx | 3 +-- .../access/AccessFormTencentCloudConfig.tsx | 6 ++---- .../components/access/AccessFormUCloudConfig.tsx | 7 ++----- .../access/AccessFormUniCloudConfig.tsx | 4 ++-- .../components/access/AccessFormUpyunConfig.tsx | 2 -- .../components/access/AccessFormVercelConfig.tsx | 4 +--- .../access/AccessFormVolcEngineConfig.tsx | 6 ++---- .../components/access/AccessFormWangsuConfig.tsx | 9 +++------ .../components/access/AccessFormWestcnConfig.tsx | 6 ++---- .../components/access/AccessFormZeroSSLConfig.tsx | 6 ++---- .../NotifyChannelEditFormGotifyFields.tsx | 7 ++++++- ui/src/components/notification/NotifyTemplate.tsx | 6 ++---- .../node/ApplyNodeConfigFormAWSRoute53Config.tsx | 6 ++---- .../node/ApplyNodeConfigFormAliyunESAConfig.tsx | 3 +-- .../ApplyNodeConfigFormHuaweiCloudDNSConfig.tsx | 3 +-- .../node/ApplyNodeConfigFormJDCloudDNSConfig.tsx | 3 +-- .../ApplyNodeConfigFormTencentCloudEOConfig.tsx | 3 +-- .../node/DeployNodeConfigFormAWSACMConfig.tsx | 3 +-- .../DeployNodeConfigFormAWSCloudFrontConfig.tsx | 6 +++--- .../node/DeployNodeConfigFormAWSIAMConfig.tsx | 3 +-- .../node/DeployNodeConfigFormAliyunALBConfig.tsx | 5 +---- .../DeployNodeConfigFormAliyunAPIGWConfig.tsx | 3 +-- .../node/DeployNodeConfigFormAliyunCASConfig.tsx | 3 +-- .../DeployNodeConfigFormAliyunCASDeployConfig.tsx | 3 +-- .../node/DeployNodeConfigFormAliyunCLBConfig.tsx | 6 ++---- .../node/DeployNodeConfigFormAliyunDDoSConfig.tsx | 3 +-- .../node/DeployNodeConfigFormAliyunESAConfig.tsx | 3 +-- .../node/DeployNodeConfigFormAliyunFCConfig.tsx | 3 +-- .../node/DeployNodeConfigFormAliyunGAConfig.tsx | 6 +----- .../node/DeployNodeConfigFormAliyunLiveConfig.tsx | 3 +-- .../node/DeployNodeConfigFormAliyunNLBConfig.tsx | 5 +---- .../node/DeployNodeConfigFormAliyunOSSConfig.tsx | 6 ++---- .../node/DeployNodeConfigFormAliyunVODConfig.tsx | 3 +-- .../node/DeployNodeConfigFormAliyunWAFConfig.tsx | 6 ++---- .../DeployNodeConfigFormAzureKeyVaultConfig.tsx | 3 +-- ...DeployNodeConfigFormBaiduCloudAppBLBConfig.tsx | 6 ++---- .../DeployNodeConfigFormBaiduCloudBLBConfig.tsx | 6 ++---- .../DeployNodeConfigFormBaotaWAFSiteConfig.tsx | 2 +- .../node/DeployNodeConfigFormBunnyCDNConfig.tsx | 8 +++----- ...eployNodeConfigFormEdgioApplicationsConfig.tsx | 3 +-- .../DeployNodeConfigFormHuaweiCloudCDNConfig.tsx | 3 +-- .../DeployNodeConfigFormHuaweiCloudELBConfig.tsx | 6 +----- .../DeployNodeConfigFormHuaweiCloudWAFConfig.tsx | 4 +--- .../node/DeployNodeConfigFormJDCloudALBConfig.tsx | 5 +---- ...DeployNodeConfigFormKubernetesSecretConfig.tsx | 15 +++++---------- .../node/DeployNodeConfigFormLocalConfig.tsx | 10 +--------- .../node/DeployNodeConfigFormQiniuPiliConfig.tsx | 5 +---- .../node/DeployNodeConfigFormSSHConfig.tsx | 10 +--------- .../DeployNodeConfigFormTencentCloudCLBConfig.tsx | 7 ++----- .../DeployNodeConfigFormTencentCloudCOSConfig.tsx | 6 ++---- .../DeployNodeConfigFormTencentCloudEOConfig.tsx | 3 +-- ...DeployNodeConfigFormTencentCloudGAAPConfig.tsx | 3 +-- .../DeployNodeConfigFormTencentCloudSCFConfig.tsx | 3 +-- ...yNodeConfigFormTencentCloudSSLDeployConfig.tsx | 6 ++---- .../DeployNodeConfigFormTencentCloudWAFConfig.tsx | 9 +++------ .../node/DeployNodeConfigFormUCloudUS3Config.tsx | 6 ++---- .../DeployNodeConfigFormUniCloudWebHostConfig.tsx | 4 ++-- .../DeployNodeConfigFormVolcEngineALBConfig.tsx | 5 +---- .../DeployNodeConfigFormVolcEngineCLBConfig.tsx | 5 +---- ...oyNodeConfigFormVolcEngineCertCenterConfig.tsx | 3 +-- ...DeployNodeConfigFormVolcEngineImageXConfig.tsx | 6 ++---- .../DeployNodeConfigFormVolcEngineTOSConfig.tsx | 6 ++---- ui/src/pages/workflows/WorkflowDetail.tsx | 4 +--- ui/src/pages/workflows/WorkflowNew.tsx | 4 +--- 119 files changed, 174 insertions(+), 361 deletions(-) diff --git a/ui/src/components/access/AccessForm.tsx b/ui/src/components/access/AccessForm.tsx index 91d7139f..2d8bee1b 100644 --- a/ui/src/components/access/AccessForm.tsx +++ b/ui/src/components/access/AccessForm.tsx @@ -109,7 +109,6 @@ const AccessForm = forwardRef(({ className, const formSchema = z.object({ name: z .string({ message: t("access.form.name.placeholder") }) - .trim() .min(1, t("access.form.name.placeholder")) .max(64, t("common.errmsg.string_max", { max: 64 })), provider: z.nativeEnum(ACCESS_PROVIDERS, { diff --git a/ui/src/components/access/AccessForm1PanelConfig.tsx b/ui/src/components/access/AccessForm1PanelConfig.tsx index 56792a02..3af64e98 100644 --- a/ui/src/components/access/AccessForm1PanelConfig.tsx +++ b/ui/src/components/access/AccessForm1PanelConfig.tsx @@ -32,8 +32,7 @@ const AccessForm1PanelConfig = ({ form: formInst, formName, disabled, initialVal apiKey: z .string() .min(1, t("access.form.1panel_api_key.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), allowInsecureConnections: z.boolean().nullish(), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormACMECAConfig.tsx b/ui/src/components/access/AccessFormACMECAConfig.tsx index d3075f22..fbba1c73 100644 --- a/ui/src/components/access/AccessFormACMECAConfig.tsx +++ b/ui/src/components/access/AccessFormACMECAConfig.tsx @@ -26,8 +26,8 @@ const AccessFormACMECAConfig = ({ form: formInst, formName, disabled, initialVal const formSchema = z.object({ endpoint: z.string().url(t("common.errmsg.url_invalid")), - eabKid: z.string().trim().nullish(), - eabHmacKey: z.string().trim().nullish(), + eabKid: z.string().nullish(), + eabHmacKey: z.string().nullish(), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormACMEHttpReqConfig.tsx b/ui/src/components/access/AccessFormACMEHttpReqConfig.tsx index 57cbc22d..6cdd8e3c 100644 --- a/ui/src/components/access/AccessFormACMEHttpReqConfig.tsx +++ b/ui/src/components/access/AccessFormACMEHttpReqConfig.tsx @@ -31,12 +31,10 @@ const AccessFormACMEHttpReqConfig = ({ form: formInst, formName, disabled, initi username: z .string() .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim() .nullish(), password: z .string() .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim() .nullish(), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormAPISIXConfig.tsx b/ui/src/components/access/AccessFormAPISIXConfig.tsx index 856a6565..71de8521 100644 --- a/ui/src/components/access/AccessFormAPISIXConfig.tsx +++ b/ui/src/components/access/AccessFormAPISIXConfig.tsx @@ -27,7 +27,7 @@ const AccessFormAPISIXConfig = ({ form: formInst, formName, disabled, initialVal const formSchema = z.object({ serverUrl: z.string().url(t("common.errmsg.url_invalid")), - apiKey: z.string().trim().nonempty(t("access.form.apisix_api_key.placeholder")), + apiKey: z.string().nonempty(t("access.form.apisix_api_key.placeholder")), allowInsecureConnections: z.boolean().nullish(), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormAWSConfig.tsx b/ui/src/components/access/AccessFormAWSConfig.tsx index 1eee6247..89500feb 100644 --- a/ui/src/components/access/AccessFormAWSConfig.tsx +++ b/ui/src/components/access/AccessFormAWSConfig.tsx @@ -29,13 +29,11 @@ const AccessFormAWSConfig = ({ form: formInst, formName, disabled, initialValues accessKeyId: z .string() .min(1, t("access.form.aws_access_key_id.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), secretAccessKey: z .string() .min(1, t("access.form.aws_secret_access_key.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormAliyunConfig.tsx b/ui/src/components/access/AccessFormAliyunConfig.tsx index 4904b072..0c34c64e 100644 --- a/ui/src/components/access/AccessFormAliyunConfig.tsx +++ b/ui/src/components/access/AccessFormAliyunConfig.tsx @@ -28,12 +28,10 @@ const AccessFormAliyunConfig = ({ form: formInst, formName, disabled, initialVal const formSchema = z.object({ accessKeyId: z .string() - .trim() .min(1, t("access.form.aliyun_access_key_id.placeholder")) .max(64, t("common.errmsg.string_max", { max: 64 })), accessKeySecret: z .string() - .trim() .min(1, t("access.form.aliyun_access_key_secret.placeholder")) .max(64, t("common.errmsg.string_max", { max: 64 })), resourceGroupId: z.string().nullish(), diff --git a/ui/src/components/access/AccessFormAzureConfig.tsx b/ui/src/components/access/AccessFormAzureConfig.tsx index a5facbf9..48be8aa5 100644 --- a/ui/src/components/access/AccessFormAzureConfig.tsx +++ b/ui/src/components/access/AccessFormAzureConfig.tsx @@ -30,18 +30,15 @@ const AccessFormAzureConfig = ({ form: formInst, formName, disabled, initialValu tenantId: z .string() .min(1, t("access.form.azure_tenant_id.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), clientId: z .string() .min(1, t("access.form.azure_client_id.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), clientSecret: z .string() .min(1, t("access.form.azure_client_secret.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), cloudName: z.string().nullish(), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormBaiduCloudConfig.tsx b/ui/src/components/access/AccessFormBaiduCloudConfig.tsx index f72473de..ab7abffc 100644 --- a/ui/src/components/access/AccessFormBaiduCloudConfig.tsx +++ b/ui/src/components/access/AccessFormBaiduCloudConfig.tsx @@ -28,14 +28,12 @@ const AccessFormBaiduCloudConfig = ({ form: formInst, formName, disabled, initia const formSchema = z.object({ accessKeyId: z .string() - .trim() .min(1, t("access.form.baiducloud_access_key_id.placeholder")) .max(64, t("common.errmsg.string_max", { max: 64 })), secretAccessKey: z .string() .min(1, t("access.form.baiducloud_secret_access_key.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormBaishanConfig.tsx b/ui/src/components/access/AccessFormBaishanConfig.tsx index 0450d9cd..ab17c62b 100644 --- a/ui/src/components/access/AccessFormBaishanConfig.tsx +++ b/ui/src/components/access/AccessFormBaishanConfig.tsx @@ -28,8 +28,7 @@ const AccessFormBaishanConfig = ({ form: formInst, formName, disabled, initialVa apiToken: z .string() .min(1, t("access.form.baishan_api_token.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormBaotaPanelConfig.tsx b/ui/src/components/access/AccessFormBaotaPanelConfig.tsx index d9cc2752..6acbc62c 100644 --- a/ui/src/components/access/AccessFormBaotaPanelConfig.tsx +++ b/ui/src/components/access/AccessFormBaotaPanelConfig.tsx @@ -27,7 +27,7 @@ const AccessFormBaotaPanelConfig = ({ form: formInst, formName, disabled, initia const formSchema = z.object({ serverUrl: z.string().url(t("common.errmsg.url_invalid")), - apiKey: z.string().nonempty(t("access.form.baotapanel_api_key.placeholder")).trim(), + apiKey: z.string().nonempty(t("access.form.baotapanel_api_key.placeholder")), allowInsecureConnections: z.boolean().nullish(), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormBaotaWAFConfig.tsx b/ui/src/components/access/AccessFormBaotaWAFConfig.tsx index edf18642..13e4a2c2 100644 --- a/ui/src/components/access/AccessFormBaotaWAFConfig.tsx +++ b/ui/src/components/access/AccessFormBaotaWAFConfig.tsx @@ -27,7 +27,7 @@ const AccessFormBaotaWAFConfig = ({ form: formInst, formName, disabled, initialV const formSchema = z.object({ serverUrl: z.string().url(t("common.errmsg.url_invalid")), - apiKey: z.string().nonempty(t("access.form.baotawaf_api_key.placeholder")).trim(), + apiKey: z.string().nonempty(t("access.form.baotawaf_api_key.placeholder")), allowInsecureConnections: z.boolean().nullish(), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormBunnyConfig.tsx b/ui/src/components/access/AccessFormBunnyConfig.tsx index 0906d3d0..8ea052f7 100644 --- a/ui/src/components/access/AccessFormBunnyConfig.tsx +++ b/ui/src/components/access/AccessFormBunnyConfig.tsx @@ -25,10 +25,7 @@ const AccessFormBunnyConfig = ({ form: formInst, formName, disabled, initialValu const { t } = useTranslation(); const formSchema = z.object({ - apiKey: z - .string() - .nonempty(t("access.form.bunny_api_key.placeholder")) - .trim(), + apiKey: z.string().nonempty(t("access.form.bunny_api_key.placeholder")), }); const formRule = createSchemaFieldRule(formSchema); @@ -45,7 +42,6 @@ const AccessFormBunnyConfig = ({ form: formInst, formName, disabled, initialValu name={formName} onValuesChange={handleFormChange} > - - ); }; diff --git a/ui/src/components/access/AccessFormBytePlusConfig.tsx b/ui/src/components/access/AccessFormBytePlusConfig.tsx index 184e0189..5902edb8 100644 --- a/ui/src/components/access/AccessFormBytePlusConfig.tsx +++ b/ui/src/components/access/AccessFormBytePlusConfig.tsx @@ -28,14 +28,12 @@ const AccessFormBytePlusConfig = ({ form: formInst, formName, disabled, initialV const formSchema = z.object({ accessKey: z .string() - .trim() .min(1, t("access.form.byteplus_access_key.placeholder")) .max(64, t("common.errmsg.string_max", { max: 64 })), secretKey: z .string() .min(1, t("access.form.byteplus_secret_key.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormCMCCCloudConfig.tsx b/ui/src/components/access/AccessFormCMCCCloudConfig.tsx index 9bc6e615..9ee88a07 100644 --- a/ui/src/components/access/AccessFormCMCCCloudConfig.tsx +++ b/ui/src/components/access/AccessFormCMCCCloudConfig.tsx @@ -28,13 +28,11 @@ const AccessFormCMCCCloudConfig = ({ form: formInst, formName, disabled, initial accessKeyId: z .string() .min(1, t("access.form.cmcccloud_access_key_id.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), accessKeySecret: z .string() .min(1, t("access.form.cmcccloud_access_key_secret.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormCacheFlyConfig.tsx b/ui/src/components/access/AccessFormCacheFlyConfig.tsx index b3172785..79ca197f 100644 --- a/ui/src/components/access/AccessFormCacheFlyConfig.tsx +++ b/ui/src/components/access/AccessFormCacheFlyConfig.tsx @@ -28,8 +28,7 @@ const AccessFormCacheFlyConfig = ({ form: formInst, formName, disabled, initialV apiToken: z .string() .min(1, t("access.form.cachefly_api_token.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormCdnflyConfig.tsx b/ui/src/components/access/AccessFormCdnflyConfig.tsx index 10422c3b..6e06d0e7 100644 --- a/ui/src/components/access/AccessFormCdnflyConfig.tsx +++ b/ui/src/components/access/AccessFormCdnflyConfig.tsx @@ -31,13 +31,11 @@ const AccessFormCdnflyConfig = ({ form: formInst, formName, disabled, initialVal apiKey: z .string() .min(1, t("access.form.cdnfly_api_key.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), apiSecret: z .string() .min(1, t("access.form.cdnfly_api_secret.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), allowInsecureConnections: z.boolean().nullish(), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormClouDNSConfig.tsx b/ui/src/components/access/AccessFormClouDNSConfig.tsx index 4472eeea..922a8e75 100644 --- a/ui/src/components/access/AccessFormClouDNSConfig.tsx +++ b/ui/src/components/access/AccessFormClouDNSConfig.tsx @@ -28,14 +28,12 @@ const AccessFormClouDNSConfig = ({ form: formInst, formName, disabled, initialVa const formSchema = z.object({ authId: z .string() - .trim() .min(1, t("access.form.cloudns_auth_id.placeholder")) .max(64, t("common.errmsg.string_max", { max: 64 })), authPassword: z .string() .min(1, t("access.form.cloudns_auth_password.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormCloudflareConfig.tsx b/ui/src/components/access/AccessFormCloudflareConfig.tsx index 79b33e3a..6e9ba6c1 100644 --- a/ui/src/components/access/AccessFormCloudflareConfig.tsx +++ b/ui/src/components/access/AccessFormCloudflareConfig.tsx @@ -28,12 +28,10 @@ const AccessFormCloudflareConfig = ({ form: formInst, formName, disabled, initia dnsApiToken: z .string() .min(1, t("access.form.cloudflare_dns_api_token.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), zoneApiToken: z .string() .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim() .nullish(), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormConstellixConfig.tsx b/ui/src/components/access/AccessFormConstellixConfig.tsx index 5966828a..8e028034 100644 --- a/ui/src/components/access/AccessFormConstellixConfig.tsx +++ b/ui/src/components/access/AccessFormConstellixConfig.tsx @@ -25,8 +25,8 @@ const AccessFormConstellixConfig = ({ form: formInst, formName, disabled, initia const { t } = useTranslation(); const formSchema = z.object({ - apiKey: z.string().trim().nonempty(t("access.form.constellix_api_key.placeholder")), - secretKey: z.string().trim().nonempty(t("access.form.constellix_secret_key.placeholder")), + apiKey: z.string().nonempty(t("access.form.constellix_api_key.placeholder")), + secretKey: z.string().nonempty(t("access.form.constellix_secret_key.placeholder")), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormDNSLAConfig.tsx b/ui/src/components/access/AccessFormDNSLAConfig.tsx index df8403ea..ee5ac5e6 100644 --- a/ui/src/components/access/AccessFormDNSLAConfig.tsx +++ b/ui/src/components/access/AccessFormDNSLAConfig.tsx @@ -29,13 +29,11 @@ const AccessFormDNSLAConfig = ({ form: formInst, formName, disabled, initialValu apiId: z .string() .min(1, t("access.form.dnsla_api_id.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), apiSecret: z .string() .min(1, t("access.form.dnsla_api_secret.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormDeSECConfig.tsx b/ui/src/components/access/AccessFormDeSECConfig.tsx index 4ba65a69..10f5a101 100644 --- a/ui/src/components/access/AccessFormDeSECConfig.tsx +++ b/ui/src/components/access/AccessFormDeSECConfig.tsx @@ -28,8 +28,7 @@ const AccessFormDeSECConfig = ({ form: formInst, formName, disabled, initialValu token: z .string() .min(1, t("access.form.desec_token.placeholder")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormDigitalOceanConfig.tsx b/ui/src/components/access/AccessFormDigitalOceanConfig.tsx index f4aafc4f..421ee9cc 100644 --- a/ui/src/components/access/AccessFormDigitalOceanConfig.tsx +++ b/ui/src/components/access/AccessFormDigitalOceanConfig.tsx @@ -25,7 +25,7 @@ const AccessFormDigitalOceanConfig = ({ form: formInst, formName, disabled, init const { t } = useTranslation(); const formSchema = z.object({ - accessToken: z.string().nonempty(t("access.form.digitalocean_access_token.placeholder")).trim(), + accessToken: z.string().nonempty(t("access.form.digitalocean_access_token.placeholder")), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormDingTalkBotConfig.tsx b/ui/src/components/access/AccessFormDingTalkBotConfig.tsx index 35aebf6e..59904e18 100644 --- a/ui/src/components/access/AccessFormDingTalkBotConfig.tsx +++ b/ui/src/components/access/AccessFormDingTalkBotConfig.tsx @@ -27,7 +27,7 @@ const AccessFormDingTalkBotConfig = ({ form: formInst, formName, disabled, initi const formSchema = z.object({ webhookUrl: z.string().url(t("common.errmsg.url_invalid")), - secret: z.string().nonempty(t("access.form.dingtalkbot_secret.placeholder")).trim(), + secret: z.string().nonempty(t("access.form.dingtalkbot_secret.placeholder")), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormDiscordBotConfig.tsx b/ui/src/components/access/AccessFormDiscordBotConfig.tsx index 16848686..5f844ccc 100644 --- a/ui/src/components/access/AccessFormDiscordBotConfig.tsx +++ b/ui/src/components/access/AccessFormDiscordBotConfig.tsx @@ -28,8 +28,7 @@ const AccessFormDiscordBotConfig = ({ form: formInst, formName, disabled, initia botToken: z .string({ message: t("access.form.discordbot_token.placeholder") }) .min(1, t("access.form.discordbot_token.placeholder")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), defaultChannelId: z.string().nullish(), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormDogeCloudConfig.tsx b/ui/src/components/access/AccessFormDogeCloudConfig.tsx index 36b73f9f..3e61d75f 100644 --- a/ui/src/components/access/AccessFormDogeCloudConfig.tsx +++ b/ui/src/components/access/AccessFormDogeCloudConfig.tsx @@ -29,13 +29,11 @@ const AccessFormDogeCloudConfig = ({ form: formInst, formName, disabled, initial accessKey: z .string() .min(1, t("access.form.dogecloud_access_key.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), secretKey: z .string() .min(1, t("access.form.dogecloud_secret_key.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormDuckDNSConfig.tsx b/ui/src/components/access/AccessFormDuckDNSConfig.tsx index 969f78f8..6b9c81b8 100644 --- a/ui/src/components/access/AccessFormDuckDNSConfig.tsx +++ b/ui/src/components/access/AccessFormDuckDNSConfig.tsx @@ -25,7 +25,7 @@ const AccessFormDuckDNSConfig = ({ form: formInst, formName, disabled, initialVa const { t } = useTranslation(); const formSchema = z.object({ - token: z.string().nonempty(t("access.form.duckdns_token.placeholder")).trim(), + token: z.string().nonempty(t("access.form.duckdns_token.placeholder")), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormDynv6Config.tsx b/ui/src/components/access/AccessFormDynv6Config.tsx index 92385302..87e16c1e 100644 --- a/ui/src/components/access/AccessFormDynv6Config.tsx +++ b/ui/src/components/access/AccessFormDynv6Config.tsx @@ -28,8 +28,7 @@ const AccessFormDynv6Config = ({ form: formInst, formName, disabled, initialValu httpToken: z .string() .min(1, t("access.form.dynv6_http_token.placeholder")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormEdgioConfig.tsx b/ui/src/components/access/AccessFormEdgioConfig.tsx index d70ece6e..a91298c9 100644 --- a/ui/src/components/access/AccessFormEdgioConfig.tsx +++ b/ui/src/components/access/AccessFormEdgioConfig.tsx @@ -29,13 +29,11 @@ const AccessFormEdgioConfig = ({ form: formInst, formName, disabled, initialValu clientId: z .string() .min(1, t("access.form.edgio_client_id.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), clientSecret: z .string() .min(1, t("access.form.edgio_client_secret.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormFlexCDNConfig.tsx b/ui/src/components/access/AccessFormFlexCDNConfig.tsx index 71aa9607..f07b8359 100644 --- a/ui/src/components/access/AccessFormFlexCDNConfig.tsx +++ b/ui/src/components/access/AccessFormFlexCDNConfig.tsx @@ -32,8 +32,8 @@ const AccessFormFlexCDNConfig = ({ form: formInst, formName, disabled, initialVa role: z.union([z.literal("user"), z.literal("admin")], { message: t("access.form.flexcdn_api_role.placeholder"), }), - accessKeyId: z.string().nonempty(t("access.form.flexcdn_access_key_id.placeholder")).trim(), - accessKey: z.string().nonempty(t("access.form.flexcdn_access_key.placeholder")).trim(), + accessKeyId: z.string().nonempty(t("access.form.flexcdn_access_key_id.placeholder")), + accessKey: z.string().nonempty(t("access.form.flexcdn_access_key.placeholder")), allowInsecureConnections: z.boolean().nullish(), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormGcoreConfig.tsx b/ui/src/components/access/AccessFormGcoreConfig.tsx index 858dac02..f78d7309 100644 --- a/ui/src/components/access/AccessFormGcoreConfig.tsx +++ b/ui/src/components/access/AccessFormGcoreConfig.tsx @@ -28,8 +28,7 @@ const AccessFormGcoreConfig = ({ form: formInst, formName, disabled, initialValu apiToken: z .string() .min(1, t("access.form.gcore_api_token.placeholder")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormGnameConfig.tsx b/ui/src/components/access/AccessFormGnameConfig.tsx index f0c8f072..990f01b6 100644 --- a/ui/src/components/access/AccessFormGnameConfig.tsx +++ b/ui/src/components/access/AccessFormGnameConfig.tsx @@ -29,13 +29,11 @@ const AccessFormGnameConfig = ({ form: formInst, formName, disabled, initialValu appId: z .string() .min(1, t("access.form.gname_app_id.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), appKey: z .string() .min(1, t("access.form.gname_app_key.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormGoDaddyConfig.tsx b/ui/src/components/access/AccessFormGoDaddyConfig.tsx index 9e8989e9..c604a8b3 100644 --- a/ui/src/components/access/AccessFormGoDaddyConfig.tsx +++ b/ui/src/components/access/AccessFormGoDaddyConfig.tsx @@ -29,13 +29,11 @@ const AccessFormGoDaddyConfig = ({ form: formInst, formName, disabled, initialVa apiKey: z .string() .min(1, t("access.form.godaddy_api_key.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), apiSecret: z .string() .min(1, t("access.form.godaddy_api_secret.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormGoEdgeConfig.tsx b/ui/src/components/access/AccessFormGoEdgeConfig.tsx index 641e2276..822c410b 100644 --- a/ui/src/components/access/AccessFormGoEdgeConfig.tsx +++ b/ui/src/components/access/AccessFormGoEdgeConfig.tsx @@ -32,8 +32,8 @@ const AccessFormGoEdgeConfig = ({ form: formInst, formName, disabled, initialVal role: z.union([z.literal("user"), z.literal("admin")], { message: t("access.form.goedge_api_role.placeholder"), }), - accessKeyId: z.string().nonempty(t("access.form.goedge_access_key_id.placeholder")).trim(), - accessKey: z.string().nonempty(t("access.form.goedge_access_key.placeholder")).trim(), + accessKeyId: z.string().nonempty(t("access.form.goedge_access_key_id.placeholder")), + accessKey: z.string().nonempty(t("access.form.goedge_access_key.placeholder")), allowInsecureConnections: z.boolean().nullish(), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormGoogleTrustServicesConfig.tsx b/ui/src/components/access/AccessFormGoogleTrustServicesConfig.tsx index 95eb6270..b30384f5 100644 --- a/ui/src/components/access/AccessFormGoogleTrustServicesConfig.tsx +++ b/ui/src/components/access/AccessFormGoogleTrustServicesConfig.tsx @@ -35,13 +35,11 @@ const AccessFormGoogleTrustServicesConfig = ({ eabKid: z .string() .min(1, t("access.form.googletrustservices_eab_kid.placeholder")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), eabHmacKey: z .string() .min(1, t("access.form.googletrustservices_eab_hmac_key.placeholder")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormHetznerConfig.tsx b/ui/src/components/access/AccessFormHetznerConfig.tsx index 12bf21b2..b596e997 100644 --- a/ui/src/components/access/AccessFormHetznerConfig.tsx +++ b/ui/src/components/access/AccessFormHetznerConfig.tsx @@ -25,7 +25,7 @@ const AccessFormHetznerConfig = ({ form: formInst, formName, disabled, initialVa const { t } = useTranslation(); const formSchema = z.object({ - apiToken: z.string().nonempty(t("access.form.hetzner_api_token.placeholder")).trim(), + apiToken: z.string().nonempty(t("access.form.hetzner_api_token.placeholder")), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormHuaweiCloudConfig.tsx b/ui/src/components/access/AccessFormHuaweiCloudConfig.tsx index ca83febd..fc56d558 100644 --- a/ui/src/components/access/AccessFormHuaweiCloudConfig.tsx +++ b/ui/src/components/access/AccessFormHuaweiCloudConfig.tsx @@ -28,12 +28,10 @@ const AccessFormHuaweiCloudConfig = ({ form: formInst, formName, disabled, initi const formSchema = z.object({ accessKeyId: z .string() - .trim() .min(1, t("access.form.huaweicloud_access_key_id.placeholder")) .max(64, t("common.errmsg.string_max", { max: 64 })), secretAccessKey: z .string() - .trim() .min(1, t("access.form.huaweicloud_secret_access_key.placeholder")) .max(64, t("common.errmsg.string_max", { max: 64 })), enterpriseProjectId: z.string().nullish(), diff --git a/ui/src/components/access/AccessFormJDCloudConfig.tsx b/ui/src/components/access/AccessFormJDCloudConfig.tsx index 7ab6b167..10fb4bad 100644 --- a/ui/src/components/access/AccessFormJDCloudConfig.tsx +++ b/ui/src/components/access/AccessFormJDCloudConfig.tsx @@ -29,13 +29,11 @@ const AccessFormJDCloudConfig = ({ form: formInst, formName, disabled, initialVa accessKeyId: z .string() .min(1, t("access.form.jdcloud_access_key_id.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), accessKeySecret: z .string() .min(1, t("access.form.jdcloud_access_key_secret.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormKubernetesConfig.tsx b/ui/src/components/access/AccessFormKubernetesConfig.tsx index 73415bb1..ff2bd491 100644 --- a/ui/src/components/access/AccessFormKubernetesConfig.tsx +++ b/ui/src/components/access/AccessFormKubernetesConfig.tsx @@ -26,7 +26,6 @@ const AccessFormKubernetesConfig = ({ form: formInst, formName, disabled, initia const formSchema = z.object({ kubeConfig: z .string() - .trim() .max(20480, t("common.errmsg.string_max", { max: 20480 })) .nullish(), }); diff --git a/ui/src/components/access/AccessFormLeCDNConfig.tsx b/ui/src/components/access/AccessFormLeCDNConfig.tsx index 282afa8d..1f9feabc 100644 --- a/ui/src/components/access/AccessFormLeCDNConfig.tsx +++ b/ui/src/components/access/AccessFormLeCDNConfig.tsx @@ -33,8 +33,8 @@ const AccessFormLeCDNConfig = ({ form: formInst, formName, disabled, initialValu role: z.union([z.literal("client"), z.literal("master")], { message: t("access.form.lecdn_api_role.placeholder"), }), - username: z.string().nonempty(t("access.form.lecdn_username.placeholder")).trim(), - password: z.string().nonempty(t("access.form.lecdn_password.placeholder")).trim(), + username: z.string().nonempty(t("access.form.lecdn_username.placeholder")), + password: z.string().nonempty(t("access.form.lecdn_password.placeholder")), allowInsecureConnections: z.boolean().nullish(), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormNS1Config.tsx b/ui/src/components/access/AccessFormNS1Config.tsx index 5b12feb0..4080b79b 100644 --- a/ui/src/components/access/AccessFormNS1Config.tsx +++ b/ui/src/components/access/AccessFormNS1Config.tsx @@ -28,8 +28,7 @@ const AccessFormNS1Config = ({ form: formInst, formName, disabled, initialValues apiKey: z .string() .min(1, t("access.form.ns1_api_key.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormNameDotComConfig.tsx b/ui/src/components/access/AccessFormNameDotComConfig.tsx index 0048de52..e5a7a372 100644 --- a/ui/src/components/access/AccessFormNameDotComConfig.tsx +++ b/ui/src/components/access/AccessFormNameDotComConfig.tsx @@ -29,13 +29,11 @@ const AccessFormNameDotComConfig = ({ form: formInst, formName, disabled, initia username: z .string() .min(1, t("access.form.namedotcom_username.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), apiToken: z .string() .min(1, t("access.form.namedotcom_api_token.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormNameSiloConfig.tsx b/ui/src/components/access/AccessFormNameSiloConfig.tsx index 1e8e2d8e..a9421ffe 100644 --- a/ui/src/components/access/AccessFormNameSiloConfig.tsx +++ b/ui/src/components/access/AccessFormNameSiloConfig.tsx @@ -28,8 +28,7 @@ const AccessFormNameSiloConfig = ({ form: formInst, formName, disabled, initialV apiKey: z .string() .min(1, t("access.form.namesilo_api_key.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormNamecheapConfig.tsx b/ui/src/components/access/AccessFormNamecheapConfig.tsx index d6a79f2a..2ac81909 100644 --- a/ui/src/components/access/AccessFormNamecheapConfig.tsx +++ b/ui/src/components/access/AccessFormNamecheapConfig.tsx @@ -29,13 +29,11 @@ const AccessFormNamecheapConfig = ({ form: formInst, formName, disabled, initial username: z .string() .min(1, t("access.form.namecheap_username.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), apiKey: z .string() .min(1, t("access.form.namecheap_api_key.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormNetcupConfig.tsx b/ui/src/components/access/AccessFormNetcupConfig.tsx index c5d4bfc6..02aa5272 100644 --- a/ui/src/components/access/AccessFormNetcupConfig.tsx +++ b/ui/src/components/access/AccessFormNetcupConfig.tsx @@ -27,9 +27,9 @@ const AccessFormNetcupConfig = ({ form: formInst, formName, disabled, initialVal const { t } = useTranslation(); const formSchema = z.object({ - customerNumber: z.string().nonempty(t("access.form.netcup_customer_number.placeholder")).trim(), - apiKey: z.string().nonempty(t("access.form.netcup_api_key.placeholder")).trim(), - apiPassword: z.string().nonempty(t("access.form.netcup_api_password.placeholder")).trim(), + customerNumber: z.string().nonempty(t("access.form.netcup_customer_number.placeholder")), + apiKey: z.string().nonempty(t("access.form.netcup_api_key.placeholder")), + apiPassword: z.string().nonempty(t("access.form.netcup_api_password.placeholder")), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormNetlifyConfig.tsx b/ui/src/components/access/AccessFormNetlifyConfig.tsx index 7fa4c8ae..91d0c31e 100644 --- a/ui/src/components/access/AccessFormNetlifyConfig.tsx +++ b/ui/src/components/access/AccessFormNetlifyConfig.tsx @@ -25,7 +25,7 @@ const AccessFormNetlifyConfig = ({ form: formInst, formName, disabled, initialVa const { t } = useTranslation(); const formSchema = z.object({ - apiToken: z.string().nonempty(t("access.form.netlify_api_token.placeholder")).trim(), + apiToken: z.string().nonempty(t("access.form.netlify_api_token.placeholder")), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormPorkbunConfig.tsx b/ui/src/components/access/AccessFormPorkbunConfig.tsx index 20cbc38a..65193db7 100644 --- a/ui/src/components/access/AccessFormPorkbunConfig.tsx +++ b/ui/src/components/access/AccessFormPorkbunConfig.tsx @@ -29,13 +29,11 @@ const AccessFormPorkbunConfig = ({ form: formInst, formName, disabled, initialVa apiKey: z .string() .min(1, t("access.form.porkbun_api_key.placeholder")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), secretApiKey: z .string() .min(1, t("access.form.porkbun_secret_api_key.placeholder")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormPowerDNSConfig.tsx b/ui/src/components/access/AccessFormPowerDNSConfig.tsx index 33447cc8..e9dc9756 100644 --- a/ui/src/components/access/AccessFormPowerDNSConfig.tsx +++ b/ui/src/components/access/AccessFormPowerDNSConfig.tsx @@ -30,8 +30,7 @@ const AccessFormPowerDNSConfig = ({ form: formInst, formName, disabled, initialV apiKey: z .string() .min(1, t("access.form.powerdns_api_key.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), allowInsecureConnections: z.boolean().nullish(), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormProxmoxVEConfig.tsx b/ui/src/components/access/AccessFormProxmoxVEConfig.tsx index 29280b1c..b2d44011 100644 --- a/ui/src/components/access/AccessFormProxmoxVEConfig.tsx +++ b/ui/src/components/access/AccessFormProxmoxVEConfig.tsx @@ -27,7 +27,7 @@ const AccessFormProxmoxVEConfig = ({ form: formInst, formName, disabled, initial const formSchema = z.object({ serverUrl: z.string().url(t("common.errmsg.url_invalid")), - apiToken: z.string().nonempty(t("access.form.proxmoxve_api_token.placeholder")).trim(), + apiToken: z.string().nonempty(t("access.form.proxmoxve_api_token.placeholder")), apiTokenSecret: z.string().nullish(), allowInsecureConnections: z.boolean().nullish(), }); diff --git a/ui/src/components/access/AccessFormQiniuConfig.tsx b/ui/src/components/access/AccessFormQiniuConfig.tsx index 40517184..dcbebcd0 100644 --- a/ui/src/components/access/AccessFormQiniuConfig.tsx +++ b/ui/src/components/access/AccessFormQiniuConfig.tsx @@ -29,13 +29,11 @@ const AccessFormQiniuConfig = ({ form: formInst, formName, disabled, initialValu accessKey: z .string() .min(1, t("access.form.qiniu_access_key.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), secretKey: z .string() .min(1, t("access.form.qiniu_secret_key.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormRainYunConfig.tsx b/ui/src/components/access/AccessFormRainYunConfig.tsx index a34cf683..b9b0b171 100644 --- a/ui/src/components/access/AccessFormRainYunConfig.tsx +++ b/ui/src/components/access/AccessFormRainYunConfig.tsx @@ -28,8 +28,7 @@ const AccessFormRainYunConfig = ({ form: formInst, formName, disabled, initialVa apiKey: z .string() .min(1, t("access.form.rainyun_api_key.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormRatPanelConfig.tsx b/ui/src/components/access/AccessFormRatPanelConfig.tsx index 04a71cd1..26448f46 100644 --- a/ui/src/components/access/AccessFormRatPanelConfig.tsx +++ b/ui/src/components/access/AccessFormRatPanelConfig.tsx @@ -29,7 +29,7 @@ const AccessFormRatPanelConfig = ({ form: formInst, formName, disabled, initialV const formSchema = z.object({ serverUrl: z.string().url(t("common.errmsg.url_invalid")), accessTokenId: z.preprocess((v) => Number(v), z.number().positive(t("access.form.ratpanel_access_token_id.placeholder"))), - accessToken: z.string().nonempty(t("access.form.ratpanel_access_token.placeholder")).trim(), + accessToken: z.string().nonempty(t("access.form.ratpanel_access_token.placeholder")), allowInsecureConnections: z.boolean().nullish(), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormSSLComConfig.tsx b/ui/src/components/access/AccessFormSSLComConfig.tsx index 85266266..22b60ae4 100644 --- a/ui/src/components/access/AccessFormSSLComConfig.tsx +++ b/ui/src/components/access/AccessFormSSLComConfig.tsx @@ -29,13 +29,11 @@ const AccessFormSSLComConfig = ({ form: formInst, formName, disabled, initialVal eabKid: z .string() .min(1, t("access.form.sslcom_eab_kid.placeholder")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), eabHmacKey: z .string() .min(1, t("access.form.sslcom_eab_hmac_key.placeholder")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormSafeLineConfig.tsx b/ui/src/components/access/AccessFormSafeLineConfig.tsx index c698d066..e3d3e75d 100644 --- a/ui/src/components/access/AccessFormSafeLineConfig.tsx +++ b/ui/src/components/access/AccessFormSafeLineConfig.tsx @@ -30,8 +30,7 @@ const AccessFormSafeLineConfig = ({ form: formInst, formName, disabled, initialV apiToken: z .string() .min(1, t("access.form.safeline_api_token.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), allowInsecureConnections: z.boolean().nullish(), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormSlackBotConfig.tsx b/ui/src/components/access/AccessFormSlackBotConfig.tsx index 3bea5f58..a0bdbad4 100644 --- a/ui/src/components/access/AccessFormSlackBotConfig.tsx +++ b/ui/src/components/access/AccessFormSlackBotConfig.tsx @@ -28,8 +28,7 @@ const AccessFormSlackBotConfig = ({ form: formInst, formName, disabled, initialV botToken: z .string({ message: t("access.form.slackbot_token.placeholder") }) .min(1, t("access.form.slackbot_token.placeholder")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), defaultChannelId: z.string().nullish(), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormTelegramBotConfig.tsx b/ui/src/components/access/AccessFormTelegramBotConfig.tsx index 82747694..a347610f 100644 --- a/ui/src/components/access/AccessFormTelegramBotConfig.tsx +++ b/ui/src/components/access/AccessFormTelegramBotConfig.tsx @@ -28,8 +28,7 @@ const AccessFormTelegramBotConfig = ({ form: formInst, formName, disabled, initi botToken: z .string({ message: t("access.form.telegrambot_token.placeholder") }) .min(1, t("access.form.telegrambot_token.placeholder")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), defaultChatId: z .preprocess( (v) => (v == null || v === "" ? undefined : Number(v)), diff --git a/ui/src/components/access/AccessFormTencentCloudConfig.tsx b/ui/src/components/access/AccessFormTencentCloudConfig.tsx index 11de6d6d..540ebdd9 100644 --- a/ui/src/components/access/AccessFormTencentCloudConfig.tsx +++ b/ui/src/components/access/AccessFormTencentCloudConfig.tsx @@ -29,13 +29,11 @@ const AccessFormTencentCloudConfig = ({ form: formInst, formName, disabled, init secretId: z .string() .min(1, t("access.form.tencentcloud_secret_id.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), secretKey: z .string() .min(1, t("access.form.tencentcloud_secret_key.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormUCloudConfig.tsx b/ui/src/components/access/AccessFormUCloudConfig.tsx index fd623925..395d185e 100644 --- a/ui/src/components/access/AccessFormUCloudConfig.tsx +++ b/ui/src/components/access/AccessFormUCloudConfig.tsx @@ -29,17 +29,14 @@ const AccessFormUCloudConfig = ({ form: formInst, formName, disabled, initialVal privateKey: z .string() .min(1, t("access.form.ucloud_private_key.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), publicKey: z .string() .min(1, t("access.form.ucloud_public_key.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), projectId: z .string() .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim() .nullish(), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormUniCloudConfig.tsx b/ui/src/components/access/AccessFormUniCloudConfig.tsx index d281f1fe..8b6d1346 100644 --- a/ui/src/components/access/AccessFormUniCloudConfig.tsx +++ b/ui/src/components/access/AccessFormUniCloudConfig.tsx @@ -26,8 +26,8 @@ const AccessFormUniCloudConfig = ({ form: formInst, formName, disabled, initialV const { t } = useTranslation(); const formSchema = z.object({ - username: z.string().trim().nonempty(t("access.form.unicloud_username.placeholder")), - password: z.string().trim().nonempty(t("access.form.unicloud_password.placeholder")), + username: z.string().nonempty(t("access.form.unicloud_username.placeholder")), + password: z.string().nonempty(t("access.form.unicloud_password.placeholder")), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormUpyunConfig.tsx b/ui/src/components/access/AccessFormUpyunConfig.tsx index 665c50cf..24feb9f8 100644 --- a/ui/src/components/access/AccessFormUpyunConfig.tsx +++ b/ui/src/components/access/AccessFormUpyunConfig.tsx @@ -28,12 +28,10 @@ const AccessFormUpyunConfig = ({ form: formInst, formName, disabled, initialValu const formSchema = z.object({ username: z .string() - .trim() .min(1, t("access.form.upyun_username.placeholder")) .max(64, t("common.errmsg.string_max", { max: 64 })), password: z .string() - .trim() .min(1, t("access.form.upyun_password.placeholder")) .max(64, t("common.errmsg.string_max", { max: 64 })), }); diff --git a/ui/src/components/access/AccessFormVercelConfig.tsx b/ui/src/components/access/AccessFormVercelConfig.tsx index 4483a9f9..a3a1954e 100644 --- a/ui/src/components/access/AccessFormVercelConfig.tsx +++ b/ui/src/components/access/AccessFormVercelConfig.tsx @@ -28,12 +28,10 @@ const AccessFormVercelConfig = ({ form: formInst, formName, disabled, initialVal apiAccessToken: z .string() .min(1, t("access.form.vercel_api_access_token.placeholder")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), teamId: z .string() .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim() .nullish(), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormVolcEngineConfig.tsx b/ui/src/components/access/AccessFormVolcEngineConfig.tsx index 8d8d18de..c9a302a2 100644 --- a/ui/src/components/access/AccessFormVolcEngineConfig.tsx +++ b/ui/src/components/access/AccessFormVolcEngineConfig.tsx @@ -29,13 +29,11 @@ const AccessFormVolcEngineConfig = ({ form: formInst, formName, disabled, initia accessKeyId: z .string() .min(1, t("access.form.volcengine_access_key_id.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), secretAccessKey: z .string() .min(1, t("access.form.volcengine_secret_access_key.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormWangsuConfig.tsx b/ui/src/components/access/AccessFormWangsuConfig.tsx index bb4f699c..fe2950c4 100644 --- a/ui/src/components/access/AccessFormWangsuConfig.tsx +++ b/ui/src/components/access/AccessFormWangsuConfig.tsx @@ -30,18 +30,15 @@ const AccessFormWangsuConfig = ({ form: formInst, formName, disabled, initialVal accessKeyId: z .string() .min(1, t("access.form.wangsu_access_key_id.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), accessKeySecret: z .string() .min(1, t("access.form.wangsu_access_key_secret.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), apiKey: z .string() .min(1, t("access.form.wangsu_api_key.placeholder")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormWestcnConfig.tsx b/ui/src/components/access/AccessFormWestcnConfig.tsx index ab21260c..34439316 100644 --- a/ui/src/components/access/AccessFormWestcnConfig.tsx +++ b/ui/src/components/access/AccessFormWestcnConfig.tsx @@ -29,13 +29,11 @@ const AccessFormWestcnConfig = ({ form: formInst, formName, disabled, initialVal username: z .string() .min(1, t("access.form.westcn_username.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), apiPassword: z .string() .min(1, t("access.form.westcn_api_password.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/access/AccessFormZeroSSLConfig.tsx b/ui/src/components/access/AccessFormZeroSSLConfig.tsx index 336777b0..a1653667 100644 --- a/ui/src/components/access/AccessFormZeroSSLConfig.tsx +++ b/ui/src/components/access/AccessFormZeroSSLConfig.tsx @@ -29,13 +29,11 @@ const AccessFormZeroSSLConfig = ({ form: formInst, formName, disabled, initialVa eabKid: z .string() .min(1, t("access.form.zerossl_eab_kid.placeholder")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), eabHmacKey: z .string() .min(1, t("access.form.zerossl_eab_hmac_key.placeholder")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/notification/NotifyChannelEditFormGotifyFields.tsx b/ui/src/components/notification/NotifyChannelEditFormGotifyFields.tsx index 189f4e16..69aa4b46 100644 --- a/ui/src/components/notification/NotifyChannelEditFormGotifyFields.tsx +++ b/ui/src/components/notification/NotifyChannelEditFormGotifyFields.tsx @@ -9,7 +9,12 @@ const NotifyChannelEditFormGotifyFields = () => { const formSchema = z.object({ url: z.string({ message: t("settings.notification.channel.form.gotify_url.placeholder") }).url({ message: t("common.errmsg.url_invalid") }), token: z.string({ message: t("settings.notification.channel.form.gotify_token.placeholder") }), - priority: z.preprocess(val => Number(val), z.number({ message: t("settings.notification.channel.form.gotify_priority.placeholder") }).gte(0, { message: t("settings.notification.channel.form.gotify_priority.error.gte0") })), + priority: z.preprocess( + (val) => Number(val), + z + .number({ message: t("settings.notification.channel.form.gotify_priority.placeholder") }) + .gte(0, { message: t("settings.notification.channel.form.gotify_priority.error.gte0") }) + ), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/notification/NotifyTemplate.tsx b/ui/src/components/notification/NotifyTemplate.tsx index 9921cda5..152596e7 100644 --- a/ui/src/components/notification/NotifyTemplate.tsx +++ b/ui/src/components/notification/NotifyTemplate.tsx @@ -27,13 +27,11 @@ const NotifyTemplateForm = ({ className, style }: NotifyTemplateFormProps) => { subject: z .string() .min(1, t("settings.notification.template.form.subject.placeholder")) - .max(1000, t("common.errmsg.string_max", { max: 1000 })) - .trim(), + .max(1000, t("common.errmsg.string_max", { max: 1000 })), message: z .string() .min(1, t("settings.notification.template.form.message.placeholder")) - .max(1000, t("common.errmsg.string_max", { max: 1000 })) - .trim(), + .max(1000, t("common.errmsg.string_max", { max: 1000 })), }); const formRule = createSchemaFieldRule(formSchema); const { diff --git a/ui/src/components/workflow/node/ApplyNodeConfigFormAWSRoute53Config.tsx b/ui/src/components/workflow/node/ApplyNodeConfigFormAWSRoute53Config.tsx index a14a7057..03698cb1 100644 --- a/ui/src/components/workflow/node/ApplyNodeConfigFormAWSRoute53Config.tsx +++ b/ui/src/components/workflow/node/ApplyNodeConfigFormAWSRoute53Config.tsx @@ -35,12 +35,10 @@ const ApplyNodeConfigFormAWSRoute53Config = ({ const formSchema = z.object({ region: z .string({ message: t("workflow_node.apply.form.aws_route53_region.placeholder") }) - .nonempty(t("workflow_node.apply.form.aws_route53_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.apply.form.aws_route53_region.placeholder")), hostedZoneId: z .string({ message: t("workflow_node.apply.form.aws_route53_hosted_zone_id.placeholder") }) - .nonempty(t("workflow_node.apply.form.aws_route53_hosted_zone_id.placeholder")) - .trim(), + .nonempty(t("workflow_node.apply.form.aws_route53_hosted_zone_id.placeholder")), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/workflow/node/ApplyNodeConfigFormAliyunESAConfig.tsx b/ui/src/components/workflow/node/ApplyNodeConfigFormAliyunESAConfig.tsx index d429b53d..0ef39b22 100644 --- a/ui/src/components/workflow/node/ApplyNodeConfigFormAliyunESAConfig.tsx +++ b/ui/src/components/workflow/node/ApplyNodeConfigFormAliyunESAConfig.tsx @@ -25,8 +25,7 @@ const ApplyNodeConfigFormAliyunESAConfig = ({ form: formInst, formName, disabled const formSchema = z.object({ region: z .string({ message: t("workflow_node.apply.form.aliyun_esa_region.placeholder") }) - .nonempty(t("workflow_node.apply.form.aliyun_esa_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.apply.form.aliyun_esa_region.placeholder")), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/workflow/node/ApplyNodeConfigFormHuaweiCloudDNSConfig.tsx b/ui/src/components/workflow/node/ApplyNodeConfigFormHuaweiCloudDNSConfig.tsx index dcde7c75..e806dd64 100644 --- a/ui/src/components/workflow/node/ApplyNodeConfigFormHuaweiCloudDNSConfig.tsx +++ b/ui/src/components/workflow/node/ApplyNodeConfigFormHuaweiCloudDNSConfig.tsx @@ -33,8 +33,7 @@ const ApplyNodeConfigFormHuaweiCloudDNSConfig = ({ const formSchema = z.object({ region: z .string({ message: t("workflow_node.apply.form.huaweicloud_dns_region.placeholder") }) - .nonempty(t("workflow_node.apply.form.huaweicloud_dns_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.apply.form.huaweicloud_dns_region.placeholder")), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/workflow/node/ApplyNodeConfigFormJDCloudDNSConfig.tsx b/ui/src/components/workflow/node/ApplyNodeConfigFormJDCloudDNSConfig.tsx index dba0b56c..cca7efd5 100644 --- a/ui/src/components/workflow/node/ApplyNodeConfigFormJDCloudDNSConfig.tsx +++ b/ui/src/components/workflow/node/ApplyNodeConfigFormJDCloudDNSConfig.tsx @@ -33,8 +33,7 @@ const ApplyNodeConfigFormJDCloudDNSConfig = ({ const formSchema = z.object({ regionId: z .string({ message: t("workflow_node.apply.form.jdcloud_dns_region_id.placeholder") }) - .nonempty(t("workflow_node.apply.form.jdcloud_dns_region_id.placeholder")) - .trim(), + .nonempty(t("workflow_node.apply.form.jdcloud_dns_region_id.placeholder")), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/workflow/node/ApplyNodeConfigFormTencentCloudEOConfig.tsx b/ui/src/components/workflow/node/ApplyNodeConfigFormTencentCloudEOConfig.tsx index 2969d4a2..f71e33e7 100644 --- a/ui/src/components/workflow/node/ApplyNodeConfigFormTencentCloudEOConfig.tsx +++ b/ui/src/components/workflow/node/ApplyNodeConfigFormTencentCloudEOConfig.tsx @@ -31,8 +31,7 @@ const ApplyNodeConfigFormTencentCloudEOConfig = ({ const formSchema = z.object({ zoneId: z .string({ message: t("workflow_node.apply.form.tencentcloud_eo_zone_id.placeholder") }) - .nonempty(t("workflow_node.apply.form.tencentcloud_eo_zone_id.placeholder")) - .trim(), + .nonempty(t("workflow_node.apply.form.tencentcloud_eo_zone_id.placeholder")), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormAWSACMConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormAWSACMConfig.tsx index 2e539453..df7ba9b6 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormAWSACMConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormAWSACMConfig.tsx @@ -26,8 +26,7 @@ const DeployNodeConfigFormAWSACMConfig = ({ form: formInst, formName, disabled, const formSchema = z.object({ region: z .string({ message: t("workflow_node.deploy.form.aws_acm_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.aws_acm_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.aws_acm_region.placeholder")), certificateArn: z.string().nullish(), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormAWSCloudFrontConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormAWSCloudFrontConfig.tsx index a34f2fbb..3a15eea0 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormAWSCloudFrontConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormAWSCloudFrontConfig.tsx @@ -33,9 +33,9 @@ const DeployNodeConfigFormAWSCloudFrontConfig = ({ const { t } = useTranslation(); const formSchema = z.object({ - region: z.string().trim().nonempty(t("workflow_node.deploy.form.aws_cloudfront_region.placeholder")), - distributionId: z.string().trim().nonempty(t("workflow_node.deploy.form.aws_cloudfront_distribution_id.placeholder")), - certificateSource: z.string().trim().nonempty(t("workflow_node.deploy.form.aws_cloudfront_certificate_source.placeholder")), + region: z.string().nonempty(t("workflow_node.deploy.form.aws_cloudfront_region.placeholder")), + distributionId: z.string().nonempty(t("workflow_node.deploy.form.aws_cloudfront_distribution_id.placeholder")), + certificateSource: z.string().nonempty(t("workflow_node.deploy.form.aws_cloudfront_certificate_source.placeholder")), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormAWSIAMConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormAWSIAMConfig.tsx index 1013153a..fa89d83b 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormAWSIAMConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormAWSIAMConfig.tsx @@ -28,8 +28,7 @@ const DeployNodeConfigFormAWSIAMConfig = ({ form: formInst, formName, disabled, const formSchema = z.object({ region: z .string({ message: t("workflow_node.deploy.form.aws_iam_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.aws_iam_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.aws_iam_region.placeholder")), certificatePath: z .string() .nullish() diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunALBConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunALBConfig.tsx index 341bfe6a..570109e5 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunALBConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunALBConfig.tsx @@ -46,18 +46,15 @@ const DeployNodeConfigFormAliyunALBConfig = ({ }), region: z .string({ message: t("workflow_node.deploy.form.aliyun_alb_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.aliyun_alb_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.aliyun_alb_region.placeholder")), loadbalancerId: z .string() .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim() .nullish() .refine((v) => fieldResourceType !== RESOURCE_TYPE_LOADBALANCER || !!v?.trim(), t("workflow_node.deploy.form.aliyun_alb_loadbalancer_id.placeholder")), listenerId: z .string() .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim() .nullish() .refine((v) => fieldResourceType !== RESOURCE_TYPE_LISTENER || !!v?.trim(), t("workflow_node.deploy.form.aliyun_alb_listener_id.placeholder")), domain: z diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunAPIGWConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunAPIGWConfig.tsx index 430859a7..c88c9e5a 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunAPIGWConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunAPIGWConfig.tsx @@ -44,8 +44,7 @@ const DeployNodeConfigFormAliyunAPIGWConfig = ({ }), region: z .string({ message: t("workflow_node.deploy.form.aliyun_apigw_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.aliyun_apigw_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.aliyun_apigw_region.placeholder")), gatewayId: z .string() .nullish() diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunCASConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunCASConfig.tsx index f4aed907..1ea744fd 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunCASConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunCASConfig.tsx @@ -31,8 +31,7 @@ const DeployNodeConfigFormAliyunCASConfig = ({ const formSchema = z.object({ region: z .string({ message: t("workflow_node.deploy.form.aliyun_cas_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.aliyun_cas_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.aliyun_cas_region.placeholder")), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunCASDeployConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunCASDeployConfig.tsx index 1b551f18..d7e961ae 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunCASDeployConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunCASDeployConfig.tsx @@ -37,8 +37,7 @@ const DeployNodeConfigFormAliyunCASDeployConfig = ({ const formSchema = z.object({ region: z .string({ message: t("workflow_node.deploy.form.aliyun_cas_deploy_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.aliyun_cas_deploy_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.aliyun_cas_deploy_region.placeholder")), resourceIds: z.string({ message: t("workflow_node.deploy.form.aliyun_cas_deploy_resource_ids.placeholder") }).refine((v) => { if (!v) return false; return String(v) diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunCLBConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunCLBConfig.tsx index fcd59569..6acc2942 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunCLBConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunCLBConfig.tsx @@ -47,13 +47,11 @@ const DeployNodeConfigFormAliyunCLBConfig = ({ }), region: z .string({ message: t("workflow_node.deploy.form.aliyun_clb_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.aliyun_clb_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.aliyun_clb_region.placeholder")), loadbalancerId: z .string({ message: t("workflow_node.deploy.form.aliyun_clb_loadbalancer_id.placeholder") }) .min(1, t("workflow_node.deploy.form.aliyun_clb_loadbalancer_id.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), listenerPort: z.preprocess( (v) => (v == null || v === "" ? undefined : Number(v)), z diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunDDoSConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunDDoSConfig.tsx index f8887794..6081e0af 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunDDoSConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunDDoSConfig.tsx @@ -34,8 +34,7 @@ const DeployNodeConfigFormAliyunDDoSConfig = ({ const formSchema = z.object({ region: z .string({ message: t("workflow_node.deploy.form.aliyun_ddos_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.aliyun_ddos_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.aliyun_ddos_region.placeholder")), domain: z .string({ message: t("workflow_node.deploy.form.aliyun_ddos_domain.placeholder") }) .refine((v) => validDomainName(v, { allowWildcard: true }), t("common.errmsg.domain_invalid")), diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunESAConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunESAConfig.tsx index f61485e2..91c34b08 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunESAConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunESAConfig.tsx @@ -32,8 +32,7 @@ const DeployNodeConfigFormAliyunESAConfig = ({ const formSchema = z.object({ region: z .string({ message: t("workflow_node.deploy.form.aliyun_esa_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.aliyun_esa_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.aliyun_esa_region.placeholder")), siteId: z.union([z.string(), z.number()]).refine((v) => { return /^\d+$/.test(v + "") && +v > 0; }, t("workflow_node.deploy.form.aliyun_esa_site_id.placeholder")), diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunFCConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunFCConfig.tsx index 63906350..c20dc15a 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunFCConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunFCConfig.tsx @@ -34,8 +34,7 @@ const DeployNodeConfigFormAliyunFCConfig = ({ form: formInst, formName, disabled }), region: z .string({ message: t("workflow_node.deploy.form.aliyun_fc_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.aliyun_fc_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.aliyun_fc_region.placeholder")), domain: z .string({ message: t("workflow_node.deploy.form.aliyun_fc_domain.placeholder") }) .refine((v) => validDomainName(v, { allowWildcard: true }), t("common.errmsg.domain_invalid")), diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunGAConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunGAConfig.tsx index f90652f9..39991869 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunGAConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunGAConfig.tsx @@ -37,14 +37,10 @@ const DeployNodeConfigFormAliyunGAConfig = ({ form: formInst, formName, disabled resourceType: z.union([z.literal(RESOURCE_TYPE_ACCELERATOR), z.literal(RESOURCE_TYPE_LISTENER)], { message: t("workflow_node.deploy.form.aliyun_ga_resource_type.placeholder"), }), - acceleratorId: z - .string() - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + acceleratorId: z.string().max(64, t("common.errmsg.string_max", { max: 64 })), listenerId: z .string() .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim() .nullish() .refine((v) => fieldResourceType !== RESOURCE_TYPE_LISTENER || !!v?.trim(), t("workflow_node.deploy.form.aliyun_ga_listener_id.placeholder")), domain: z diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunLiveConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunLiveConfig.tsx index 04692846..569b1469 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunLiveConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunLiveConfig.tsx @@ -34,8 +34,7 @@ const DeployNodeConfigFormAliyunLiveConfig = ({ const formSchema = z.object({ region: z .string({ message: t("workflow_node.deploy.form.aliyun_live_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.aliyun_live_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.aliyun_live_region.placeholder")), domain: z .string({ message: t("workflow_node.deploy.form.aliyun_live_domain.placeholder") }) .refine((v) => validDomainName(v, { allowWildcard: true }), t("common.errmsg.domain_invalid")), diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunNLBConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunNLBConfig.tsx index abd95843..ff4928be 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunNLBConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunNLBConfig.tsx @@ -44,18 +44,15 @@ const DeployNodeConfigFormAliyunNLBConfig = ({ }), region: z .string({ message: t("workflow_node.deploy.form.aliyun_nlb_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.aliyun_nlb_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.aliyun_nlb_region.placeholder")), loadbalancerId: z .string() .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim() .nullish() .refine((v) => fieldResourceType !== RESOURCE_TYPE_LOADBALANCER || !!v?.trim(), t("workflow_node.deploy.form.aliyun_nlb_loadbalancer_id.placeholder")), listenerId: z .string() .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim() .nullish() .refine((v) => fieldResourceType !== RESOURCE_TYPE_LISTENER || !!v?.trim(), t("workflow_node.deploy.form.aliyun_nlb_listener_id.placeholder")), }); diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunOSSConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunOSSConfig.tsx index 5cc1edd6..5aefa851 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunOSSConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunOSSConfig.tsx @@ -35,12 +35,10 @@ const DeployNodeConfigFormAliyunOSSConfig = ({ const formSchema = z.object({ region: z .string({ message: t("workflow_node.deploy.form.aliyun_oss_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.aliyun_oss_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.aliyun_oss_region.placeholder")), bucket: z .string({ message: t("workflow_node.deploy.form.aliyun_oss_bucket.placeholder") }) - .nonempty(t("workflow_node.deploy.form.aliyun_oss_bucket.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.aliyun_oss_bucket.placeholder")), domain: z .string({ message: t("workflow_node.deploy.form.aliyun_oss_domain.placeholder") }) .refine((v) => validDomainName(v, { allowWildcard: true }), t("common.errmsg.domain_invalid")), diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunVODConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunVODConfig.tsx index d76e1193..752d28cd 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunVODConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunVODConfig.tsx @@ -34,8 +34,7 @@ const DeployNodeConfigFormAliyunVODConfig = ({ const formSchema = z.object({ region: z .string({ message: t("workflow_node.deploy.form.aliyun_vod_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.aliyun_vod_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.aliyun_vod_region.placeholder")), domain: z .string({ message: t("workflow_node.deploy.form.aliyun_vod_domain.placeholder") }) .refine((v) => validDomainName(v), t("common.errmsg.domain_invalid")), diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunWAFConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunWAFConfig.tsx index a46c7327..f7044063 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunWAFConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunWAFConfig.tsx @@ -38,16 +38,14 @@ const DeployNodeConfigFormAliyunWAFConfig = ({ const formSchema = z.object({ region: z .string({ message: t("workflow_node.deploy.form.aliyun_waf_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.aliyun_waf_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.aliyun_waf_region.placeholder")), serviceVersion: z.literal("3.0", { message: t("workflow_node.deploy.form.aliyun_waf_service_version.placeholder"), }), instanceId: z .string({ message: t("workflow_node.deploy.form.aliyun_waf_instance_id.placeholder") }) .nonempty(t("workflow_node.deploy.form.aliyun_waf_instance_id.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), domain: z .string() .nullish() diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormAzureKeyVaultConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormAzureKeyVaultConfig.tsx index bd2347df..952d3e23 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormAzureKeyVaultConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormAzureKeyVaultConfig.tsx @@ -32,8 +32,7 @@ const DeployNodeConfigFormAzureKeyVaultConfig = ({ const formSchema = z.object({ keyvaultName: z .string({ message: t("workflow_node.deploy.form.azure_keyvault_name.placeholder") }) - .nonempty(t("workflow_node.deploy.form.azure_keyvault_name.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.azure_keyvault_name.placeholder")), certificateName: z .string() .nullish() diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormBaiduCloudAppBLBConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormBaiduCloudAppBLBConfig.tsx index aba8bf6b..7f6b21cf 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormBaiduCloudAppBLBConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormBaiduCloudAppBLBConfig.tsx @@ -47,13 +47,11 @@ const DeployNodeConfigFormBaiduCloudAppBLBConfig = ({ }), region: z .string({ message: t("workflow_node.deploy.form.baiducloud_appblb_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.baiducloud_appblb_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.baiducloud_appblb_region.placeholder")), loadbalancerId: z .string({ message: t("workflow_node.deploy.form.baiducloud_appblb_loadbalancer_id.placeholder") }) .min(1, t("workflow_node.deploy.form.baiducloud_appblb_loadbalancer_id.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), listenerPort: z.preprocess( (v) => (v == null || v === "" ? undefined : Number(v)), z diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormBaiduCloudBLBConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormBaiduCloudBLBConfig.tsx index fd61053c..28582fd6 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormBaiduCloudBLBConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormBaiduCloudBLBConfig.tsx @@ -47,13 +47,11 @@ const DeployNodeConfigFormBaiduCloudBLBConfig = ({ }), region: z .string({ message: t("workflow_node.deploy.form.baiducloud_blb_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.baiducloud_blb_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.baiducloud_blb_region.placeholder")), loadbalancerId: z .string({ message: t("workflow_node.deploy.form.baiducloud_blb_loadbalancer_id.placeholder") }) .min(1, t("workflow_node.deploy.form.baiducloud_blb_loadbalancer_id.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), listenerPort: z.preprocess( (v) => (v == null || v === "" ? undefined : Number(v)), z diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormBaotaWAFSiteConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormBaotaWAFSiteConfig.tsx index 6f992fb8..7c0ae293 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormBaotaWAFSiteConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormBaotaWAFSiteConfig.tsx @@ -35,7 +35,7 @@ const DeployNodeConfigFormBaotaWAFSiteConfig = ({ const { t } = useTranslation(); const formSchema = z.object({ - siteName: z.string().nonempty(t("workflow_node.deploy.form.baotawaf_site_name.placeholder")).trim(), + siteName: z.string().nonempty(t("workflow_node.deploy.form.baotawaf_site_name.placeholder")), sitePort: z.preprocess( (v) => Number(v), z diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormBunnyCDNConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormBunnyCDNConfig.tsx index 340de12c..d6a42f3b 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormBunnyCDNConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormBunnyCDNConfig.tsx @@ -25,11 +25,9 @@ const DeployNodeConfigFormBunnyCDNConfig = ({ form: formInst, formName, disabled const { t } = useTranslation(); const formSchema = z.object({ - pullZoneId: z - .union([z.string(), z.number().int()]) - .refine((v) => { - return /^\d+$/.test(v + "") && +v! > 0; - }, t("workflow_node.deploy.form.bunny_cdn_pull_zone_id.placeholder")), + pullZoneId: z.union([z.string(), z.number().int()]).refine((v) => { + return /^\d+$/.test(v + "") && +v! > 0; + }, t("workflow_node.deploy.form.bunny_cdn_pull_zone_id.placeholder")), hostname: z .string({ message: t("workflow_node.deploy.form.bunny_cdn_hostname.placeholder") }) .nonempty(t("workflow_node.deploy.form.bunny_cdn_hostname.placeholder")) diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormEdgioApplicationsConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormEdgioApplicationsConfig.tsx index 2a6929d8..599e4ec4 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormEdgioApplicationsConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormEdgioApplicationsConfig.tsx @@ -32,8 +32,7 @@ const DeployNodeConfigFormEdgioApplicationsConfig = ({ environmentId: z .string({ message: t("workflow_node.deploy.form.edgio_applications_environment_id.placeholder") }) .min(1, t("workflow_node.deploy.form.edgio_applications_environment_id.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormHuaweiCloudCDNConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormHuaweiCloudCDNConfig.tsx index 92d4efee..93d0a300 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormHuaweiCloudCDNConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormHuaweiCloudCDNConfig.tsx @@ -34,8 +34,7 @@ const DeployNodeConfigFormHuaweiCloudCDNConfig = ({ const formSchema = z.object({ region: z .string({ message: t("workflow_node.deploy.form.huaweicloud_cdn_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.huaweicloud_cdn_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.huaweicloud_cdn_region.placeholder")), domain: z .string({ message: t("workflow_node.deploy.form.huaweicloud_cdn_domain.placeholder") }) .refine((v) => validDomainName(v), t("common.errmsg.domain_invalid")), diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormHuaweiCloudELBConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormHuaweiCloudELBConfig.tsx index c3f17e2a..7e164ff2 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormHuaweiCloudELBConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormHuaweiCloudELBConfig.tsx @@ -46,18 +46,15 @@ const DeployNodeConfigFormHuaweiCloudELBConfig = ({ }), region: z .string({ message: t("workflow_node.deploy.form.huaweicloud_elb_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.huaweicloud_elb_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.huaweicloud_elb_region.placeholder")), certificateId: z .string() .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim() .nullish() .refine((v) => fieldResourceType !== RESOURCE_TYPE_CERTIFICATE || !!v?.trim(), t("workflow_node.deploy.form.huaweicloud_elb_certificate_id.placeholder")), loadbalancerId: z .string() .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim() .nullish() .refine( (v) => fieldResourceType !== RESOURCE_TYPE_LOADBALANCER || !!v?.trim(), @@ -66,7 +63,6 @@ const DeployNodeConfigFormHuaweiCloudELBConfig = ({ listenerId: z .string() .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim() .nullish() .refine((v) => fieldResourceType !== RESOURCE_TYPE_LISTENER || !!v?.trim(), t("workflow_node.deploy.form.huaweicloud_elb_listener_id.placeholder")), }); diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormHuaweiCloudWAFConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormHuaweiCloudWAFConfig.tsx index cdcabef5..4d21bddf 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormHuaweiCloudWAFConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormHuaweiCloudWAFConfig.tsx @@ -45,12 +45,10 @@ const DeployNodeConfigFormHuaweiCloudWAFConfig = ({ }), region: z .string({ message: t("workflow_node.deploy.form.huaweicloud_waf_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.huaweicloud_waf_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.huaweicloud_waf_region.placeholder")), certificateId: z .string() .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim() .nullish() .refine((v) => { if (fieldResourceType !== RESOURCE_TYPE_CERTIFICATE) return true; diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormJDCloudALBConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormJDCloudALBConfig.tsx index f9cfd937..59f5ad91 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormJDCloudALBConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormJDCloudALBConfig.tsx @@ -46,18 +46,15 @@ const DeployNodeConfigFormJDCloudALBConfig = ({ }), regionId: z .string({ message: t("workflow_node.deploy.form.jdcloud_alb_region_id.placeholder") }) - .nonempty(t("workflow_node.deploy.form.jdcloud_alb_region_id.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.jdcloud_alb_region_id.placeholder")), loadbalancerId: z .string() .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim() .nullish() .refine((v) => fieldResourceType !== RESOURCE_TYPE_LOADBALANCER || !!v?.trim(), t("workflow_node.deploy.form.jdcloud_alb_loadbalancer_id.placeholder")), listenerId: z .string() .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim() .nullish() .refine((v) => fieldResourceType !== RESOURCE_TYPE_LISTENER || !!v?.trim(), t("workflow_node.deploy.form.jdcloud_alb_listener_id.placeholder")), domain: z diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormKubernetesSecretConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormKubernetesSecretConfig.tsx index f6efd4d0..fcd67072 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormKubernetesSecretConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormKubernetesSecretConfig.tsx @@ -41,28 +41,23 @@ const DeployNodeConfigFormKubernetesSecretConfig = ({ namespace: z .string({ message: t("workflow_node.deploy.form.k8s_namespace.placeholder") }) .nonempty(t("workflow_node.deploy.form.k8s_namespace.placeholder")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), secretName: z .string({ message: t("workflow_node.deploy.form.k8s_secret_name.placeholder") }) .nonempty(t("workflow_node.deploy.form.k8s_secret_name.placeholder")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), secretType: z .string({ message: t("workflow_node.deploy.form.k8s_secret_type.placeholder") }) .nonempty(t("workflow_node.deploy.form.k8s_secret_type.placeholder")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), secretDataKeyForCrt: z .string({ message: t("workflow_node.deploy.form.k8s_secret_data_key_for_crt.placeholder") }) .nonempty(t("workflow_node.deploy.form.k8s_secret_data_key_for_crt.placeholder")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), secretDataKeyForKey: z .string({ message: t("workflow_node.deploy.form.k8s_secret_data_key_for_key.placeholder") }) .nonempty(t("workflow_node.deploy.form.k8s_secret_data_key_for_key.placeholder")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormLocalConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormLocalConfig.tsx index 282503e5..36d22a08 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormLocalConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormLocalConfig.tsx @@ -166,46 +166,38 @@ const DeployNodeConfigFormLocalConfig = ({ form: formInst, formName, disabled, i certPath: z .string() .min(1, t("workflow_node.deploy.form.local_cert_path.tooltip")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), certPathForServerOnly: z .string() .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim() .nullish(), certPathForIntermediaOnly: z .string() .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim() .nullish(), keyPath: z .string() .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim() .nullish() .refine((v) => fieldFormat !== FORMAT_PEM || !!v?.trim(), { message: t("workflow_node.deploy.form.local_key_path.tooltip") }), pfxPassword: z .string() .max(64, t("common.errmsg.string_max", { max: 256 })) - .trim() .nullish() .refine((v) => fieldFormat !== FORMAT_PFX || !!v?.trim(), { message: t("workflow_node.deploy.form.local_pfx_password.tooltip") }), jksAlias: z .string() .max(64, t("common.errmsg.string_max", { max: 256 })) - .trim() .nullish() .refine((v) => fieldFormat !== FORMAT_JKS || !!v?.trim(), { message: t("workflow_node.deploy.form.local_jks_alias.tooltip") }), jksKeypass: z .string() .max(64, t("common.errmsg.string_max", { max: 256 })) - .trim() .nullish() .refine((v) => fieldFormat !== FORMAT_JKS || !!v?.trim(), { message: t("workflow_node.deploy.form.local_jks_keypass.tooltip") }), jksStorepass: z .string() .max(64, t("common.errmsg.string_max", { max: 256 })) - .trim() .nullish() .refine((v) => fieldFormat !== FORMAT_JKS || !!v?.trim(), { message: t("workflow_node.deploy.form.local_jks_storepass.tooltip") }), shellEnv: z.union([z.literal(SHELLENV_SH), z.literal(SHELLENV_CMD), z.literal(SHELLENV_POWERSHELL)], { diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormQiniuPiliConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormQiniuPiliConfig.tsx index dd6f1570..2cac6de7 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormQiniuPiliConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormQiniuPiliConfig.tsx @@ -32,10 +32,7 @@ const DeployNodeConfigFormQiniuPiliConfig = ({ const { t } = useTranslation(); const formSchema = z.object({ - hub: z - .string({ message: t("workflow_node.deploy.form.qiniu_pili_hub.placeholder") }) - .nonempty(t("workflow_node.deploy.form.qiniu_pili_hub.placeholder")) - .trim(), + hub: z.string({ message: t("workflow_node.deploy.form.qiniu_pili_hub.placeholder") }).nonempty(t("workflow_node.deploy.form.qiniu_pili_hub.placeholder")), domain: z .string({ message: t("workflow_node.deploy.form.qiniu_pili_domain.placeholder") }) .refine((v) => validDomainName(v, { allowWildcard: true }), t("common.errmsg.domain_invalid")), diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormSSHConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormSSHConfig.tsx index aa528b2e..304f638e 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormSSHConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormSSHConfig.tsx @@ -198,46 +198,38 @@ const DeployNodeConfigFormSSHConfig = ({ form: formInst, formName, disabled, ini certPath: z .string() .min(1, t("workflow_node.deploy.form.ssh_cert_path.tooltip")) - .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim(), + .max(256, t("common.errmsg.string_max", { max: 256 })), keyPath: z .string() .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim() .nullish() .refine((v) => fieldFormat !== FORMAT_PEM || !!v?.trim(), { message: t("workflow_node.deploy.form.ssh_key_path.tooltip") }), certPathForServerOnly: z .string() .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim() .nullish(), certPathForIntermediaOnly: z .string() .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim() .nullish(), pfxPassword: z .string() .max(64, t("common.errmsg.string_max", { max: 256 })) - .trim() .nullish() .refine((v) => fieldFormat !== FORMAT_PFX || !!v?.trim(), { message: t("workflow_node.deploy.form.ssh_pfx_password.tooltip") }), jksAlias: z .string() .max(64, t("common.errmsg.string_max", { max: 256 })) - .trim() .nullish() .refine((v) => fieldFormat !== FORMAT_JKS || !!v?.trim(), { message: t("workflow_node.deploy.form.ssh_jks_alias.tooltip") }), jksKeypass: z .string() .max(64, t("common.errmsg.string_max", { max: 256 })) - .trim() .nullish() .refine((v) => fieldFormat !== FORMAT_JKS || !!v?.trim(), { message: t("workflow_node.deploy.form.ssh_jks_keypass.tooltip") }), jksStorepass: z .string() .max(64, t("common.errmsg.string_max", { max: 256 })) - .trim() .nullish() .refine((v) => fieldFormat !== FORMAT_JKS || !!v?.trim(), { message: t("workflow_node.deploy.form.ssh_jks_storepass.tooltip") }), preCommand: z diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudCLBConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudCLBConfig.tsx index cd06dbd7..f2cd3f39 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudCLBConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudCLBConfig.tsx @@ -49,17 +49,14 @@ const DeployNodeConfigFormTencentCloudCLBConfig = ({ ), region: z .string({ message: t("workflow_node.deploy.form.tencentcloud_clb_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.tencentcloud_clb_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.tencentcloud_clb_region.placeholder")), loadbalancerId: z .string() .min(1, t("workflow_node.deploy.form.tencentcloud_clb_loadbalancer_id.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), listenerId: z .string() .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim() .nullish() .refine( (v) => ![RESOURCE_TYPE_VIA_SSLDEPLOY, RESOURCE_TYPE_LISTENER, RESOURCE_TYPE_RULEDOMAIN].includes(fieldResourceType) || !!v?.trim(), diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudCOSConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudCOSConfig.tsx index 26b70048..6192c9b9 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudCOSConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudCOSConfig.tsx @@ -35,12 +35,10 @@ const DeployNodeConfigFormTencentCloudCOSConfig = ({ const formSchema = z.object({ region: z .string({ message: t("workflow_node.deploy.form.tencentcloud_cos_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.tencentcloud_cos_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.tencentcloud_cos_region.placeholder")), bucket: z .string({ message: t("workflow_node.deploy.form.tencentcloud_cos_bucket.placeholder") }) - .nonempty(t("workflow_node.deploy.form.tencentcloud_cos_bucket.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.tencentcloud_cos_bucket.placeholder")), domain: z .string({ message: t("workflow_node.deploy.form.tencentcloud_cos_domain.placeholder") }) .refine((v) => validDomainName(v), t("common.errmsg.domain_invalid")), diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudEOConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudEOConfig.tsx index 44e277eb..13bc78ba 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudEOConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudEOConfig.tsx @@ -34,8 +34,7 @@ const DeployNodeConfigFormTencentCloudEOConfig = ({ const formSchema = z.object({ zoneId: z .string({ message: t("workflow_node.deploy.form.tencentcloud_eo_zone_id.placeholder") }) - .nonempty(t("workflow_node.deploy.form.tencentcloud_eo_zone_id.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.tencentcloud_eo_zone_id.placeholder")), domain: z .string({ message: t("workflow_node.deploy.form.tencentcloud_eo_domain.placeholder") }) .refine((v) => validDomainName(v, { allowWildcard: true }), t("common.errmsg.domain_invalid")), diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudGAAPConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudGAAPConfig.tsx index 1f443cdf..9432596b 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudGAAPConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudGAAPConfig.tsx @@ -39,10 +39,9 @@ const DeployNodeConfigFormTencentCloudGAAPConfig = ({ const formSchema = z.object({ resourceType: z.literal(RESOURCE_TYPE_LISTENER, { message: t("workflow_node.deploy.form.tencentcloud_gaap_resource_type.placeholder") }), - proxyId: z.string().trim().nullish(), + proxyId: z.string().nullish(), listenerId: z .string() - .trim() .nullish() .refine( (v) => ![RESOURCE_TYPE_LISTENER].includes(fieldResourceType) || !!v?.trim(), diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudSCFConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudSCFConfig.tsx index 6758ddbd..b217f584 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudSCFConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudSCFConfig.tsx @@ -34,8 +34,7 @@ const DeployNodeConfigFormTencentCloudSCFConfig = ({ const formSchema = z.object({ region: z .string({ message: t("workflow_node.deploy.form.tencentcloud_scf_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.tencentcloud_scf_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.tencentcloud_scf_region.placeholder")), domain: z .string({ message: t("workflow_node.deploy.form.tencentcloud_scf_domain.placeholder") }) .refine((v) => validDomainName(v), t("common.errmsg.domain_invalid")), diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudSSLDeployConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudSSLDeployConfig.tsx index 2b764771..a0477fbf 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudSSLDeployConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudSSLDeployConfig.tsx @@ -37,12 +37,10 @@ const DeployNodeConfigFormTencentCloudSSLDeployConfig = ({ const formSchema = z.object({ region: z .string({ message: t("workflow_node.deploy.form.tencentcloud_ssl_deploy_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.tencentcloud_ssl_deploy_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.tencentcloud_ssl_deploy_region.placeholder")), resourceType: z .string({ message: t("workflow_node.deploy.form.tencentcloud_ssl_deploy_resource_type.placeholder") }) - .nonempty(t("workflow_node.deploy.form.tencentcloud_ssl_deploy_resource_type.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.tencentcloud_ssl_deploy_resource_type.placeholder")), resourceIds: z.string({ message: t("workflow_node.deploy.form.tencentcloud_ssl_deploy_resource_ids.placeholder") }).refine((v) => { if (!v) return false; return String(v) diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudWAFConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudWAFConfig.tsx index 347ebaa2..0ac3e778 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudWAFConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormTencentCloudWAFConfig.tsx @@ -36,19 +36,16 @@ const DeployNodeConfigFormTencentCloudWAFConfig = ({ const formSchema = z.object({ region: z .string({ message: t("workflow_node.deploy.form.tencentcloud_waf_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.tencentcloud_waf_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.tencentcloud_waf_region.placeholder")), domain: z .string({ message: t("workflow_node.deploy.form.tencentcloud_waf_domain.placeholder") }) .refine((v) => validDomainName(v), t("common.errmsg.domain_invalid")), domainId: z .string({ message: t("workflow_node.deploy.form.tencentcloud_waf_domain_id.placeholder") }) - .nonempty(t("workflow_node.deploy.form.tencentcloud_waf_domain_id.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.tencentcloud_waf_domain_id.placeholder")), instanceId: z .string({ message: t("workflow_node.deploy.form.tencentcloud_waf_instance_id.placeholder") }) - .nonempty(t("workflow_node.deploy.form.tencentcloud_waf_instance_id.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.tencentcloud_waf_instance_id.placeholder")), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormUCloudUS3Config.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormUCloudUS3Config.tsx index 0ac3a5d6..a2ea684b 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormUCloudUS3Config.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormUCloudUS3Config.tsx @@ -35,12 +35,10 @@ const DeployNodeConfigFormUCloudUS3Config = ({ const formSchema = z.object({ region: z .string({ message: t("workflow_node.deploy.form.ucloud_us3_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.ucloud_us3_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.ucloud_us3_region.placeholder")), bucket: z .string({ message: t("workflow_node.deploy.form.ucloud_us3_bucket.placeholder") }) - .nonempty(t("workflow_node.deploy.form.ucloud_us3_bucket.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.ucloud_us3_bucket.placeholder")), domain: z .string({ message: t("workflow_node.deploy.form.ucloud_us3_domain.placeholder") }) .refine((v) => validDomainName(v), t("common.errmsg.domain_invalid")), diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormUniCloudWebHostConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormUniCloudWebHostConfig.tsx index df524417..21624c52 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormUniCloudWebHostConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormUniCloudWebHostConfig.tsx @@ -37,8 +37,8 @@ const DeployNodeConfigFormUniCloudWebHostConfig = ({ const { t } = useTranslation(); const formSchema = z.object({ - spaceProvider: z.string().trim().nonempty(t("workflow_node.deploy.form.unicloud_webhost_space_provider.placeholder")), - spaceId: z.string().trim().nonempty(t("workflow_node.deploy.form.unicloud_webhost_space_id.placeholder")), + spaceProvider: z.string().nonempty(t("workflow_node.deploy.form.unicloud_webhost_space_provider.placeholder")), + spaceId: z.string().nonempty(t("workflow_node.deploy.form.unicloud_webhost_space_id.placeholder")), domain: z.string().refine((v) => validDomainName(v), t("common.errmsg.domain_invalid")), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormVolcEngineALBConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormVolcEngineALBConfig.tsx index 650323ab..41750936 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormVolcEngineALBConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormVolcEngineALBConfig.tsx @@ -46,12 +46,10 @@ const DeployNodeConfigFormVolcEngineALBConfig = ({ }), region: z .string({ message: t("workflow_node.deploy.form.volcengine_alb_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.volcengine_alb_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.volcengine_alb_region.placeholder")), loadbalancerId: z .string() .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim() .nullish() .refine( (v) => ![RESOURCE_TYPE_LOADBALANCER].includes(fieldResourceType) || !!v?.trim(), @@ -60,7 +58,6 @@ const DeployNodeConfigFormVolcEngineALBConfig = ({ listenerId: z .string() .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim() .nullish() .refine( (v) => ![RESOURCE_TYPE_LISTENER].includes(fieldResourceType) || !!v?.trim(), diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormVolcEngineCLBConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormVolcEngineCLBConfig.tsx index 99263044..9c00db70 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormVolcEngineCLBConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormVolcEngineCLBConfig.tsx @@ -44,12 +44,10 @@ const DeployNodeConfigFormVolcEngineCLBConfig = ({ }), region: z .string({ message: t("workflow_node.deploy.form.volcengine_clb_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.volcengine_clb_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.volcengine_clb_region.placeholder")), loadbalancerId: z .string() .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim() .nullish() .refine( (v) => ![RESOURCE_TYPE_LOADBALANCER].includes(fieldResourceType) || !!v?.trim(), @@ -58,7 +56,6 @@ const DeployNodeConfigFormVolcEngineCLBConfig = ({ listenerId: z .string() .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim() .nullish() .refine( (v) => ![RESOURCE_TYPE_LISTENER].includes(fieldResourceType) || !!v?.trim(), diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormVolcEngineCertCenterConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormVolcEngineCertCenterConfig.tsx index 21f4557f..28fb16f6 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormVolcEngineCertCenterConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormVolcEngineCertCenterConfig.tsx @@ -31,8 +31,7 @@ const DeployNodeConfigFormVolcEngineCertCenterConfig = ({ const formSchema = z.object({ region: z .string({ message: t("workflow_node.deploy.form.volcengine_certcenter_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.volcengine_certcenter_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.volcengine_certcenter_region.placeholder")), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormVolcEngineImageXConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormVolcEngineImageXConfig.tsx index 61f59e23..5ce81fd0 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormVolcEngineImageXConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormVolcEngineImageXConfig.tsx @@ -33,12 +33,10 @@ const DeployNodeConfigFormVolcEngineImageXConfig = ({ const formSchema = z.object({ region: z .string({ message: t("workflow_node.deploy.form.volcengine_imagex_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.volcengine_imagex_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.volcengine_imagex_region.placeholder")), serviceId: z .string({ message: t("workflow_node.deploy.form.volcengine_imagex_service_id.placeholder") }) - .nonempty(t("workflow_node.deploy.form.volcengine_imagex_service_id.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.volcengine_imagex_service_id.placeholder")), domain: z .string({ message: t("workflow_node.deploy.form.volcengine_imagex_domain.placeholder") }) .refine((v) => validDomainName(v), t("common.errmsg.domain_invalid")), diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormVolcEngineTOSConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormVolcEngineTOSConfig.tsx index 730d1fd7..516dc123 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormVolcEngineTOSConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormVolcEngineTOSConfig.tsx @@ -35,12 +35,10 @@ const DeployNodeConfigFormVolcEngineTOSConfig = ({ const formSchema = z.object({ region: z .string({ message: t("workflow_node.deploy.form.volcengine_tos_region.placeholder") }) - .nonempty(t("workflow_node.deploy.form.volcengine_tos_region.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.volcengine_tos_region.placeholder")), bucket: z .string({ message: t("workflow_node.deploy.form.volcengine_tos_bucket.placeholder") }) - .nonempty(t("workflow_node.deploy.form.volcengine_tos_bucket.placeholder")) - .trim(), + .nonempty(t("workflow_node.deploy.form.volcengine_tos_bucket.placeholder")), domain: z .string({ message: t("workflow_node.deploy.form.volcengine_tos_domain.placeholder") }) .refine((v) => validDomainName(v), t("common.errmsg.domain_invalid")), diff --git a/ui/src/pages/workflows/WorkflowDetail.tsx b/ui/src/pages/workflows/WorkflowDetail.tsx index 91e8d746..549bc311 100644 --- a/ui/src/pages/workflows/WorkflowDetail.tsx +++ b/ui/src/pages/workflows/WorkflowDetail.tsx @@ -335,12 +335,10 @@ const WorkflowBaseInfoModal = ({ trigger }: { trigger?: React.ReactNode }) => { name: z .string({ message: t("workflow.detail.baseinfo.form.name.placeholder") }) .min(1, t("workflow.detail.baseinfo.form.name.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), description: z .string({ message: t("workflow.detail.baseinfo.form.description.placeholder") }) .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim() .nullish(), }); const formRule = createSchemaFieldRule(formSchema); diff --git a/ui/src/pages/workflows/WorkflowNew.tsx b/ui/src/pages/workflows/WorkflowNew.tsx index 9877dcc2..1da27939 100644 --- a/ui/src/pages/workflows/WorkflowNew.tsx +++ b/ui/src/pages/workflows/WorkflowNew.tsx @@ -37,12 +37,10 @@ const WorkflowNew = () => { name: z .string({ message: t("workflow.new.modal.form.name.placeholder") }) .min(1, t("workflow.new.modal.form.name.placeholder")) - .max(64, t("common.errmsg.string_max", { max: 64 })) - .trim(), + .max(64, t("common.errmsg.string_max", { max: 64 })), description: z .string({ message: t("workflow.new.modal.form.description.placeholder") }) .max(256, t("common.errmsg.string_max", { max: 256 })) - .trim() .nullish(), }); const formRule = createSchemaFieldRule(formSchema);