From: David Cho-Lerat Date: Fri, 21 Jul 2023 09:41:01 +0000 (+0200) Subject: SONAR-19986 Do not load tags for bulk issue change modal when re-indexing X-Git-Tag: 10.2.0.77647~309 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=13af0fca3a4ce35ef3ca63fe64adafe0142914eb;p=sonarqube.git SONAR-19986 Do not load tags for bulk issue change modal when re-indexing --- diff --git a/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx b/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx index bc315025937..bbe8bcc8a46 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { ButtonPrimary, Checkbox, @@ -96,9 +97,14 @@ export class BulkChangeModal extends React.PureComponent { } componentDidMount() { + const { needIssueSync } = this.props; + this.mounted = true; - Promise.all([this.loadIssues(), searchIssueTags({})]).then( + Promise.all([ + this.loadIssues(), + needIssueSync ? Promise.resolve([]) : searchIssueTags({}), + ]).then( ([{ issues, paging }, tags]) => { if (this.mounted) { if (issues.length > MAX_PAGE_SIZE) { @@ -185,6 +191,7 @@ export class BulkChangeModal extends React.PureComponent { const issueKeys = this.state.issues.map((issue) => issue.key); this.setState({ submitting: true }); + bulkChangeIssues(issueKeys, query).then( () => { this.setState({ submitting: false }); @@ -200,6 +207,7 @@ export class BulkChangeModal extends React.PureComponent { getAvailableTransitions(issues: Issue[]) { const transitions: Dict = {}; + issues.forEach((issue) => { if (issue.transitions) { issue.transitions.forEach((t) => { @@ -211,6 +219,7 @@ export class BulkChangeModal extends React.PureComponent { }); } }); + return sortBy(Object.keys(transitions)).map((transition) => ({ transition, count: transitions[transition], @@ -239,6 +248,7 @@ export class BulkChangeModal extends React.PureComponent {
{input} + {affected !== undefined && ( ({translateWithParameters('issue_bulk_change.x_issues', affected)}) @@ -282,7 +292,7 @@ export class BulkChangeModal extends React.PureComponent { const options: LabelValueSelectOption[] = types.map((type) => ({ label: translate('issue.type', type), value: type, - Icon: , + Icon: , })); const input = ( @@ -311,7 +321,7 @@ export class BulkChangeModal extends React.PureComponent { const options: LabelValueSelectOption[] = SEVERITIES.map((severity) => ({ label: translate('severity', severity), value: severity, - Icon: , + Icon: , })); const input = ( @@ -399,13 +409,13 @@ export class BulkChangeModal extends React.PureComponent { return (
} + htmlFor="comment" + label={translate('issue.comment.formlink')} >