Skip to content

Commit

Permalink
dont allow tag creation if id is invalid (#25133)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattapperson committed Nov 7, 2018
1 parent 301dfae commit 755b92b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ export class CreateTagFragment extends React.PureComponent<TagPageProps, TagPage
<EuiButton
fill
disabled={
this.state.tag.id === '' || this.state.tag.configuration_blocks.length === 0
this.state.tag.id.search(/^[a-zA-Z0-9-]+$/) === -1 ||
this.state.tag.id === '' ||
this.state.tag.configuration_blocks.length === 0
}
onClick={this.saveTag}
>
Expand Down
4 changes: 3 additions & 1 deletion x-pack/plugins/beats_management/public/pages/tag/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ export class TagPageComponent extends React.PureComponent<TagPageProps, TagPageS
<EuiButton
fill
disabled={
this.state.tag.id === '' || this.getNumExclusiveConfigurationBlocks() > 1 // || this.state.tag.configuration_blocks.length === 0
this.state.tag.id.search(/^[a-zA-Z0-9-]+$/) === -1 ||
this.state.tag.id === '' ||
this.getNumExclusiveConfigurationBlocks() > 1 // || this.state.tag.configuration_blocks.length === 0
}
onClick={this.saveTag}
>
Expand Down

0 comments on commit 755b92b

Please sign in to comment.