From 426062571e84035f9ff66f4e53bba71837c61921 Mon Sep 17 00:00:00 2001 From: Philippe Perrin Date: Thu, 7 Apr 2022 20:10:48 +0200 Subject: [NO-JIRA] Fix eslint issues --- .../src/main/js/app/components/AdminContainer.tsx | 2 - .../js/app/components/NonAdminPagesContainer.tsx | 7 --- .../components/__tests__/AdminContainer-test.tsx | 3 +- .../__tests__/NonAdminPagesContainer-test.tsx | 7 +-- .../__snapshots__/AdminContainer-test.tsx.snap | 11 ---- .../js/app/components/extensions/PortfolioPage.tsx | 3 +- .../extensions/ProjectAdminPageExtension.tsx | 2 - .../components/extensions/ProjectPageExtension.tsx | 1 - .../__tests__/ProjectAdminPageExtension-test.tsx | 2 - .../__tests__/ProjectPageExtension-test.tsx | 2 - .../__snapshots__/PortfolioPage-test.tsx.snap | 11 ---- .../indexation/IndexationNotificationRenderer.tsx | 3 + .../component/projectInformation/meta/MetaTags.tsx | 7 +-- .../projectInformation/meta/MetaTagsSelector.tsx | 1 - .../meta/__tests__/MetaTagsSelector-test.tsx | 4 +- .../__tests__/__snapshots__/MetaTags-test.tsx.snap | 1 - .../js/app/components/nav/global/GlobalNav.tsx | 2 +- .../__snapshots__/GlobalNav-test.tsx.snap | 16 +----- .../js/app/components/nav/settings/SettingsNav.tsx | 1 - .../nav/settings/__tests__/SettingsNav-test.tsx | 1 - .../src/main/js/app/components/search/Search.tsx | 15 ++--- .../components/StatPendingTime.tsx | 2 - .../components/ActivationFormModal.tsx | 1 + .../main/js/apps/coding-rules/components/App.tsx | 1 - .../apps/coding-rules/components/RuleDetails.tsx | 1 - .../components/RuleDetailsProfiles.tsx | 1 - .../apps/coding-rules/components/RuleListItem.tsx | 1 - .../__tests__/__snapshots__/App-test.tsx.snap | 2 - .../components/MeasureContent.tsx | 1 - .../components/MeasureOverview.tsx | 1 - .../__snapshots__/MeasureOverview-test.tsx.snap | 28 ---------- .../component-measures/drilldown/BubbleChart.tsx | 2 - .../component-measures/drilldown/TreeMapView.tsx | 2 - .../drilldown/__tests__/BubbleChart-test.tsx | 1 - .../create/project/CreateProjectModeSelection.tsx | 3 + .../js/apps/create/project/CreateProjectPage.tsx | 5 +- .../create/project/GitHubProjectCreateRenderer.tsx | 3 + .../project/__tests__/CreateProjectPage-test.tsx | 8 +-- .../main/js/apps/issues/components/IssuesApp.tsx | 1 - .../issues/components/__tests__/IssuesApp-test.tsx | 1 - .../main/js/apps/issues/sidebar/StandardFacet.tsx | 3 + .../src/main/js/apps/overview/components/App.tsx | 4 +- .../js/apps/overview/components/IssueRating.tsx | 3 + .../overview/components/__tests__/App-test.tsx | 8 +-- .../global/components/AllHoldersList.tsx | 1 - .../js/apps/permissions/global/components/App.tsx | 1 - .../components/__tests__/AllHoldersList-test.tsx | 1 - .../__tests__/__snapshots__/App-test.tsx.snap | 2 - .../components/BaselineSettingReferenceBranch.tsx | 1 - .../BaselineSettingReferenceBranch-test.tsx | 7 +-- .../js/apps/projects/filters/NewLinesFilter.tsx | 1 - .../js/apps/projects/filters/QualityGateFilter.tsx | 1 - .../components/QualityGatePermissionsAddModal.tsx | 3 +- .../QualityGatePermissionsAddModalRenderer.tsx | 1 - ...QualityGatePermissionsAddModalRenderer-test.tsx | 4 +- .../QualityGatePermissionsAddModal-test.tsx.snap | 1 - ...tyGatePermissionsAddModalRenderer-test.tsx.snap | 64 ---------------------- .../quality-profiles/components/ProfileActions.tsx | 1 - .../apps/quality-profiles/home/ProfilesListRow.tsx | 2 +- .../__snapshots__/ProfilesListRow-test.tsx.snap | 4 -- .../src/main/js/apps/sessions/components/Login.tsx | 6 +- .../main/js/apps/sessions/components/LoginForm.tsx | 1 - .../components/__tests__/LoginForm-test.tsx | 6 +- .../__tests__/__snapshots__/Login-test.tsx.snap | 3 - .../src/main/js/apps/webhooks/components/App.tsx | 1 + .../components/SourceViewer/SourceViewerBase.tsx | 1 - .../components/SourceViewer/SourceViewerCode.tsx | 1 - .../__tests__/SourceViewerCode-test.tsx | 1 - .../__snapshots__/SourceViewerBase-test.tsx.snap | 1 - .../components/activity-graph/AddGraphMetric.tsx | 1 - .../js/components/activity-graph/GraphsHeader.tsx | 1 - .../src/main/js/components/common/MultiSelect.tsx | 1 + .../js/components/facet/ListStyleFacetFooter.tsx | 1 - .../components/tutorials/jenkins/WebhookStep.tsx | 3 + 74 files changed, 47 insertions(+), 261 deletions(-) (limited to 'server/sonar-web/src/main') diff --git a/server/sonar-web/src/main/js/app/components/AdminContainer.tsx b/server/sonar-web/src/main/js/app/components/AdminContainer.tsx index 0f05906ec49..f5ef383db99 100644 --- a/server/sonar-web/src/main/js/app/components/AdminContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/AdminContainer.tsx @@ -33,7 +33,6 @@ import SettingsNav from './nav/settings/SettingsNav'; export interface AdminContainerProps { appState: AppState; - location: {}; children: React.ReactElement; } @@ -128,7 +127,6 @@ export class AdminContainer extends React.PureComponent diff --git a/server/sonar-web/src/main/js/app/components/NonAdminPagesContainer.tsx b/server/sonar-web/src/main/js/app/components/NonAdminPagesContainer.tsx index e0ec00bb08f..622a88610ae 100644 --- a/server/sonar-web/src/main/js/app/components/NonAdminPagesContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/NonAdminPagesContainer.tsx @@ -20,19 +20,12 @@ import * as React from 'react'; import { Alert } from '../../components/ui/Alert'; import { translate } from '../../helpers/l10n'; -import { BranchLike } from '../../types/branch-like'; import { isApplication } from '../../types/component'; import { Component } from '../../types/types'; export interface NonAdminPagesContainerProps { children: JSX.Element; - branchLike?: BranchLike; - branchLikes: BranchLike[]; component: Component; - isInProgress?: boolean; - isPending?: boolean; - onBranchesChange: () => void; - onComponentChange: (changes: {}) => void; } export default function NonAdminPagesContainer(props: NonAdminPagesContainerProps) { diff --git a/server/sonar-web/src/main/js/app/components/__tests__/AdminContainer-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/AdminContainer-test.tsx index 319896752c2..fc5b9bcd6ab 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/AdminContainer-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/AdminContainer-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { mockAppState, mockLocation } from '../../../helpers/testMocks'; +import { mockAppState } from '../../../helpers/testMocks'; import { AdminContainer, AdminContainerProps } from '../AdminContainer'; jest.mock('../../../api/plugins', () => ({ @@ -42,7 +42,6 @@ function shallowRender(props: Partial = {}) { appState={mockAppState({ canAdmin: true })} - location={mockLocation()} {...props}>
diff --git a/server/sonar-web/src/main/js/app/components/__tests__/NonAdminPagesContainer-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/NonAdminPagesContainer-test.tsx index 7674ff38787..d6d98b7ab09 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/NonAdminPagesContainer-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/NonAdminPagesContainer-test.tsx @@ -57,12 +57,7 @@ it('should render correctly', () => { function shallowRender(props: Partial = {}) { return shallow( - + ); diff --git a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/AdminContainer-test.tsx.snap b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/AdminContainer-test.tsx.snap index a12b91340b1..b36639ca82e 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/AdminContainer-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/AdminContainer-test.tsx.snap @@ -13,17 +13,6 @@ exports[`should render correctly 1`] = ` extensions={Array []} fetchPendingPlugins={[Function]} fetchSystemStatus={[Function]} - location={ - Object { - "action": "PUSH", - "hash": "", - "key": "key", - "pathname": "/path", - "query": Object {}, - "search": "", - "state": Object {}, - } - } pendingPlugins={ Object { "installing": Array [], diff --git a/server/sonar-web/src/main/js/app/components/extensions/PortfolioPage.tsx b/server/sonar-web/src/main/js/app/components/extensions/PortfolioPage.tsx index 8ce97829e18..389c138c607 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/PortfolioPage.tsx +++ b/server/sonar-web/src/main/js/app/components/extensions/PortfolioPage.tsx @@ -28,12 +28,11 @@ export interface PortfolioPageProps extends WithRouterProps { component: Component; } -export function PortfolioPage({ component, location }: PortfolioPageProps) { +export function PortfolioPage({ component }: PortfolioPageProps) { return ( ); } diff --git a/server/sonar-web/src/main/js/app/components/extensions/ProjectAdminPageExtension.tsx b/server/sonar-web/src/main/js/app/components/extensions/ProjectAdminPageExtension.tsx index 9ee040a60ff..72befde92a8 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/ProjectAdminPageExtension.tsx +++ b/server/sonar-web/src/main/js/app/components/extensions/ProjectAdminPageExtension.tsx @@ -17,7 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { Location } from 'history'; import * as React from 'react'; import { connect } from 'react-redux'; import { addGlobalErrorMessage } from '../../../store/globalMessages'; @@ -27,7 +26,6 @@ import Extension from './Extension'; export interface ProjectAdminPageExtensionProps { component: Component; - location: Location; params: { extensionKey: string; pluginKey: string }; } diff --git a/server/sonar-web/src/main/js/app/components/extensions/ProjectPageExtension.tsx b/server/sonar-web/src/main/js/app/components/extensions/ProjectPageExtension.tsx index 56357e55b4a..40f8bd94b39 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/ProjectPageExtension.tsx +++ b/server/sonar-web/src/main/js/app/components/extensions/ProjectPageExtension.tsx @@ -26,7 +26,6 @@ import Extension from './Extension'; export interface ProjectPageExtensionProps { branchLike?: BranchLike; component: Component; - location: { query: { id: string } }; params: { extensionKey: string; pluginKey: string; diff --git a/server/sonar-web/src/main/js/app/components/extensions/__tests__/ProjectAdminPageExtension-test.tsx b/server/sonar-web/src/main/js/app/components/extensions/__tests__/ProjectAdminPageExtension-test.tsx index 0dcf91d9032..f3b7a57bfc4 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/__tests__/ProjectAdminPageExtension-test.tsx +++ b/server/sonar-web/src/main/js/app/components/extensions/__tests__/ProjectAdminPageExtension-test.tsx @@ -20,7 +20,6 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockComponent } from '../../../../helpers/mocks/component'; -import { mockLocation } from '../../../../helpers/testMocks'; import { ProjectAdminPageExtension, ProjectAdminPageExtensionProps @@ -41,7 +40,6 @@ function shallowRender(props: Partial = {}) { return shallow( diff --git a/server/sonar-web/src/main/js/app/components/extensions/__tests__/ProjectPageExtension-test.tsx b/server/sonar-web/src/main/js/app/components/extensions/__tests__/ProjectPageExtension-test.tsx index fe89332d3dc..1d0dab75dec 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/__tests__/ProjectPageExtension-test.tsx +++ b/server/sonar-web/src/main/js/app/components/extensions/__tests__/ProjectPageExtension-test.tsx @@ -21,7 +21,6 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { mockMainBranch } from '../../../../helpers/mocks/branch-like'; import { mockComponent } from '../../../../helpers/mocks/component'; -import { mockLocation } from '../../../../helpers/testMocks'; import ProjectPageExtension, { ProjectPageExtensionProps } from '../ProjectPageExtension'; it('should render correctly', () => { @@ -43,7 +42,6 @@ function shallowRender(props?: Partial) { component={mockComponent({ extensions: [{ key: 'plugin-key/extension-key', name: 'plugin' }] })} - location={mockLocation()} params={{ extensionKey: 'extension-key', pluginKey: 'plugin-key' }} {...props} /> diff --git a/server/sonar-web/src/main/js/app/components/extensions/__tests__/__snapshots__/PortfolioPage-test.tsx.snap b/server/sonar-web/src/main/js/app/components/extensions/__tests__/__snapshots__/PortfolioPage-test.tsx.snap index 553afe6de35..dc84ed679d0 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/__tests__/__snapshots__/PortfolioPage-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/extensions/__tests__/__snapshots__/PortfolioPage-test.tsx.snap @@ -24,17 +24,6 @@ exports[`should render correctly 1`] = ` "tags": Array [], } } - location={ - Object { - "action": "PUSH", - "hash": "", - "key": "key", - "pathname": "/path", - "query": Object {}, - "search": "", - "state": Object {}, - } - } params={ Object { "extensionKey": "portfolio", diff --git a/server/sonar-web/src/main/js/app/components/indexation/IndexationNotificationRenderer.tsx b/server/sonar-web/src/main/js/app/components/indexation/IndexationNotificationRenderer.tsx index 502c7deddf4..8c192a2490d 100644 --- a/server/sonar-web/src/main/js/app/components/indexation/IndexationNotificationRenderer.tsx +++ b/server/sonar-web/src/main/js/app/components/indexation/IndexationNotificationRenderer.tsx @@ -17,6 +17,9 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* eslint-disable react/no-unused-prop-types */ + import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTags.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTags.tsx index 49b8ff4dc3b..4e2f7efc4b6 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTags.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTags.tsx @@ -72,7 +72,6 @@ export default class MetaTags extends React.PureComponent { }; render() { - const { key } = this.props.component; const tags = this.props.component.tags || []; if (this.canUpdateTags()) { @@ -82,11 +81,7 @@ export default class MetaTags extends React.PureComponent { closeOnClick={false} closeOnClickOutside={true} overlay={ - + } overlayPlacement={PopupPlacement.BottomLeft}> (this.tagsList = tagsList)} stopPropagation={true}> diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTagsSelector.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTagsSelector.tsx index d27463e1222..d6713dcb72a 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTagsSelector.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTagsSelector.tsx @@ -23,7 +23,6 @@ import { searchProjectTags } from '../../../../../../api/components'; import TagsSelector from '../../../../../../components/tags/TagsSelector'; interface Props { - project: string; selectedTags: string[]; setProjectTags: (tags: string[]) => void; } diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/MetaTagsSelector-test.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/MetaTagsSelector-test.tsx index 22bb661a9bd..f96f150bf68 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/MetaTagsSelector-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/MetaTagsSelector-test.tsx @@ -37,14 +37,14 @@ it('searches tags on mount', () => { (searchProjectTags as jest.Mock).mockImplementation(() => Promise.resolve({ tags: ['foo', 'bar'] }) ); - mount(); + mount(); expect(searchProjectTags).toBeCalledWith({ ps: 9, q: '' }); }); it('selects and deselects tags', () => { const setProjectTags = jest.fn(); const wrapper = shallow( - + ); const tagSelect: any = wrapper.find('TagsSelector'); diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/__snapshots__/MetaTags-test.tsx.snap b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/__snapshots__/MetaTags-test.tsx.snap index 5e9a5365588..72b8274396d 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/__snapshots__/MetaTags-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/__snapshots__/MetaTags-test.tsx.snap @@ -9,7 +9,6 @@ exports[`should render with tags and admin rights 1`] = ` closeOnClickOutside={true} overlay={ - + diff --git a/server/sonar-web/src/main/js/app/components/nav/global/__tests__/__snapshots__/GlobalNav-test.tsx.snap b/server/sonar-web/src/main/js/app/components/nav/global/__tests__/__snapshots__/GlobalNav-test.tsx.snap index 964e19a9cdb..c693f643ee9 100644 --- a/server/sonar-web/src/main/js/app/components/nav/global/__tests__/__snapshots__/GlobalNav-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/nav/global/__tests__/__snapshots__/GlobalNav-test.tsx.snap @@ -23,13 +23,7 @@ exports[`should render correctly: anonymous users 1`] = ` className="global-navbar-menu global-navbar-menu-right" > - + - + void; fetchSystemStatus: () => void; - location: {}; pendingPlugins: PendingPluginResult; systemStatus: SysStatus; } diff --git a/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/SettingsNav-test.tsx b/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/SettingsNav-test.tsx index 4b4c53afac3..7b96b2cc92a 100644 --- a/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/SettingsNav-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/SettingsNav-test.tsx @@ -65,7 +65,6 @@ function shallowRender(props: Partial = {}) { extensions={[{ key: 'foo', name: 'Foo' }]} fetchPendingPlugins={jest.fn()} fetchSystemStatus={jest.fn()} - location={{}} pendingPlugins={{ installing: [], removing: [], updating: [] }} systemStatus="UP" {...props} diff --git a/server/sonar-web/src/main/js/app/components/search/Search.tsx b/server/sonar-web/src/main/js/app/components/search/Search.tsx index 9e8664ef0fc..9d3c30f43ff 100644 --- a/server/sonar-web/src/main/js/app/components/search/Search.tsx +++ b/server/sonar-web/src/main/js/app/components/search/Search.tsx @@ -35,7 +35,6 @@ import { scrollToElement } from '../../../helpers/scrolling'; import { getComponentOverviewUrl } from '../../../helpers/urls'; import { ComponentQualifier } from '../../../types/component'; import { Dict } from '../../../types/types'; -import { CurrentUser } from '../../../types/users'; import RecentHistory from '../RecentHistory'; import './Search.css'; import { ComponentResult, More, Results, sortQualifiers } from './utils'; @@ -43,12 +42,6 @@ import { ComponentResult, More, Results, sortQualifiers } from './utils'; const SearchResults = lazyLoadComponent(() => import('./SearchResults')); const SearchResult = lazyLoadComponent(() => import('./SearchResult')); -interface OwnProps { - currentUser: CurrentUser; -} - -type Props = OwnProps & WithRouterProps; - interface State { loading: boolean; loadingMore?: string; @@ -61,13 +54,13 @@ interface State { shortQuery: boolean; } -export class Search extends React.PureComponent { +export class Search extends React.PureComponent { input?: HTMLInputElement | null; node?: HTMLElement | null; nodes: Dict; mounted = false; - constructor(props: Props) { + constructor(props: WithRouterProps) { super(props); this.nodes = {}; this.search = debounce(this.search, 250); @@ -95,7 +88,7 @@ export class Search extends React.PureComponent { this.nodes = {}; } - componentDidUpdate(_prevProps: Props, prevState: State) { + componentDidUpdate(_prevProps: WithRouterProps, prevState: State) { if (prevState.selected !== this.state.selected) { this.scrollToSelected(); } @@ -402,4 +395,4 @@ export class Search extends React.PureComponent { } } -export default withRouter(Search); +export default withRouter<{}>(Search); diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/StatPendingTime.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/StatPendingTime.tsx index 5db61515125..01243ca661e 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/StatPendingTime.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/StatPendingTime.tsx @@ -21,14 +21,12 @@ import * as React from 'react'; import HelpTooltip from '../../../components/controls/HelpTooltip'; import { translate } from '../../../helpers/l10n'; import { formatMeasure } from '../../../helpers/measures'; -import { Component } from '../../../types/types'; // Do not display the pending time for values smaller than this threshold (in ms) const MIN_PENDING_TIME_THRESHOLD = 1000; export interface Props { className?: string; - component?: Pick; pendingCount?: number; pendingTime?: number; } diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx index d405bbd13eb..baab266c94e 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx @@ -36,6 +36,7 @@ interface Props { modalHeader: string; onClose: () => void; onDone: (severity: string) => Promise; + // eslint-disable-next-line react/no-unused-prop-types profiles: Profile[]; rule: Rule | RuleDetails; } diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx index a9a5d6604c9..3cb94eac4e8 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx @@ -641,7 +641,6 @@ export class App extends React.PureComponent { {rules.map(rule => ( { {!ruleDetails.isTemplate && ( Promise; onDeactivate: () => Promise; referencedProfiles: Dict; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx index a8c419998da..cef3becbb43 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx @@ -37,7 +37,6 @@ import SimilarRulesFilter from './SimilarRulesFilter'; interface Props { activation?: Activation; - canWrite?: boolean; isLoggedIn: boolean; onActivate: (profile: string, rule: string, activation: Activation) => void; onDeactivate: (profile: string, rule: string) => void; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/__snapshots__/App-test.tsx.snap b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/__snapshots__/App-test.tsx.snap index cb55971f54b..4ebb7c6295d 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/__snapshots__/App-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/__snapshots__/App-test.tsx.snap @@ -271,7 +271,6 @@ exports[`should render correctly: loaded 1`] = ` className="layout-page-main-inner" > { return ( { return ( ; diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.tsx index 325d9370cff..d564ef2fdaf 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.tsx @@ -29,13 +29,11 @@ import { getComponentMeasureUniqueKey } from '../../../helpers/component'; import { getLocalizedMetricName, translate, translateWithParameters } from '../../../helpers/l10n'; import { formatMeasure, isDiffMetric } from '../../../helpers/measures'; import { isDefined } from '../../../helpers/types'; -import { BranchLike } from '../../../types/branch-like'; import { MetricKey } from '../../../types/metrics'; import { ComponentMeasureEnhanced, ComponentMeasureIntern, Metric } from '../../../types/types'; import EmptyResult from './EmptyResult'; interface Props { - branchLike?: BranchLike; components: ComponentMeasureEnhanced[]; handleSelect: (component: ComponentMeasureIntern) => void; metric: Metric; diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/__tests__/BubbleChart-test.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/__tests__/BubbleChart-test.tsx index 0b69818e937..a52f882cf91 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/__tests__/BubbleChart-test.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/__tests__/BubbleChart-test.tsx @@ -75,7 +75,6 @@ it('should handle filtering', () => { function shallowRender(overrides: Partial = {}) { return shallow( { appState: AppState; - currentUser: LoggedInUser; } interface State { @@ -273,4 +270,4 @@ export class CreateProjectPage extends React.PureComponent { } } -export default whenLoggedIn(withAppStateContext(CreateProjectPage)); +export default withAppStateContext(CreateProjectPage); diff --git a/server/sonar-web/src/main/js/apps/create/project/GitHubProjectCreateRenderer.tsx b/server/sonar-web/src/main/js/apps/create/project/GitHubProjectCreateRenderer.tsx index ffde9cf777e..e801b649039 100644 --- a/server/sonar-web/src/main/js/apps/create/project/GitHubProjectCreateRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/GitHubProjectCreateRenderer.tsx @@ -17,6 +17,9 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* eslint-disable react/no-unused-prop-types */ + import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/CreateProjectPage-test.tsx b/server/sonar-web/src/main/js/apps/create/project/__tests__/CreateProjectPage-test.tsx index 5a00628a86b..31dd8c7ca2f 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/CreateProjectPage-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/CreateProjectPage-test.tsx @@ -20,12 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { getAlmSettings } from '../../../../api/alm-settings'; -import { - mockAppState, - mockLocation, - mockLoggedInUser, - mockRouter -} from '../../../../helpers/testMocks'; +import { mockAppState, mockLocation, mockRouter } from '../../../../helpers/testMocks'; import { waitAndUpdate } from '../../../../helpers/testUtils'; import { AlmKeys } from '../../../../types/alm-settings'; import AlmBindingDefinitionForm from '../../../settings/components/almIntegration/AlmBindingDefinitionForm'; @@ -133,7 +128,6 @@ function shallowRender(props: Partial = {}) { return shallow( void; location: Location; - onBranchesChange?: () => void; router: Pick; } diff --git a/server/sonar-web/src/main/js/apps/issues/components/__tests__/IssuesApp-test.tsx b/server/sonar-web/src/main/js/apps/issues/components/__tests__/IssuesApp-test.tsx index ff7dfd752ad..7b9c514592f 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/__tests__/IssuesApp-test.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/__tests__/IssuesApp-test.tsx @@ -622,7 +622,6 @@ function shallowRender(props: Partial = {}) { currentUser={mockLoggedInUser()} fetchBranchStatus={jest.fn()} location={mockLocation({ pathname: '/issues', query: {} })} - onBranchesChange={() => {}} router={mockRouter()} {...props} /> diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx index d107b97a5dd..ca13e67a7e3 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx @@ -17,6 +17,9 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* eslint-disable react/no-unused-prop-types */ + import { omit, sortBy, without } from 'lodash'; import * as React from 'react'; import FacetBox from '../../../components/facet/FacetBox'; diff --git a/server/sonar-web/src/main/js/apps/overview/components/App.tsx b/server/sonar-web/src/main/js/apps/overview/components/App.tsx index 0477fff99e9..192ecf0eaa5 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/App.tsx @@ -20,7 +20,6 @@ import * as React from 'react'; import withAppStateContext from '../../../app/components/app-state/withAppStateContext'; import Suggestions from '../../../app/components/embed-docs-modal/Suggestions'; -import { Router, withRouter } from '../../../components/hoc/withRouter'; import { lazyLoadComponent } from '../../../components/lazyLoadComponent'; import { isPullRequest } from '../../../helpers/branch-like'; import { ProjectAlmBindingResponse } from '../../../types/alm-settings'; @@ -41,7 +40,6 @@ interface Props { isInProgress?: boolean; isPending?: boolean; projectBinding?: ProjectAlmBindingResponse; - router: Pick; } export class App extends React.PureComponent { @@ -94,4 +92,4 @@ export class App extends React.PureComponent { } } -export default withRouter(withAppStateContext(App)); +export default withAppStateContext(App); diff --git a/server/sonar-web/src/main/js/apps/overview/components/IssueRating.tsx b/server/sonar-web/src/main/js/apps/overview/components/IssueRating.tsx index 2eee2295c08..b81a710a559 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/IssueRating.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/IssueRating.tsx @@ -17,6 +17,9 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* eslint-disable react/no-unused-prop-types */ + import * as React from 'react'; import Tooltip from '../../../components/controls/Tooltip'; import RatingTooltipContent from '../../../components/measure/RatingTooltipContent'; diff --git a/server/sonar-web/src/main/js/apps/overview/components/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/overview/components/__tests__/App-test.tsx index 4452c9090cf..e9e3c018fce 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/__tests__/App-test.tsx @@ -50,12 +50,6 @@ it('should render BranchOverview', () => { function getWrapper(props = {}) { return shallow( - + ); } diff --git a/server/sonar-web/src/main/js/apps/permissions/global/components/AllHoldersList.tsx b/server/sonar-web/src/main/js/apps/permissions/global/components/AllHoldersList.tsx index 8c4a4eb19f0..630e78f5217 100644 --- a/server/sonar-web/src/main/js/apps/permissions/global/components/AllHoldersList.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/global/components/AllHoldersList.tsx @@ -41,7 +41,6 @@ interface OwnProps { grantPermissionToUser: (login: string, permission: string) => Promise; groups: PermissionGroup[]; groupsPaging?: Paging; - loadHolders: () => void; loading?: boolean; onLoadMore: () => void; onFilter: (filter: string) => void; diff --git a/server/sonar-web/src/main/js/apps/permissions/global/components/App.tsx b/server/sonar-web/src/main/js/apps/permissions/global/components/App.tsx index 4a0708dc103..60d89d36cb0 100644 --- a/server/sonar-web/src/main/js/apps/permissions/global/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/global/components/App.tsx @@ -271,7 +271,6 @@ export default class App extends React.PureComponent<{}, State> { grantPermissionToUser={this.grantPermissionToUser} groups={this.state.groups} groupsPaging={this.state.groupsPaging} - loadHolders={this.loadHolders} loading={this.state.loading} onFilter={this.onFilter} onLoadMore={this.onLoadMore} diff --git a/server/sonar-web/src/main/js/apps/permissions/global/components/__tests__/AllHoldersList-test.tsx b/server/sonar-web/src/main/js/apps/permissions/global/components/__tests__/AllHoldersList-test.tsx index 7ca580ec0db..e68aac57038 100644 --- a/server/sonar-web/src/main/js/apps/permissions/global/components/__tests__/AllHoldersList-test.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/global/components/__tests__/AllHoldersList-test.tsx @@ -84,7 +84,6 @@ function shallowRender(props: Partial = {}) { grantPermissionToGroup={jest.fn()} grantPermissionToUser={jest.fn()} groups={[mockPermissionGroup()]} - loadHolders={jest.fn()} onLoadMore={jest.fn()} onFilter={jest.fn()} onSearch={jest.fn()} diff --git a/server/sonar-web/src/main/js/apps/permissions/global/components/__tests__/__snapshots__/App-test.tsx.snap b/server/sonar-web/src/main/js/apps/permissions/global/components/__tests__/__snapshots__/App-test.tsx.snap index bf85f340bc3..17de9f73448 100644 --- a/server/sonar-web/src/main/js/apps/permissions/global/components/__tests__/__snapshots__/App-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/permissions/global/components/__tests__/__snapshots__/App-test.tsx.snap @@ -21,7 +21,6 @@ exports[`should render correctly 1`] = ` grantPermissionToGroup={[Function]} grantPermissionToUser={[Function]} groups={Array []} - loadHolders={[Function]} loading={true} onFilter={[Function]} onLoadMore={[Function]} @@ -79,7 +78,6 @@ exports[`should render correctly 2`] = ` "total": 2, } } - loadHolders={[Function]} loading={false} onFilter={[Function]} onLoadMore={[Function]} diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingReferenceBranch.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingReferenceBranch.tsx index 12e94c24f5e..9cf2517a172 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingReferenceBranch.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingReferenceBranch.tsx @@ -31,7 +31,6 @@ import { NewCodePeriodSettingType } from '../../../types/types'; export interface BaselineSettingReferenceBranchProps { branchList: BranchOption[]; className?: string; - configuredBranchName?: string; disabled?: boolean; onChangeReferenceBranch: (value: string) => void; onSelect: (selection: NewCodePeriodSettingType) => void; diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BaselineSettingReferenceBranch-test.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BaselineSettingReferenceBranch-test.tsx index 7ac3867884a..eba115e93b1 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BaselineSettingReferenceBranch-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/BaselineSettingReferenceBranch-test.tsx @@ -30,14 +30,11 @@ import BaselineSettingReferenceBranch, { it('should render correctly', () => { expect(shallowRender()).toMatchSnapshot('Project level'); - expect(shallowRender({ settingLevel: 'branch', configuredBranchName: 'master' })).toMatchSnapshot( - 'Branch level' - ); + expect(shallowRender({ settingLevel: 'branch' })).toMatchSnapshot('Branch level'); expect( shallowRender({ branchList: [{ label: 'master', value: 'master', isMain: true }], - settingLevel: 'branch', - configuredBranchName: 'master' + settingLevel: 'branch' }) ).toMatchSnapshot('Branch level - no other branches'); }); diff --git a/server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.tsx index 47a0ff13249..106ab095f92 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.tsx @@ -26,7 +26,6 @@ import Filter from './Filter'; import FilterHeader from './FilterHeader'; export interface Props { - className?: string; facet?: Facet; maxFacetValue?: number; onQueryChange: (change: RawQuery) => void; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.tsx index db56242ada7..c0d5e024c73 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.tsx @@ -27,7 +27,6 @@ import Filter from './Filter'; import FilterHeader from './FilterHeader'; export interface Props { - className?: string; facet?: Facet; maxFacetValue?: number; onQueryChange: (change: RawQuery) => void; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsAddModal.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsAddModal.tsx index 81bb2ec4ad0..2a2a7160b2c 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsAddModal.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsAddModal.tsx @@ -111,7 +111,7 @@ export default class QualityGatePermissionsAddModal extends React.Component void; submitting: boolean; loading: boolean; - query: string; searchResults: Array; selection?: UserBase | Group; } diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/QualityGatePermissionsAddModalRenderer-test.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/QualityGatePermissionsAddModalRenderer-test.tsx index da50d58ab68..4d2a5f04336 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/QualityGatePermissionsAddModalRenderer-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/QualityGatePermissionsAddModalRenderer-test.tsx @@ -27,13 +27,12 @@ import QualityGatePermissionsAddModalRenderer, { it('should render correctly', () => { expect(shallowRender()).toMatchSnapshot('default'); - expect(shallowRender({ query: 'a' })).toMatchSnapshot('short query'); expect(shallowRender({ selection: mockUserBase() })).toMatchSnapshot('selection'); expect(shallowRender({ selection: mockUserBase(), submitting: true })).toMatchSnapshot( 'submitting' ); expect( - shallowRender({ query: 'ab', searchResults: [mockUserBase(), { name: 'group name' }] }) + shallowRender({ searchResults: [mockUserBase(), { name: 'group name' }] }) ).toMatchSnapshot('query and results'); }); @@ -52,7 +51,6 @@ function shallowRender(overrides: Partial diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/QualityGatePermissionsAddModalRenderer-test.tsx.snap b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/QualityGatePermissionsAddModalRenderer-test.tsx.snap index f11d813ff89..6feb60f1acc 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/QualityGatePermissionsAddModalRenderer-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/QualityGatePermissionsAddModalRenderer-test.tsx.snap @@ -203,70 +203,6 @@ exports[`should render correctly: selection 1`] = ` `; -exports[`should render correctly: short query 1`] = ` - -
-

- quality_gates.permissions.grant -

-
-
-
-
- -