aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2017-09-26 15:09:37 +0200
committerStas Vilchik <stas.vilchik@sonarsource.com>2017-09-27 11:04:22 +0200
commit8d4e3f45dfb9e31df001a8b25175beac7c1d99c6 (patch)
tree8f4db4bc1815f7af77e8b88efd28a493889291ec
parent9045f371469ade40f42cc4a82fa9d9df95552a3c (diff)
downloadsonarqube-8d4e3f45dfb9e31df001a8b25175beac7c1d99c6.tar.gz
sonarqube-8d4e3f45dfb9e31df001a8b25175beac7c1d99c6.zip
revert SONAR-9708 Display incremental analysis badge in UI
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx5
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMeta.tsx10
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/component/IncrementalBadge.tsx30
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNav-test.tsx11
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavMeta-test.tsx15
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNav-test.tsx.snap1
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/TaskType.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskType-test.tsx1
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskType-test.tsx.snap11
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/types.ts1
-rw-r--r--sonar-core/src/main/resources/org/sonar/l10n/core.properties2
12 files changed, 7 insertions, 88 deletions
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx
index 5b9a509fdd8..27c39fa2a97 100644
--- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx
+++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx
@@ -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}
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMeta.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMeta.tsx
index c5721aa4e24..ea33a7af4f8 100644
--- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMeta.tsx
+++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMeta.tsx
@@ -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
index 25f9121e592..00000000000
--- a/server/sonar-web/src/main/js/app/components/nav/component/IncrementalBadge.tsx
+++ /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>
- );
-}
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNav-test.tsx b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNav-test.tsx
index f63e785ca5a..945ceed22ad 100644
--- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNav-test.tsx
+++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNav-test.tsx
@@ -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();
});
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavMeta-test.tsx b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavMeta-test.tsx
index 1e1d412852c..331c7c034e7 100644
--- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavMeta-test.tsx
+++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavMeta-test.tsx
@@ -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,
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNav-test.tsx.snap b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNav-test.tsx.snap
index a4317c09cec..b110b9a507a 100644
--- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNav-test.tsx.snap
+++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNav-test.tsx.snap
@@ -50,7 +50,6 @@ exports[`renders 1`] = `
"qualifier": "TRK",
}
}
- incremental={true}
isFailed={true}
isInProgress={true}
isPending={true}
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.tsx
index 72a38a1bf50..5e9fcca412b 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.tsx
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.tsx
@@ -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>
);
}
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskType.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskType.tsx
index 456abbdf210..17f4a23a286 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskType.tsx
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskType.tsx
@@ -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>
);
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskType-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskType-test.tsx
index 1c0e961622f..89bf27debb8 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskType-test.tsx
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskType-test.tsx
@@ -23,5 +23,4 @@ import TaskType from '../TaskType';
it('renders', () => {
expect(shallow(<TaskType type="REPORT" />)).toMatchSnapshot();
- expect(shallow(<TaskType incremental={true} type="REPORT" />)).toMatchSnapshot();
});
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskType-test.tsx.snap b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskType-test.tsx.snap
index df6e0ffa00b..67fa0621b7e 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskType-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskType-test.tsx.snap
@@ -9,14 +9,3 @@ exports[`renders 1`] = `
]
</span>
`;
-
-exports[`renders 2`] = `
-<span
- className="display-inline-block note"
->
- [
- background_task.type.REPORT
- - incremental
- ]
-</span>
-`;
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/types.ts b/server/sonar-web/src/main/js/apps/background-tasks/types.ts
index a149d2f7d2e..6a81a1d824f 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/types.ts
+++ b/server/sonar-web/src/main/js/apps/background-tasks/types.ts
@@ -28,7 +28,6 @@ export interface Task {
executedAt?: string;
executionTimeMs?: number;
hasScannerContext?: boolean;
- incremental?: boolean;
id: string;
organization?: string;
startedAt?: string;
diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
index f4831a7f68f..7bf157dc139 100644
--- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties
+++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
@@ -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