diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-09-06 17:53:37 +0200 |
---|---|---|
committer | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-09-11 11:28:29 +0200 |
commit | 3ac9340f013701017f8dbab5b0686d2682f1768f (patch) | |
tree | 2be2f877ee0a92fe2e3ed652c730474dc239ba4a /server/sonar-web/src/main/js/apps/projectsManagement/App.tsx | |
parent | 048982bb3d8d5b2c715f95bc7818c90314e72a14 (diff) | |
download | sonarqube-3ac9340f013701017f8dbab5b0686d2682f1768f.tar.gz sonarqube-3ac9340f013701017f8dbab5b0686d2682f1768f.zip |
SONAR-9181 bulk delete projects or bulk apply template in one go
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projectsManagement/App.tsx')
-rw-r--r-- | server/sonar-web/src/main/js/apps/projectsManagement/App.tsx | 45 |
1 files changed, 12 insertions, 33 deletions
diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/App.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/App.tsx index da819c20f4f..6ede35e8917 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/App.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/App.tsx @@ -26,7 +26,7 @@ import Projects from './Projects'; import CreateProjectForm from './CreateProjectForm'; import ListFooter from '../../components/controls/ListFooter'; import { PAGE_SIZE, Project } from './utils'; -import { getComponents, getProvisioned } from '../../api/components'; +import { getComponents } from '../../api/components'; import { Organization } from '../../app/types'; import { translate } from '../../helpers/l10n'; @@ -78,38 +78,17 @@ export default class App extends React.PureComponent<Props, State> { this.mounted = false; } - getFilters = () => ({ - analyzedBefore: this.state.analyzedBefore, - organization: this.props.organization.key, - p: this.state.page !== 1 ? this.state.page : undefined, - ps: PAGE_SIZE, - q: this.state.query ? this.state.query : undefined - }); - - requestProjects = () => - this.state.provisioned ? this.requestProvisioned() : this.requestAllProjects(); - - requestProvisioned = () => { - const data = this.getFilters(); - getProvisioned(data).then(r => { - if (this.mounted) { - let projects: Project[] = r.projects.map((project: any) => ({ - ...project, - id: project.uuid, - qualifier: 'TRK' - })); - if (this.state.page > 1) { - projects = [...this.state.projects, ...projects]; - } - this.setState({ ready: true, projects, selection: [], total: r.paging.total }); - } - }); - }; - - requestAllProjects = () => { - const data = this.getFilters(); - Object.assign(data, { qualifiers: this.state.qualifiers }); - getComponents(data).then(r => { + requestProjects = () => { + const parameters = { + analyzedBefore: this.state.analyzedBefore, + onProvisionedOnly: this.state.provisioned || undefined, + organization: this.props.organization.key, + p: this.state.page !== 1 ? this.state.page : undefined, + ps: PAGE_SIZE, + q: this.state.query || undefined, + qualifiers: this.state.qualifiers + }; + getComponents(parameters).then(r => { if (this.mounted) { let projects: Project[] = r.components; if (this.state.page > 1) { |