mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-05 05:50:19 +08:00
feat: add type and options to signup items
This commit is contained in:
@ -65,7 +65,7 @@ class SignupTable extends React.Component {
|
||||
}
|
||||
|
||||
addRow(table) {
|
||||
const row = {name: Setting.getNewRowNameForTable(table, "Please select a signup item"), visible: true, required: true, rule: "None", customCss: ""};
|
||||
const row = {name: Setting.getNewRowNameForTable(table, "Please select a signup item"), visible: true, required: true, options: [], rule: "None", customCss: ""};
|
||||
if (table === undefined) {
|
||||
table = [];
|
||||
}
|
||||
@ -201,6 +201,25 @@ class SignupTable extends React.Component {
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: i18next.t("provider:Type"),
|
||||
dataIndex: "type",
|
||||
key: "type",
|
||||
width: "160px",
|
||||
render: (text, record, index) => {
|
||||
const options = [
|
||||
{id: "Input", name: i18next.t("application:Input")},
|
||||
{id: "Single Choice", name: i18next.t("application:Single Choice")},
|
||||
{id: "Multiple Choices", name: i18next.t("application:Multiple Choices")},
|
||||
];
|
||||
|
||||
return (
|
||||
<Select virtual={false} style={{width: "100%"}} value={text} onChange={(value => {
|
||||
this.updateField(table, index, "type", value);
|
||||
})} options={options.map(item => Setting.getOption(item.name, item.id))} />
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: i18next.t("signup:Label"),
|
||||
dataIndex: "label",
|
||||
@ -261,7 +280,7 @@ class SignupTable extends React.Component {
|
||||
title: i18next.t("signup:Placeholder"),
|
||||
dataIndex: "placeholder",
|
||||
key: "placeholder",
|
||||
width: "200px",
|
||||
width: "110px",
|
||||
render: (text, record, index) => {
|
||||
if (record.name.startsWith("Text ")) {
|
||||
return null;
|
||||
@ -274,6 +293,26 @@ class SignupTable extends React.Component {
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: i18next.t("signup:Options"),
|
||||
dataIndex: "options",
|
||||
key: "options",
|
||||
width: "180px",
|
||||
render: (text, record, index) => {
|
||||
if (record.type !== "Single Choice" && record.type !== "Multiple Choices") {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Select virtual={false} mode="tags" style={{width: "100%"}} value={text}
|
||||
onChange={(value => {
|
||||
this.updateField(table, index, "options", value);
|
||||
})}
|
||||
options={text?.map((option) => Setting.getOption(option, option))}
|
||||
/>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: i18next.t("signup:Regex"),
|
||||
dataIndex: "regex",
|
||||
|
Reference in New Issue
Block a user