]> source.dussan.org Git - sonarqube.git/commitdiff
revert SONAR-9708 Display incremental analysis badge in UI
authorStas Vilchik <stas.vilchik@sonarsource.com>
Tue, 26 Sep 2017 13:09:37 +0000 (15:09 +0200)
committerStas Vilchik <stas.vilchik@sonarsource.com>
Wed, 27 Sep 2017 09:04:22 +0000 (11:04 +0200)
12 files changed:
server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx
server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMeta.tsx
server/sonar-web/src/main/js/app/components/nav/component/IncrementalBadge.tsx [deleted file]
server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNav-test.tsx
server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavMeta-test.tsx
server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNav-test.tsx.snap
server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.tsx
server/sonar-web/src/main/js/apps/background-tasks/components/TaskType.tsx
server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskType-test.tsx
server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskType-test.tsx.snap
server/sonar-web/src/main/js/apps/background-tasks/types.ts
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 5b9a509fdd81b93031afc12a394f7bb14a7c9b17..27c39fa2a97f47c644632a15be11c235307cdd96 100644 (file)
@@ -38,7 +38,6 @@ interface Props {
 }
 
 interface State {
-  incremental?: boolean;
   isFailed?: boolean;
   isInProgress?: boolean;
   isPending?: boolean;
@@ -65,8 +64,7 @@ export default class ComponentNav extends React.PureComponent<Props, State> {
         this.setState({
           isPending: r.queue.some((task: any) => task.status === STATUSES.PENDING),
           isInProgress: r.queue.some((task: any) => task.status === STATUSES.IN_PROGRESS),
-          isFailed: r.current && r.current.status === STATUSES.FAILED,
-          incremental: r.current && r.current.incremental
+          isFailed: r.current && r.current.status === STATUSES.FAILED
         });
       }
     });
