mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-05 05:41:46 +08:00
Use new providerItem.
This commit is contained in:
@ -38,7 +38,7 @@ class ProviderTable extends React.Component {
|
||||
}
|
||||
|
||||
addRow(table) {
|
||||
let row = {name: "", canSignUp: false, canSignIn: true, canUnbind: true};
|
||||
let row = {name: "Please select a provider", canSignUp: false, canSignIn: true, canUnbind: true, alertType: "None"};
|
||||
if (table === undefined) {
|
||||
table = [];
|
||||
}
|
||||
@ -73,9 +73,11 @@ class ProviderTable extends React.Component {
|
||||
value={text}
|
||||
onChange={value => {
|
||||
this.updateField(table, index, 'name', value);
|
||||
const provider = this.props.providers.filter(provider => provider.name === value)[0];
|
||||
this.updateField(table, index, 'provider', provider);
|
||||
}} >
|
||||
{
|
||||
this.props.providers.map((provider, index) => <Option key={index} value={provider.name}>{provider.name}</Option>)
|
||||
this.props.providers.filter(provider => table.filter(providerItem => providerItem.name === provider.name).length === 0).map((provider, index) => <Option key={index} value={provider.name}>{provider.name}</Option>)
|
||||
}
|
||||
</Select>
|
||||
)
|
||||
@ -125,6 +127,27 @@ class ProviderTable extends React.Component {
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: i18next.t("provider:alertType"),
|
||||
dataIndex: 'alertType',
|
||||
key: 'alertType',
|
||||
width: '120px',
|
||||
render: (text, record, index) => {
|
||||
return (
|
||||
<Select virtual={false} style={{width: '100%'}} value={text} onChange={(value => {
|
||||
this.updateField(table, index, 'alertType', value);
|
||||
})}>
|
||||
{
|
||||
[
|
||||
{id: 'None', name: 'None'},
|
||||
{id: 'Once', name: 'Once'},
|
||||
{id: 'Always', name: 'Always'},
|
||||
].map((item, index) => <Option key={index} value={item.id}>{item.name}</Option>)
|
||||
}
|
||||
</Select>
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: i18next.t("general:Action"),
|
||||
key: 'action',
|
||||
|
Reference in New Issue
Block a user