diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-09-06 10:57:08 +0200 |
---|---|---|
committer | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-09-11 11:28:29 +0200 |
commit | ee1e62962405c87a03a53b0d88ac4a8fa64073b4 (patch) | |
tree | 9d978874871b2fea884139bbe57945510a2791ca /server/sonar-web/src/main/js/apps | |
parent | 71fec25c4056c1dcfe75769c2041b1d56a89a2e5 (diff) | |
download | sonarqube-ee1e62962405c87a03a53b0d88ac4a8fa64073b4.tar.gz sonarqube-ee1e62962405c87a03a53b0d88ac4a8fa64073b4.zip |
SONAR-9784 Drop ghosts tab on projects management page
Diffstat (limited to 'server/sonar-web/src/main/js/apps')
5 files changed, 4 insertions, 51 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 5a860abb5f7..88ac5426f91 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, Type, Project } from './utils'; -import { getComponents, getProvisioned, getGhosts } from '../../api/components'; +import { getComponents, getProvisioned } from '../../api/components'; import { Organization } from '../../app/types'; import { translate } from '../../helpers/l10n'; @@ -92,29 +92,9 @@ export default class App extends React.PureComponent<Props, State> { case Type.Provisioned: this.requestProvisioned(); break; - case Type.Ghosts: - this.requestGhosts(); - break; } }; - requestGhosts = () => { - const data = this.getFilters(); - getGhosts(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.total }); - } - }); - }; - requestProvisioned = () => { const data = this.getFilters(); getProvisioned(data).then(r => { diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx index 914883f8359..69f0f958080 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx @@ -68,8 +68,7 @@ export default class Search extends React.PureComponent<Props, State> { getTypeOptions = () => [ { value: Type.All, label: 'All' }, - { value: Type.Provisioned, label: 'Provisioned' }, - { value: Type.Ghosts, label: 'Ghosts' } + { value: Type.Provisioned, label: 'Provisioned' } ]; getQualifierOptions = () => { @@ -123,17 +122,6 @@ export default class Search extends React.PureComponent<Props, State> { return <Checkbox checked={checked} thirdState={thirdState} onCheck={this.onCheck} />; }; - renderGhostsDescription = () => { - if (this.props.type !== Type.Ghosts || !this.props.ready) { - return null; - } - return ( - <div className="spacer-top alert alert-info"> - {translate('bulk_deletion.ghosts.description')} - </div> - ); - }; - renderQualifierFilter = () => { const options = this.getQualifierOptions(); if (options.length < 2) { @@ -201,7 +189,6 @@ export default class Search extends React.PureComponent<Props, State> { </tr> </tbody> </table> - {this.renderGhostsDescription()} {this.state.bulkApplyTemplateModal && <BulkApplyTemplateModal diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/App-test.tsx index 1c9569d5700..ae2cfdcee0e 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/App-test.tsx @@ -25,8 +25,7 @@ jest.mock('lodash', () => { jest.mock('../../../api/components', () => ({ getComponents: jest.fn(), - getProvisioned: jest.fn(() => Promise.resolve({ paging: { total: 0 }, projects: [] })), - getGhosts: jest.fn(() => Promise.resolve({ projects: [], total: 0 })) + getProvisioned: jest.fn(() => Promise.resolve({ paging: { total: 0 }, projects: [] })) })); import * as React from 'react'; @@ -36,7 +35,6 @@ import { Type } from '../utils'; const getComponents = require('../../../api/components').getComponents as jest.Mock<any>; const getProvisioned = require('../../../api/components').getProvisioned as jest.Mock<any>; -const getGhosts = require('../../../api/components').getGhosts as jest.Mock<any>; const organization = { key: 'org', name: 'org', projectVisibility: 'public' }; @@ -52,7 +50,6 @@ beforeEach(() => { .mockImplementation(() => Promise.resolve({ paging: { total: 0 }, components: [] })) .mockClear(); getProvisioned.mockClear(); - getGhosts.mockClear(); }); it('fetches all projects on mount', () => { @@ -64,8 +61,6 @@ it('changes type', () => { const wrapper = mountRender(); wrapper.find('Search').prop<Function>('onTypeChanged')(Type.Provisioned); expect(getProvisioned).lastCalledWith(defaultSearchParameters); - wrapper.find('Search').prop<Function>('onTypeChanged')(Type.Ghosts); - expect(getGhosts).lastCalledWith(defaultSearchParameters); }); it('changes qualifier and resets type', () => { diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/__snapshots__/Search-test.tsx.snap b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/__snapshots__/Search-test.tsx.snap index 84838c7bc2e..eb9c3bd28ca 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/__snapshots__/Search-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/__snapshots__/Search-test.tsx.snap @@ -88,10 +88,6 @@ exports[`render qualifiers filter 1`] = ` "label": "Provisioned", "value": "PROVISIONED", }, - Object { - "label": "Ghosts", - "value": "GHOSTS", - }, ] } value="ALL" @@ -178,10 +174,6 @@ exports[`renders 1`] = ` "label": "Provisioned", "value": "PROVISIONED", }, - Object { - "label": "Ghosts", - "value": "GHOSTS", - }, ] } value="ALL" diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/utils.ts b/server/sonar-web/src/main/js/apps/projectsManagement/utils.ts index 4e3f01888b3..8f2b119bfab 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/utils.ts +++ b/server/sonar-web/src/main/js/apps/projectsManagement/utils.ts @@ -23,8 +23,7 @@ export const QUALIFIERS_ORDER = ['TRK', 'VW', 'APP', 'DEV']; export enum Type { All = 'ALL', - Provisioned = 'PROVISIONED', - Ghosts = 'GHOSTS' + Provisioned = 'PROVISIONED' } export interface Project { |