diff options
Diffstat (limited to 'server/sonar-web/src/main/js/apps')
114 files changed, 417 insertions, 295 deletions
diff --git a/server/sonar-web/src/main/js/apps/about/components/ReadMore.js b/server/sonar-web/src/main/js/apps/about/components/ReadMore.js index 47a2b0e442a..87df2de5625 100644 --- a/server/sonar-web/src/main/js/apps/about/components/ReadMore.js +++ b/server/sonar-web/src/main/js/apps/about/components/ReadMore.js @@ -18,11 +18,12 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import { translate } from '../../../helpers/l10n'; export default class ReadMore extends React.PureComponent { static propTypes = { - link: React.PropTypes.string.isRequired + link: PropTypes.string.isRequired }; render() { diff --git a/server/sonar-web/src/main/js/apps/account/components/UserCard.js b/server/sonar-web/src/main/js/apps/account/components/UserCard.js index 8b0ecc308ef..f6d071696a6 100644 --- a/server/sonar-web/src/main/js/apps/account/components/UserCard.js +++ b/server/sonar-web/src/main/js/apps/account/components/UserCard.js @@ -18,11 +18,12 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Avatar from '../../../components/ui/Avatar'; export default class UserCard extends React.PureComponent { static propTypes = { - user: React.PropTypes.object.isRequired + user: PropTypes.object.isRequired }; render() { diff --git a/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/Notifications-test.js.snap b/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/Notifications-test.js.snap index 66eea69153b..978e4038e91 100644 --- a/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/Notifications-test.js.snap +++ b/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/Notifications-test.js.snap @@ -5,6 +5,7 @@ exports[`should match snapshot 1`] = ` className="account-body account-container" > <HelmetWrapper + encodeSpecialCharacters={true} title="my_account.notifications" /> <p diff --git a/server/sonar-web/src/main/js/apps/account/profile/UserGroups.js b/server/sonar-web/src/main/js/apps/account/profile/UserGroups.js index 7aaf49a23c8..75c9f0a2d96 100644 --- a/server/sonar-web/src/main/js/apps/account/profile/UserGroups.js +++ b/server/sonar-web/src/main/js/apps/account/profile/UserGroups.js @@ -18,11 +18,12 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import { translate } from '../../../helpers/l10n'; export default class UserGroups extends React.PureComponent { static propTypes = { - groups: React.PropTypes.arrayOf(React.PropTypes.string).isRequired + groups: PropTypes.arrayOf(PropTypes.string).isRequired }; render() { diff --git a/server/sonar-web/src/main/js/apps/account/profile/UserScmAccounts.js b/server/sonar-web/src/main/js/apps/account/profile/UserScmAccounts.js index 968f27bc8e1..b4fc4ecd6e0 100644 --- a/server/sonar-web/src/main/js/apps/account/profile/UserScmAccounts.js +++ b/server/sonar-web/src/main/js/apps/account/profile/UserScmAccounts.js @@ -18,12 +18,13 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import { translate } from '../../../helpers/l10n'; export default class UserScmAccounts extends React.PureComponent { static propTypes = { - user: React.PropTypes.object.isRequired, - scmAccounts: React.PropTypes.arrayOf(React.PropTypes.string).isRequired + user: PropTypes.object.isRequired, + scmAccounts: PropTypes.arrayOf(PropTypes.string).isRequired }; render() { diff --git a/server/sonar-web/src/main/js/apps/account/projects/Projects.js b/server/sonar-web/src/main/js/apps/account/projects/Projects.js index 71141b11ba7..89c151f73d5 100644 --- a/server/sonar-web/src/main/js/apps/account/projects/Projects.js +++ b/server/sonar-web/src/main/js/apps/account/projects/Projects.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import ProjectCard from './ProjectCard'; import ListFooter from '../../../components/controls/ListFooter'; import { projectsListType } from './propTypes'; @@ -26,9 +27,9 @@ import { translate } from '../../../helpers/l10n'; export default class Projects extends React.PureComponent { static propTypes = { projects: projectsListType.isRequired, - total: React.PropTypes.number.isRequired, - loading: React.PropTypes.bool.isRequired, - loadMore: React.PropTypes.func.isRequired + total: PropTypes.number.isRequired, + loading: PropTypes.bool.isRequired, + loadMore: PropTypes.func.isRequired }; render() { diff --git a/server/sonar-web/src/main/js/apps/account/projects/propTypes.js b/server/sonar-web/src/main/js/apps/account/projects/propTypes.js index 67d11b209be..cae87b48906 100644 --- a/server/sonar-web/src/main/js/apps/account/projects/propTypes.js +++ b/server/sonar-web/src/main/js/apps/account/projects/propTypes.js @@ -17,9 +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. */ -import React from 'react'; +import PropTypes from 'prop-types'; -const { shape, string, array, arrayOf } = React.PropTypes; +const { shape, string, array, arrayOf } = PropTypes; export const projectType = shape({ id: string.isRequired, diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js b/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js index 23a54777c67..d68069722f3 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js @@ -19,6 +19,7 @@ */ // @flow import React from 'react'; +import PropTypes from 'prop-types'; import Helmet from 'react-helmet'; import { debounce, uniq } from 'lodash'; import { connect } from 'react-redux'; @@ -63,7 +64,7 @@ class BackgroundTasksApp extends React.PureComponent { props: Props; static contextTypes = { - router: React.PropTypes.object.isRequired + router: PropTypes.object.isRequired }; state: State = { diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Search.js b/server/sonar-web/src/main/js/apps/background-tasks/components/Search.js index fb595f3c60a..2ffdc3a2db6 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/Search.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Search.js @@ -19,6 +19,7 @@ */ /* @flow */ import React from 'react'; +import PropTypes from 'prop-types'; import StatusFilter from './StatusFilter'; import TypesFilter from './TypesFilter'; import CurrentsFilter from './CurrentsFilter'; @@ -28,13 +29,13 @@ import { translate } from '../../../helpers/l10n'; export default class Search extends React.PureComponent { static propTypes = { - loading: React.PropTypes.bool.isRequired, - status: React.PropTypes.any.isRequired, - taskType: React.PropTypes.any.isRequired, - currents: React.PropTypes.any.isRequired, - query: React.PropTypes.string.isRequired, - onFilterUpdate: React.PropTypes.func.isRequired, - onReload: React.PropTypes.func.isRequired + loading: PropTypes.bool.isRequired, + status: PropTypes.any.isRequired, + taskType: PropTypes.any.isRequired, + currents: PropTypes.any.isRequired, + query: PropTypes.string.isRequired, + onFilterUpdate: PropTypes.func.isRequired, + onReload: PropTypes.func.isRequired }; handleStatusChange(status: string) { diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Task.js b/server/sonar-web/src/main/js/apps/background-tasks/components/Task.js index ca8cc8c84fd..a12bea92a49 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/Task.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Task.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import TaskStatus from './TaskStatus'; import TaskComponent from './TaskComponent'; import TaskId from './TaskId'; @@ -28,13 +29,13 @@ import TaskActions from './TaskActions'; export default class Task extends React.PureComponent { static propTypes = { - task: React.PropTypes.object.isRequired, - index: React.PropTypes.number.isRequired, - tasks: React.PropTypes.array.isRequired, - component: React.PropTypes.object, - types: React.PropTypes.array.isRequired, - onCancelTask: React.PropTypes.func.isRequired, - onFilterTask: React.PropTypes.func.isRequired + task: PropTypes.object.isRequired, + index: PropTypes.number.isRequired, + tasks: PropTypes.array.isRequired, + component: PropTypes.object, + types: PropTypes.array.isRequired, + onCancelTask: PropTypes.func.isRequired, + onFilterTask: PropTypes.func.isRequired }; render() { diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/WorkersForm-test.js.snap b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/WorkersForm-test.js.snap index 35ba8f86128..4bf13d5848f 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/WorkersForm-test.js.snap +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/WorkersForm-test.js.snap @@ -3,6 +3,7 @@ exports[`changes select 1`] = ` <Modal ariaHideApp={true} + bodyOpenClassName="ReactModal__Body--open" className="modal" closeTimeoutMS={0} contentLabel="background_tasks.change_number_of_workers" @@ -34,8 +35,10 @@ exports[`changes select 1`] = ` backspaceToRemoveMessage="Press backspace to remove {label}" className="input-tiny spacer-top" clearAllText="Clear all" + clearRenderer={[Function]} clearValueText="Clear value" clearable={false} + deleteRemoves={true} delimiter="," disabled={false} escapeClearsValue={true} @@ -55,7 +58,6 @@ exports[`changes select 1`] = ` onBlurResetsInput={true} onChange={[Function]} onCloseResetsInput={true} - openAfterFocus={false} optionComponent={[Function]} options={ Array [ @@ -144,6 +146,7 @@ exports[`changes select 1`] = ` exports[`changes select 2`] = ` <Modal ariaHideApp={true} + bodyOpenClassName="ReactModal__Body--open" className="modal" closeTimeoutMS={0} contentLabel="background_tasks.change_number_of_workers" @@ -175,8 +178,10 @@ exports[`changes select 2`] = ` backspaceToRemoveMessage="Press backspace to remove {label}" className="input-tiny spacer-top" clearAllText="Clear all" + clearRenderer={[Function]} clearValueText="Clear value" clearable={false} + deleteRemoves={true} delimiter="," disabled={false} escapeClearsValue={true} @@ -196,7 +201,6 @@ exports[`changes select 2`] = ` onBlurResetsInput={true} onChange={[Function]} onCloseResetsInput={true} - openAfterFocus={false} optionComponent={[Function]} options={ Array [ diff --git a/server/sonar-web/src/main/js/apps/code/components/Search.js b/server/sonar-web/src/main/js/apps/code/components/Search.js index 508487eaea0..12b644d943c 100644 --- a/server/sonar-web/src/main/js/apps/code/components/Search.js +++ b/server/sonar-web/src/main/js/apps/code/components/Search.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import classNames from 'classnames'; import { debounce } from 'lodash'; import Components from './Components'; @@ -28,13 +29,13 @@ import { getComponentUrl } from '../../../helpers/urls'; export default class Search extends React.PureComponent { static contextTypes = { - router: React.PropTypes.object.isRequired + router: PropTypes.object.isRequired }; static propTypes = { - component: React.PropTypes.object.isRequired, - location: React.PropTypes.object.isRequired, - onError: React.PropTypes.func.isRequired + component: PropTypes.object.isRequired, + location: PropTypes.object.isRequired, + onError: PropTypes.func.isRequired }; state = { diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/Measure.js b/server/sonar-web/src/main/js/apps/component-measures/components/Measure.js index aa81154e99f..ba59123b3b7 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/Measure.js +++ b/server/sonar-web/src/main/js/apps/component-measures/components/Measure.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Rating from '../../../components/ui/Rating'; import Level from '../../../components/ui/Level'; import { formatMeasure, isDiffMetric } from '../../../helpers/measures'; @@ -26,10 +27,10 @@ import { formatLeak, getRatingTooltip } from '../utils'; export default class Measure extends React.PureComponent { static propTypes = { - className: React.PropTypes.string, - measure: React.PropTypes.object, - metric: React.PropTypes.object, - decimals: React.PropTypes.number + className: PropTypes.string, + measure: PropTypes.object, + metric: PropTypes.object, + decimals: PropTypes.number }; renderRating(measure, metric) { diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ListView.js b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ListView.js index 901073b7a6c..88d28d8f5f9 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ListView.js +++ b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ListView.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import classNames from 'classnames'; import moment from 'moment'; import ComponentsList from './ComponentsList'; @@ -28,7 +29,7 @@ import ListFooter from '../../../../components/controls/ListFooter'; export default class ListView extends React.PureComponent { static contextTypes = { - router: React.PropTypes.object.isRequired + router: PropTypes.object.isRequired }; componentDidMount() { diff --git a/server/sonar-web/src/main/js/apps/component-measures/home/AllMeasuresDomain.js b/server/sonar-web/src/main/js/apps/component-measures/home/AllMeasuresDomain.js index a4512876a18..1111a362a9c 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/home/AllMeasuresDomain.js +++ b/server/sonar-web/src/main/js/apps/component-measures/home/AllMeasuresDomain.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import HomeMeasuresList from './HomeMeasuresList'; import { getLocalizedMetricDomain } from '../../../helpers/l10n'; @@ -43,5 +44,5 @@ AllMeasuresDomain.defaultProps = { }; AllMeasuresDomain.propTypes = { - displayHeader: React.PropTypes.bool + displayHeader: PropTypes.bool }; diff --git a/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/SearchSelect-test.js.snap b/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/SearchSelect-test.js.snap index 96a6e6985cb..d3ea2edb7b0 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/SearchSelect-test.js.snap +++ b/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/SearchSelect-test.js.snap @@ -11,8 +11,10 @@ exports[`should render Select 1`] = ` cache={false} className="input-super-large" clearAllText="Clear all" + clearRenderer={[Function]} clearValueText="Clear value" clearable={false} + deleteRemoves={true} delimiter="," disabled={false} escapeClearsValue={true} @@ -35,7 +37,6 @@ exports[`should render Select 1`] = ` onChange={[Function]} onCloseResetsInput={true} onInputChange={[Function]} - openAfterFocus={false} optionComponent={[Function]} options={Array []} pageSize={5} diff --git a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationDelete-test.js.snap b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationDelete-test.js.snap index 4762fa4e4d9..508cdecb71b 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationDelete-test.js.snap +++ b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationDelete-test.js.snap @@ -5,6 +5,7 @@ exports[`smoke test 1`] = ` className="page page-limited" > <HelmetWrapper + encodeSpecialCharacters={true} title="organization.delete" /> <header @@ -38,6 +39,7 @@ exports[`smoke test 2`] = ` className="page page-limited" > <HelmetWrapper + encodeSpecialCharacters={true} title="organization.delete" /> <header @@ -64,6 +66,7 @@ exports[`smoke test 2`] = ` </button> <Modal ariaHideApp={true} + bodyOpenClassName="ReactModal__Body--open" className="modal" closeTimeoutMS={0} contentLabel="modal form" @@ -119,6 +122,7 @@ exports[`smoke test 3`] = ` className="page page-limited" > <HelmetWrapper + encodeSpecialCharacters={true} title="organization.delete" /> <header @@ -145,6 +149,7 @@ exports[`smoke test 3`] = ` </button> <Modal ariaHideApp={true} + bodyOpenClassName="ReactModal__Body--open" className="modal" closeTimeoutMS={0} contentLabel="modal form" diff --git a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationEdit-test.js.snap b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationEdit-test.js.snap index 86dcb2b5556..6c13ca615a2 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationEdit-test.js.snap +++ b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationEdit-test.js.snap @@ -5,6 +5,7 @@ exports[`smoke test 1`] = ` className="page page-limited" > <HelmetWrapper + encodeSpecialCharacters={true} title="organization.edit" /> <header @@ -136,6 +137,7 @@ exports[`smoke test 2`] = ` className="page page-limited" > <HelmetWrapper + encodeSpecialCharacters={true} title="organization.edit" /> <header @@ -282,6 +284,7 @@ exports[`smoke test 3`] = ` className="page page-limited" > <HelmetWrapper + encodeSpecialCharacters={true} title="organization.edit" /> <header diff --git a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationMembers-test.js.snap b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationMembers-test.js.snap index 20de4c58030..17ab36b7540 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationMembers-test.js.snap +++ b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationMembers-test.js.snap @@ -5,6 +5,7 @@ exports[`should not render actions for non admin 1`] = ` className="page page-limited" > <HelmetWrapper + encodeSpecialCharacters={true} title="organization.members.page" /> <MembersPageHeader @@ -54,6 +55,7 @@ exports[`should render actions for admin 1`] = ` className="page page-limited" > <HelmetWrapper + encodeSpecialCharacters={true} title="organization.members.page" /> <MembersPageHeader diff --git a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationPage-test.js.snap b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationPage-test.js.snap index d9579e1bf4a..f63164ef1e0 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationPage-test.js.snap +++ b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationPage-test.js.snap @@ -16,6 +16,7 @@ exports[`smoke test 2`] = ` <div> <HelmetWrapper defaultTitle="Foo" + encodeSpecialCharacters={true} titleTemplate="%s - Foo" /> <OrganizationNavigation diff --git a/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/__snapshots__/AddMemberForm-test.js.snap b/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/__snapshots__/AddMemberForm-test.js.snap index 8fbd79d33c3..b00ff229314 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/__snapshots__/AddMemberForm-test.js.snap +++ b/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/__snapshots__/AddMemberForm-test.js.snap @@ -15,6 +15,7 @@ exports[`should render and open the modal 2`] = ` organization.members.add <Modal ariaHideApp={true} + bodyOpenClassName="ReactModal__Body--open" className="modal" closeTimeoutMS={0} contentLabel="modal form" diff --git a/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/__snapshots__/ManageMemberGroupsForm-test.js.snap b/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/__snapshots__/ManageMemberGroupsForm-test.js.snap index a87d5985b3f..3f450483d13 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/__snapshots__/ManageMemberGroupsForm-test.js.snap +++ b/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/__snapshots__/ManageMemberGroupsForm-test.js.snap @@ -85,6 +85,7 @@ exports[`should render and open the modal 2`] = ` organization.members.manage_groups <Modal ariaHideApp={true} + bodyOpenClassName="ReactModal__Body--open" className="modal" closeTimeoutMS={0} contentLabel="modal form" diff --git a/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/__snapshots__/RemoveMemberForm-test.js.snap b/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/__snapshots__/RemoveMemberForm-test.js.snap index 9a736b8c6de..5b298e526ba 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/__snapshots__/RemoveMemberForm-test.js.snap +++ b/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/__snapshots__/RemoveMemberForm-test.js.snap @@ -30,6 +30,7 @@ exports[`should render and open the modal 2`] = ` organization.members.remove <Modal ariaHideApp={true} + bodyOpenClassName="ReactModal__Body--open" className="modal" closeTimeoutMS={0} contentLabel="modal form" diff --git a/server/sonar-web/src/main/js/apps/overview/components/Timeline.js b/server/sonar-web/src/main/js/apps/overview/components/Timeline.js index 476707db58c..cabf59b0e5a 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/Timeline.js +++ b/server/sonar-web/src/main/js/apps/overview/components/Timeline.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import { max } from 'd3-array'; import { LineChart } from '../../../components/charts/line-chart'; @@ -25,9 +26,9 @@ const HEIGHT = 80; export default class Timeline extends React.PureComponent { static propTypes = { - history: React.PropTypes.arrayOf(React.PropTypes.object).isRequired, - before: React.PropTypes.object, - after: React.PropTypes.object + history: PropTypes.arrayOf(PropTypes.object).isRequired, + before: PropTypes.object, + after: PropTypes.object }; filterSnapshots() { diff --git a/server/sonar-web/src/main/js/apps/overview/meta/MetaLinks.js b/server/sonar-web/src/main/js/apps/overview/meta/MetaLinks.js index c88e57977a6..4982632cc80 100644 --- a/server/sonar-web/src/main/js/apps/overview/meta/MetaLinks.js +++ b/server/sonar-web/src/main/js/apps/overview/meta/MetaLinks.js @@ -18,13 +18,14 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import MetaLink from './MetaLink'; import { getProjectLinks } from '../../../api/projectLinks'; import { orderLinks } from '../../project-admin/links/utils'; export default class MetaLinks extends React.PureComponent { static propTypes = { - component: React.PropTypes.object.isRequired + component: PropTypes.object.isRequired }; state = {}; diff --git a/server/sonar-web/src/main/js/apps/overview/meta/MetaSize.js b/server/sonar-web/src/main/js/apps/overview/meta/MetaSize.js index 0367e3a8147..6c632128757 100644 --- a/server/sonar-web/src/main/js/apps/overview/meta/MetaSize.js +++ b/server/sonar-web/src/main/js/apps/overview/meta/MetaSize.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import { DrilldownLink } from '../../../components/shared/drilldown-link'; import LanguageDistribution from '../../../components/charts/LanguageDistribution'; import { formatMeasure } from '../../../helpers/measures'; @@ -26,8 +27,8 @@ import SizeRating from '../../../components/ui/SizeRating'; export default class MetaSize extends React.PureComponent { static propTypes = { - component: React.PropTypes.object.isRequired, - measures: React.PropTypes.array.isRequired + component: PropTypes.object.isRequired, + measures: PropTypes.array.isRequired }; render() { diff --git a/server/sonar-web/src/main/js/apps/overview/propTypes.js b/server/sonar-web/src/main/js/apps/overview/propTypes.js index 19d9d6624a0..014a74176de 100644 --- a/server/sonar-web/src/main/js/apps/overview/propTypes.js +++ b/server/sonar-web/src/main/js/apps/overview/propTypes.js @@ -17,9 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { PropTypes } from 'react'; - -const { shape, arrayOf, array, string, number, object } = PropTypes; +import { shape, arrayOf, array, string, number, object } from 'prop-types'; export const ComponentType = shape({ id: string.isRequired diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/ActionsCell.js b/server/sonar-web/src/main/js/apps/permission-templates/components/ActionsCell.js index fca2990dc54..7282eecc45d 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/ActionsCell.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/ActionsCell.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import { Link } from 'react-router'; import { difference } from 'lodash'; import Backbone from 'backbone'; @@ -30,11 +31,11 @@ import { setDefaultPermissionTemplate } from '../../../api/permissions'; export default class ActionsCell extends React.PureComponent { static propTypes = { - organization: React.PropTypes.object, + organization: PropTypes.object, permissionTemplate: PermissionTemplateType.isRequired, - topQualifiers: React.PropTypes.array.isRequired, + topQualifiers: PropTypes.array.isRequired, refresh: CallbackType, - fromDetails: React.PropTypes.bool + fromDetails: PropTypes.bool }; static defaultProps = { @@ -42,7 +43,7 @@ export default class ActionsCell extends React.PureComponent { }; static contextTypes = { - router: React.PropTypes.object + router: PropTypes.object }; handleUpdateClick(e) { diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/App.js b/server/sonar-web/src/main/js/apps/permission-templates/components/App.js index b28c3564d9e..9f0df724326 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/App.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/App.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Home from './Home'; import Template from './Template'; import OrganizationHelmet from '../../../components/common/OrganizationHelmet'; @@ -28,9 +29,9 @@ import '../../permissions/styles.css'; export default class App extends React.PureComponent { static propTypes = { - location: React.PropTypes.object.isRequired, - organization: React.PropTypes.object, - topQualifiers: React.PropTypes.array.isRequired + location: PropTypes.object.isRequired, + organization: PropTypes.object, + topQualifiers: PropTypes.array.isRequired }; state = { diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/Defaults.js b/server/sonar-web/src/main/js/apps/permission-templates/components/Defaults.js index 4a551a419fc..454b269f85a 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/Defaults.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/Defaults.js @@ -18,13 +18,14 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import { sortBy } from 'lodash'; import { translate } from '../../../helpers/l10n'; import { PermissionTemplateType } from '../propTypes'; export default class Defaults extends React.PureComponent { static propTypes = { - organization: React.PropTypes.object, + organization: PropTypes.object, permissionTemplate: PermissionTemplateType.isRequired }; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/Header.js b/server/sonar-web/src/main/js/apps/permission-templates/components/Header.js index 17eb68d06c3..74c4741fc64 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/Header.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/Header.js @@ -18,19 +18,20 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import CreateView from '../views/CreateView'; import { translate } from '../../../helpers/l10n'; import { CallbackType } from '../propTypes'; export default class Header extends React.PureComponent { static propTypes = { - organization: React.PropTypes.object, - ready: React.PropTypes.bool.isRequired, + organization: PropTypes.object, + ready: PropTypes.bool.isRequired, refresh: CallbackType }; static contextTypes = { - router: React.PropTypes.object + router: PropTypes.object }; componentWillMount() { diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/Home.js b/server/sonar-web/src/main/js/apps/permission-templates/components/Home.js index 7b2135fc335..bdd5a97a1bc 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/Home.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/Home.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Helmet from 'react-helmet'; import Header from './Header'; import List from './List'; @@ -25,12 +26,12 @@ import { translate } from '../../../helpers/l10n'; export default class Home extends React.PureComponent { static propTypes = { - organization: React.PropTypes.object, - topQualifiers: React.PropTypes.array.isRequired, - permissions: React.PropTypes.array.isRequired, - permissionTemplates: React.PropTypes.array.isRequired, - ready: React.PropTypes.bool.isRequired, - refresh: React.PropTypes.func.isRequired + organization: PropTypes.object, + topQualifiers: PropTypes.array.isRequired, + permissions: PropTypes.array.isRequired, + permissionTemplates: PropTypes.array.isRequired, + ready: PropTypes.bool.isRequired, + refresh: PropTypes.func.isRequired }; render() { diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/List.js b/server/sonar-web/src/main/js/apps/permission-templates/components/List.js index 200fb7244fb..76b5570fd51 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/List.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/List.js @@ -18,16 +18,17 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import ListHeader from './ListHeader'; import ListItem from './ListItem'; import { PermissionTemplateType, CallbackType } from '../propTypes'; export default class List extends React.PureComponent { static propTypes = { - organization: React.PropTypes.object, - permissionTemplates: React.PropTypes.arrayOf(PermissionTemplateType).isRequired, - permissions: React.PropTypes.array.isRequired, - topQualifiers: React.PropTypes.array.isRequired, + organization: PropTypes.object, + permissionTemplates: PropTypes.arrayOf(PermissionTemplateType).isRequired, + permissions: PropTypes.array.isRequired, + topQualifiers: PropTypes.array.isRequired, refresh: CallbackType }; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/ListHeader.js b/server/sonar-web/src/main/js/apps/permission-templates/components/ListHeader.js index 31915dbacdd..b09b86a3ee3 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/ListHeader.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/ListHeader.js @@ -18,13 +18,14 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Tooltip from '../../../components/controls/Tooltip'; import { translate } from '../../../helpers/l10n'; export default class ListHeader extends React.PureComponent { static propTypes = { - organization: React.PropTypes.object, - permissions: React.PropTypes.array.isRequired + organization: PropTypes.object, + permissions: PropTypes.array.isRequired }; renderTooltip = permission => diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/ListItem.js b/server/sonar-web/src/main/js/apps/permission-templates/components/ListItem.js index b6dbec1d7b9..ea111a3e0c2 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/ListItem.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/ListItem.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import NameCell from './NameCell'; import PermissionCell from './PermissionCell'; import ActionsCell from './ActionsCell'; @@ -25,9 +26,9 @@ import { PermissionTemplateType, CallbackType } from '../propTypes'; export default class ListItem extends React.PureComponent { static propTypes = { - organization: React.PropTypes.object, + organization: PropTypes.object, permissionTemplate: PermissionTemplateType.isRequired, - topQualifiers: React.PropTypes.array.isRequired, + topQualifiers: PropTypes.array.isRequired, refresh: CallbackType }; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/NameCell.js b/server/sonar-web/src/main/js/apps/permission-templates/components/NameCell.js index 5e0d4ea196b..cb52710b803 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/NameCell.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/NameCell.js @@ -18,13 +18,14 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import { Link } from 'react-router'; import Defaults from './Defaults'; import { PermissionTemplateType } from '../propTypes'; export default class NameCell extends React.PureComponent { static propTypes = { - organization: React.PropTypes.object, + organization: PropTypes.object, permissionTemplate: PermissionTemplateType.isRequired }; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/Template.js b/server/sonar-web/src/main/js/apps/permission-templates/components/Template.js index a0191df28f0..82260039e0e 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/Template.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/Template.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Helmet from 'react-helmet'; import { debounce } from 'lodash'; import TemplateHeader from './TemplateHeader'; @@ -30,10 +31,10 @@ import { translate } from '../../../helpers/l10n'; export default class Template extends React.PureComponent { static propTypes = { - organization: React.PropTypes.object, - template: React.PropTypes.object.isRequired, - refresh: React.PropTypes.func.isRequired, - topQualifiers: React.PropTypes.array.isRequired + organization: PropTypes.object, + template: PropTypes.object.isRequired, + refresh: PropTypes.func.isRequired, + topQualifiers: PropTypes.array.isRequired }; constructor(props) { diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/TemplateDetails.js b/server/sonar-web/src/main/js/apps/permission-templates/components/TemplateDetails.js index ef4b83905ae..541200c995b 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/TemplateDetails.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/TemplateDetails.js @@ -18,12 +18,13 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Defaults from './Defaults'; export default class TemplateDetails extends React.PureComponent { static propTypes = { - organization: React.PropTypes.object, - template: React.PropTypes.object.isRequired + organization: PropTypes.object, + template: PropTypes.object.isRequired }; render() { diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/TemplateHeader.js b/server/sonar-web/src/main/js/apps/permission-templates/components/TemplateHeader.js index e7a81092fa5..1e0417c2f7b 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/TemplateHeader.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/TemplateHeader.js @@ -18,17 +18,18 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import { Link } from 'react-router'; import ActionsCell from './ActionsCell'; import { translate } from '../../../helpers/l10n'; export default class TemplateHeader extends React.PureComponent { static propTypes = { - organization: React.PropTypes.object, - template: React.PropTypes.object.isRequired, - loading: React.PropTypes.bool.isRequired, - refresh: React.PropTypes.func.isRequired, - topQualifiers: React.PropTypes.array.isRequired + organization: PropTypes.object, + template: PropTypes.object.isRequired, + loading: PropTypes.bool.isRequired, + refresh: PropTypes.func.isRequired, + topQualifiers: PropTypes.array.isRequired }; render() { diff --git a/server/sonar-web/src/main/js/apps/permission-templates/propTypes.js b/server/sonar-web/src/main/js/apps/permission-templates/propTypes.js index efda8d264c2..612a9e78b9e 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/propTypes.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/propTypes.js @@ -17,9 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { PropTypes } from 'react'; - -const { shape, arrayOf, string, number, func } = PropTypes; +import { shape, arrayOf, string, number, func } from 'prop-types'; export const PermissionType = shape({ key: string.isRequired, diff --git a/server/sonar-web/src/main/js/apps/permissions/shared/components/GroupHolder.js b/server/sonar-web/src/main/js/apps/permissions/shared/components/GroupHolder.js index dc037d86753..9fd34e34b5b 100644 --- a/server/sonar-web/src/main/js/apps/permissions/shared/components/GroupHolder.js +++ b/server/sonar-web/src/main/js/apps/permissions/shared/components/GroupHolder.js @@ -18,15 +18,16 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import GroupIcon from './GroupIcon'; export default class GroupHolder extends React.PureComponent { static propTypes = { - group: React.PropTypes.object.isRequired, - permissions: React.PropTypes.array.isRequired, - selectedPermission: React.PropTypes.string, - permissionsOrder: React.PropTypes.array.isRequired, - onToggle: React.PropTypes.func.isRequired + group: PropTypes.object.isRequired, + permissions: PropTypes.array.isRequired, + selectedPermission: PropTypes.string, + permissionsOrder: PropTypes.array.isRequired, + onToggle: PropTypes.func.isRequired }; handleClick(permission, e) { diff --git a/server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.js b/server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.js index d2eee7396c6..710b6830ed2 100644 --- a/server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.js +++ b/server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import UserHolder from './UserHolder'; import GroupHolder from './GroupHolder'; import Tooltip from '../../../../components/controls/Tooltip'; @@ -25,14 +26,14 @@ import { translate } from '../../../../helpers/l10n'; export default class HoldersList extends React.PureComponent { static propTypes = { - permissions: React.PropTypes.array.isRequired, - users: React.PropTypes.array.isRequired, - groups: React.PropTypes.array.isRequired, - selectedPermission: React.PropTypes.string, - showPublicProjectsWarning: React.PropTypes.bool, - onSelectPermission: React.PropTypes.func.isRequired, - onToggleUser: React.PropTypes.func.isRequired, - onToggleGroup: React.PropTypes.func.isRequired + permissions: PropTypes.array.isRequired, + users: PropTypes.array.isRequired, + groups: PropTypes.array.isRequired, + selectedPermission: PropTypes.string, + showPublicProjectsWarning: PropTypes.bool, + onSelectPermission: PropTypes.func.isRequired, + onToggleUser: PropTypes.func.isRequired, + onToggleGroup: PropTypes.func.isRequired }; static defaultProps = { diff --git a/server/sonar-web/src/main/js/apps/permissions/shared/components/PageError.js b/server/sonar-web/src/main/js/apps/permissions/shared/components/PageError.js index da53c30b9ef..4b1ad1d8ede 100644 --- a/server/sonar-web/src/main/js/apps/permissions/shared/components/PageError.js +++ b/server/sonar-web/src/main/js/apps/permissions/shared/components/PageError.js @@ -18,12 +18,13 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { getPermissionsAppError } from '../../../../store/rootReducer'; class PageError extends React.PureComponent { static propTypes = { - message: React.PropTypes.string + message: PropTypes.string }; render() { diff --git a/server/sonar-web/src/main/js/apps/permissions/shared/components/SearchForm.js b/server/sonar-web/src/main/js/apps/permissions/shared/components/SearchForm.js index 9687e42732a..08f0654683c 100644 --- a/server/sonar-web/src/main/js/apps/permissions/shared/components/SearchForm.js +++ b/server/sonar-web/src/main/js/apps/permissions/shared/components/SearchForm.js @@ -18,15 +18,16 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import RadioToggle from '../../../../components/controls/RadioToggle'; import { translate, translateWithParameters } from '../../../../helpers/l10n'; export default class SearchForm extends React.PureComponent { static propTypes = { - query: React.PropTypes.string, - filter: React.PropTypes.oneOf(['all', 'users', 'groups']), - onSearch: React.PropTypes.func, - onFilter: React.PropTypes.func + query: PropTypes.string, + filter: PropTypes.oneOf(['all', 'users', 'groups']), + onSearch: PropTypes.func, + onFilter: PropTypes.func }; componentWillMount() { diff --git a/server/sonar-web/src/main/js/apps/permissions/shared/components/UserHolder.js b/server/sonar-web/src/main/js/apps/permissions/shared/components/UserHolder.js index d95158c9032..4ef61d7aa0b 100644 --- a/server/sonar-web/src/main/js/apps/permissions/shared/components/UserHolder.js +++ b/server/sonar-web/src/main/js/apps/permissions/shared/components/UserHolder.js @@ -18,16 +18,17 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Avatar from '../../../../components/ui/Avatar'; import { translate } from '../../../../helpers/l10n'; export default class UserHolder extends React.PureComponent { static propTypes = { - user: React.PropTypes.object.isRequired, - permissions: React.PropTypes.array.isRequired, - selectedPermission: React.PropTypes.string, - permissionsOrder: React.PropTypes.array.isRequired, - onToggle: React.PropTypes.func.isRequired + user: PropTypes.object.isRequired, + permissions: PropTypes.array.isRequired, + selectedPermission: PropTypes.string, + permissionsOrder: PropTypes.array.isRequired, + onToggle: PropTypes.func.isRequired }; handleClick(permission, e) { diff --git a/server/sonar-web/src/main/js/apps/project-admin/deletion/Deletion.js b/server/sonar-web/src/main/js/apps/project-admin/deletion/Deletion.js index e94863a7ac1..5aff00dd956 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/deletion/Deletion.js +++ b/server/sonar-web/src/main/js/apps/project-admin/deletion/Deletion.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Helmet from 'react-helmet'; import { connect } from 'react-redux'; import Header from './Header'; @@ -27,7 +28,7 @@ import { translate } from '../../../helpers/l10n'; class Deletion extends React.PureComponent { static propTypes = { - component: React.PropTypes.object + component: PropTypes.object }; render() { diff --git a/server/sonar-web/src/main/js/apps/project-admin/deletion/Form.js b/server/sonar-web/src/main/js/apps/project-admin/deletion/Form.js index 06f7189aae5..b4e381e7373 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/deletion/Form.js +++ b/server/sonar-web/src/main/js/apps/project-admin/deletion/Form.js @@ -18,17 +18,18 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Modal from 'react-modal'; import { deleteProject } from '../../../api/components'; import { translate, translateWithParameters } from '../../../helpers/l10n'; export default class Form extends React.PureComponent { static propTypes = { - component: React.PropTypes.object.isRequired + component: PropTypes.object.isRequired }; static contextTypes = { - router: React.PropTypes.object + router: PropTypes.object }; state = { loading: false, modalOpen: false }; diff --git a/server/sonar-web/src/main/js/apps/project-admin/key/BulkUpdate.js b/server/sonar-web/src/main/js/apps/project-admin/key/BulkUpdate.js index 90af5ae2f54..c0452fc158b 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/key/BulkUpdate.js +++ b/server/sonar-web/src/main/js/apps/project-admin/key/BulkUpdate.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import BulkUpdateForm from './BulkUpdateForm'; import BulkUpdateResults from './BulkUpdateResults'; @@ -34,10 +35,10 @@ import RecentHistory from '../../../app/components/RecentHistory'; class BulkUpdate extends React.PureComponent { static propTypes = { - component: React.PropTypes.object.isRequired, - addGlobalErrorMessage: React.PropTypes.func.isRequired, - addGlobalSuccessMessage: React.PropTypes.func.isRequired, - closeAllGlobalMessages: React.PropTypes.func.isRequired + component: PropTypes.object.isRequired, + addGlobalErrorMessage: PropTypes.func.isRequired, + addGlobalSuccessMessage: PropTypes.func.isRequired, + closeAllGlobalMessages: PropTypes.func.isRequired }; state = { diff --git a/server/sonar-web/src/main/js/apps/project-admin/key/BulkUpdateForm.js b/server/sonar-web/src/main/js/apps/project-admin/key/BulkUpdateForm.js index 3c58171ebdb..b549c19db05 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/key/BulkUpdateForm.js +++ b/server/sonar-web/src/main/js/apps/project-admin/key/BulkUpdateForm.js @@ -18,11 +18,12 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import { translate } from '../../../helpers/l10n'; export default class BulkUpdateForm extends React.PureComponent { static propTypes = { - onSubmit: React.PropTypes.func.isRequired + onSubmit: PropTypes.func.isRequired }; handleSubmit(e) { diff --git a/server/sonar-web/src/main/js/apps/project-admin/key/BulkUpdateResults.js b/server/sonar-web/src/main/js/apps/project-admin/key/BulkUpdateResults.js index ff202655a41..bd96b8a225a 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/key/BulkUpdateResults.js +++ b/server/sonar-web/src/main/js/apps/project-admin/key/BulkUpdateResults.js @@ -18,13 +18,14 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import { some } from 'lodash'; import { translateWithParameters, translate } from '../../../helpers/l10n'; export default class BulkUpdateResults extends React.PureComponent { static propTypes = { - results: React.PropTypes.array.isRequired, - onConfirm: React.PropTypes.func.isRequired + results: PropTypes.array.isRequired, + onConfirm: PropTypes.func.isRequired }; handleConfirm(e) { diff --git a/server/sonar-web/src/main/js/apps/project-admin/key/Key.js b/server/sonar-web/src/main/js/apps/project-admin/key/Key.js index 97cd01c3f1c..130d67cd4c2 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/key/Key.js +++ b/server/sonar-web/src/main/js/apps/project-admin/key/Key.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Helmet from 'react-helmet'; import { connect } from 'react-redux'; import Header from './Header'; @@ -38,12 +39,12 @@ import { getProjectAdminProjectModules, getComponent } from '../../../store/root class Key extends React.PureComponent { static propTypes = { - component: React.PropTypes.object.isRequired, - fetchProjectModules: React.PropTypes.func.isRequired, - changeKey: React.PropTypes.func.isRequired, - addGlobalErrorMessage: React.PropTypes.func.isRequired, - addGlobalSuccessMessage: React.PropTypes.func.isRequired, - closeAllGlobalMessages: React.PropTypes.func.isRequired + component: PropTypes.object.isRequired, + fetchProjectModules: PropTypes.func.isRequired, + changeKey: PropTypes.func.isRequired, + addGlobalErrorMessage: PropTypes.func.isRequired, + addGlobalSuccessMessage: PropTypes.func.isRequired, + closeAllGlobalMessages: PropTypes.func.isRequired }; state = { diff --git a/server/sonar-web/src/main/js/apps/project-admin/key/UpdateForm.js b/server/sonar-web/src/main/js/apps/project-admin/key/UpdateForm.js index 1de387c9721..59a01d1fe0a 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/key/UpdateForm.js +++ b/server/sonar-web/src/main/js/apps/project-admin/key/UpdateForm.js @@ -18,13 +18,14 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import UpdateKeyConfirmation from './views/UpdateKeyConfirmation'; import { translate } from '../../../helpers/l10n'; export default class UpdateForm extends React.PureComponent { static propTypes = { - component: React.PropTypes.object.isRequired, - onKeyChange: React.PropTypes.func.isRequired + component: PropTypes.object.isRequired, + onKeyChange: PropTypes.func.isRequired }; state = { newKey: null }; diff --git a/server/sonar-web/src/main/js/apps/project-admin/key/UpdateKeyForm.js b/server/sonar-web/src/main/js/apps/project-admin/key/UpdateKeyForm.js index bb510a4ca26..87c53066797 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/key/UpdateKeyForm.js +++ b/server/sonar-web/src/main/js/apps/project-admin/key/UpdateKeyForm.js @@ -18,12 +18,13 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import UpdateKeyConfirmation from './views/UpdateKeyConfirmation'; import { translate } from '../../../helpers/l10n'; export default class UpdateKeyForm extends React.PureComponent { static propTypes = { - component: React.PropTypes.object.isRequired + component: PropTypes.object.isRequired }; state = {}; diff --git a/server/sonar-web/src/main/js/apps/project-admin/links/Header.js b/server/sonar-web/src/main/js/apps/project-admin/links/Header.js index 9173d97c1aa..34faf7a76d4 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/links/Header.js +++ b/server/sonar-web/src/main/js/apps/project-admin/links/Header.js @@ -18,12 +18,13 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import CreationModal from './views/CreationModal'; import { translate } from '../../../helpers/l10n'; export default class Header extends React.PureComponent { static propTypes = { - onCreate: React.PropTypes.func.isRequired + onCreate: PropTypes.func.isRequired }; handleCreateClick(e) { diff --git a/server/sonar-web/src/main/js/apps/project-admin/links/LinkRow.js b/server/sonar-web/src/main/js/apps/project-admin/links/LinkRow.js index 67313e188f4..ad0fcc33306 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/links/LinkRow.js +++ b/server/sonar-web/src/main/js/apps/project-admin/links/LinkRow.js @@ -18,14 +18,15 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import { isProvided, isClickable } from './utils'; import { translate } from '../../../helpers/l10n'; import BugTrackerIcon from '../../../components/ui/BugTrackerIcon'; export default class LinkRow extends React.PureComponent { static propTypes = { - link: React.PropTypes.object.isRequired, - onDelete: React.PropTypes.func.isRequired + link: PropTypes.object.isRequired, + onDelete: PropTypes.func.isRequired }; handleDeleteClick(e) { diff --git a/server/sonar-web/src/main/js/apps/project-admin/links/Links.js b/server/sonar-web/src/main/js/apps/project-admin/links/Links.js index e06a045a9aa..fede0404e07 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/links/Links.js +++ b/server/sonar-web/src/main/js/apps/project-admin/links/Links.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Helmet from 'react-helmet'; import { connect } from 'react-redux'; import Header from './Header'; @@ -29,8 +30,8 @@ import { translate } from '../../../helpers/l10n'; class Links extends React.PureComponent { static propTypes = { - component: React.PropTypes.object.isRequired, - links: React.PropTypes.array + component: PropTypes.object.isRequired, + links: PropTypes.array }; componentWillMount() { diff --git a/server/sonar-web/src/main/js/apps/project-admin/links/Table.js b/server/sonar-web/src/main/js/apps/project-admin/links/Table.js index a7358dbb26b..acc5cf5ec96 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/links/Table.js +++ b/server/sonar-web/src/main/js/apps/project-admin/links/Table.js @@ -18,14 +18,15 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import LinkRow from './LinkRow'; import { orderLinks } from './utils'; import { translate } from '../../../helpers/l10n'; export default class Table extends React.PureComponent { static propTypes = { - links: React.PropTypes.array.isRequired, - onDelete: React.PropTypes.func.isRequired + links: PropTypes.array.isRequired, + onDelete: PropTypes.func.isRequired }; handleDeleteLink(link) { diff --git a/server/sonar-web/src/main/js/apps/project-admin/quality-gate/Form.js b/server/sonar-web/src/main/js/apps/project-admin/quality-gate/Form.js index 5e594cac288..69b5fdc2126 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/quality-gate/Form.js +++ b/server/sonar-web/src/main/js/apps/project-admin/quality-gate/Form.js @@ -18,15 +18,16 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Select from 'react-select'; import { some } from 'lodash'; import { translate } from '../../../helpers/l10n'; export default class Form extends React.PureComponent { static propTypes = { - allGates: React.PropTypes.array.isRequired, - gate: React.PropTypes.object, - onChange: React.PropTypes.func.isRequired + allGates: PropTypes.array.isRequired, + gate: PropTypes.object, + onChange: PropTypes.func.isRequired }; state = { diff --git a/server/sonar-web/src/main/js/apps/project-admin/quality-gate/QualityGate.js b/server/sonar-web/src/main/js/apps/project-admin/quality-gate/QualityGate.js index fd5759a40b9..f07fbed428b 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/quality-gate/QualityGate.js +++ b/server/sonar-web/src/main/js/apps/project-admin/quality-gate/QualityGate.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Helmet from 'react-helmet'; import { connect } from 'react-redux'; import Header from './Header'; @@ -32,9 +33,9 @@ import { translate } from '../../../helpers/l10n'; class QualityGate extends React.PureComponent { static propTypes = { - component: React.PropTypes.object.isRequired, - allGates: React.PropTypes.array, - gate: React.PropTypes.object + component: PropTypes.object.isRequired, + allGates: PropTypes.array, + gate: PropTypes.object }; componentDidMount() { diff --git a/server/sonar-web/src/main/js/apps/project-admin/quality-profiles/ProfileRow.js b/server/sonar-web/src/main/js/apps/project-admin/quality-profiles/ProfileRow.js index bc1f3c55417..8a9e02e717f 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/quality-profiles/ProfileRow.js +++ b/server/sonar-web/src/main/js/apps/project-admin/quality-profiles/ProfileRow.js @@ -18,14 +18,15 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Select from 'react-select'; import { translate } from '../../../helpers/l10n'; export default class ProfileRow extends React.PureComponent { static propTypes = { - profile: React.PropTypes.object.isRequired, - possibleProfiles: React.PropTypes.array.isRequired, - onChangeProfile: React.PropTypes.func.isRequired + profile: PropTypes.object.isRequired, + possibleProfiles: PropTypes.array.isRequired, + onChangeProfile: PropTypes.func.isRequired }; state = { diff --git a/server/sonar-web/src/main/js/apps/project-admin/quality-profiles/Table.js b/server/sonar-web/src/main/js/apps/project-admin/quality-profiles/Table.js index 77b9039762b..24a099134b2 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/quality-profiles/Table.js +++ b/server/sonar-web/src/main/js/apps/project-admin/quality-profiles/Table.js @@ -18,15 +18,16 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import { groupBy, orderBy } from 'lodash'; import ProfileRow from './ProfileRow'; import { translate } from '../../../helpers/l10n'; export default class Table extends React.PureComponent { static propTypes = { - allProfiles: React.PropTypes.array.isRequired, - profiles: React.PropTypes.array.isRequired, - onChangeProfile: React.PropTypes.func.isRequired + allProfiles: PropTypes.array.isRequired, + profiles: PropTypes.array.isRequired, + onChangeProfile: PropTypes.func.isRequired }; renderHeader() { diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityApp-test.js.snap b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityApp-test.js.snap index 6bf098ccb15..9912ce833fc 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityApp-test.js.snap +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityApp-test.js.snap @@ -6,6 +6,7 @@ exports[`should render correctly 1`] = ` id="project-activity" > <HelmetWrapper + encodeSpecialCharacters={true} title="project_activity.page" /> <ProjectActivityPageHeader diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityPageHeader-test.js.snap b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityPageHeader-test.js.snap index 42faa3e8acd..1112cfa4ea8 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityPageHeader-test.js.snap +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityPageHeader-test.js.snap @@ -12,8 +12,10 @@ exports[`should render correctly the list of series 1`] = ` backspaceToRemoveMessage="Press backspace to remove {label}" className="input-medium pull-left big-spacer-right" clearAllText="Clear all" + clearRenderer={[Function]} clearValueText="Clear value" clearable={true} + deleteRemoves={true} delimiter="," disabled={false} escapeClearsValue={true} @@ -33,7 +35,6 @@ exports[`should render correctly the list of series 1`] = ` onBlurResetsInput={true} onChange={[Function]} onCloseResetsInput={true} - openAfterFocus={false} optionComponent={[Function]} options={ Array [ diff --git a/server/sonar-web/src/main/js/apps/projects-admin/projects.js b/server/sonar-web/src/main/js/apps/projects-admin/projects.js index 847d2a5f702..0d0f59342ad 100644 --- a/server/sonar-web/src/main/js/apps/projects-admin/projects.js +++ b/server/sonar-web/src/main/js/apps/projects-admin/projects.js @@ -19,6 +19,7 @@ */ import classNames from 'classnames'; import React from 'react'; +import PropTypes from 'prop-types'; import { Link } from 'react-router'; import { getComponentPermissionsUrl } from '../../helpers/urls'; import ApplyTemplateView from '../permissions/project/views/ApplyTemplateView'; @@ -29,9 +30,9 @@ import { translate } from '../../helpers/l10n'; export default class Projects extends React.PureComponent { static propTypes = { - projects: React.PropTypes.array.isRequired, - selection: React.PropTypes.array.isRequired, - organization: React.PropTypes.object.isRequired + projects: PropTypes.array.isRequired, + selection: PropTypes.array.isRequired, + organization: PropTypes.object.isRequired }; componentWillMount() { diff --git a/server/sonar-web/src/main/js/apps/projects-admin/search.js b/server/sonar-web/src/main/js/apps/projects-admin/search.js index ee8d522e2ad..ce42b2050e9 100644 --- a/server/sonar-web/src/main/js/apps/projects-admin/search.js +++ b/server/sonar-web/src/main/js/apps/projects-admin/search.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import { sortBy } from 'lodash'; import { TYPE, QUALIFIERS_ORDER } from './constants'; import DeleteView from './delete-view'; @@ -28,7 +29,7 @@ import { translate } from '../../helpers/l10n'; export default class Search extends React.PureComponent { static propTypes = { - onSearch: React.PropTypes.func.isRequired + onSearch: PropTypes.func.isRequired }; onSubmit = e => { diff --git a/server/sonar-web/src/main/js/apps/projects/components/ProjectsListFooter.js b/server/sonar-web/src/main/js/apps/projects/components/ProjectsListFooter.js index 3a1f5d4c1fe..bf478ed0a6d 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/ProjectsListFooter.js +++ b/server/sonar-web/src/main/js/apps/projects/components/ProjectsListFooter.js @@ -18,11 +18,12 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import ListFooter from '../../../components/controls/ListFooter'; export default class ProjectsListFooter extends React.PureComponent { static propTypes = { - total: React.PropTypes.number.isRequired + total: PropTypes.number.isRequired }; render() { diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/__snapshots__/PerspectiveSelect-test.js.snap b/server/sonar-web/src/main/js/apps/projects/components/__tests__/__snapshots__/PerspectiveSelect-test.js.snap index b4ab927ee51..7671abced29 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/__snapshots__/PerspectiveSelect-test.js.snap +++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/__snapshots__/PerspectiveSelect-test.js.snap @@ -35,8 +35,10 @@ exports[`should render correctly 1`] = ` backspaceToRemoveMessage="Press backspace to remove {label}" className="little-spacer-left input-medium" clearAllText="Clear all" + clearRenderer={[Function]} clearValueText="Clear value" clearable={false} + deleteRemoves={true} delimiter="," disabled={false} escapeClearsValue={true} @@ -56,7 +58,6 @@ exports[`should render correctly 1`] = ` onBlurResetsInput={true} onChange={[Function]} onCloseResetsInput={true} - openAfterFocus={false} optionComponent={[Function]} options={ Array [ @@ -130,8 +131,10 @@ exports[`should render with coverage selected 1`] = ` backspaceToRemoveMessage="Press backspace to remove {label}" className="little-spacer-left input-medium" clearAllText="Clear all" + clearRenderer={[Function]} clearValueText="Clear value" clearable={false} + deleteRemoves={true} delimiter="," disabled={false} escapeClearsValue={true} @@ -151,7 +154,6 @@ exports[`should render with coverage selected 1`] = ` onBlurResetsInput={true} onChange={[Function]} onCloseResetsInput={true} - openAfterFocus={false} optionComponent={[Function]} options={ Array [ diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/__snapshots__/ProjectsSortingSelect-test.js.snap b/server/sonar-web/src/main/js/apps/projects/components/__tests__/__snapshots__/ProjectsSortingSelect-test.js.snap index 21c3b3f5d5a..dfa78f606fc 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/__snapshots__/ProjectsSortingSelect-test.js.snap +++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/__snapshots__/ProjectsSortingSelect-test.js.snap @@ -14,8 +14,10 @@ exports[`should handle the descending sort direction 1`] = ` backspaceToRemoveMessage="Press backspace to remove {label}" className="little-spacer-left input-medium" clearAllText="Clear all" + clearRenderer={[Function]} clearValueText="Clear value" clearable={false} + deleteRemoves={true} delimiter="," disabled={false} escapeClearsValue={true} @@ -35,7 +37,6 @@ exports[`should handle the descending sort direction 1`] = ` onBlurResetsInput={true} onChange={[Function]} onCloseResetsInput={true} - openAfterFocus={false} optionComponent={[Function]} options={ Array [ @@ -123,8 +124,10 @@ exports[`should render correctly for leak view 1`] = ` backspaceToRemoveMessage="Press backspace to remove {label}" className="little-spacer-left input-medium" clearAllText="Clear all" + clearRenderer={[Function]} clearValueText="Clear value" clearable={false} + deleteRemoves={true} delimiter="," disabled={false} escapeClearsValue={true} @@ -144,7 +147,6 @@ exports[`should render correctly for leak view 1`] = ` onBlurResetsInput={true} onChange={[Function]} onCloseResetsInput={true} - openAfterFocus={false} optionComponent={[Function]} options={ Array [ @@ -232,8 +234,10 @@ exports[`should render correctly for overall view 1`] = ` backspaceToRemoveMessage="Press backspace to remove {label}" className="little-spacer-left input-medium" clearAllText="Clear all" + clearRenderer={[Function]} clearValueText="Clear value" clearable={false} + deleteRemoves={true} delimiter="," disabled={false} escapeClearsValue={true} @@ -253,7 +257,6 @@ exports[`should render correctly for overall view 1`] = ` onBlurResetsInput={true} onChange={[Function]} onCloseResetsInput={true} - openAfterFocus={false} optionComponent={[Function]} options={ Array [ diff --git a/server/sonar-web/src/main/js/apps/projects/filters/CoverageFilter.js b/server/sonar-web/src/main/js/apps/projects/filters/CoverageFilter.js index 277c59a4e1d..368069368ef 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/CoverageFilter.js +++ b/server/sonar-web/src/main/js/apps/projects/filters/CoverageFilter.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import FilterContainer from './FilterContainer'; import FilterHeader from './FilterHeader'; import CoverageRating from '../../../components/ui/CoverageRating'; @@ -26,11 +27,11 @@ import { translate } from '../../../helpers/l10n'; export default class CoverageFilter extends React.PureComponent { static propTypes = { - className: React.PropTypes.string, - query: React.PropTypes.object.isRequired, - isFavorite: React.PropTypes.bool, - organization: React.PropTypes.object, - property: React.PropTypes.string + className: PropTypes.string, + query: PropTypes.object.isRequired, + isFavorite: PropTypes.bool, + organization: PropTypes.object, + property: PropTypes.string }; static defaultProps = { diff --git a/server/sonar-web/src/main/js/apps/projects/filters/DuplicationsFilter.js b/server/sonar-web/src/main/js/apps/projects/filters/DuplicationsFilter.js index 5b9f30484c0..74ed1033c6d 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/DuplicationsFilter.js +++ b/server/sonar-web/src/main/js/apps/projects/filters/DuplicationsFilter.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import FilterContainer from './FilterContainer'; import FilterHeader from './FilterHeader'; import DuplicationsRating from '../../../components/ui/DuplicationsRating'; @@ -29,11 +30,11 @@ import { translate } from '../../../helpers/l10n'; export default class DuplicationsFilter extends React.PureComponent { static propTypes = { - className: React.PropTypes.string, - query: React.PropTypes.object.isRequired, - isFavorite: React.PropTypes.bool, - organization: React.PropTypes.object, - property: React.PropTypes.string + className: PropTypes.string, + query: PropTypes.object.isRequired, + isFavorite: PropTypes.bool, + organization: PropTypes.object, + property: PropTypes.string }; static defaultProps = { diff --git a/server/sonar-web/src/main/js/apps/projects/filters/Filter.js b/server/sonar-web/src/main/js/apps/projects/filters/Filter.js index 876eb1e7abf..a00b11ef2a3 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/Filter.js +++ b/server/sonar-web/src/main/js/apps/projects/filters/Filter.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import classNames from 'classnames'; import { Link } from 'react-router'; import { getFilterUrl } from './utils'; @@ -26,27 +27,27 @@ import { translate } from '../../../helpers/l10n'; export default class Filter extends React.PureComponent { static propTypes = { - property: React.PropTypes.string.isRequired, - className: React.PropTypes.string, - options: React.PropTypes.array.isRequired, - query: React.PropTypes.object.isRequired, - renderOption: React.PropTypes.func.isRequired, - - value: React.PropTypes.any, - facet: React.PropTypes.object, - maxFacetValue: React.PropTypes.number, - optionClassName: React.PropTypes.string, - isFavorite: React.PropTypes.bool, - organization: React.PropTypes.object, - - getFacetValueForOption: React.PropTypes.func, - - halfWidth: React.PropTypes.bool, - highlightUnder: React.PropTypes.number, - highlightUnderMax: React.PropTypes.number, - - header: React.PropTypes.object, - footer: React.PropTypes.object + property: PropTypes.string.isRequired, + className: PropTypes.string, + options: PropTypes.array.isRequired, + query: PropTypes.object.isRequired, + renderOption: PropTypes.func.isRequired, + + value: PropTypes.any, + facet: PropTypes.object, + maxFacetValue: PropTypes.number, + optionClassName: PropTypes.string, + isFavorite: PropTypes.bool, + organization: PropTypes.object, + + getFacetValueForOption: PropTypes.func, + + halfWidth: PropTypes.bool, + highlightUnder: PropTypes.number, + highlightUnderMax: PropTypes.number, + + header: PropTypes.object, + footer: PropTypes.object }; static defaultProps = { diff --git a/server/sonar-web/src/main/js/apps/projects/filters/IssuesFilter.js b/server/sonar-web/src/main/js/apps/projects/filters/IssuesFilter.js index 69d68a033ff..0d790a7b0c4 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/IssuesFilter.js +++ b/server/sonar-web/src/main/js/apps/projects/filters/IssuesFilter.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import FilterContainer from './FilterContainer'; import FilterHeader from './FilterHeader'; import Rating from '../../../components/ui/Rating'; @@ -25,13 +26,13 @@ import { translate } from '../../../helpers/l10n'; export default class IssuesFilter extends React.PureComponent { static propTypes = { - className: React.PropTypes.string, - headerDetail: React.PropTypes.element, - isFavorite: React.PropTypes.bool, - organization: React.PropTypes.object, - name: React.PropTypes.string.isRequired, - property: React.PropTypes.string.isRequired, - query: React.PropTypes.object.isRequired + className: PropTypes.string, + headerDetail: PropTypes.element, + isFavorite: PropTypes.bool, + organization: PropTypes.object, + name: PropTypes.string.isRequired, + property: PropTypes.string.isRequired, + query: PropTypes.object.isRequired }; getFacetValueForOption(facet, option) { diff --git a/server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.js b/server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.js index 3aa2f889cfc..d060e1259b7 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.js +++ b/server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import FilterContainer from './FilterContainer'; import FilterHeader from './FilterHeader'; import { translate } from '../../../helpers/l10n'; @@ -25,11 +26,11 @@ import { getSizeRatingLabel } from '../../../helpers/ratings'; export default class NewLinesFilter extends React.PureComponent { static propTypes = { - className: React.PropTypes.string, - query: React.PropTypes.object.isRequired, - isFavorite: React.PropTypes.bool, - organization: React.PropTypes.object, - property: React.PropTypes.string + className: PropTypes.string, + query: PropTypes.object.isRequired, + isFavorite: PropTypes.bool, + organization: PropTypes.object, + property: PropTypes.string }; static defaultProps = { diff --git a/server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.js b/server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.js index 348a3b199d6..825ccb8625d 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.js +++ b/server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import FilterContainer from './FilterContainer'; import FilterHeader from './FilterHeader'; import Level from '../../../components/ui/Level'; @@ -25,9 +26,9 @@ import { translate } from '../../../helpers/l10n'; export default class QualityGateFilter extends React.PureComponent { static propTypes = { - query: React.PropTypes.object.isRequired, - isFavorite: React.PropTypes.bool, - organization: React.PropTypes.object + query: PropTypes.object.isRequired, + isFavorite: PropTypes.bool, + organization: PropTypes.object }; getFacetValueForOption(facet, option) { diff --git a/server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterOption.js b/server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterOption.js index ed8877f6df5..99eff214d0c 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterOption.js +++ b/server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterOption.js @@ -18,12 +18,13 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import { translate } from '../../../helpers/l10n'; export default class SearchableFilterOption extends React.PureComponent { static propTypes = { - optionKey: React.PropTypes.string.isRequired, - option: React.PropTypes.object + optionKey: PropTypes.string.isRequired, + option: PropTypes.object }; render() { diff --git a/server/sonar-web/src/main/js/apps/projects/filters/SizeFilter.js b/server/sonar-web/src/main/js/apps/projects/filters/SizeFilter.js index ca46efe6c21..1677be82ff0 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/SizeFilter.js +++ b/server/sonar-web/src/main/js/apps/projects/filters/SizeFilter.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import FilterContainer from './FilterContainer'; import FilterHeader from './FilterHeader'; import SizeRating from '../../../components/ui/SizeRating'; @@ -26,11 +27,11 @@ import { getSizeRatingLabel, getSizeRatingAverageValue } from '../../../helpers/ export default class SizeFilter extends React.PureComponent { static propTypes = { - className: React.PropTypes.string, - query: React.PropTypes.object.isRequired, - isFavorite: React.PropTypes.bool, - organization: React.PropTypes.object, - property: React.PropTypes.string + className: PropTypes.string, + query: PropTypes.object.isRequired, + isFavorite: PropTypes.bool, + organization: PropTypes.object, + property: PropTypes.string }; static defaultProps = { diff --git a/server/sonar-web/src/main/js/apps/projects/filters/__tests__/__snapshots__/SearchableFilterFooter-test.js.snap b/server/sonar-web/src/main/js/apps/projects/filters/__tests__/__snapshots__/SearchableFilterFooter-test.js.snap index 59dc178ab24..b0346a32181 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/__tests__/__snapshots__/SearchableFilterFooter-test.js.snap +++ b/server/sonar-web/src/main/js/apps/projects/filters/__tests__/__snapshots__/SearchableFilterFooter-test.js.snap @@ -12,8 +12,10 @@ exports[`should render the languages without the ones in the facet 1`] = ` backspaceToRemoveMessage="Press backspace to remove {label}" className="input-super-large" clearAllText="Clear all" + clearRenderer={[Function]} clearValueText="Clear value" clearable={false} + deleteRemoves={true} delimiter="," disabled={false} escapeClearsValue={true} @@ -33,7 +35,6 @@ exports[`should render the languages without the ones in the facet 1`] = ` onBlurResetsInput={true} onChange={[Function]} onCloseResetsInput={true} - openAfterFocus={false} optionComponent={[Function]} options={ Array [ @@ -76,8 +77,10 @@ exports[`should render the tags without the ones in the facet 1`] = ` backspaceToRemoveMessage="Press backspace to remove {label}" className="input-super-large" clearAllText="Clear all" + clearRenderer={[Function]} clearValueText="Clear value" clearable={false} + deleteRemoves={true} delimiter="," disabled={false} escapeClearsValue={true} @@ -97,7 +100,6 @@ exports[`should render the tags without the ones in the facet 1`] = ` onBlurResetsInput={true} onChange={[Function]} onCloseResetsInput={true} - openAfterFocus={false} optionComponent={[Function]} options={ Array [ diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Details.js b/server/sonar-web/src/main/js/apps/quality-gates/components/Details.js index 8f52c7bbe69..4d9893fbff3 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/Details.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Details.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Helmet from 'react-helmet'; import { fetchQualityGate, @@ -132,5 +133,5 @@ export default class Details extends React.PureComponent { } Details.contextTypes = { - router: React.PropTypes.object.isRequired + router: PropTypes.object.isRequired }; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatesApp.js b/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatesApp.js index e197e6f0f83..1499f139787 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatesApp.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/QualityGatesApp.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import Helmet from 'react-helmet'; import ListHeader from './ListHeader'; import List from './List'; @@ -31,7 +32,7 @@ import '../styles.css'; export default class QualityGatesApp extends Component { static contextTypes = { - router: React.PropTypes.object.isRequired + router: PropTypes.object.isRequired }; state = {}; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/ThresholdInput.js b/server/sonar-web/src/main/js/apps/quality-gates/components/ThresholdInput.js index 4b8f6980975..e1c13626495 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/ThresholdInput.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/ThresholdInput.js @@ -18,14 +18,15 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Select from 'react-select'; export default class ThresholdInput extends React.PureComponent { static propTypes = { - name: React.PropTypes.string.isRequired, - value: React.PropTypes.any, - metric: React.PropTypes.object.isRequired, - onChange: React.PropTypes.func.isRequired + name: PropTypes.string.isRequired, + value: PropTypes.any, + metric: PropTypes.object.isRequired, + onChange: PropTypes.func.isRequired }; handleChange = e => { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogContainer.js b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogContainer.js index a8d4fea6593..d7088601445 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogContainer.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ChangelogContainer.js @@ -19,6 +19,7 @@ */ // @flow import React from 'react'; +import PropTypes from 'prop-types'; import Changelog from './Changelog'; import ChangelogSearch from './ChangelogSearch'; import ChangelogEmpty from './ChangelogEmpty'; @@ -50,7 +51,7 @@ export default class ChangelogContainer extends React.PureComponent { props: Props; static contextTypes = { - router: React.PropTypes.object + router: PropTypes.object }; state: State = { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonContainer.js b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonContainer.js index 24fba98b452..a7258bce199 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonContainer.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonContainer.js @@ -19,6 +19,7 @@ */ // @flow import React from 'react'; +import PropTypes from 'prop-types'; import ComparisonForm from './ComparisonForm'; import ComparisonResults from './ComparisonResults'; import { compareProfiles } from '../../../api/quality-profiles'; @@ -47,7 +48,7 @@ export default class ComparisonContainer extends React.PureComponent { state: State; static contextTypes = { - router: React.PropTypes.object + router: PropTypes.object }; constructor(props: Props) { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileActions.js b/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileActions.js index 3f1e42bd3da..723a283b51c 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileActions.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileActions.js @@ -19,6 +19,7 @@ */ // @flow import React from 'react'; +import PropTypes from 'prop-types'; import { Link } from 'react-router'; import RenameProfileForm from './RenameProfileForm'; import CopyProfileForm from './CopyProfileForm'; @@ -53,7 +54,7 @@ export default class ProfileActions extends React.PureComponent { }; static contextTypes = { - router: React.PropTypes.object + router: PropTypes.object }; constructor(props: Props) { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/PageHeader.js b/server/sonar-web/src/main/js/apps/quality-profiles/home/PageHeader.js index 44ce54b4555..734dbde494b 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/PageHeader.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/PageHeader.js @@ -19,6 +19,7 @@ */ // @flow import React from 'react'; +import PropTypes from 'prop-types'; import CreateProfileForm from './CreateProfileForm'; import RestoreProfileForm from './RestoreProfileForm'; import type { Profile } from '../propTypes'; @@ -42,7 +43,7 @@ export default class PageHeader extends React.PureComponent { props: Props; static contextTypes = { - router: React.PropTypes.object + router: PropTypes.object }; state: State = { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/propTypes.js b/server/sonar-web/src/main/js/apps/quality-profiles/propTypes.js index 12a872f056b..bdc59bbecc0 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/propTypes.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/propTypes.js @@ -18,9 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ // @flow -import { PropTypes } from 'react'; - -const { shape, string, number, bool, arrayOf } = PropTypes; +import { shape, string, number, bool, arrayOf } from 'prop-types'; export type Profile = { key: string, diff --git a/server/sonar-web/src/main/js/apps/sessions/components/LoginFormContainer.js b/server/sonar-web/src/main/js/apps/sessions/components/LoginFormContainer.js index 9208545732f..257f00a8259 100644 --- a/server/sonar-web/src/main/js/apps/sessions/components/LoginFormContainer.js +++ b/server/sonar-web/src/main/js/apps/sessions/components/LoginFormContainer.js @@ -19,6 +19,7 @@ */ // @flow import React from 'react'; +import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import LoginForm from './LoginForm'; import { doLogin } from '../../../store/rootActions'; @@ -29,7 +30,7 @@ class LoginFormContainer extends React.PureComponent { mounted: boolean; static propTypes = { - location: React.PropTypes.object.isRequired + location: PropTypes.object.isRequired }; state = {}; diff --git a/server/sonar-web/src/main/js/apps/sessions/components/Unauthorized.js b/server/sonar-web/src/main/js/apps/sessions/components/Unauthorized.js index 52f00e1b8f6..a8f98da3fd1 100644 --- a/server/sonar-web/src/main/js/apps/sessions/components/Unauthorized.js +++ b/server/sonar-web/src/main/js/apps/sessions/components/Unauthorized.js @@ -19,10 +19,11 @@ */ // @flow import React from 'react'; +import PropTypes from 'prop-types'; export default class Unauthorized extends React.PureComponent { static propTypes = { - location: React.PropTypes.object.isRequired + location: PropTypes.object.isRequired }; render() { diff --git a/server/sonar-web/src/main/js/apps/settings/components/Definition.js b/server/sonar-web/src/main/js/apps/settings/components/Definition.js index ec64d222cb4..9b613bc6d79 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/Definition.js +++ b/server/sonar-web/src/main/js/apps/settings/components/Definition.js @@ -19,6 +19,7 @@ */ // @flow import React from 'react'; +import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import classNames from 'classnames'; import Input from './inputs/Input'; @@ -46,17 +47,17 @@ class Definition extends React.PureComponent { timeout: number; static propTypes = { - component: React.PropTypes.object, - setting: React.PropTypes.object.isRequired, - changedValue: React.PropTypes.any, - loading: React.PropTypes.bool.isRequired, - validationMessage: React.PropTypes.string, - - changeValue: React.PropTypes.func.isRequired, - cancelChange: React.PropTypes.func.isRequired, - saveValue: React.PropTypes.func.isRequired, - resetValue: React.PropTypes.func.isRequired, - passValidation: React.PropTypes.func.isRequired + component: PropTypes.object, + setting: PropTypes.object.isRequired, + changedValue: PropTypes.any, + loading: PropTypes.bool.isRequired, + validationMessage: PropTypes.string, + + changeValue: PropTypes.func.isRequired, + cancelChange: PropTypes.func.isRequired, + saveValue: PropTypes.func.isRequired, + resetValue: PropTypes.func.isRequired, + passValidation: PropTypes.func.isRequired }; state = { diff --git a/server/sonar-web/src/main/js/apps/settings/components/DefinitionChanges.js b/server/sonar-web/src/main/js/apps/settings/components/DefinitionChanges.js index ef9c248ffd0..67545155421 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/DefinitionChanges.js +++ b/server/sonar-web/src/main/js/apps/settings/components/DefinitionChanges.js @@ -19,12 +19,13 @@ */ // @flow import React from 'react'; +import PropTypes from 'prop-types'; import { translate } from '../../../helpers/l10n'; export default class DefinitionChanges extends React.PureComponent { static propTypes = { - onSave: React.PropTypes.func.isRequired, - onCancel: React.PropTypes.func.isRequired + onSave: PropTypes.func.isRequired, + onCancel: PropTypes.func.isRequired }; handleSaveClick(e: Object) { diff --git a/server/sonar-web/src/main/js/apps/settings/components/DefinitionDefaults.js b/server/sonar-web/src/main/js/apps/settings/components/DefinitionDefaults.js index d686f9097db..01ef2658324 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/DefinitionDefaults.js +++ b/server/sonar-web/src/main/js/apps/settings/components/DefinitionDefaults.js @@ -19,14 +19,15 @@ */ // @flow import React from 'react'; +import PropTypes from 'prop-types'; import { getSettingValue, isEmptyValue, getDefaultValue } from '../utils'; import { translate } from '../../../helpers/l10n'; export default class DefinitionDefaults extends React.PureComponent { static propTypes = { - setting: React.PropTypes.object.isRequired, - isDefault: React.PropTypes.bool.isRequired, - onReset: React.PropTypes.func.isRequired + setting: PropTypes.object.isRequired, + isDefault: PropTypes.bool.isRequired, + onReset: PropTypes.func.isRequired }; handleReset(e: Object) { diff --git a/server/sonar-web/src/main/js/apps/settings/components/DefinitionsList.js b/server/sonar-web/src/main/js/apps/settings/components/DefinitionsList.js index 8a9399e2c8b..3df8d283c7d 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/DefinitionsList.js +++ b/server/sonar-web/src/main/js/apps/settings/components/DefinitionsList.js @@ -19,12 +19,13 @@ */ // @flow import React from 'react'; +import PropTypes from 'prop-types'; import Definition from './Definition'; export default class DefinitionsList extends React.PureComponent { static propTypes = { - component: React.PropTypes.object, - settings: React.PropTypes.array.isRequired + component: PropTypes.object, + settings: PropTypes.array.isRequired }; render() { diff --git a/server/sonar-web/src/main/js/apps/settings/components/PageHeader.js b/server/sonar-web/src/main/js/apps/settings/components/PageHeader.js index 44fc1f1976c..394b607a715 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/PageHeader.js +++ b/server/sonar-web/src/main/js/apps/settings/components/PageHeader.js @@ -19,11 +19,12 @@ */ // @flow import React from 'react'; +import PropTypes from 'prop-types'; import { translate } from '../../../helpers/l10n'; export default class PageHeader extends React.PureComponent { static propTypes = { - component: React.PropTypes.object + component: PropTypes.object }; render() { diff --git a/server/sonar-web/src/main/js/apps/settings/components/SubCategoryDefinitionsList.js b/server/sonar-web/src/main/js/apps/settings/components/SubCategoryDefinitionsList.js index 51186fde3b8..532a03ba4b1 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/SubCategoryDefinitionsList.js +++ b/server/sonar-web/src/main/js/apps/settings/components/SubCategoryDefinitionsList.js @@ -19,6 +19,7 @@ */ // @flow import React from 'react'; +import PropTypes from 'prop-types'; import { groupBy, sortBy } from 'lodash'; import DefinitionsList from './DefinitionsList'; import EmailForm from './EmailForm'; @@ -26,8 +27,8 @@ import { getSubCategoryName, getSubCategoryDescription } from '../utils'; export default class SubCategoryDefinitionsList extends React.PureComponent { static propTypes = { - component: React.PropTypes.object, - settings: React.PropTypes.array.isRequired + component: PropTypes.object, + settings: PropTypes.array.isRequired }; renderEmailForm(subCategoryKey: string) { diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/Input.js b/server/sonar-web/src/main/js/apps/settings/components/inputs/Input.js index ac0e51a76b6..1a1b8d7cb56 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/inputs/Input.js +++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/Input.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import PropertySetInput from './PropertySetInput'; import MultiValueInput from './MultiValueInput'; import PrimitiveInput from './PrimitiveInput'; @@ -25,9 +26,9 @@ import { TYPE_PROPERTY_SET } from '../../constants'; export default class Input extends React.PureComponent { static propTypes = { - setting: React.PropTypes.object.isRequired, - value: React.PropTypes.any, - onChange: React.PropTypes.func.isRequired + setting: PropTypes.object.isRequired, + value: PropTypes.any, + onChange: PropTypes.func.isRequired }; render() { diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForBoolean.js b/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForBoolean.js index 66794971de7..fa95e12b7b1 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForBoolean.js +++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForBoolean.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Toggle from '../../../../components/controls/Toggle'; import { defaultInputPropTypes } from '../../propTypes'; import { translate } from '../../../../helpers/l10n'; @@ -25,7 +26,7 @@ import { translate } from '../../../../helpers/l10n'; export default class InputForBoolean extends React.PureComponent { static propTypes = { ...defaultInputPropTypes, - value: React.PropTypes.oneOfType([React.PropTypes.bool, React.PropTypes.string]) + value: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]) }; render() { diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForSingleSelectList.js b/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForSingleSelectList.js index 06de1ca1c58..c6c62a38651 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForSingleSelectList.js +++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForSingleSelectList.js @@ -18,13 +18,14 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Select from 'react-select'; import { defaultInputPropTypes } from '../../propTypes'; export default class InputForSingleSelectList extends React.PureComponent { static propTypes = { ...defaultInputPropTypes, - options: React.PropTypes.arrayOf(React.PropTypes.string).isRequired + options: PropTypes.arrayOf(PropTypes.string).isRequired }; handleInputChange(option) { diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/MultiValueInput.js b/server/sonar-web/src/main/js/apps/settings/components/inputs/MultiValueInput.js index a5346068192..668f9fe5720 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/inputs/MultiValueInput.js +++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/MultiValueInput.js @@ -18,14 +18,15 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import PrimitiveInput from './PrimitiveInput'; import { getEmptyValue } from '../../utils'; export default class MultiValueInput extends React.PureComponent { static propTypes = { - setting: React.PropTypes.object.isRequired, - value: React.PropTypes.array, - onChange: React.PropTypes.func.isRequired + setting: PropTypes.object.isRequired, + value: PropTypes.array, + onChange: PropTypes.func.isRequired }; ensureValue() { diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/PrimitiveInput.js b/server/sonar-web/src/main/js/apps/settings/components/inputs/PrimitiveInput.js index 3f39350f7b6..fc8f48de793 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/inputs/PrimitiveInput.js +++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/PrimitiveInput.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import InputForString from './InputForString'; import InputForText from './InputForText'; import InputForPassword from './InputForPassword'; @@ -39,9 +40,9 @@ const typeMapping = { export default class PrimitiveInput extends React.PureComponent { static propTypes = { - setting: React.PropTypes.object.isRequired, - value: React.PropTypes.any, - onChange: React.PropTypes.func.isRequired + setting: PropTypes.object.isRequired, + value: PropTypes.any, + onChange: PropTypes.func.isRequired }; render() { diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/PropertySetInput.js b/server/sonar-web/src/main/js/apps/settings/components/inputs/PropertySetInput.js index 8a48eede7f9..a77603fb388 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/inputs/PropertySetInput.js +++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/PropertySetInput.js @@ -18,14 +18,15 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import PrimitiveInput from './PrimitiveInput'; import { getEmptyValue, getUniqueName } from '../../utils'; export default class PropertySetInput extends React.PureComponent { static propTypes = { - setting: React.PropTypes.object.isRequired, - value: React.PropTypes.array, - onChange: React.PropTypes.func.isRequired + setting: PropTypes.object.isRequired, + value: PropTypes.array, + onChange: PropTypes.func.isRequired }; ensureValue() { diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/SimpleInput.js b/server/sonar-web/src/main/js/apps/settings/components/inputs/SimpleInput.js index 0b0164407a3..b628f69c7e6 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/inputs/SimpleInput.js +++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/SimpleInput.js @@ -18,14 +18,15 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import { defaultInputPropTypes } from '../../propTypes'; export default class SimpleInput extends React.PureComponent { static propTypes = { ...defaultInputPropTypes, - value: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.number]), - type: React.PropTypes.string.isRequired, - className: React.PropTypes.string.isRequired + value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + type: PropTypes.string.isRequired, + className: PropTypes.string.isRequired }; handleInputChange(e) { diff --git a/server/sonar-web/src/main/js/apps/settings/encryption/EncryptionApp.js b/server/sonar-web/src/main/js/apps/settings/encryption/EncryptionApp.js index 9b769007425..e9f59b8c2df 100644 --- a/server/sonar-web/src/main/js/apps/settings/encryption/EncryptionApp.js +++ b/server/sonar-web/src/main/js/apps/settings/encryption/EncryptionApp.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Helmet from 'react-helmet'; import GenerateSecretKeyForm from './GenerateSecretKeyForm'; import EncryptionForm from './EncryptionForm'; @@ -25,15 +26,15 @@ import { translate } from '../../../helpers/l10n'; export default class EncryptionApp extends React.PureComponent { static propTypes = { - loading: React.PropTypes.bool.isRequired, - secretKeyAvailable: React.PropTypes.bool, - secretKey: React.PropTypes.string, - encryptedValue: React.PropTypes.string, + loading: PropTypes.bool.isRequired, + secretKeyAvailable: PropTypes.bool, + secretKey: PropTypes.string, + encryptedValue: PropTypes.string, - checkSecretKey: React.PropTypes.func.isRequired, - generateSecretKey: React.PropTypes.func.isRequired, - encryptValue: React.PropTypes.func.isRequired, - startGeneration: React.PropTypes.func.isRequired + checkSecretKey: PropTypes.func.isRequired, + generateSecretKey: PropTypes.func.isRequired, + encryptValue: PropTypes.func.isRequired, + startGeneration: PropTypes.func.isRequired }; componentDidMount() { diff --git a/server/sonar-web/src/main/js/apps/settings/encryption/EncryptionForm.js b/server/sonar-web/src/main/js/apps/settings/encryption/EncryptionForm.js index 544c19fa45c..c3301970686 100644 --- a/server/sonar-web/src/main/js/apps/settings/encryption/EncryptionForm.js +++ b/server/sonar-web/src/main/js/apps/settings/encryption/EncryptionForm.js @@ -18,12 +18,13 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; export default class EncryptionForm extends React.PureComponent { static propTypes = { - encryptedValue: React.PropTypes.string, - encryptValue: React.PropTypes.func.isRequired, - generateSecretKey: React.PropTypes.func.isRequired + encryptedValue: PropTypes.string, + encryptValue: PropTypes.func.isRequired, + generateSecretKey: PropTypes.func.isRequired }; state = { value: '' }; diff --git a/server/sonar-web/src/main/js/apps/settings/encryption/GenerateSecretKeyForm.js b/server/sonar-web/src/main/js/apps/settings/encryption/GenerateSecretKeyForm.js index f6ae735d4eb..79166acc968 100644 --- a/server/sonar-web/src/main/js/apps/settings/encryption/GenerateSecretKeyForm.js +++ b/server/sonar-web/src/main/js/apps/settings/encryption/GenerateSecretKeyForm.js @@ -18,11 +18,12 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; export default class GenerateSecretKeyForm extends React.PureComponent { static propTypes = { - secretKey: React.PropTypes.string, - generateSecretKey: React.PropTypes.func.isRequired + secretKey: PropTypes.string, + generateSecretKey: PropTypes.func.isRequired }; handleSubmit(e) { diff --git a/server/sonar-web/src/main/js/apps/settings/licenses/LicenseChangeForm.js b/server/sonar-web/src/main/js/apps/settings/licenses/LicenseChangeForm.js index b9b6c56b737..36fa5ff8a70 100644 --- a/server/sonar-web/src/main/js/apps/settings/licenses/LicenseChangeForm.js +++ b/server/sonar-web/src/main/js/apps/settings/licenses/LicenseChangeForm.js @@ -18,13 +18,14 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Modal from 'react-modal'; import { translate, translateWithParameters } from '../../../helpers/l10n'; export default class LicenseChangeForm extends React.PureComponent { static propTypes = { - license: React.PropTypes.object.isRequired, - onChange: React.PropTypes.func.isRequired + license: PropTypes.object.isRequired, + onChange: PropTypes.func.isRequired }; state = { diff --git a/server/sonar-web/src/main/js/apps/settings/licenses/LicenseRow.js b/server/sonar-web/src/main/js/apps/settings/licenses/LicenseRow.js index 277d8a4c636..f8ef6d4c7f0 100644 --- a/server/sonar-web/src/main/js/apps/settings/licenses/LicenseRow.js +++ b/server/sonar-web/src/main/js/apps/settings/licenses/LicenseRow.js @@ -18,14 +18,15 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import moment from 'moment'; import LicenseStatus from './LicenseStatus'; import LicenseChangeForm from './LicenseChangeForm'; export default class LicenseRow extends React.PureComponent { static propTypes = { - license: React.PropTypes.object.isRequired, - setLicense: React.PropTypes.func.isRequired + license: PropTypes.object.isRequired, + setLicense: PropTypes.func.isRequired }; handleSet = value => this.props.setLicense(this.props.license.key, value); diff --git a/server/sonar-web/src/main/js/apps/settings/licenses/LicenseStatus.js b/server/sonar-web/src/main/js/apps/settings/licenses/LicenseStatus.js index 086fb5f4eb0..5f77eeeb718 100644 --- a/server/sonar-web/src/main/js/apps/settings/licenses/LicenseStatus.js +++ b/server/sonar-web/src/main/js/apps/settings/licenses/LicenseStatus.js @@ -18,11 +18,12 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import { isLicenseInvalid } from './licenseUtils'; export default class LicenseStatus extends React.PureComponent { static propTypes = { - license: React.PropTypes.object.isRequired + license: PropTypes.object.isRequired }; render() { diff --git a/server/sonar-web/src/main/js/apps/settings/licenses/LicensesList.js b/server/sonar-web/src/main/js/apps/settings/licenses/LicensesList.js index 9104cd830ee..91fcdcb1889 100644 --- a/server/sonar-web/src/main/js/apps/settings/licenses/LicensesList.js +++ b/server/sonar-web/src/main/js/apps/settings/licenses/LicensesList.js @@ -18,13 +18,14 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import LicenseRowContainer from './LicenseRowContainer'; import { translate } from '../../../helpers/l10n'; export default class LicensesList extends React.PureComponent { static propTypes = { - licenses: React.PropTypes.array.isRequired, - fetchLicenses: React.PropTypes.func.isRequired + licenses: PropTypes.array.isRequired, + fetchLicenses: PropTypes.func.isRequired }; componentDidMount() { diff --git a/server/sonar-web/src/main/js/apps/settings/propTypes.js b/server/sonar-web/src/main/js/apps/settings/propTypes.js index 871b3301c02..e6284a0d86b 100644 --- a/server/sonar-web/src/main/js/apps/settings/propTypes.js +++ b/server/sonar-web/src/main/js/apps/settings/propTypes.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { PropTypes } from 'react'; +import PropTypes from 'prop-types'; export const defaultInputPropTypes = { name: PropTypes.string.isRequired, diff --git a/server/sonar-web/src/main/js/apps/settings/serverId/ServerIdApp.js b/server/sonar-web/src/main/js/apps/settings/serverId/ServerIdApp.js index ef2ded655bc..a6adaec83b9 100644 --- a/server/sonar-web/src/main/js/apps/settings/serverId/ServerIdApp.js +++ b/server/sonar-web/src/main/js/apps/settings/serverId/ServerIdApp.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Helmet from 'react-helmet'; import { translate } from '../../../helpers/l10n'; import { getServerId, generateServerId } from '../../../api/settings'; @@ -25,8 +26,8 @@ import { parseError } from '../../code/utils'; export default class ServerIdApp extends React.PureComponent { static propTypes = { - addGlobalErrorMessage: React.PropTypes.func.isRequired, - closeAllGlobalMessages: React.PropTypes.func.isRequired + addGlobalErrorMessage: PropTypes.func.isRequired, + closeAllGlobalMessages: PropTypes.func.isRequired }; state = { diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/Onboarding.js b/server/sonar-web/src/main/js/apps/tutorials/onboarding/Onboarding.js index b648f3a5197..4d3cc475152 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/Onboarding.js +++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/Onboarding.js @@ -19,6 +19,7 @@ */ // @flow import React from 'react'; +import PropTypes from 'prop-types'; import Helmet from 'react-helmet'; import TokenStep from './TokenStep'; import OrganizationStep from './OrganizationStep'; @@ -52,7 +53,7 @@ export default class Onboarding extends React.PureComponent { state: State; static contextTypes = { - router: React.PropTypes.object + router: PropTypes.object }; constructor(props: Props) { diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/__tests__/__snapshots__/Onboarding-test.js.snap b/server/sonar-web/src/main/js/apps/tutorials/onboarding/__tests__/__snapshots__/Onboarding-test.js.snap index 5e9291b6c85..74b2721d7b0 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/__tests__/__snapshots__/Onboarding-test.js.snap +++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/__tests__/__snapshots__/Onboarding-test.js.snap @@ -5,6 +5,7 @@ exports[`guides for on-premise 1`] = ` className="modal-container" > <HelmetWrapper + encodeSpecialCharacters={true} title="onboarding.header" titleTemplate="%s" /> @@ -59,6 +60,7 @@ exports[`guides for on-premise 2`] = ` className="modal-container" > <HelmetWrapper + encodeSpecialCharacters={true} title="onboarding.header" titleTemplate="%s" /> @@ -114,6 +116,7 @@ exports[`guides for sonarcloud 1`] = ` className="modal-container" > <HelmetWrapper + encodeSpecialCharacters={true} title="onboarding.header.sonarcloud" titleTemplate="%s" /> @@ -181,6 +184,7 @@ exports[`guides for sonarcloud 2`] = ` className="modal-container" > <HelmetWrapper + encodeSpecialCharacters={true} title="onboarding.header.sonarcloud" titleTemplate="%s" /> @@ -249,6 +253,7 @@ exports[`guides for sonarcloud 3`] = ` className="modal-container" > <HelmetWrapper + encodeSpecialCharacters={true} title="onboarding.header.sonarcloud" titleTemplate="%s" /> diff --git a/server/sonar-web/src/main/js/apps/users/components/UsersAppContainer.js b/server/sonar-web/src/main/js/apps/users/components/UsersAppContainer.js index d70383fd891..3dae41946b2 100644 --- a/server/sonar-web/src/main/js/apps/users/components/UsersAppContainer.js +++ b/server/sonar-web/src/main/js/apps/users/components/UsersAppContainer.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; import Helmet from 'react-helmet'; import { connect } from 'react-redux'; import init from '../init'; @@ -26,7 +27,7 @@ import { translate } from '../../../helpers/l10n'; class UsersAppContainer extends React.PureComponent { static propTypes = { - currentUser: React.PropTypes.object.isRequired + currentUser: PropTypes.object.isRequired }; componentDidMount() { diff --git a/server/sonar-web/src/main/js/apps/users/components/__tests__/__snapshots__/UsersSelectSearch-test.js.snap b/server/sonar-web/src/main/js/apps/users/components/__tests__/__snapshots__/UsersSelectSearch-test.js.snap index 23e19035a29..483f49d3ea0 100644 --- a/server/sonar-web/src/main/js/apps/users/components/__tests__/__snapshots__/UsersSelectSearch-test.js.snap +++ b/server/sonar-web/src/main/js/apps/users/components/__tests__/__snapshots__/UsersSelectSearch-test.js.snap @@ -9,8 +9,10 @@ exports[`should render correctly 1`] = ` backspaceToRemoveMessage="Press backspace to remove {label}" className="Select-big" clearAllText="Clear all" + clearRenderer={[Function]} clearValueText="Clear value" clearable={false} + deleteRemoves={true} delimiter="," disabled={false} escapeClearsValue={true} @@ -31,7 +33,6 @@ exports[`should render correctly 1`] = ` onChange={[Function]} onCloseResetsInput={true} onInputChange={[Function]} - openAfterFocus={false} optionComponent={[Function]} options={Array []} pageSize={5} @@ -77,8 +78,10 @@ exports[`should render correctly 3`] = ` backspaceToRemoveMessage="Press backspace to remove {label}" className="Select-big" clearAllText="Clear all" + clearRenderer={[Function]} clearValueText="Clear value" clearable={false} + deleteRemoves={true} delimiter="," disabled={false} escapeClearsValue={true} @@ -99,7 +102,6 @@ exports[`should render correctly 3`] = ` onChange={[Function]} onCloseResetsInput={true} onInputChange={[Function]} - openAfterFocus={false} optionComponent={[Function]} options={ Array [ diff --git a/server/sonar-web/src/main/js/apps/web-api/components/WebApiApp.js b/server/sonar-web/src/main/js/apps/web-api/components/WebApiApp.js index a6dd2212369..ecd167948dc 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/WebApiApp.js +++ b/server/sonar-web/src/main/js/apps/web-api/components/WebApiApp.js @@ -19,6 +19,7 @@ */ // @flow import React from 'react'; +import PropTypes from 'prop-types'; import Helmet from 'react-helmet'; import { Link } from 'react-router'; import { fetchWebApi } from '../../../api/web-api'; @@ -187,5 +188,5 @@ export default class WebApiApp extends React.PureComponent { } WebApiApp.contextTypes = { - router: React.PropTypes.object.isRequired + router: PropTypes.object.isRequired }; |