diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-10-10 15:39:38 +0200 |
---|---|---|
committer | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-10-11 12:02:21 +0200 |
commit | cb17989ed82948611a3bf912a9fbe4f9713073f5 (patch) | |
tree | 06650dbc7177b90a29432329485ddff72e6ec926 | |
parent | 508a1d7944f43fcace900993f25bccf7f70110e9 (diff) | |
download | sonarqube-cb17989ed82948611a3bf912a9fbe4f9713073f5.tar.gz sonarqube-cb17989ed82948611a3bf912a9fbe4f9713073f5.zip |
SONAR-9696 UI asks to comment issues after bulk change
-rw-r--r-- | server/sonar-web/src/main/js/components/issue/components/IssueActionsBar.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueActionsBar.js b/server/sonar-web/src/main/js/components/issue/components/IssueActionsBar.js index f36ac5d3504..4227c2ab634 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueActionsBar.js +++ b/server/sonar-web/src/main/js/components/issue/components/IssueActionsBar.js @@ -52,13 +52,6 @@ export default class IssueActionsBar extends React.PureComponent { commentPlaceholder: '' }; - componentDidUpdate(prevProps /*: Props */) { - const { resolution } = this.props.issue; - if (!prevProps.issue.resolution && ['FALSE-POSITIVE', 'WONTFIX'].includes(resolution)) { - this.toggleComment(true, translate('issue.comment.tell_why')); - } - } - setIssueProperty = ( property /*: string */, popup /*: string */, @@ -84,6 +77,13 @@ export default class IssueActionsBar extends React.PureComponent { this.props.togglePopup('comment', open); }; + handleTransition = (issue /*: Issue */) => { + this.props.onChange(issue); + if (['FALSE-POSITIVE', 'WONTFIX'].includes(issue.resolution)) { + this.toggleComment(true, translate('issue.comment.tell_why')); + } + }; + render() { const { issue } = this.props; const canAssign = issue.actions.includes('assign'); @@ -121,7 +121,7 @@ export default class IssueActionsBar extends React.PureComponent { isOpen={this.props.currentPopup === 'transition' && hasTransitions} issue={issue} hasTransitions={hasTransitions} - onChange={this.props.onChange} + onChange={this.handleTransition} onFail={this.props.onFail} togglePopup={this.props.togglePopup} /> |