mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
This commit is contained in:
parent
a7e0743028
commit
2d1408f080
2 changed files with 15 additions and 0 deletions
|
@ -115,6 +115,7 @@ exports[`it renders without crashing 1`] = `
|
|||
isClearable={true}
|
||||
isDisabled={false}
|
||||
onChange={[Function]}
|
||||
onCreateOption={[Function]}
|
||||
options={Array []}
|
||||
placeholder="Add a user…"
|
||||
selectedOptions={Array []}
|
||||
|
|
|
@ -133,6 +133,7 @@ export class ElasticsearchPrivileges extends Component<Props, {}> {
|
|||
isGroupLabelOption: false,
|
||||
}))}
|
||||
selectedOptions={this.props.role.elasticsearch.run_as.map(u => ({ label: u }))}
|
||||
onCreateOption={this.onCreateRunAsOption}
|
||||
onChange={this.onRunAsUserChange}
|
||||
isDisabled={!this.props.editable}
|
||||
/>
|
||||
|
@ -231,4 +232,17 @@ export class ElasticsearchPrivileges extends Component<Props, {}> {
|
|||
|
||||
this.props.onChange(role);
|
||||
};
|
||||
|
||||
public onCreateRunAsOption = (option: any) => {
|
||||
const newRunAsUsers = this.props.role.elasticsearch.run_as.concat(option);
|
||||
|
||||
const role = {
|
||||
...this.props.role,
|
||||
elasticsearch: {
|
||||
...this.props.role.elasticsearch,
|
||||
run_as: newRunAsUsers,
|
||||
},
|
||||
};
|
||||
this.props.onChange(role);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue