mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 18:54:03 +08:00
Restrict rule options.
This commit is contained in:
parent
4a0f22355e
commit
59ac7d6317
@ -151,17 +151,29 @@ class SignupTable extends React.Component {
|
|||||||
key: 'rule',
|
key: 'rule',
|
||||||
width: '120px',
|
width: '120px',
|
||||||
render: (text, record, index) => {
|
render: (text, record, index) => {
|
||||||
|
let options = [];
|
||||||
|
if (record.name === "ID") {
|
||||||
|
options = [
|
||||||
|
{id: 'Random', name: 'Random'},
|
||||||
|
{id: 'Incremental', name: 'Incremental'},
|
||||||
|
];
|
||||||
|
} if (record.name === "Display name") {
|
||||||
|
options = [
|
||||||
|
{id: 'None', name: 'None'},
|
||||||
|
{id: 'Personal', name: 'Personal'},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.length === 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Select virtual={false} style={{width: '100%'}} value={text} onChange={(value => {
|
<Select virtual={false} style={{width: '100%'}} value={text} onChange={(value => {
|
||||||
this.updateField(table, index, 'rule', value);
|
this.updateField(table, index, 'rule', value);
|
||||||
})}>
|
})}>
|
||||||
{
|
{
|
||||||
[
|
options.map((item, index) => <Option key={index} value={item.id}>{item.name}</Option>)
|
||||||
{id: 'None', name: 'None'},
|
|
||||||
{id: 'Random', name: 'Random'},
|
|
||||||
{id: 'Incremental', name: 'Incremental'},
|
|
||||||
{id: 'Personal', name: 'Personal'},
|
|
||||||
].map((item, index) => <Option key={index} value={item.id}>{item.name}</Option>)
|
|
||||||
}
|
}
|
||||||
</Select>
|
</Select>
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user