|
|
@@ -42,7 +42,7 @@ export default class CommentForm extends React.Component {
|
|
|
errorMessage: undefined,
|
|
|
hasSlackConfig: config.hasSlackConfig,
|
|
|
isSlackEnabled: false,
|
|
|
- slackChannels: this.props.slackChannels,
|
|
|
+ slackChannels: '',
|
|
|
};
|
|
|
|
|
|
this.growiRenderer = new GrowiRenderer(this.props.crowi, this.props.crowiOriginRenderer, {mode: 'comment'});
|
|
|
@@ -58,6 +58,15 @@ export default class CommentForm extends React.Component {
|
|
|
this.onSlackOnChange = this.onSlackOnChange.bind(this);
|
|
|
}
|
|
|
|
|
|
+ componentWillMount() {
|
|
|
+ this.props.crowi.apiGet('/pages.updatePost', {path: this.props.pagePath})
|
|
|
+ .then(res => {
|
|
|
+ if (res.ok) {
|
|
|
+ this.setState({slackChannels: res.updatePost.join(', ')});
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
updateState(value) {
|
|
|
this.setState({comment: value});
|
|
|
}
|
|
|
@@ -299,7 +308,6 @@ CommentForm.propTypes = {
|
|
|
revisionId: PropTypes.string,
|
|
|
pagePath: PropTypes.string,
|
|
|
editorOptions: PropTypes.object,
|
|
|
- slackChannels: PropTypes.string,
|
|
|
};
|
|
|
CommentForm.defaultProps = {
|
|
|
editorOptions: {},
|