diff options
author | Philippe Perrin <philippe.perrin@sonarsource.com> | 2022-04-07 20:10:48 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-04-08 20:02:59 +0000 |
commit | 426062571e84035f9ff66f4e53bba71837c61921 (patch) | |
tree | 6688c82f876789293b752d8519ac152ff1cb83ad /server/sonar-web/src/main/js | |
parent | 8552fdb1d725753b4c4128ef81771db528d41c49 (diff) | |
download | sonarqube-426062571e84035f9ff66f4e53bba71837c61921.tar.gz sonarqube-426062571e84035f9ff66f4e53bba71837c61921.zip |
[NO-JIRA] Fix eslint issues
Diffstat (limited to 'server/sonar-web/src/main/js')
74 files changed, 47 insertions, 261 deletions
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<AdminContainerProps, Sta extensions={adminPages} fetchPendingPlugins={this.fetchPendingPlugins} fetchSystemStatus={this.fetchSystemStatus} - location={this.props.location} pendingPlugins={pendingPlugins} systemStatus={systemStatus} /> 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<AdminContainerProps> = {}) { appState={mockAppState({ canAdmin: true })} - location={mockLocation()} {...props}> <div /> </AdminContainer> 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<NonAdminPagesContainerProps> = {}) { return shallow<NonAdminPagesContainerProps>( - <NonAdminPagesContainer - branchLikes={[]} - component={mockComponent()} - onBranchesChange={jest.fn()} - onComponentChange={jest.fn()} - {...props}> + <NonAdminPagesContainer component={mockComponent()} {...props}> <Child /> </NonAdminPagesContainer> ); 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 ( <ProjectPageExtension component={component} params={{ pluginKey: 'governance', extensionKey: 'portfolio' }} - location={location} /> ); } 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<ProjectAdminPageExtensionProps> = {}) { return shallow( <ProjectAdminPageExtension component={mockComponent()} - location={mockLocation()} params={{ extensionKey: 'bar', pluginKey: 'foo' }} {...props} /> 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<ProjectPageExtensionProps>) { 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<Props> { }; 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<Props> { closeOnClick={false} closeOnClickOutside={true} overlay={ - <MetaTagsSelector - project={key} - selectedTags={tags} - setProjectTags={this.handleSetProjectTags} - /> + <MetaTagsSelector selectedTags={tags} setProjectTags={this.handleSetProjectTags} /> } overlayPlacement={PopupPlacement.BottomLeft}> <ButtonLink innerRef={tagsList => (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(<MetaTagsSelector project="foo" selectedTags={[]} setProjectTags={jest.fn()} />); + mount(<MetaTagsSelector selectedTags={[]} setProjectTags={jest.fn()} />); expect(searchProjectTags).toBeCalledWith({ ps: 9, q: '' }); }); it('selects and deselects tags', () => { const setProjectTags = jest.fn(); const wrapper = shallow( - <MetaTagsSelector project="foo" selectedTags={['foo', 'bar']} setProjectTags={setProjectTags} /> + <MetaTagsSelector selectedTags={['foo', 'bar']} setProjectTags={setProjectTags} /> ); 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={ <MetaTagsSelector - project="my-second-project" selectedTags={ Array [ "foo", diff --git a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.tsx b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.tsx index 45288c9ef07..0c7b6d964cc 100644 --- a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.tsx @@ -44,7 +44,7 @@ export function GlobalNav(props: GlobalNavProps) { <ul className="global-navbar-menu global-navbar-menu-right"> <EmbedDocsPopupHelper /> - <Search currentUser={currentUser} /> + <Search /> <GlobalNavUser currentUser={currentUser} /> </ul> </NavBar> 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" > <EmbedDocsPopupHelper /> - <withRouter(Search) - currentUser={ - Object { - "isLoggedIn": false, - } - } - /> + <withRouter(Search) /> <withRouter(GlobalNavUser) currentUser={ Object { @@ -64,13 +58,7 @@ exports[`should render correctly: logged in users 1`] = ` className="global-navbar-menu global-navbar-menu-right" > <EmbedDocsPopupHelper /> - <withRouter(Search) - currentUser={ - Object { - "isLoggedIn": true, - } - } - /> + <withRouter(Search) /> <withRouter(GlobalNavUser) currentUser={ Object { diff --git a/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.tsx b/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.tsx index 1075a088893..0dd3a155f42 100644 --- a/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.tsx @@ -37,7 +37,6 @@ interface Props { extensions: Extension[]; fetchPendingPlugins: () => 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<SettingsNav['props']> = {}) { 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<Props, State> { +export class Search extends React.PureComponent<WithRouterProps, State> { input?: HTMLInputElement | null; node?: HTMLElement | null; nodes: Dict<HTMLElement>; 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<Props, State> { 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<Props, State> { } } -export default withRouter<OwnProps>(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<Component, 'key'>; 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<void>; + // 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<Props, State> { {rules.map(rule => ( <RuleListItem activation={this.getRuleActivation(rule.key)} - canWrite={this.state.canWrite} isLoggedIn={isLoggedIn(this.props.currentUser)} key={rule.key} onActivate={this.handleRuleActivate} diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx index 96f59bce97d..02aa57b0a59 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx @@ -238,7 +238,6 @@ export default class RuleDetails extends React.PureComponent<Props, State> { {!ruleDetails.isTemplate && ( <RuleDetailsProfiles activations={this.state.actives} - canWrite={canWrite} onActivate={this.handleActivate} onDeactivate={this.handleDeactivate} referencedProfiles={referencedProfiles} diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx index 94b9422d37c..a154245226d 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx @@ -35,7 +35,6 @@ import RuleInheritanceIcon from './RuleInheritanceIcon'; interface Props { activations: RuleActivation[] | undefined; - canWrite: boolean | undefined; onActivate: () => Promise<void>; onDeactivate: () => Promise<void>; referencedProfiles: Dict<Profile>; 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" > <RuleListItem - canWrite={true} isLoggedIn={true} key="javascript:S1067" onActivate={[Function]} @@ -299,7 +298,6 @@ exports[`should render correctly: loaded 1`] = ` selected={true} /> <RuleListItem - canWrite={true} isLoggedIn={true} key="javascript:S1067" onActivate={[Function]} diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx index fad332407d8..de90a337509 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx @@ -333,7 +333,6 @@ export default class MeasureContent extends React.PureComponent<Props, State> { return ( <TreeMapView - branchLike={this.props.branchLike} components={this.state.components} handleSelect={this.onOpenComponent} metric={metric} diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx index b4854392fa4..466423cc0ad 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx @@ -139,7 +139,6 @@ export default class MeasureOverview extends React.PureComponent<Props, State> { return ( <BubbleChart - component={component} components={this.state.components} domain={domain} metrics={metrics} diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/MeasureOverview-test.tsx.snap b/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/MeasureOverview-test.tsx.snap index 13bfbaa05b3..a3e7343a950 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/MeasureOverview-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/MeasureOverview-test.tsx.snap @@ -70,20 +70,6 @@ exports[`should render correctly: default 1`] = ` loading={false} /> <BubbleChart - component={ - Object { - "key": "foo", - "measures": Array [ - Object { - "bestValue": false, - "metric": "bugs", - "value": "12", - }, - ], - "name": "Foo", - "qualifier": "TRK", - } - } components={Array []} domain="Reliability" metrics={ @@ -223,20 +209,6 @@ exports[`should render correctly: has leak period 1`] = ` loading={false} /> <BubbleChart - component={ - Object { - "key": "foo", - "measures": Array [ - Object { - "bestValue": false, - "metric": "bugs", - "value": "12", - }, - ], - "name": "Foo", - "qualifier": "TRK", - } - } components={Array []} domain="Reliability" metrics={ diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.tsx index 5f7624d7ec9..39be3005c63 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.tsx @@ -32,7 +32,6 @@ import { formatMeasure, isDiffMetric } from '../../../helpers/measures'; import { isDefined } from '../../../helpers/types'; import { isProject } from '../../../types/component'; import { - ComponentMeasure, ComponentMeasureEnhanced, ComponentMeasureIntern, Dict, @@ -50,7 +49,6 @@ import EmptyResult from './EmptyResult'; const HEIGHT = 500; interface Props { - component: ComponentMeasure; components: ComponentMeasureEnhanced[]; domain: string; metrics: Dict<Metric>; 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<BubbleChart['props']> = {}) { return shallow<BubbleChart>( <BubbleChart - component={mockComponentMeasure()} components={[ enhanceComponent( mockComponentMeasure(true, { diff --git a/server/sonar-web/src/main/js/apps/create/project/CreateProjectModeSelection.tsx b/server/sonar-web/src/main/js/apps/create/project/CreateProjectModeSelection.tsx index 4471a7923b0..f3f9631952c 100644 --- a/server/sonar-web/src/main/js/apps/create/project/CreateProjectModeSelection.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/CreateProjectModeSelection.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 classNames from 'classnames'; import * as React from 'react'; import withAppStateContext from '../../../app/components/app-state/withAppStateContext'; diff --git a/server/sonar-web/src/main/js/apps/create/project/CreateProjectPage.tsx b/server/sonar-web/src/main/js/apps/create/project/CreateProjectPage.tsx index 1f9706f2148..c7e1c62d258 100644 --- a/server/sonar-web/src/main/js/apps/create/project/CreateProjectPage.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/CreateProjectPage.tsx @@ -23,12 +23,10 @@ import { WithRouterProps } from 'react-router'; import { getAlmSettings } from '../../../api/alm-settings'; import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget'; import withAppStateContext from '../../../app/components/app-state/withAppStateContext'; -import { whenLoggedIn } from '../../../components/hoc/whenLoggedIn'; import { translate } from '../../../helpers/l10n'; import { getProjectUrl } from '../../../helpers/urls'; import { AlmKeys, AlmSettingsInstance } from '../../../types/alm-settings'; import { AppState } from '../../../types/appstate'; -import { LoggedInUser } from '../../../types/users'; import AlmBindingDefinitionForm from '../../settings/components/almIntegration/AlmBindingDefinitionForm'; import AzureProjectCreate from './AzureProjectCreate'; import BitbucketCloudProjectCreate from './BitbucketCloudProjectCreate'; @@ -42,7 +40,6 @@ import { CreateProjectModes } from './types'; interface Props extends Pick<WithRouterProps, 'router' | 'location'> { appState: AppState; - currentUser: LoggedInUser; } interface State { @@ -273,4 +270,4 @@ export class CreateProjectPage extends React.PureComponent<Props, State> { } } -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<CreateProjectPage['props']> = {}) { return shallow<CreateProjectPage>( <CreateProjectPage appState={mockAppState()} - currentUser={mockLoggedInUser()} location={mockLocation()} router={mockRouter()} {...props} diff --git a/server/sonar-web/src/main/js/apps/issues/components/IssuesApp.tsx b/server/sonar-web/src/main/js/apps/issues/components/IssuesApp.tsx index 7da860bcc43..b00454f3fca 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/IssuesApp.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/IssuesApp.tsx @@ -100,7 +100,6 @@ interface Props { currentUser: CurrentUser; fetchBranchStatus: (branchLike: BranchLike, projectKey: string) => void; location: Location; - onBranchesChange?: () => void; router: Pick<Router, 'push' | 'replace'>; } 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<App['props']> = {}) { 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<Router, 'replace'>; } export class App extends React.PureComponent<Props> { @@ -94,4 +92,4 @@ export class App extends React.PureComponent<Props> { } } -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( - <App - appState={mockAppState()} - branchLikes={[]} - component={component} - router={{ replace: jest.fn() }} - {...props} - /> + <App appState={mockAppState()} branchLikes={[]} component={component} {...props} /> ); } 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<void>; 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<AllHoldersList['props']> = {}) { 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<Prop render() { const { submitting } = this.props; - const { loading, query = '', searchResults, selection } = this.state; + const { loading, searchResults, selection } = this.state; return ( <QualityGatePermissionsAddModalRenderer @@ -120,7 +120,6 @@ export default class QualityGatePermissionsAddModal extends React.Component<Prop onInputChange={this.handleInputChange} onSelection={this.handleSelection} onSubmit={this.handleSubmit} - query={query} searchResults={searchResults} selection={selection} submitting={submitting} diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsAddModalRenderer.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsAddModalRenderer.tsx index 47c6190c801..f848fae6065 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsAddModalRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatePermissionsAddModalRenderer.tsx @@ -36,7 +36,6 @@ export interface QualityGatePermissionsAddModalRendererProps { onSelection: (selection: Option) => void; submitting: boolean; loading: boolean; - query: string; searchResults: Array<UserBase | Group>; 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<QualityGatePermissionsAddModalRenderer onInputChange={jest.fn()} onSelection={jest.fn()} onSubmit={jest.fn()} - query="" searchResults={[]} submitting={false} {...overrides} diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/QualityGatePermissionsAddModal-test.tsx.snap b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/QualityGatePermissionsAddModal-test.tsx.snap index 360a11c6027..60b40cc6cca 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/QualityGatePermissionsAddModal-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/QualityGatePermissionsAddModal-test.tsx.snap @@ -7,7 +7,6 @@ exports[`should render correctly 1`] = ` onInputChange={[Function]} onSelection={[Function]} onSubmit={[Function]} - query="" searchResults={Array []} submitting={false} /> 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`] = ` </Modal> `; -exports[`should render correctly: short query 1`] = ` -<Modal - contentLabel="quality_gates.permissions.grant" - onRequestClose={[MockFunction]} -> - <header - className="modal-head" - > - <h2> - quality_gates.permissions.grant - </h2> - </header> - <form - onSubmit={[MockFunction]} - > - <div - className="modal-body" - > - <div - className="modal-field" - > - <label> - quality_gates.permissions.search - </label> - <Select - autoFocus={true} - className="Select-big" - components={ - Object { - "Control": [Function], - "Option": [Function], - "SingleValue": [Function], - } - } - filterOptions={[Function]} - isClearable={false} - isLoading={false} - isSearchable={true} - noOptionsMessage={[Function]} - onChange={[MockFunction]} - onInputChange={[MockFunction]} - options={Array []} - placeholder="" - /> - </div> - </div> - <footer - className="modal-foot" - > - <SubmitButton - disabled={true} - > - add_verb - </SubmitButton> - <ResetButtonLink - onClick={[MockFunction]} - > - cancel - </ResetButtonLink> - </footer> - </form> -</Modal> -`; - exports[`should render correctly: submitting 1`] = ` <Modal contentLabel="quality_gates.permissions.grant" diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileActions.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileActions.tsx index 48c59ac56c4..62fcbf30d0a 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileActions.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileActions.tsx @@ -43,7 +43,6 @@ import ProfileModalForm from './ProfileModalForm'; interface Props { className?: string; - fromList?: boolean; profile: Profile; router: Pick<Router, 'push' | 'replace'>; updateProfiles: () => Promise<void>; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx index cc37a7b0820..6bf8c8a38ec 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx @@ -98,7 +98,7 @@ export function ProfilesListRow(props: ProfilesListRowProps) { </td> <td className="quality-profiles-table-actions thin nowrap text-middle text-right"> - <ProfileActions fromList={true} profile={profile} updateProfiles={props.updateProfiles} /> + <ProfileActions profile={profile} updateProfiles={props.updateProfiles} /> </td> </tr> ); diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/__tests__/__snapshots__/ProfilesListRow-test.tsx.snap b/server/sonar-web/src/main/js/apps/quality-profiles/home/__tests__/__snapshots__/ProfilesListRow-test.tsx.snap index 25e5e98478b..a19c915a89c 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/__tests__/__snapshots__/ProfilesListRow-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/__tests__/__snapshots__/ProfilesListRow-test.tsx.snap @@ -97,7 +97,6 @@ exports[`should render correctly: built-in profile 1`] = ` className="quality-profiles-table-actions thin nowrap text-middle text-right" > <withRouter(ProfileActions) - fromList={true} profile={ Object { "activeDeprecatedRuleCount": 2, @@ -189,7 +188,6 @@ exports[`should render correctly: default 1`] = ` className="quality-profiles-table-actions thin nowrap text-middle text-right" > <withRouter(ProfileActions) - fromList={true} profile={ Object { "activeDeprecatedRuleCount": 0, @@ -312,7 +310,6 @@ exports[`should render correctly: default profile 1`] = ` className="quality-profiles-table-actions thin nowrap text-middle text-right" > <withRouter(ProfileActions) - fromList={true} profile={ Object { "activeDeprecatedRuleCount": 2, @@ -429,7 +426,6 @@ exports[`should render correctly: with deprecated rules 1`] = ` className="quality-profiles-table-actions thin nowrap text-middle text-right" > <withRouter(ProfileActions) - fromList={true} profile={ Object { "activeDeprecatedRuleCount": 10, diff --git a/server/sonar-web/src/main/js/apps/sessions/components/Login.tsx b/server/sonar-web/src/main/js/apps/sessions/components/Login.tsx index 88d364073d6..1934450b65d 100644 --- a/server/sonar-web/src/main/js/apps/sessions/components/Login.tsx +++ b/server/sonar-web/src/main/js/apps/sessions/components/Login.tsx @@ -54,11 +54,7 @@ export function Login(props: LoginProps) { <OAuthProviders identityProviders={identityProviders} returnTo={returnTo} /> )} - <LoginForm - collapsed={identityProviders.length > 0} - onSubmit={props.onSubmit} - returnTo={returnTo} - /> + <LoginForm collapsed={identityProviders.length > 0} onSubmit={props.onSubmit} /> <GlobalMessagesContainer /> </div> diff --git a/server/sonar-web/src/main/js/apps/sessions/components/LoginForm.tsx b/server/sonar-web/src/main/js/apps/sessions/components/LoginForm.tsx index c332f227f16..aa137b6a5bb 100644 --- a/server/sonar-web/src/main/js/apps/sessions/components/LoginForm.tsx +++ b/server/sonar-web/src/main/js/apps/sessions/components/LoginForm.tsx @@ -27,7 +27,6 @@ import './LoginForm.css'; interface Props { collapsed?: boolean; onSubmit: (login: string, password: string) => Promise<void>; - returnTo: string; } interface State { diff --git a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/LoginForm-test.tsx b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/LoginForm-test.tsx index f89fb6cb189..5f3b1b64385 100644 --- a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/LoginForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/LoginForm-test.tsx @@ -24,7 +24,7 @@ import LoginForm from '../LoginForm'; it('logs in with simple credentials', () => { const onSubmit = jest.fn(() => Promise.resolve()); - const wrapper = shallow(<LoginForm onSubmit={onSubmit} returnTo="" />); + const wrapper = shallow(<LoginForm onSubmit={onSubmit} />); expect(wrapper).toMatchSnapshot(); change(wrapper.find('#login'), 'admin'); @@ -36,7 +36,7 @@ it('logs in with simple credentials', () => { it('should display a spinner and disabled button while loading', async () => { const onSubmit = jest.fn(() => Promise.resolve()); - const wrapper = shallow(<LoginForm onSubmit={onSubmit} returnTo="" />); + const wrapper = shallow(<LoginForm onSubmit={onSubmit} />); change(wrapper.find('#login'), 'admin'); change(wrapper.find('#password'), 'admin'); @@ -48,7 +48,7 @@ it('should display a spinner and disabled button while loading', async () => { }); it('expands more options', () => { - const wrapper = shallow(<LoginForm collapsed={true} onSubmit={jest.fn()} returnTo="" />); + const wrapper = shallow(<LoginForm collapsed={true} onSubmit={jest.fn()} />); expect(wrapper).toMatchSnapshot(); click(wrapper.find('.js-more-options')); diff --git a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/__snapshots__/Login-test.tsx.snap b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/__snapshots__/Login-test.tsx.snap index d09b2373fa9..d9ee013c6b7 100644 --- a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/__snapshots__/Login-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/__snapshots__/Login-test.tsx.snap @@ -33,7 +33,6 @@ exports[`should render correctly: with authorization error 1`] = ` <LoginForm collapsed={true} onSubmit={[MockFunction]} - returnTo="" /> <Connect(GlobalMessages) /> </div> @@ -65,7 +64,6 @@ exports[`should render correctly: with identity providers 1`] = ` <LoginForm collapsed={true} onSubmit={[MockFunction]} - returnTo="" /> <Connect(GlobalMessages) /> </div> @@ -84,7 +82,6 @@ exports[`should render correctly: without any identity providers 1`] = ` <LoginForm collapsed={false} onSubmit={[MockFunction]} - returnTo="" /> <Connect(GlobalMessages) /> </div> diff --git a/server/sonar-web/src/main/js/apps/webhooks/components/App.tsx b/server/sonar-web/src/main/js/apps/webhooks/components/App.tsx index 37c0c142daf..7e057bf0cbc 100644 --- a/server/sonar-web/src/main/js/apps/webhooks/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/webhooks/components/App.tsx @@ -28,6 +28,7 @@ import PageHeader from './PageHeader'; import WebhooksList from './WebhooksList'; interface Props { + // eslint-disable-next-line react/no-unused-prop-types component?: LightComponent; } diff --git a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.tsx b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.tsx index cab1a4a622a..e2e41a16165 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.tsx @@ -588,7 +588,6 @@ export default class SourceViewerBase extends React.PureComponent<Props, State> return ( <SourceViewerCode branchLike={this.props.branchLike} - componentKey={this.props.component} displayAllIssues={this.props.displayAllIssues} displayIssueLocationsCount={this.props.displayIssueLocationsCount} displayIssueLocationsLink={this.props.displayIssueLocationsLink} diff --git a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerCode.tsx b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerCode.tsx index ebeb526fff6..e3e604671b6 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerCode.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerCode.tsx @@ -48,7 +48,6 @@ const ZERO_LINE = { interface Props { branchLike: BranchLike | undefined; - componentKey: string; displayAllIssues?: boolean; displayIssueLocationsCount?: boolean; displayIssueLocationsLink?: boolean; diff --git a/server/sonar-web/src/main/js/components/SourceViewer/__tests__/SourceViewerCode-test.tsx b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/SourceViewerCode-test.tsx index 605f29a1930..e51a763b9df 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/__tests__/SourceViewerCode-test.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/SourceViewerCode-test.tsx @@ -82,7 +82,6 @@ function shallowRender(props: Partial<SourceViewerCode['props']> = {}) { return shallow<SourceViewerCode>( <SourceViewerCode branchLike={mockBranch()} - componentKey="foo" duplications={[]} duplicationsByLine={[]} hasSourcesAfter={false} diff --git a/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerBase-test.tsx.snap b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerBase-test.tsx.snap index 6c3cbd2af18..62e0125c3de 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerBase-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerBase-test.tsx.snap @@ -43,7 +43,6 @@ exports[`should render correctly 1`] = ` "name": "master", } } - componentKey="my-component" displayAllIssues={false} displayIssueLocationsCount={true} displayIssueLocationsLink={true} diff --git a/server/sonar-web/src/main/js/components/activity-graph/AddGraphMetric.tsx b/server/sonar-web/src/main/js/components/activity-graph/AddGraphMetric.tsx index 9871e117e64..29dfd8d6fb8 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/AddGraphMetric.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/AddGraphMetric.tsx @@ -29,7 +29,6 @@ import AddGraphMetricPopup from './AddGraphMetricPopup'; interface Props { addMetric: (metric: string) => void; - className?: string; metrics: Metric[]; metricsTypeFilter?: string[]; removeMetric: (metric: string) => void; diff --git a/server/sonar-web/src/main/js/components/activity-graph/GraphsHeader.tsx b/server/sonar-web/src/main/js/components/activity-graph/GraphsHeader.tsx index 1d0faa676e3..318f96634e2 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/GraphsHeader.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/GraphsHeader.tsx @@ -77,7 +77,6 @@ export default class GraphsHeader extends React.PureComponent<Props> { removeCustomMetric !== undefined && ( <AddGraphMetric addMetric={addCustomMetric} - className="pull-left spacer-left" metrics={metrics} metricsTypeFilter={metricsTypeFilter} removeMetric={removeCustomMetric} diff --git a/server/sonar-web/src/main/js/components/common/MultiSelect.tsx b/server/sonar-web/src/main/js/components/common/MultiSelect.tsx index 1e46688c872..d2d815dda67 100644 --- a/server/sonar-web/src/main/js/components/common/MultiSelect.tsx +++ b/server/sonar-web/src/main/js/components/common/MultiSelect.tsx @@ -29,6 +29,7 @@ export interface MultiSelectProps { allowNewElements?: boolean; allowSelection?: boolean; elements: string[]; + // eslint-disable-next-line react/no-unused-prop-types filterSelected?: (query: string, selectedElements: string[]) => string[]; footerNode?: React.ReactNode; listSize?: number; diff --git a/server/sonar-web/src/main/js/components/facet/ListStyleFacetFooter.tsx b/server/sonar-web/src/main/js/components/facet/ListStyleFacetFooter.tsx index 6169627f236..2e8f9473d2c 100644 --- a/server/sonar-web/src/main/js/components/facet/ListStyleFacetFooter.tsx +++ b/server/sonar-web/src/main/js/components/facet/ListStyleFacetFooter.tsx @@ -22,7 +22,6 @@ import { translate, translateWithParameters } from '../../helpers/l10n'; import { formatMeasure } from '../../helpers/measures'; interface Props { - className?: string; count: number; showMore: () => void; showLess: (() => void) | undefined; diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/WebhookStep.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/WebhookStep.tsx index 8d0206d1113..74da63a0228 100644 --- a/server/sonar-web/src/main/js/components/tutorials/jenkins/WebhookStep.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/jenkins/WebhookStep.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 { rawSizes } from '../../../app/theme'; |