Skip to content

Commit

Permalink
fix(web): update error prompt of function name format (#1094)
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow authored Apr 27, 2023
1 parent 2d764e4 commit 8506124
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion web/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"SystemDependence": "Built-In",
"Value": "Value",
"isSupport": "Whether to support",
"FunctionNameRule": "Function names can only contain English letters or underscores (_).",
"FunctionNameRule": "Function names must consist of letters, numbers, periods (.), and hyphens (-), matching the regex: /^[a-zA-Z0-9.-]{1,128}$/.",
"EmptyDebugTip": "No results yet",
"EmptyFunctionTip": "You have not created the function",
"UploadButton": "upload",
Expand Down
2 changes: 1 addition & 1 deletion web/public/locales/zh-CN/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"SystemDependence": "内置依赖",
"Value": "",
"isSupport": "是否支持",
"FunctionNameRule": "函数名只能包含英文或 _",
"FunctionNameRule": "函数名须由字母、数字、点(.)和划线(-_)组成,匹配正则:/^[a-zA-Z0-9_.-]{1,128}$/",
"EmptyDebugTip": "暂无运行结果",
"EmptyFunctionTip": "您还没有创建函数",
"UploadButton": "上传",
Expand Down
2 changes: 1 addition & 1 deletion web/public/locales/zh/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"SystemDependence": "内置依赖",
"Value": "",
"isSupport": "是否支持",
"FunctionNameRule": "函数名只能包含英文或 _",
"FunctionNameRule": "函数名须由字母、数字、点(.)和划线(-_)组成,匹配正则:/^[a-zA-Z0-9_.-]{1,128}$/",
"EmptyDebugTip": "暂无运行结果",
"EmptyFunctionTip": "您还没有创建函数",
"UploadButton": "上传",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const PromptModal = (props: { functionItem?: any; children?: React.ReactElement
<Input
{...register("name", {
pattern: {
value: /^[_A-Za-z][A-Za-z0-9-_]+$/,
value: /^[a-zA-Z0-9_.-]{1,128}$/,
message: t("FunctionPanel.FunctionNameRule"),
},
})}
Expand Down

0 comments on commit 8506124

Please sign in to comment.