From 37daea2bbcd2902a49b28bffd5729fbdcd67f393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=83=E7=9F=B3?= Date: Tue, 17 Jun 2025 05:06:52 -0700 Subject: [PATCH] feat: improve error message in ApplicationEditPage (#3886) --- web/src/ApplicationEditPage.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/web/src/ApplicationEditPage.js b/web/src/ApplicationEditPage.js index 09fcc864..de0fef25 100644 --- a/web/src/ApplicationEditPage.js +++ b/web/src/ApplicationEditPage.js @@ -13,7 +13,7 @@ // limitations under the License. import React from "react"; -import {Button, Card, Col, ConfigProvider, Input, InputNumber, Popover, Radio, Result, Row, Select, Space, Switch, Upload} from "antd"; +import {Button, Card, Col, ConfigProvider, Input, InputNumber, Popover, Radio, Result, Row, Select, Space, Switch, Upload, message} from "antd"; import {CopyOutlined, HolderOutlined, LinkOutlined, UploadOutlined, UsergroupAddOutlined} from "@ant-design/icons"; import * as ApplicationBackend from "./backend/ApplicationBackend"; import * as CertBackend from "./backend/CertBackend"; @@ -279,6 +279,13 @@ class ApplicationEditPage extends React.Component { { + const value = e.target.value; + if (/[/?:@#&%=+;]/.test(value)) { + const invalidChars = "/ ? : @ # & % = + ;"; + const messageText = i18next.t("application:Invalid characters in application name") + ":" + " " + invalidChars; + message.error(messageText); + return; + } this.updateApplicationField("name", e.target.value); }} />