]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-9784 Drop ghosts tab on projects management page
authorStas Vilchik <stas.vilchik@sonarsource.com>
Wed, 6 Sep 2017 08:57:08 +0000 (10:57 +0200)
committerStas Vilchik <stas.vilchik@sonarsource.com>
Mon, 11 Sep 2017 09:28:29 +0000 (11:28 +0200)
server/sonar-web/src/main/js/api/components.ts
server/sonar-web/src/main/js/apps/projectsManagement/App.tsx
server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx
server/sonar-web/src/main/js/apps/projectsManagement/__tests__/App-test.tsx
server/sonar-web/src/main/js/apps/projectsManagement/__tests__/__snapshots__/Search-test.tsx.snap
server/sonar-web/src/main/js/apps/projectsManagement/utils.ts
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 7e9ac772df9293d8b272afabf2fa7f3c9c46bcb5..572875aa7905f687352d3949b4b2a2dc0a40af31 100644 (file)
@@ -28,10 +28,6 @@ export function getProvisioned(data: RequestData): Promise<any> {
   return getJSON('/api/projects/provisioned', data);
 }
 
-export function getGhosts(data: RequestData): Promise<any> {
-  return getJSON('/api/projects/ghosts', data);
-}
-
 export function deleteComponents(projects: string[], organization: string): Promise<void> {
   return post('/api/projects/bulk_delete', { projects: projects.join(), organization });
 }
index 5a860abb5f732b770972ab3662045634fcf3e10f..88ac5426f91cfec7f49e23aa92ef36dc87a1d667 100644 (file)
@@ -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 => {
index 914883f835931ea9c7f8b22f3489d5d91ba0fc45..69f0f958080b2c8784b322383f6b996e46efd20d 100644 (file)
@@ -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
index 1c9569d570098e7b4030a9b30de1b90de7964523..ae2cfdcee0efe2c15b1c965de8238256d614c06f 100644 (file)
@@ -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', () => {
index 84838c7bc2e25b18d3834a81c6cc5fd54a5f2eae..eb9c3bd28cabc3c590125eb6a8a2ce06c28f22bc 100644 (file)
@@ -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"
index 4e3f01888b3ca6794e42aa6b29796d4731788c2d..8f2b119bfabadd487a46f41d74f2935fd913cbb4 100644 (file)
@@ -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 {
index 963655f5f6735170c36b1a8246115ed533b92a63..916420b80b927852ac62198757e90a6ff1b8c676 100644 (file)
@@ -1984,11 +1984,6 @@ bulk_deletion.deletion_manager.currently_deleting_x_out_of_x=Currently deleting
 bulk_deletion.deletion_manager.deletion_completed=Component deletion completed.
 bulk_deletion.deletion_manager.however_failures_occurred=However, some failures occurred.
 bulk_deletion.started_since_x=Started {0} ago
-bulk_deletion.ghosts=Ghosts
-bulk_deletion.ghosts.description=A ghost is the result of constantly failed attempts to analyse a project. In such a case, the project is not linked to any successful analysis, and therefore cannot be displayed in SonarQube. When the user authentication is forced, leaving a ghost can even prevent further analyses of the corresponding project.
-bulk_deletion.no_ghosts=There is currently no ghost.
-bulk_deletion.following_ghosts_can_be_deleted=The following ghosts can be safely deleted:
-bulk_deletion.delete_all_ghosts=Delete all ghosts
 
 
 #------------------------------------------------------------------------------