|
@@ -43,24 +43,24 @@ export default class SlackNotification extends React.Component {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
render() {
|
|
|
|
|
+ const formNameSlackOn = this.props.formName && this.props.formName + '[notify][slack][on]';
|
|
|
|
|
+ const formNameChannels = this.props.formName && this.props.formName + '[notify][slack][channel]';
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
- <div className="form-inline d-flex align-items-center" id="comment-form-setting">
|
|
|
|
|
- <span className="input-group input-group-sm input-group-slack extended-setting m-r-5">
|
|
|
|
|
- <label className="input-group-addon">
|
|
|
|
|
- <img id="slack-mark-white" src="/images/icons/slack/mark-monochrome_white.svg" width="18" height="18"/>
|
|
|
|
|
- <img id="slack-mark-black" src="/images/icons/slack/mark-monochrome_black.svg" width="18" height="18"/>
|
|
|
|
|
- <input className="comment-form-slack" type="checkbox" name="slack" value="1" checked={this.state.isSlackEnabled} onChange={this.updateStateCheckbox}/>
|
|
|
|
|
- </label>
|
|
|
|
|
- <input className="form-control" type="text" value={this.state.slackChannels} placeholder="slack-channel-name"
|
|
|
|
|
- id="comment-form-slack-channel"
|
|
|
|
|
- data-toggle="popover"
|
|
|
|
|
- title="Slack通知"
|
|
|
|
|
- data-content="通知するにはチェックを入れてください。カンマ区切りで複数チャンネルに通知することができます。"
|
|
|
|
|
- data-trigger="focus"
|
|
|
|
|
- data-placement="top"
|
|
|
|
|
- onChange={e => this.updateState(e.target.value)}
|
|
|
|
|
- />
|
|
|
|
|
- </span>
|
|
|
|
|
|
|
+ <div className="input-group input-group-sm input-group-slack extended-setting m-r-5">
|
|
|
|
|
+ <label className="input-group-addon">
|
|
|
|
|
+ <img id="slack-mark-white" src="/images/icons/slack/mark-monochrome_white.svg" width="18" height="18"/>
|
|
|
|
|
+ <img id="slack-mark-black" src="/images/icons/slack/mark-monochrome_black.svg" width="18" height="18"/>
|
|
|
|
|
+ <input type="checkbox" name={formNameSlackOn} value="1" checked={this.state.isSlackEnabled} onChange={this.updateStateCheckbox}/>
|
|
|
|
|
+ </label>
|
|
|
|
|
+ <input className="form-control" type="text" name={formNameChannels} value={this.state.slackChannels} placeholder="slack channel name"
|
|
|
|
|
+ data-toggle="popover"
|
|
|
|
|
+ title="Slack通知"
|
|
|
|
|
+ data-content="通知するにはチェックを入れてください。カンマ区切りで複数チャンネルに通知することができます。"
|
|
|
|
|
+ data-trigger="focus"
|
|
|
|
|
+ data-placement="top"
|
|
|
|
|
+ onChange={e => this.updateState(e.target.value)}
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
@@ -70,8 +70,9 @@ SlackNotification.propTypes = {
|
|
|
crowi: PropTypes.object.isRequired,
|
|
crowi: PropTypes.object.isRequired,
|
|
|
pageId: PropTypes.string,
|
|
pageId: PropTypes.string,
|
|
|
pagePath: PropTypes.string,
|
|
pagePath: PropTypes.string,
|
|
|
- onChannelChange: PropTypes.func.isRequired,
|
|
|
|
|
- onSlackOnChange: PropTypes.func.isRequired,
|
|
|
|
|
|
|
+ onChannelChange: PropTypes.func,
|
|
|
|
|
+ onSlackOnChange: PropTypes.func,
|
|
|
isSlackEnabled: PropTypes.bool,
|
|
isSlackEnabled: PropTypes.bool,
|
|
|
slackChannels: PropTypes.string,
|
|
slackChannels: PropTypes.string,
|
|
|
|
|
+ formName: PropTypes.string,
|
|
|
};
|
|
};
|