From: stanislavh Date: Thu, 5 Oct 2023 13:04:33 +0000 (+0200) Subject: SONAR-20366 Migrate Select Projects Modal X-Git-Tag: 10.3.0.82913~257 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d550cc4b27d01d40f0f083fe7f1c2287078cc34e;p=sonarqube.git SONAR-20366 Migrate Select Projects Modal --- diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeProjectsForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeProjectsForm.tsx index 16430984626..d6d85c4747d 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeProjectsForm.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeProjectsForm.tsx @@ -17,16 +17,15 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { Modal, Note } from 'design-system'; import { find, without } from 'lodash'; import * as React from 'react'; import { + ProfileProject, associateProject, dissociateProject, getProfileProjects, - ProfileProject, } from '../../../api/quality-profiles'; -import { ResetButtonLink } from '../../../components/controls/buttons'; -import Modal from '../../../components/controls/Modal'; import SelectList, { SelectListFilter, SelectListSearchParams, @@ -122,17 +121,17 @@ export default class ChangeProjectsForm extends React.PureComponent { const project = find(this.state.projects, { key }); return ( -
+ <> {project === undefined ? ( key ) : ( <> {project.name}
- {project.key} + {project.key} )} -
+ ); }; @@ -140,37 +139,34 @@ export default class ChangeProjectsForm extends React.PureComponent -
-

{header}

-
- -
- project.key)} - elementsTotalCount={this.state.projectsTotalCount} - labelAll={translate('quality_gates.projects.all')} - labelSelected={translate('quality_gates.projects.with')} - labelUnselected={translate('quality_gates.projects.without')} - needToReload={ - this.state.needToReload && - this.state.lastSearchParams && - this.state.lastSearchParams.filter !== SelectListFilter.All - } - onSearch={this.fetchProjects} - onSelect={this.handleSelect} - onUnselect={this.handleUnselect} - renderElement={this.renderElement} - selectedElements={this.state.selectedProjects} - withPaging - /> -
- -
- {translate('close')} -
- + + project.key)} + elementsTotalCount={this.state.projectsTotalCount} + labelAll={translate('quality_gates.projects.all')} + labelSelected={translate('quality_gates.projects.with')} + labelUnselected={translate('quality_gates.projects.without')} + needToReload={ + this.state.needToReload && + this.state.lastSearchParams && + this.state.lastSearchParams.filter !== SelectListFilter.All + } + onSearch={this.fetchProjects} + onSelect={this.handleSelect} + onUnselect={this.handleUnselect} + renderElement={this.renderElement} + selectedElements={this.state.selectedProjects} + withPaging + /> + + } + /> ); } }