@@ -111,7 +109,6 @@ export default class ComponentNav extends React.PureComponent<Props, State> {
         <ComponentNavMeta
           branch={this.props.currentBranch}
           component={this.props.component}
-          incremental={this.state.incremental}
           isInProgress={this.state.isInProgress}
           isFailed={this.state.isFailed}
           isPending={this.state.isPending}
index c5721aa4e24f997cd0c92cbc7735b0a87e57fb51..ea33a7af4f83eba914b5bd0a26bf771b267a1e11 100644 (file)
@@ -18,7 +18,6 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
-import IncrementalBadge from './IncrementalBadge';
 import BranchStatus from '../../../../components/common/BranchStatus';
 import { Branch, Component } from '../../../types';
 import Tooltip from '../../../../components/controls/Tooltip';
@@ -30,7 +29,6 @@ import { isShortLivingBranch } from '../../../../helpers/branches';
 interface Props {
   branch?: Branch;
   component: Component;
-  incremental?: boolean;
   isInProgress?: boolean;
   isFailed?: boolean;
   isPending?: boolean;
@@ -103,14 +101,6 @@ export default function ComponentNavMeta(props: Props) {
     metaList.push(<li key="version">Version {props.component.version}</li>);
   }
 
-  if (props.incremental) {
-    metaList.push(
-      <li key="incremental">
-        <IncrementalBadge />
-      </li>
-    );
-  }
-
   return (
     <div className="navbar-context-meta">
       <ul className="list-inline">{metaList}</ul>
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/IncrementalBadge.tsx b/server/sonar-web/src/main/js/app/components/nav/component/IncrementalBadge.tsx
deleted file mode 100644 (file)
index 25f9121..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import * as React from 'react';
-import Tooltip from '../../../../components/controls/Tooltip';
-import { translate } from '../../../../helpers/l10n';
-
-export default function IncrementalBadge() {
-  return (
-    <Tooltip overlay={translate('incremental.project_tooltip')}>
-      <div className="outline-badge">{translate('incremental')}</div>
-    </Tooltip>
-  );
-}
index f63e785ca5aeac3f85c1f052bc478af9ed7ceea1..945ceed22adbcf809e4079f1f08ab4842586869c 100644 (file)
@@ -67,14 +67,7 @@ it('loads status', () => {
 });
 
 it('renders', () => {
-  const wrapper = shallow(
-    <ComponentNav branches={[]} component={component} location={{}} />
-  );
-  wrapper.setState({
-    incremental: true,
-    isFailed: true,
-    isInProgress: true,
-    isPending: true
-  });
+  const wrapper = shallow(<ComponentNav branches={[]} component={component} location={{}} />);
+  wrapper.setState({ isFailed: true, isInProgress: true, isPending: true });
   expect(wrapper).toMatchSnapshot();
 });
index 1e1d412852c0633c1d773d31eb4390f4f11c1535..331c7c034e73041fd1ecc2873d64085f9f06cb77 100644 (file)
@@ -20,7 +20,7 @@
 import * as React from 'react';
 import { shallow } from 'enzyme';
 import ComponentNavMeta from '../ComponentNavMeta';
-import { Branch, BranchType, ShortLivingBranch, LongLivingBranch } from '../../../../types';
+import { BranchType, ShortLivingBranch, LongLivingBranch } from '../../../../types';
 
 const component = {
   analysisDate: '2017-01-02T00:00:00.000Z',
@@ -32,19 +32,6 @@ const component = {
   version: '0.0.1'
 };
 
-it('renders incremental badge', () => {
-  check(true);
-  check(false);
-
-  function check(incremental: boolean) {
-    expect(
-      shallow(
-        <ComponentNavMeta branch={{} as Branch} component={component} incremental={incremental} />
-      ).find('IncrementalBadge')
-    ).toHaveLength(incremental ? 1 : 0);
-  }
-});
-
 it('renders status of short-living branch', () => {
   const branch: ShortLivingBranch = {
     isMain: false,
index a4317c09cec400e150aedd9a8d728d898d2ff161..b110b9a507a2e6a21391976b84618f1538a54932 100644 (file)
@@ -50,7 +50,6 @@ exports[`renders 1`] = `
         "qualifier": "TRK",
       }
     }
-    incremental={true}
     isFailed={true}
     isInProgress={true}
     isPending={true}
index 72a38a1bf5021cc25eaade84797711f9a3d747ae..5e9fcca412bd8de1be2d7c9bf18d25ff918f1f67 100644 (file)
@@ -34,7 +34,7 @@ export default function TaskComponent({ task }: Props) {
     return (
       <td>
         <span className="note">{task.id}</span>
-        <TaskType incremental={task.incremental} type={task.type} />
+        <TaskType type={task.type} />
       </td>
     );
   }
@@ -62,7 +62,7 @@ export default function TaskComponent({ task }: Props) {
         </Link>
       )}
 
-      <TaskType incremental={task.incremental} type={task.type} />
+      <TaskType type={task.type} />
     </td>
   );
 }
index 456abbdf210f9a2ba3fa963b5fc57f387fd49897..17f4a23a2861b109cbd7dcf4e8ec656fd9efbd1b 100644 (file)
@@ -21,16 +21,14 @@ import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
 
 interface Props {
-  incremental?: boolean;
   type: string;
 }
 
-export default function TaskType({ incremental, type }: Props) {
+export default function TaskType({ type }: Props) {
   return (
     <span className="display-inline-block note">
       {'['}
       {translate('background_task.type', type)}
-      {incremental && ` - ${translate('incremental')}`}
       {']'}
     </span>
   );
index 1c0e961622f052cf357c5748cd1c56781ed78b53..89bf27debb86a7f91cc937773acbdf234c7775c9 100644 (file)
@@ -23,5 +23,4 @@ import TaskType from '../TaskType';
 
 it('renders', () => {
   expect(shallow(<TaskType type="REPORT" />)).toMatchSnapshot();
-  expect(shallow(<TaskType incremental={true} type="REPORT" />)).toMatchSnapshot();
 });
index df6e0ffa00b2f3abc5671d984c311a93b5c582a6..67fa0621b7ece65b5599ecbaa04a09ab7333682c 100644 (file)
@@ -9,14 +9,3 @@ exports[`renders 1`] = `
   ]
 </span>
 `;
-
-exports[`renders 2`] = `
-<span
-  className="display-inline-block note"
->
-  [
-  background_task.type.REPORT
-   - incremental
-  ]
-</span>
-`;
index a149d2f7d2e0c81849532d4dce554f63dd212023..6a81a1d824f9d04b2a9b60752970cb8a496f2f94 100644 (file)
@@ -28,7 +28,6 @@ export interface Task {
   executedAt?: string;
   executionTimeMs?: number;
   hasScannerContext?: boolean;
-  incremental?: boolean;
   id: string;
   organization?: string;
   startedAt?: string;
index f4831a7f68f79c26ac9fcef6e5bf691c9256d512..7bf157dc1393bb429b7a4abbccc0f90c3e19b42f 100644 (file)
@@ -81,8 +81,6 @@ hide=Hide
 identifier_abbreviated=Id
 inactive=Inactive
 including_abbreviated=incl.
-incremental=Incremental
-incremental.project_tooltip=Overall project status could be incomplete: incremental mode was used in the last analysis, so only changed files were examined.
 info=Info
 issue=Issue
 issues=Issues