From: Stas Vilchik Date: Tue, 26 Sep 2017 13:09:37 +0000 (+0200) Subject: revert SONAR-9708 Display incremental analysis badge in UI X-Git-Tag: 6.6-RC1~195 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8d4e3f45dfb9e31df001a8b25175beac7c1d99c6;p=sonarqube.git revert SONAR-9708 Display incremental analysis badge in UI --- 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 { 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 { Version {props.component.version}); } - if (props.incremental) { - metaList.push( -
  • - -
  • - ); - } - return (
      {metaList}
    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 ( - -
    {translate('incremental')}
    -
    - ); -} 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( - - ); - wrapper.setState({ - incremental: true, - isFailed: true, - isInProgress: true, - isPending: true - }); + const wrapper = shallow(); + 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( - - ).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 ( {task.id} - + ); } @@ -62,7 +62,7 @@ export default function TaskComponent({ task }: Props) { )} - + ); } 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 ( {'['} {translate('background_task.type', type)} - {incremental && ` - ${translate('incremental')}`} {']'} ); 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()).toMatchSnapshot(); - expect(shallow()).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`] = ` ] `; - -exports[`renders 2`] = ` - - [ - background_task.type.REPORT - - incremental - ] - -`; 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