feat: add regex support for account item (#2714)

* feat: add regex support for account item

* feat: use reflect to process user field

* fix: fix lint problem

* feat: improve code format and fix reflect error
This commit is contained in:
DacongDA
2024-02-17 15:24:36 +08:00
committed by GitHub
parent 4a68dd65cd
commit d731c3c934
52 changed files with 336 additions and 39 deletions

View File

@ -14,7 +14,7 @@
import React from "react";
import {DeleteOutlined, DownOutlined, UpOutlined} from "@ant-design/icons";
import {Button, Col, Row, Select, Switch, Table, Tooltip} from "antd";
import {Button, Col, Input, Row, Select, Switch, Table, Tooltip} from "antd";
import * as Setting from "../Setting";
import i18next from "i18next";
@ -140,6 +140,26 @@ class AccountTable extends React.Component {
);
},
},
{
title: i18next.t("signup:Regex"),
dataIndex: "regex",
key: "regex",
width: "200px",
render: (text, record, index) => {
const regexIncludeList = ["Display name", "Password", "Email", "Phone", "Location",
"Title", "Homepage", "Bio", "Gender", "Birthday", "Education", "ID card",
"ID card type"];
if (!regexIncludeList.includes(record.name)) {
return null;
}
return (
<Input value={text} onChange={e => {
this.updateField(table, index, "regex", e.target.value);
}} />
);
},
},
{
title: i18next.t("organization:View rule"),
dataIndex: "viewRule",