Skip to content

Commit

Permalink
[MM-15329] Add Enabled beside post:all and post:channel checkboxes (m…
Browse files Browse the repository at this point in the history
…attermost#2882)

* [MM-15329] Add Enabled beside post:all and post:channel checkboxes

* Add new translation string to i18n/en.json

* MM-15329 - Updating checkboxes markup
  • Loading branch information
bolariin authored and saturninoabril committed May 31, 2019
1 parent 21c0667 commit ad9a0a3
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 14 deletions.
44 changes: 30 additions & 14 deletions components/integrations/bots/add_bot/add_bot.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -589,13 +589,21 @@ export default class AddBot extends React.Component {
/>
</label>
<div className='col-md-5 col-sm-8 checkbox'>
<input
id='postAll'
type='checkbox'
checked={this.state.postAll || this.state.role === roleOptionSystemAdmin}
onChange={this.updatePostAll}
disabled={!this.props.editingUserHasManageSystem || this.state.role === roleOptionSystemAdmin}
/>
<div className='checkbox no-padding'>
<label htmlFor='postAll'>
<input
id='postAll'
type='checkbox'
checked={this.state.postAll || this.state.role === roleOptionSystemAdmin}
onChange={this.updatePostAll}
disabled={!this.props.editingUserHasManageSystem || this.state.role === roleOptionSystemAdmin}
/>
<FormattedMessage
id='bot.add.post_all.enabled'
defaultMessage='Enabled'
/>
</label>
</div>
<div className='form__help'>
<FormattedMessage
id='bot.add.post_all.help'
Expand All @@ -615,13 +623,21 @@ export default class AddBot extends React.Component {
/>
</label>
<div className='col-md-5 col-sm-8 checkbox'>
<input
id='postChannels'
type='checkbox'
checked={this.state.postChannels || this.state.role === roleOptionSystemAdmin || this.state.postAll}
onChange={this.updatePostChannels}
disabled={!this.props.editingUserHasManageSystem || this.state.role === roleOptionSystemAdmin || this.state.postAll}
/>
<div className='checkbox no-padding'>
<label htmlFor='postChannels'>
<input
id='postChannels'
type='checkbox'
checked={this.state.postChannels || this.state.role === roleOptionSystemAdmin || this.state.postAll}
onChange={this.updatePostChannels}
disabled={!this.props.editingUserHasManageSystem || this.state.role === roleOptionSystemAdmin || this.state.postAll}
/>
<FormattedMessage
id='bot.add.post_channels.enabled'
defaultMessage='Enabled'
/>
</label>
</div>
<div className='form__help'>
<FormattedMessage
id='bot.add.post_channels.help'
Expand Down
2 changes: 2 additions & 0 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1606,8 +1606,10 @@
"bot.add.description.help": "(Optional) Let others know what this bot does.",
"bot.add.display_name.help": "(Optional) You can choose to display your bot's full name rather than its username.",
"bot.add.post_all": "post:all",
"bot.add.post_all.enabled": "Enabled",
"bot.add.post_all.help": "Bot will have access to post to all Mattermost channels including direct messages.",
"bot.add.post_channels": "post:channels",
"bot.add.post_channels.enabled": "Enabled",
"bot.add.post_channels.help": "Bot will have access to post to all Mattermost public channels.",
"bot.add.role": "Role",
"bot.add.role.help": "Choose what role the bot should have.",
Expand Down
8 changes: 8 additions & 0 deletions sass/layout/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
&.margin-bottom--none {
margin-bottom: 0;
}

&.no-padding {
padding: 0;

label {
padding: 0;
}
}
}

.form-control {
Expand Down

0 comments on commit ad9a0a3

Please sign in to comment.