Skip to content

Commit

Permalink
Removes redundant aria-labels where ui label is inherited. Removes un…
Browse files Browse the repository at this point in the history
…necessary components.
  • Loading branch information
jeramysoucy committed Mar 27, 2023
1 parent 065c05a commit adafdf1
Showing 1 changed file with 20 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,6 @@ export class IndexPrivilegeForm extends Component<Props, State> {
{...this.props.validator.validateIndexPrivilege(this.props.indexPrivilege)}
>
<EuiComboBox
aria-label={i18n.translate(
'xpack.security.management.editRole.indexPrivilegeForm.indicesAriaLabel',
{ defaultMessage: 'Indices' }
)}
data-test-subj={`indicesInput${this.props.formIndex}`}
options={this.props.indexPatterns.map(toOption)}
selectedOptions={this.props.indexPrivilege.names.map(toOption)}
Expand All @@ -152,10 +148,6 @@ export class IndexPrivilegeForm extends Component<Props, State> {
fullWidth={true}
>
<EuiComboBox
aria-label={i18n.translate(
'xpack.security.management.editRole.indexPrivilegeForm.privilegesAriaLabel',
{ defaultMessage: 'Index privileges' }
)}
data-test-subj={`privilegesInput${this.props.formIndex}`}
options={this.props.availableIndexPrivileges.map(toOption)}
selectedOptions={this.props.indexPrivilege.privileges.map(toOption)}
Expand Down Expand Up @@ -249,22 +241,16 @@ export class IndexPrivilegeForm extends Component<Props, State> {
) : undefined
}
>
<Fragment>
<EuiComboBox
aria-label={i18n.translate(
'xpack.security.management.editRole.indexPrivilegeForm.grantedFieldsAriaLabel',
{ defaultMessage: 'Granted fields' }
)}
data-test-subj={`fieldInput${this.props.formIndex}`}
options={this.state.flsOptions.map(toOption)}
selectedOptions={grant.map(toOption)}
onCreateOption={this.onCreateGrantedField}
onChange={this.onGrantedFieldsChange}
isDisabled={this.props.isRoleReadOnly}
async={true}
isLoading={this.state.isFieldListLoading}
/>
</Fragment>
<EuiComboBox
data-test-subj={`fieldInput${this.props.formIndex}`}
options={this.state.flsOptions.map(toOption)}
selectedOptions={grant.map(toOption)}
onCreateOption={this.onCreateGrantedField}
onChange={this.onGrantedFieldsChange}
isDisabled={this.props.isRoleReadOnly}
async={true}
isLoading={this.state.isFieldListLoading}
/>
</EuiFormRow>
</EuiFlexItem>
<EuiFlexItem>
Expand All @@ -278,22 +264,16 @@ export class IndexPrivilegeForm extends Component<Props, State> {
fullWidth={true}
className="indexPrivilegeForm__deniedFieldsRow"
>
<Fragment>
<EuiComboBox
aria-label={i18n.translate(
'xpack.security.management.editRole.indexPrivilegeForm.deniedFieldsAriaLabel',
{ defaultMessage: 'Denied fields' }
)}
data-test-subj={`deniedFieldInput${this.props.formIndex}`}
options={this.state.flsOptions.map(toOption)}
selectedOptions={except.map(toOption)}
onCreateOption={this.onCreateDeniedField}
onChange={this.onDeniedFieldsChange}
isDisabled={isRoleReadOnly}
async={true}
isLoading={this.state.isFieldListLoading}
/>
</Fragment>
<EuiComboBox
data-test-subj={`deniedFieldInput${this.props.formIndex}`}
options={this.state.flsOptions.map(toOption)}
selectedOptions={except.map(toOption)}
onCreateOption={this.onCreateDeniedField}
onChange={this.onDeniedFieldsChange}
isDisabled={isRoleReadOnly}
async={true}
isLoading={this.state.isFieldListLoading}
/>
</EuiFormRow>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down

0 comments on commit adafdf1

Please sign in to comment.