mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 05:10:19 +08:00
Improve Select modes
This commit is contained in:
@ -564,7 +564,7 @@ class ApplicationEditPage extends React.Component {
|
|||||||
{Setting.getLabel(i18next.t("application:Grant types"), i18next.t("application:Grant types - Tooltip"))} :
|
{Setting.getLabel(i18next.t("application:Grant types"), i18next.t("application:Grant types - Tooltip"))} :
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<Select virtual={false} mode="tags" style={{width: "100%"}}
|
<Select virtual={false} mode="multiple" style={{width: "100%"}}
|
||||||
value={this.state.application.grantTypes}
|
value={this.state.application.grantTypes}
|
||||||
onChange={(value => {
|
onChange={(value => {
|
||||||
this.updateApplicationField("grantTypes", value);
|
this.updateApplicationField("grantTypes", value);
|
||||||
|
@ -175,7 +175,7 @@ class ChatEditPage extends React.Component {
|
|||||||
{Setting.getLabel(i18next.t("general:Users"), i18next.t("chat:Users - Tooltip"))} :
|
{Setting.getLabel(i18next.t("general:Users"), i18next.t("chat:Users - Tooltip"))} :
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<Select mode="tags" style={{width: "100%"}} value={this.state.chat.users}
|
<Select virtual={false} mode="multiple" style={{width: "100%"}} value={this.state.chat.users}
|
||||||
onChange={(value => {this.updateChatField("users", value);})}
|
onChange={(value => {this.updateChatField("users", value);})}
|
||||||
options={this.state.users.map((user) => Setting.getOption(`${user.owner}/${user.name}`, `${user.owner}/${user.name}`))}
|
options={this.state.users.map((user) => Setting.getOption(`${user.owner}/${user.name}`, `${user.owner}/${user.name}`))}
|
||||||
/>
|
/>
|
||||||
|
@ -205,7 +205,7 @@ class OrganizationEditPage extends React.Component {
|
|||||||
{Setting.getLabel(i18next.t("general:Languages"), i18next.t("general:Languages - Tooltip"))} :
|
{Setting.getLabel(i18next.t("general:Languages"), i18next.t("general:Languages - Tooltip"))} :
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<Select virtual={false} mode="tags" style={{width: "100%"}}
|
<Select virtual={false} mode="multiple" style={{width: "100%"}}
|
||||||
options={Setting.Countries.map((item) => {
|
options={Setting.Countries.map((item) => {
|
||||||
return Setting.getOption(item.label, item.key);
|
return Setting.getOption(item.label, item.key);
|
||||||
})}
|
})}
|
||||||
|
@ -217,7 +217,7 @@ class PermissionEditPage extends React.Component {
|
|||||||
{Setting.getLabel(i18next.t("role:Sub users"), i18next.t("role:Sub users - Tooltip"))} :
|
{Setting.getLabel(i18next.t("role:Sub users"), i18next.t("role:Sub users - Tooltip"))} :
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<Select mode="tags" style={{width: "100%"}} value={this.state.permission.users}
|
<Select virtual={false} mode="multiple" style={{width: "100%"}} value={this.state.permission.users}
|
||||||
onChange={(value => {this.updatePermissionField("users", value);})}
|
onChange={(value => {this.updatePermissionField("users", value);})}
|
||||||
options={this.state.users.map((user) => Setting.getOption(`${user.owner}/${user.name}`, `${user.owner}/${user.name}`))}
|
options={this.state.users.map((user) => Setting.getOption(`${user.owner}/${user.name}`, `${user.owner}/${user.name}`))}
|
||||||
/>
|
/>
|
||||||
@ -228,7 +228,7 @@ class PermissionEditPage extends React.Component {
|
|||||||
{Setting.getLabel(i18next.t("role:Sub roles"), i18next.t("role:Sub roles - Tooltip"))} :
|
{Setting.getLabel(i18next.t("role:Sub roles"), i18next.t("role:Sub roles - Tooltip"))} :
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<Select virtual={false} disabled={!this.hasRoleDefinition(this.state.model)} mode="tags" style={{width: "100%"}} value={this.state.permission.roles}
|
<Select disabled={!this.hasRoleDefinition(this.state.model)} virtual={false} mode="multiple" style={{width: "100%"}} value={this.state.permission.roles}
|
||||||
onChange={(value => {this.updatePermissionField("roles", value);})}
|
onChange={(value => {this.updatePermissionField("roles", value);})}
|
||||||
options={this.state.roles.filter(roles => (roles.owner !== this.state.roles.owner || roles.name !== this.state.roles.name)).map((permission) => Setting.getOption(`${permission.owner}/${permission.name}`, `${permission.owner}/${permission.name}`))
|
options={this.state.roles.filter(roles => (roles.owner !== this.state.roles.owner || roles.name !== this.state.roles.name)).map((permission) => Setting.getOption(`${permission.owner}/${permission.name}`, `${permission.owner}/${permission.name}`))
|
||||||
} />
|
} />
|
||||||
@ -267,7 +267,7 @@ class PermissionEditPage extends React.Component {
|
|||||||
{Setting.getLabel(i18next.t("general:Resources"), i18next.t("permission:Resources - Tooltip"))} :
|
{Setting.getLabel(i18next.t("general:Resources"), i18next.t("permission:Resources - Tooltip"))} :
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<Select virtual={false} mode="tags" style={{width: "100%"}} value={this.state.permission.resources}
|
<Select virtual={false} mode="multiple" style={{width: "100%"}} value={this.state.permission.resources}
|
||||||
onChange={(value => {this.updatePermissionField("resources", value);})}
|
onChange={(value => {this.updatePermissionField("resources", value);})}
|
||||||
options={this.state.resources.map((resource) => Setting.getOption(`${resource.name}`, `${resource.name}`))
|
options={this.state.resources.map((resource) => Setting.getOption(`${resource.name}`, `${resource.name}`))
|
||||||
} />
|
} />
|
||||||
@ -278,7 +278,7 @@ class PermissionEditPage extends React.Component {
|
|||||||
{Setting.getLabel(i18next.t("permission:Actions"), i18next.t("permission:Actions - Tooltip"))} :
|
{Setting.getLabel(i18next.t("permission:Actions"), i18next.t("permission:Actions - Tooltip"))} :
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<Select virtual={false} mode="tags" style={{width: "100%"}} value={this.state.permission.actions} onChange={(value => {
|
<Select virtual={false} mode="multiple" style={{width: "100%"}} value={this.state.permission.actions} onChange={(value => {
|
||||||
this.updatePermissionField("actions", value);
|
this.updatePermissionField("actions", value);
|
||||||
})}
|
})}
|
||||||
options={[
|
options={[
|
||||||
|
@ -181,7 +181,7 @@ class PricingEditPage extends React.Component {
|
|||||||
{Setting.getLabel(i18next.t("general:Plans"), i18next.t("general:Plans - Tooltip"))} :
|
{Setting.getLabel(i18next.t("general:Plans"), i18next.t("general:Plans - Tooltip"))} :
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<Select mode="tags" style={{width: "100%"}} value={this.state.pricing.plans}
|
<Select virtual={false} mode="multiple" style={{width: "100%"}} value={this.state.pricing.plans}
|
||||||
onChange={(value => {
|
onChange={(value => {
|
||||||
this.updatePricingField("plans", value);
|
this.updatePricingField("plans", value);
|
||||||
})}
|
})}
|
||||||
|
@ -228,7 +228,7 @@ class ProductEditPage extends React.Component {
|
|||||||
{Setting.getLabel(i18next.t("product:Payment providers"), i18next.t("product:Payment providers - Tooltip"))} :
|
{Setting.getLabel(i18next.t("product:Payment providers"), i18next.t("product:Payment providers - Tooltip"))} :
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<Select virtual={false} mode="tags" style={{width: "100%"}} value={this.state.product.providers} onChange={(value => {this.updateProductField("providers", value);})}>
|
<Select virtual={false} mode="multiple" style={{width: "100%"}} value={this.state.product.providers} onChange={(value => {this.updateProductField("providers", value);})}>
|
||||||
{
|
{
|
||||||
this.state.providers.map((provider, index) => <Option key={index} value={provider.name}>{provider.name}</Option>)
|
this.state.providers.map((provider, index) => <Option key={index} value={provider.name}>{provider.name}</Option>)
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ class RoleEditPage extends React.Component {
|
|||||||
{Setting.getLabel(i18next.t("role:Sub users"), i18next.t("role:Sub users - Tooltip"))} :
|
{Setting.getLabel(i18next.t("role:Sub users"), i18next.t("role:Sub users - Tooltip"))} :
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<Select mode="tags" style={{width: "100%"}} value={this.state.role.users}
|
<Select virtual={false} mode="multiple" style={{width: "100%"}} value={this.state.role.users}
|
||||||
onChange={(value => {this.updateRoleField("users", value);})}
|
onChange={(value => {this.updateRoleField("users", value);})}
|
||||||
options={this.state.users.map((user) => Setting.getOption(`${user.owner}/${user.name}`, `${user.owner}/${user.name}`))}
|
options={this.state.users.map((user) => Setting.getOption(`${user.owner}/${user.name}`, `${user.owner}/${user.name}`))}
|
||||||
/>
|
/>
|
||||||
@ -152,7 +152,7 @@ class RoleEditPage extends React.Component {
|
|||||||
{Setting.getLabel(i18next.t("role:Sub roles"), i18next.t("role:Sub roles - Tooltip"))} :
|
{Setting.getLabel(i18next.t("role:Sub roles"), i18next.t("role:Sub roles - Tooltip"))} :
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<Select virtual={false} mode="tags" style={{width: "100%"}} value={this.state.role.roles} onChange={(value => {this.updateRoleField("roles", value);})}
|
<Select virtual={false} mode="multiple" style={{width: "100%"}} value={this.state.role.roles} onChange={(value => {this.updateRoleField("roles", value);})}
|
||||||
options={this.state.roles.filter(role => (role.owner !== this.state.role.owner || role.name !== this.state.role.name)).map((role) => Setting.getOption(`${role.owner}/${role.name}`, `${role.owner}/${role.name}`))
|
options={this.state.roles.filter(role => (role.owner !== this.state.role.owner || role.name !== this.state.role.name)).map((role) => Setting.getOption(`${role.owner}/${role.name}`, `${role.owner}/${role.name}`))
|
||||||
} />
|
} />
|
||||||
</Col>
|
</Col>
|
||||||
|
@ -252,7 +252,7 @@ class WebhookEditPage extends React.Component {
|
|||||||
{Setting.getLabel(i18next.t("webhook:Events"), i18next.t("webhook:Events - Tooltip"))} :
|
{Setting.getLabel(i18next.t("webhook:Events"), i18next.t("webhook:Events - Tooltip"))} :
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<Select virtual={false} mode="tags" style={{width: "100%"}}
|
<Select virtual={false} mode="multiple" style={{width: "100%"}}
|
||||||
value={this.state.webhook.events}
|
value={this.state.webhook.events}
|
||||||
onChange={value => {
|
onChange={value => {
|
||||||
this.updateWebhookField("events", value);
|
this.updateWebhookField("events", value);
|
||||||
|
Reference in New Issue
Block a user