From 79b393afee4139fe82535d764c8e5bbf4295350e Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Sat, 13 Jan 2024 16:05:45 +0800 Subject: [PATCH] feat: add regex to SignupTable --- object/application.go | 1 + web/src/locales/ar/data.json | 1 + web/src/locales/de/data.json | 1 + web/src/locales/en/data.json | 1 + web/src/locales/es/data.json | 1 + web/src/locales/fa/data.json | 1 + web/src/locales/fi/data.json | 1 + web/src/locales/fr/data.json | 1 + web/src/locales/he/data.json | 1 + web/src/locales/id/data.json | 1 + web/src/locales/it/data.json | 1 + web/src/locales/ja/data.json | 1 + web/src/locales/kk/data.json | 1 + web/src/locales/ko/data.json | 1 + web/src/locales/ms/data.json | 1 + web/src/locales/nl/data.json | 1 + web/src/locales/pl/data.json | 1 + web/src/locales/pt/data.json | 1 + web/src/locales/ru/data.json | 1 + web/src/locales/sv/data.json | 1 + web/src/locales/tr/data.json | 1 + web/src/locales/uk/data.json | 1 + web/src/locales/vi/data.json | 1 + web/src/locales/zh/data.json | 1 + web/src/table/SignupTable.js | 17 +++++++++++++++++ 25 files changed, 41 insertions(+) diff --git a/object/application.go b/object/application.go index ec8e8cf6..e14373a9 100644 --- a/object/application.go +++ b/object/application.go @@ -37,6 +37,7 @@ type SignupItem struct { Prompted bool `json:"prompted"` Label string `json:"label"` Placeholder string `json:"placeholder"` + Regex string `json:"regex"` Rule string `json:"rule"` } diff --git a/web/src/locales/ar/data.json b/web/src/locales/ar/data.json index 271f8373..a65d0679 100644 --- a/web/src/locales/ar/data.json +++ b/web/src/locales/ar/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "Please input your real name!", "Please select your country code!": "Please select your country code!", "Please select your country/region!": "Please select your country/region!", + "Regex": "Regex", "Terms of Use": "Terms of Use", "Terms of Use - Tooltip": "Terms of use that users need to read and agree to during registration", "Text 1": "Text 1", diff --git a/web/src/locales/de/data.json b/web/src/locales/de/data.json index 362d6fa5..79e71757 100644 --- a/web/src/locales/de/data.json +++ b/web/src/locales/de/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "Bitte geben Sie Ihren richtigen Namen ein!", "Please select your country code!": "Bitte wählen Sie Ihren Ländercode aus!", "Please select your country/region!": "Bitte wählen Sie Ihr Land/Ihre Region aus!", + "Regex": "Regex", "Terms of Use": "Nutzungsbedingungen", "Terms of Use - Tooltip": "Nutzungsbedingungen, die Benutzer während der Registrierung lesen und akzeptieren müssen", "Text 1": "Text 1", diff --git a/web/src/locales/en/data.json b/web/src/locales/en/data.json index cef5a130..4d9f387a 100644 --- a/web/src/locales/en/data.json +++ b/web/src/locales/en/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "Please input your real name!", "Please select your country code!": "Please select your country code!", "Please select your country/region!": "Please select your country/region!", + "Regex": "Regex", "Terms of Use": "Terms of Use", "Terms of Use - Tooltip": "Terms of use that users need to read and agree to during registration", "Text 1": "Text 1", diff --git a/web/src/locales/es/data.json b/web/src/locales/es/data.json index 60d92f21..a9b3165f 100644 --- a/web/src/locales/es/data.json +++ b/web/src/locales/es/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "¡Por favor, ingresa tu nombre real!", "Please select your country code!": "¡Por favor seleccione su código de país!", "Please select your country/region!": "¡Por favor seleccione su país/región!", + "Regex": "Regex", "Terms of Use": "Términos de uso", "Terms of Use - Tooltip": "Términos de uso que los usuarios necesitan leer y aceptar durante el registro", "Text 1": "Text 1", diff --git a/web/src/locales/fa/data.json b/web/src/locales/fa/data.json index 271f8373..a65d0679 100644 --- a/web/src/locales/fa/data.json +++ b/web/src/locales/fa/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "Please input your real name!", "Please select your country code!": "Please select your country code!", "Please select your country/region!": "Please select your country/region!", + "Regex": "Regex", "Terms of Use": "Terms of Use", "Terms of Use - Tooltip": "Terms of use that users need to read and agree to during registration", "Text 1": "Text 1", diff --git a/web/src/locales/fi/data.json b/web/src/locales/fi/data.json index 271f8373..a65d0679 100644 --- a/web/src/locales/fi/data.json +++ b/web/src/locales/fi/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "Please input your real name!", "Please select your country code!": "Please select your country code!", "Please select your country/region!": "Please select your country/region!", + "Regex": "Regex", "Terms of Use": "Terms of Use", "Terms of Use - Tooltip": "Terms of use that users need to read and agree to during registration", "Text 1": "Text 1", diff --git a/web/src/locales/fr/data.json b/web/src/locales/fr/data.json index c0ab126c..ad0fea0a 100644 --- a/web/src/locales/fr/data.json +++ b/web/src/locales/fr/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "Veuillez saisir votre nom complet !", "Please select your country code!": "Sélectionnez votre code de pays, s'il vous plaît !", "Please select your country/region!": "Veuillez sélectionner votre pays/région !", + "Regex": "Regex", "Terms of Use": "Conditions d'utilisation", "Terms of Use - Tooltip": "Conditions d'utilisation qui doivent être lus acceptés lors de l'enregistrement du compte", "Text 1": "Text 1", diff --git a/web/src/locales/he/data.json b/web/src/locales/he/data.json index 271f8373..a65d0679 100644 --- a/web/src/locales/he/data.json +++ b/web/src/locales/he/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "Please input your real name!", "Please select your country code!": "Please select your country code!", "Please select your country/region!": "Please select your country/region!", + "Regex": "Regex", "Terms of Use": "Terms of Use", "Terms of Use - Tooltip": "Terms of use that users need to read and agree to during registration", "Text 1": "Text 1", diff --git a/web/src/locales/id/data.json b/web/src/locales/id/data.json index 2cf50781..f1c9dcef 100644 --- a/web/src/locales/id/data.json +++ b/web/src/locales/id/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "Silakan masukkan nama asli Anda!", "Please select your country code!": "Tolong pilih kode negara Anda!", "Please select your country/region!": "Silakan pilih negara/region Anda!", + "Regex": "Regex", "Terms of Use": "Syarat Penggunaan", "Terms of Use - Tooltip": "Syarat penggunaan yang harus dibaca dan disetujui oleh pengguna selama proses registrasi", "Text 1": "Text 1", diff --git a/web/src/locales/it/data.json b/web/src/locales/it/data.json index f57b7198..7135503a 100644 --- a/web/src/locales/it/data.json +++ b/web/src/locales/it/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "Please input your real name!", "Please select your country code!": "Please select your country code!", "Please select your country/region!": "Please select your country/region!", + "Regex": "Regex", "Terms of Use": "Terms of Use", "Terms of Use - Tooltip": "Terms of use that users need to read and agree to during registration", "Text 1": "Text 1", diff --git a/web/src/locales/ja/data.json b/web/src/locales/ja/data.json index 15777b98..cbd6c2d1 100644 --- a/web/src/locales/ja/data.json +++ b/web/src/locales/ja/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "正しい名前を入力してください!", "Please select your country code!": "あなたの国コードを選択してください!", "Please select your country/region!": "あなたの国/地域を選択してください!", + "Regex": "Regex", "Terms of Use": "利用規約", "Terms of Use - Tooltip": "ユーザーが登録する際に読んで同意する必要がある利用規約", "Text 1": "Text 1", diff --git a/web/src/locales/kk/data.json b/web/src/locales/kk/data.json index 271f8373..a65d0679 100644 --- a/web/src/locales/kk/data.json +++ b/web/src/locales/kk/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "Please input your real name!", "Please select your country code!": "Please select your country code!", "Please select your country/region!": "Please select your country/region!", + "Regex": "Regex", "Terms of Use": "Terms of Use", "Terms of Use - Tooltip": "Terms of use that users need to read and agree to during registration", "Text 1": "Text 1", diff --git a/web/src/locales/ko/data.json b/web/src/locales/ko/data.json index 14b5d26b..ebd4a5d3 100644 --- a/web/src/locales/ko/data.json +++ b/web/src/locales/ko/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "진짜 이름을 입력해주세요!", "Please select your country code!": "국가 코드를 선택해 주세요!", "Please select your country/region!": "국가 / 지역을 선택해주세요!", + "Regex": "Regex", "Terms of Use": "사용 약관", "Terms of Use - Tooltip": "등록 중 사용자가 읽어야 하고 동의해야하는 이용 약관", "Text 1": "Text 1", diff --git a/web/src/locales/ms/data.json b/web/src/locales/ms/data.json index 271f8373..a65d0679 100644 --- a/web/src/locales/ms/data.json +++ b/web/src/locales/ms/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "Please input your real name!", "Please select your country code!": "Please select your country code!", "Please select your country/region!": "Please select your country/region!", + "Regex": "Regex", "Terms of Use": "Terms of Use", "Terms of Use - Tooltip": "Terms of use that users need to read and agree to during registration", "Text 1": "Text 1", diff --git a/web/src/locales/nl/data.json b/web/src/locales/nl/data.json index 271f8373..a65d0679 100644 --- a/web/src/locales/nl/data.json +++ b/web/src/locales/nl/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "Please input your real name!", "Please select your country code!": "Please select your country code!", "Please select your country/region!": "Please select your country/region!", + "Regex": "Regex", "Terms of Use": "Terms of Use", "Terms of Use - Tooltip": "Terms of use that users need to read and agree to during registration", "Text 1": "Text 1", diff --git a/web/src/locales/pl/data.json b/web/src/locales/pl/data.json index 271f8373..a65d0679 100644 --- a/web/src/locales/pl/data.json +++ b/web/src/locales/pl/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "Please input your real name!", "Please select your country code!": "Please select your country code!", "Please select your country/region!": "Please select your country/region!", + "Regex": "Regex", "Terms of Use": "Terms of Use", "Terms of Use - Tooltip": "Terms of use that users need to read and agree to during registration", "Text 1": "Text 1", diff --git a/web/src/locales/pt/data.json b/web/src/locales/pt/data.json index c19dc9e9..0655961f 100644 --- a/web/src/locales/pt/data.json +++ b/web/src/locales/pt/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "Por favor, insira seu nome real!", "Please select your country code!": "Por favor, selecione o código do seu país!", "Please select your country/region!": "Por favor, selecione seu país/região!", + "Regex": "Regex", "Terms of Use": "Termos de Uso", "Terms of Use - Tooltip": "Termos de uso que os usuários precisam ler e concordar durante o registro", "Text 1": "Text 1", diff --git a/web/src/locales/ru/data.json b/web/src/locales/ru/data.json index b9b79e91..98cd84b1 100644 --- a/web/src/locales/ru/data.json +++ b/web/src/locales/ru/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "Пожалуйста, введите своё настоящее имя!", "Please select your country code!": "Пожалуйста, выберите код своей страны!", "Please select your country/region!": "Пожалуйста, выберите свою страну / регион!", + "Regex": "Regex", "Terms of Use": "Условия использования", "Terms of Use - Tooltip": "Условия использования, которые пользователи должны прочитать и согласиться с ними при регистрации", "Text 1": "Text 1", diff --git a/web/src/locales/sv/data.json b/web/src/locales/sv/data.json index 271f8373..a65d0679 100644 --- a/web/src/locales/sv/data.json +++ b/web/src/locales/sv/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "Please input your real name!", "Please select your country code!": "Please select your country code!", "Please select your country/region!": "Please select your country/region!", + "Regex": "Regex", "Terms of Use": "Terms of Use", "Terms of Use - Tooltip": "Terms of use that users need to read and agree to during registration", "Text 1": "Text 1", diff --git a/web/src/locales/tr/data.json b/web/src/locales/tr/data.json index 271f8373..a65d0679 100644 --- a/web/src/locales/tr/data.json +++ b/web/src/locales/tr/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "Please input your real name!", "Please select your country code!": "Please select your country code!", "Please select your country/region!": "Please select your country/region!", + "Regex": "Regex", "Terms of Use": "Terms of Use", "Terms of Use - Tooltip": "Terms of use that users need to read and agree to during registration", "Text 1": "Text 1", diff --git a/web/src/locales/uk/data.json b/web/src/locales/uk/data.json index 271f8373..a65d0679 100644 --- a/web/src/locales/uk/data.json +++ b/web/src/locales/uk/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "Please input your real name!", "Please select your country code!": "Please select your country code!", "Please select your country/region!": "Please select your country/region!", + "Regex": "Regex", "Terms of Use": "Terms of Use", "Terms of Use - Tooltip": "Terms of use that users need to read and agree to during registration", "Text 1": "Text 1", diff --git a/web/src/locales/vi/data.json b/web/src/locales/vi/data.json index db9233e9..2576ac72 100644 --- a/web/src/locales/vi/data.json +++ b/web/src/locales/vi/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "Vui lòng nhập tên thật của bạn!", "Please select your country code!": "Vui lòng chọn mã quốc gia của bạn!", "Please select your country/region!": "Vui lòng chọn quốc gia/vùng của bạn!", + "Regex": "Regex", "Terms of Use": "Điều khoản sử dụng", "Terms of Use - Tooltip": "Điều khoản sử dụng mà người dùng cần đọc và đồng ý trong quá trình đăng ký", "Text 1": "Text 1", diff --git a/web/src/locales/zh/data.json b/web/src/locales/zh/data.json index 9d7dd464..ebe63673 100644 --- a/web/src/locales/zh/data.json +++ b/web/src/locales/zh/data.json @@ -888,6 +888,7 @@ "Please input your real name!": "请输入您的姓名!", "Please select your country code!": "请选择国家代码!", "Please select your country/region!": "请选择您的国家或地区", + "Regex": "正则表达式", "Terms of Use": "《用户协议》", "Terms of Use - Tooltip": "用户注册时需要阅读并同意的使用条款", "Text 1": "文本1", diff --git a/web/src/table/SignupTable.js b/web/src/table/SignupTable.js index ee14c0b3..da9d72b6 100644 --- a/web/src/table/SignupTable.js +++ b/web/src/table/SignupTable.js @@ -224,6 +224,23 @@ class SignupTable extends React.Component { ); }, }, + { + title: i18next.t("signup:Regex"), + dataIndex: "regex", + key: "regex", + width: "200px", + render: (text, record, index) => { + if (record.name.startsWith("Text ") || record.name === "Password" || record.name === "Confirm password") { + return null; + } + + return ( + { + this.updateField(table, index, "regex", e.target.value); + }} /> + ); + }, + }, { title: i18next.t("application:Rule"), dataIndex: "rule",