diff options
Diffstat (limited to 'server/sonar-web/src')
154 files changed, 669 insertions, 495 deletions
diff --git a/server/sonar-web/src/main/js/app/components/App.js b/server/sonar-web/src/main/js/app/components/App.js index ea68bd92461..21b2e7e6f96 100644 --- a/server/sonar-web/src/main/js/app/components/App.js +++ b/server/sonar-web/src/main/js/app/components/App.js @@ -19,6 +19,7 @@ */ // @flow import React from 'react'; +import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import GlobalLoading from './GlobalLoading'; import { fetchCurrentUser } from '../../store/users/actions'; @@ -28,10 +29,10 @@ class App extends React.PureComponent { mounted: boolean; static propTypes = { - fetchAppState: React.PropTypes.func.isRequired, - fetchCurrentUser: React.PropTypes.func.isRequired, - fetchLanguages: React.PropTypes.func.isRequired, - children: React.PropTypes.element.isRequired + fetchAppState: PropTypes.func.isRequired, + fetchCurrentUser: PropTypes.func.isRequired, + fetchLanguages: PropTypes.func.isRequired, + children: PropTypes.element.isRequired }; state = { diff --git a/server/sonar-web/src/main/js/app/components/Landing.js b/server/sonar-web/src/main/js/app/components/Landing.js index 9cd07a0d4ba..2d69e4686ca 100644 --- a/server/sonar-web/src/main/js/app/components/Landing.js +++ b/server/sonar-web/src/main/js/app/components/Landing.js @@ -19,14 +19,14 @@ */ // @flow import React from 'react'; +import PropTypes from 'prop-types'; import { withRouter } from 'react-router'; import { connect } from 'react-redux'; import { getCurrentUser } from '../../store/rootReducer'; class Landing extends React.PureComponent { static propTypes = { - currentUser: React.PropTypes.oneOfType([React.PropTypes.bool, React.PropTypes.object]) - .isRequired + currentUser: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]).isRequired }; componentDidMount() { diff --git a/server/sonar-web/src/main/js/app/components/help/__tests__/__snapshots__/GlobalHelp-test.js.snap b/server/sonar-web/src/main/js/app/components/help/__tests__/__snapshots__/GlobalHelp-test.js.snap index 37587136dbb..e9a2ed0ec03 100644 --- a/server/sonar-web/src/main/js/app/components/help/__tests__/__snapshots__/GlobalHelp-test.js.snap +++ b/server/sonar-web/src/main/js/app/components/help/__tests__/__snapshots__/GlobalHelp-test.js.snap @@ -3,6 +3,7 @@ exports[`does not show tutorials for anonymous 1`] = ` <Modal ariaHideApp={true} + bodyOpenClassName="ReactModal__Body--open" className="modal modal-medium" closeTimeoutMS={0} contentLabel="help" diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBreadcrumbs.js b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBreadcrumbs.js index c7f17f3a9cd..f584506a493 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBreadcrumbs.js +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBreadcrumbs.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 { Link } from 'react-router'; import QualifierIcon from '../../../../components/shared/QualifierIcon'; @@ -29,9 +30,9 @@ import { collapsePath, limitComponentName } from '../../../../helpers/path'; class ComponentNavBreadcrumbs extends React.PureComponent { static propTypes = { - breadcrumbs: React.PropTypes.array, - component: React.PropTypes.shape({ - visibility: React.PropTypes.string + breadcrumbs: PropTypes.array, + component: PropTypes.shape({ + visibility: PropTypes.string }).isRequired }; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavFavorite.js b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavFavorite.js index 6b3fd012d28..9d6c59c000b 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavFavorite.js +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavFavorite.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 { connect } from 'react-redux'; import Favorite from '../../../../components/controls/Favorite'; import { getCurrentUser } from '../../../../store/rootReducer'; class ComponentNavFavorite extends React.PureComponent { static propTypes = { - currentUser: React.PropTypes.object.isRequired + currentUser: PropTypes.object.isRequired }; render() { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMenu.js b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMenu.js index c484fa2b50c..b77945b4d47 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMenu.js +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMenu.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 classNames from 'classnames'; import NavBarTabs from '../../../../components/nav/NavBarTabs'; @@ -39,8 +40,8 @@ const SETTINGS_URLS = [ export default class ComponentNavMenu extends React.PureComponent { static propTypes = { - component: React.PropTypes.object.isRequired, - conf: React.PropTypes.object.isRequired + component: PropTypes.object.isRequired, + conf: PropTypes.object.isRequired }; isProject() { diff --git a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavBranding.js b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavBranding.js index 968a9d109eb..55237996772 100644 --- a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavBranding.js +++ b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavBranding.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 { connect } from 'react-redux'; import { getSettingValue, getCurrentUser } from '../../../../store/rootReducer'; @@ -25,8 +26,8 @@ import { translate } from '../../../../helpers/l10n'; class GlobalNavBranding extends React.PureComponent { static propTypes = { - customLogoUrl: React.PropTypes.string, - customLogoWidth: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.number]) + customLogoUrl: PropTypes.string, + customLogoWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]) }; renderLogo() { diff --git a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.js b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.js index 7d7437238bf..89053dedf89 100644 --- a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.js +++ b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.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 { translate } from '../../../../helpers/l10n'; import { getQualityGatesUrl } from '../../../../helpers/urls'; @@ -25,10 +26,10 @@ import { isMySet } from '../../../../apps/issues/utils'; export default class GlobalNavMenu extends React.PureComponent { static propTypes = { - appState: React.PropTypes.object.isRequired, - currentUser: React.PropTypes.object.isRequired, - location: React.PropTypes.shape({ - pathname: React.PropTypes.string.isRequired + appState: PropTypes.object.isRequired, + currentUser: PropTypes.object.isRequired, + location: PropTypes.shape({ + pathname: PropTypes.string.isRequired }).isRequired }; diff --git a/server/sonar-web/src/main/js/app/components/search/Search.js b/server/sonar-web/src/main/js/app/components/search/Search.js index 808614922d1..fff7cdd5011 100644 --- a/server/sonar-web/src/main/js/app/components/search/Search.js +++ b/server/sonar-web/src/main/js/app/components/search/Search.js @@ -19,6 +19,7 @@ */ // @flow import React from 'react'; +import PropTypes from 'prop-types'; import classNames from 'classnames'; import key from 'keymaster'; import { debounce, keyBy, uniqBy } from 'lodash'; @@ -62,7 +63,7 @@ export default class Search 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/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 }; diff --git a/server/sonar-web/src/main/js/components/charts/LanguageDistribution.js b/server/sonar-web/src/main/js/components/charts/LanguageDistribution.js index d6fb2024693..696ad6c6e24 100644 --- a/server/sonar-web/src/main/js/components/charts/LanguageDistribution.js +++ b/server/sonar-web/src/main/js/components/charts/LanguageDistribution.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { find, sortBy } from 'lodash'; +import PropTypes from 'prop-types'; import React from 'react'; import { Histogram } from './histogram'; import { formatMeasure } from '../../helpers/measures'; @@ -26,7 +27,7 @@ import { translate } from '../../helpers/l10n'; export default class LanguageDistribution extends React.PureComponent { static propTypes = { - distribution: React.PropTypes.string.isRequired + distribution: PropTypes.string.isRequired }; state = {}; diff --git a/server/sonar-web/src/main/js/components/charts/Timeline.js b/server/sonar-web/src/main/js/components/charts/Timeline.js index f8c5568df02..0896127d099 100644 --- a/server/sonar-web/src/main/js/components/charts/Timeline.js +++ b/server/sonar-web/src/main/js/components/charts/Timeline.js @@ -19,19 +19,23 @@ */ import $ from 'jquery'; import moment from 'moment'; +import PropTypes from 'prop-types'; import React from 'react'; +import createReactClass from 'create-react-class'; import { extent, max } from 'd3-array'; import { scaleLinear, scalePoint, scaleTime } from 'd3-scale'; import { line as d3Line, curveBasis } from 'd3-shape'; import { ResizeMixin } from '../mixins/resize-mixin'; import { TooltipsMixin } from '../mixins/tooltips-mixin'; -const Timeline = React.createClass({ +const Timeline = createReactClass({ + displayName: 'Timeline', + propTypes: { - data: React.PropTypes.arrayOf(React.PropTypes.object).isRequired, - padding: React.PropTypes.arrayOf(React.PropTypes.number), - height: React.PropTypes.number, - basisCurve: React.PropTypes.bool + data: PropTypes.arrayOf(PropTypes.object).isRequired, + padding: PropTypes.arrayOf(PropTypes.number), + height: PropTypes.number, + basisCurve: PropTypes.bool }, mixins: [ResizeMixin, TooltipsMixin], @@ -205,6 +209,7 @@ const Timeline = React.createClass({ </g> ); }, + render() { if (!this.state.width || !this.state.height) { return <div />; diff --git a/server/sonar-web/src/main/js/components/charts/bar-chart.js b/server/sonar-web/src/main/js/components/charts/bar-chart.js index 1d89adb5475..37e847d580d 100644 --- a/server/sonar-web/src/main/js/components/charts/bar-chart.js +++ b/server/sonar-web/src/main/js/components/charts/bar-chart.js @@ -18,20 +18,24 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import createReactClass from 'create-react-class'; +import PropTypes from 'prop-types'; import { max } from 'd3-array'; import { scaleLinear, scaleBand } from 'd3-scale'; import { ResizeMixin } from './../mixins/resize-mixin'; import { TooltipsContainer } from './../mixins/tooltips-mixin'; -export const BarChart = React.createClass({ +export const BarChart = createReactClass({ + displayName: 'BarChart', + propTypes: { - data: React.PropTypes.arrayOf(React.PropTypes.object).isRequired, - xTicks: React.PropTypes.arrayOf(React.PropTypes.any), - xValues: React.PropTypes.arrayOf(React.PropTypes.any), - height: React.PropTypes.number, - padding: React.PropTypes.arrayOf(React.PropTypes.number), - barsWidth: React.PropTypes.number.isRequired, - onBarClick: React.PropTypes.func + data: PropTypes.arrayOf(PropTypes.object).isRequired, + xTicks: PropTypes.arrayOf(PropTypes.any), + xValues: PropTypes.arrayOf(PropTypes.any), + height: PropTypes.number, + padding: PropTypes.arrayOf(PropTypes.number), + barsWidth: PropTypes.number.isRequired, + onBarClick: PropTypes.func }, mixins: [ResizeMixin], diff --git a/server/sonar-web/src/main/js/components/charts/donut-chart.js b/server/sonar-web/src/main/js/components/charts/donut-chart.js index a55a243a72f..9acec66a199 100644 --- a/server/sonar-web/src/main/js/components/charts/donut-chart.js +++ b/server/sonar-web/src/main/js/components/charts/donut-chart.js @@ -18,22 +18,22 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import createReactClass from 'create-react-class'; +import PropTypes from 'prop-types'; import { arc as d3Arc, pie as d3Pie } from 'd3-shape'; import { ResizeMixin } from './../mixins/resize-mixin'; import { TooltipsMixin } from './../mixins/tooltips-mixin'; -const Sector = React.createClass({ - render() { - const arc = d3Arc() - .outerRadius(this.props.radius) - .innerRadius(this.props.radius - this.props.thickness); - return <path d={arc(this.props.data)} style={{ fill: this.props.fill }} />; - } -}); +function Sector(props) { + const arc = d3Arc().outerRadius(props.radius).innerRadius(props.radius - props.thickness); + return <path d={arc(props.data)} style={{ fill: props.fill }} />; +} + +export const DonutChart = createReactClass({ + displayName: 'DonutChart', -export const DonutChart = React.createClass({ propTypes: { - data: React.PropTypes.arrayOf(React.PropTypes.object).isRequired + data: PropTypes.arrayOf(PropTypes.object).isRequired }, mixins: [ResizeMixin, TooltipsMixin], diff --git a/server/sonar-web/src/main/js/components/charts/histogram.js b/server/sonar-web/src/main/js/components/charts/histogram.js index c7542b3a0de..b6fdeb7b6c5 100644 --- a/server/sonar-web/src/main/js/components/charts/histogram.js +++ b/server/sonar-web/src/main/js/components/charts/histogram.js @@ -18,21 +18,25 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import createReactClass from 'create-react-class'; +import PropTypes from 'prop-types'; import { max } from 'd3-array'; import { scaleLinear, scaleBand } from 'd3-scale'; import { ResizeMixin } from './../mixins/resize-mixin'; import { TooltipsMixin } from './../mixins/tooltips-mixin'; -export const Histogram = React.createClass({ +export const Histogram = createReactClass({ + displayName: 'Histogram', + propTypes: { - data: React.PropTypes.arrayOf(React.PropTypes.object).isRequired, - yTicks: React.PropTypes.arrayOf(React.PropTypes.any), - yValues: React.PropTypes.arrayOf(React.PropTypes.any), - width: React.PropTypes.number, - height: React.PropTypes.number, - padding: React.PropTypes.arrayOf(React.PropTypes.number), - barsHeight: React.PropTypes.number, - onBarClick: React.PropTypes.func + data: PropTypes.arrayOf(PropTypes.object).isRequired, + yTicks: PropTypes.arrayOf(PropTypes.any), + yValues: PropTypes.arrayOf(PropTypes.any), + width: PropTypes.number, + height: PropTypes.number, + padding: PropTypes.arrayOf(PropTypes.number), + barsHeight: PropTypes.number, + onBarClick: PropTypes.func }, mixins: [ResizeMixin, TooltipsMixin], diff --git a/server/sonar-web/src/main/js/components/charts/line-chart.js b/server/sonar-web/src/main/js/components/charts/line-chart.js index 1b574db1216..ea56aa7e6ca 100644 --- a/server/sonar-web/src/main/js/components/charts/line-chart.js +++ b/server/sonar-web/src/main/js/components/charts/line-chart.js @@ -18,23 +18,27 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import createReactClass from 'create-react-class'; +import PropTypes from 'prop-types'; import { extent, max } from 'd3-array'; import { scaleLinear } from 'd3-scale'; import { area as d3Area, line as d3Line, curveBasis } from 'd3-shape'; import { ResizeMixin } from './../mixins/resize-mixin'; import { TooltipsMixin } from './../mixins/tooltips-mixin'; -export const LineChart = React.createClass({ +export const LineChart = createReactClass({ + displayName: 'LineChart', + propTypes: { - data: React.PropTypes.arrayOf(React.PropTypes.object).isRequired, - xTicks: React.PropTypes.arrayOf(React.PropTypes.any), - xValues: React.PropTypes.arrayOf(React.PropTypes.any), - padding: React.PropTypes.arrayOf(React.PropTypes.number), - backdropConstraints: React.PropTypes.arrayOf(React.PropTypes.number), - displayBackdrop: React.PropTypes.bool, - displayPoints: React.PropTypes.bool, - displayVerticalGrid: React.PropTypes.bool, - height: React.PropTypes.number + data: PropTypes.arrayOf(PropTypes.object).isRequired, + xTicks: PropTypes.arrayOf(PropTypes.any), + xValues: PropTypes.arrayOf(PropTypes.any), + padding: PropTypes.arrayOf(PropTypes.number), + backdropConstraints: PropTypes.arrayOf(PropTypes.number), + displayBackdrop: PropTypes.bool, + displayPoints: PropTypes.bool, + displayVerticalGrid: PropTypes.bool, + height: PropTypes.number }, mixins: [ResizeMixin, TooltipsMixin], diff --git a/server/sonar-web/src/main/js/components/charts/treemap-breadcrumbs.js b/server/sonar-web/src/main/js/components/charts/treemap-breadcrumbs.js index 3e23cb080ac..8ed3536a9d6 100644 --- a/server/sonar-web/src/main/js/components/charts/treemap-breadcrumbs.js +++ b/server/sonar-web/src/main/js/components/charts/treemap-breadcrumbs.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 QualifierIcon from '../shared/QualifierIcon'; export class TreemapBreadcrumbs extends React.PureComponent { static propTypes = { - breadcrumbs: React.PropTypes.arrayOf( - React.PropTypes.shape({ - key: React.PropTypes.string.isRequired, - name: React.PropTypes.string.isRequired, - qualifier: React.PropTypes.string.isRequired + breadcrumbs: PropTypes.arrayOf( + PropTypes.shape({ + key: PropTypes.string.isRequired, + name: PropTypes.string.isRequired, + qualifier: PropTypes.string.isRequired }).isRequired ).isRequired }; diff --git a/server/sonar-web/src/main/js/components/charts/treemap.js b/server/sonar-web/src/main/js/components/charts/treemap.js index 77316c7c78f..7b6c73af59e 100644 --- a/server/sonar-web/src/main/js/components/charts/treemap.js +++ b/server/sonar-web/src/main/js/components/charts/treemap.js @@ -18,6 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import createReactClass from 'create-react-class'; +import PropTypes from 'prop-types'; import { scaleLinear } from 'd3-scale'; import { treemap as d3Treemap, hierarchy as d3Hierarchy } from 'd3-hierarchy'; import { TreemapBreadcrumbs } from './treemap-breadcrumbs'; @@ -42,18 +44,18 @@ function mostCommitPrefix(strings) { return prefix.substr(0, prefix.length - lastPrefixPart.length); } -export const TreemapRect = React.createClass({ - propTypes: { - x: React.PropTypes.number.isRequired, - y: React.PropTypes.number.isRequired, - width: React.PropTypes.number.isRequired, - height: React.PropTypes.number.isRequired, - fill: React.PropTypes.string.isRequired, - label: React.PropTypes.string.isRequired, - onClick: React.PropTypes.func - }, - - renderLink() { +export class TreemapRect extends React.PureComponent { + static propTypes = { + x: PropTypes.number.isRequired, + y: PropTypes.number.isRequired, + width: PropTypes.number.isRequired, + height: PropTypes.number.isRequired, + fill: PropTypes.string.isRequired, + label: PropTypes.string.isRequired, + onClick: PropTypes.func + }; + + renderLink = () => { if (!this.props.link) { return null; } @@ -71,7 +73,7 @@ export const TreemapRect = React.createClass({ <span className="icon-link" /> </a> ); - }, + }; render() { let tooltipAttrs = {}; @@ -108,13 +110,15 @@ export const TreemapRect = React.createClass({ </div> ); } -}); +} + +export const Treemap = createReactClass({ + displayName: 'Treemap', -export const Treemap = React.createClass({ propTypes: { - items: React.PropTypes.arrayOf(React.PropTypes.object).isRequired, - height: React.PropTypes.number, - onRectangleClick: React.PropTypes.func + items: PropTypes.arrayOf(PropTypes.object).isRequired, + height: PropTypes.number, + onRectangleClick: PropTypes.func }, mixins: [ResizeMixin, TooltipsMixin], diff --git a/server/sonar-web/src/main/js/components/charts/word-cloud.js b/server/sonar-web/src/main/js/components/charts/word-cloud.js index 021b5bcba59..c7547ebdf87 100644 --- a/server/sonar-web/src/main/js/components/charts/word-cloud.js +++ b/server/sonar-web/src/main/js/components/charts/word-cloud.js @@ -18,39 +18,41 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import createReactClass from 'create-react-class'; +import PropTypes from 'prop-types'; import { max } from 'd3-array'; import { scaleLinear } from 'd3-scale'; import { sortBy } from 'lodash'; import { TooltipsMixin } from './../mixins/tooltips-mixin'; -export const Word = React.createClass({ - propTypes: { - size: React.PropTypes.number.isRequired, - text: React.PropTypes.string.isRequired, - tooltip: React.PropTypes.string, - link: React.PropTypes.string.isRequired - }, - - render() { - let tooltipAttrs = {}; - if (this.props.tooltip) { - tooltipAttrs = { - 'data-toggle': 'tooltip', - title: this.props.tooltip - }; - } - return ( - <a {...tooltipAttrs} style={{ fontSize: this.props.size }} href={this.props.link}> - {this.props.text} - </a> - ); +export function Word(props) { + let tooltipAttrs = {}; + if (props.tooltip) { + tooltipAttrs = { + 'data-toggle': 'tooltip', + title: props.tooltip + }; } -}); + return ( + <a {...tooltipAttrs} style={{ fontSize: props.size }} href={props.link}> + {props.text} + </a> + ); +} + +Word.propTypes = { + size: PropTypes.number.isRequired, + text: PropTypes.string.isRequired, + tooltip: PropTypes.string, + link: PropTypes.string.isRequired +}; + +export const WordCloud = createReactClass({ + displayName: 'WordCloud', -export const WordCloud = React.createClass({ propTypes: { - items: React.PropTypes.arrayOf(React.PropTypes.object).isRequired, - sizeRange: React.PropTypes.arrayOf(React.PropTypes.number) + items: PropTypes.arrayOf(PropTypes.object).isRequired, + sizeRange: PropTypes.arrayOf(PropTypes.number) }, mixins: [TooltipsMixin], diff --git a/server/sonar-web/src/main/js/components/common/BubblePopup.js b/server/sonar-web/src/main/js/components/common/BubblePopup.js index b29ee147dab..c77167ee53b 100644 --- a/server/sonar-web/src/main/js/components/common/BubblePopup.js +++ b/server/sonar-web/src/main/js/components/common/BubblePopup.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 classNames from 'classnames'; export default class BubblePopup extends React.PureComponent { static propsType = { - children: React.PropTypes.object.isRequired, - position: React.PropTypes.object.isRequired, - customClass: React.PropTypes.string + children: PropTypes.object.isRequired, + position: PropTypes.object.isRequired, + customClass: PropTypes.string }; static defaultProps = { diff --git a/server/sonar-web/src/main/js/components/controls/Checkbox.js b/server/sonar-web/src/main/js/components/controls/Checkbox.js index 57a5d6969a5..b1acc9f577e 100644 --- a/server/sonar-web/src/main/js/components/controls/Checkbox.js +++ b/server/sonar-web/src/main/js/components/controls/Checkbox.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 classNames from 'classnames'; export default class Checkbox extends React.PureComponent { static propTypes = { - id: React.PropTypes.string, - onCheck: React.PropTypes.func.isRequired, - checked: React.PropTypes.bool.isRequired, - thirdState: React.PropTypes.bool, - className: React.PropTypes.any + id: PropTypes.string, + onCheck: PropTypes.func.isRequired, + checked: PropTypes.bool.isRequired, + thirdState: PropTypes.bool, + className: PropTypes.any }; static defaultProps = { diff --git a/server/sonar-web/src/main/js/components/controls/DateInput.js b/server/sonar-web/src/main/js/components/controls/DateInput.js index 16bab132de3..9da950af99a 100644 --- a/server/sonar-web/src/main/js/components/controls/DateInput.js +++ b/server/sonar-web/src/main/js/components/controls/DateInput.js @@ -19,18 +19,19 @@ */ import $ from 'jquery'; import React from 'react'; +import PropTypes from 'prop-types'; import classNames from 'classnames'; import { pick } from 'lodash'; import './styles.css'; export default class DateInput extends React.PureComponent { static propTypes = { - className: React.PropTypes.string, - value: React.PropTypes.string, - format: React.PropTypes.string, - name: React.PropTypes.string, - placeholder: React.PropTypes.string, - onChange: React.PropTypes.func.isRequired + className: PropTypes.string, + value: PropTypes.string, + format: PropTypes.string, + name: PropTypes.string, + placeholder: PropTypes.string, + onChange: PropTypes.func.isRequired }; static defaultProps = { diff --git a/server/sonar-web/src/main/js/components/controls/Favorite.js b/server/sonar-web/src/main/js/components/controls/Favorite.js index f783d24b666..4faf4e186e6 100644 --- a/server/sonar-web/src/main/js/components/controls/Favorite.js +++ b/server/sonar-web/src/main/js/components/controls/Favorite.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 FavoriteBase from './FavoriteBase'; import { addFavorite, removeFavorite } from '../../api/favorites'; export default class Favorite extends React.PureComponent { static propTypes = { - favorite: React.PropTypes.bool.isRequired, - component: React.PropTypes.string.isRequired, - className: React.PropTypes.string + favorite: PropTypes.bool.isRequired, + component: PropTypes.string.isRequired, + className: PropTypes.string }; render() { diff --git a/server/sonar-web/src/main/js/components/controls/FavoriteBase.js b/server/sonar-web/src/main/js/components/controls/FavoriteBase.js index 13ec0372fe1..ac1d58186b3 100644 --- a/server/sonar-web/src/main/js/components/controls/FavoriteBase.js +++ b/server/sonar-web/src/main/js/components/controls/FavoriteBase.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 classNames from 'classnames'; import FavoriteIcon from '../common/FavoriteIcon'; export default class FavoriteBase extends React.PureComponent { static propTypes = { - favorite: React.PropTypes.bool.isRequired, - addFavorite: React.PropTypes.func.isRequired, - removeFavorite: React.PropTypes.func.isRequired, - className: React.PropTypes.string + favorite: PropTypes.bool.isRequired, + addFavorite: PropTypes.func.isRequired, + removeFavorite: PropTypes.func.isRequired, + className: PropTypes.string }; constructor(props) { diff --git a/server/sonar-web/src/main/js/components/controls/FavoriteBaseStateless.js b/server/sonar-web/src/main/js/components/controls/FavoriteBaseStateless.js index 1e4f325fa1f..35260d19d85 100644 --- a/server/sonar-web/src/main/js/components/controls/FavoriteBaseStateless.js +++ b/server/sonar-web/src/main/js/components/controls/FavoriteBaseStateless.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 classNames from 'classnames'; import FavoriteIcon from '../common/FavoriteIcon'; export default class FavoriteBaseStateless extends React.PureComponent { static propTypes = { - favorite: React.PropTypes.bool.isRequired, - addFavorite: React.PropTypes.func.isRequired, - removeFavorite: React.PropTypes.func.isRequired, - className: React.PropTypes.string + favorite: PropTypes.bool.isRequired, + addFavorite: PropTypes.func.isRequired, + removeFavorite: PropTypes.func.isRequired, + className: PropTypes.string }; toggleFavorite = e => { diff --git a/server/sonar-web/src/main/js/components/controls/FavoriteIssueFilter.js b/server/sonar-web/src/main/js/components/controls/FavoriteIssueFilter.js index 2cfaf29aa8a..c00c2993d04 100644 --- a/server/sonar-web/src/main/js/components/controls/FavoriteIssueFilter.js +++ b/server/sonar-web/src/main/js/components/controls/FavoriteIssueFilter.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 FavoriteBase from './FavoriteBase'; import { toggleIssueFilter } from '../../api/issue-filters'; export default class FavoriteIssueFilter extends React.PureComponent { static propTypes = { - favorite: React.PropTypes.bool.isRequired, - filter: React.PropTypes.shape({ - id: React.PropTypes.string.isRequired + favorite: PropTypes.bool.isRequired, + filter: PropTypes.shape({ + id: PropTypes.string.isRequired }).isRequired }; diff --git a/server/sonar-web/src/main/js/components/controls/GlobalMessages.js b/server/sonar-web/src/main/js/components/controls/GlobalMessages.js index 10f41ddad15..ac3c07535bf 100644 --- a/server/sonar-web/src/main/js/components/controls/GlobalMessages.js +++ b/server/sonar-web/src/main/js/components/controls/GlobalMessages.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 classNames from 'classnames'; import { ERROR, SUCCESS } from '../../store/globalMessages/duck'; export default class GlobalMessages extends React.PureComponent { static propTypes = { - messages: React.PropTypes.arrayOf( - React.PropTypes.shape({ - id: React.PropTypes.string.isRequired, - message: React.PropTypes.string.isRequired, - level: React.PropTypes.oneOf([ERROR, SUCCESS]) + messages: PropTypes.arrayOf( + PropTypes.shape({ + id: PropTypes.string.isRequired, + message: PropTypes.string.isRequired, + level: PropTypes.oneOf([ERROR, SUCCESS]) }) ), - closeGlobalMessage: React.PropTypes.func.isRequired + closeGlobalMessage: PropTypes.func.isRequired }; renderMessage = message => { diff --git a/server/sonar-web/src/main/js/components/controls/ListFooter.js b/server/sonar-web/src/main/js/components/controls/ListFooter.js index ba8ea10eadd..2cb3d59e903 100644 --- a/server/sonar-web/src/main/js/components/controls/ListFooter.js +++ b/server/sonar-web/src/main/js/components/controls/ListFooter.js @@ -19,15 +19,16 @@ */ import classNames from 'classnames'; import React from 'react'; +import PropTypes from 'prop-types'; import { translate, translateWithParameters } from '../../helpers/l10n'; import { formatMeasure } from '../../helpers/measures'; export default class ListFooter extends React.PureComponent { static propTypes = { - count: React.PropTypes.number.isRequired, - total: React.PropTypes.number.isRequired, - loadMore: React.PropTypes.func, - ready: React.PropTypes.bool + count: PropTypes.number.isRequired, + total: PropTypes.number.isRequired, + loadMore: PropTypes.func, + ready: PropTypes.bool }; static defaultProps = { diff --git a/server/sonar-web/src/main/js/components/controls/RadioToggle.js b/server/sonar-web/src/main/js/components/controls/RadioToggle.js index 83f36d2d846..2041eba1422 100644 --- a/server/sonar-web/src/main/js/components/controls/RadioToggle.js +++ b/server/sonar-web/src/main/js/components/controls/RadioToggle.js @@ -18,18 +18,19 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import PropTypes from 'prop-types'; export default class RadioToggle extends React.PureComponent { static propTypes = { - value: React.PropTypes.string, - options: React.PropTypes.arrayOf( - React.PropTypes.shape({ - value: React.PropTypes.string.isRequired, - label: React.PropTypes.string.isRequired + value: PropTypes.string, + options: PropTypes.arrayOf( + PropTypes.shape({ + value: PropTypes.string.isRequired, + label: PropTypes.string.isRequired }) ).isRequired, - name: React.PropTypes.string.isRequired, - onCheck: React.PropTypes.func.isRequired + name: PropTypes.string.isRequired, + onCheck: PropTypes.func.isRequired }; static defaultProps = { diff --git a/server/sonar-web/src/main/js/components/controls/Toggle.js b/server/sonar-web/src/main/js/components/controls/Toggle.js index 870ed5220ec..165c74777eb 100644 --- a/server/sonar-web/src/main/js/components/controls/Toggle.js +++ b/server/sonar-web/src/main/js/components/controls/Toggle.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 classNames from 'classnames'; import './styles.css'; export default class Toggle extends React.PureComponent { static propTypes = { - value: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.bool]).isRequired, - name: React.PropTypes.string, - onChange: React.PropTypes.func + value: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]).isRequired, + name: PropTypes.string, + onChange: PropTypes.func }; handleClick(e, value) { diff --git a/server/sonar-web/src/main/js/components/issue/Issue.js b/server/sonar-web/src/main/js/components/issue/Issue.js index eaa0214f92a..f21644f1e59 100644 --- a/server/sonar-web/src/main/js/components/issue/Issue.js +++ b/server/sonar-web/src/main/js/components/issue/Issue.js @@ -19,6 +19,7 @@ */ // @flow import React from 'react'; +import PropTypes from 'prop-types'; import key from 'keymaster'; import IssueView from './IssueView'; import { updateIssue } from './actions'; @@ -46,7 +47,7 @@ export default class BaseIssue extends React.PureComponent { state: State; static contextTypes = { - store: React.PropTypes.object + store: PropTypes.object }; static defaultProps = { diff --git a/server/sonar-web/src/main/js/components/select-list/footer.js b/server/sonar-web/src/main/js/components/select-list/footer.js index 3088c2f2337..d85be905a9d 100644 --- a/server/sonar-web/src/main/js/components/select-list/footer.js +++ b/server/sonar-web/src/main/js/components/select-list/footer.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 Footer extends React.PureComponent { static propTypes = { - count: React.PropTypes.number.isRequired, - total: React.PropTypes.number.isRequired, - loadMore: React.PropTypes.func.isRequired + count: PropTypes.number.isRequired, + total: PropTypes.number.isRequired, + loadMore: PropTypes.func.isRequired }; loadMore = e => { diff --git a/server/sonar-web/src/main/js/components/select-list/item.js b/server/sonar-web/src/main/js/components/select-list/item.js index ecd5442c927..c03ef453c04 100644 --- a/server/sonar-web/src/main/js/components/select-list/item.js +++ b/server/sonar-web/src/main/js/components/select-list/item.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 Checkbox from '../controls/Checkbox'; export default class Item extends React.PureComponent { static propTypes = { - item: React.PropTypes.any.isRequired, - renderItem: React.PropTypes.func.isRequired, - selectItem: React.PropTypes.func.isRequired, - deselectItem: React.PropTypes.func.isRequired + item: PropTypes.any.isRequired, + renderItem: PropTypes.func.isRequired, + selectItem: PropTypes.func.isRequired, + deselectItem: PropTypes.func.isRequired }; onCheck = checked => { diff --git a/server/sonar-web/src/main/js/components/select-list/list.js b/server/sonar-web/src/main/js/components/select-list/list.js index 6a701f51eb4..c752367bb8e 100644 --- a/server/sonar-web/src/main/js/components/select-list/list.js +++ b/server/sonar-web/src/main/js/components/select-list/list.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 Item from './item'; export default class List extends React.PureComponent { static propTypes = { - items: React.PropTypes.array.isRequired, - renderItem: React.PropTypes.func.isRequired, - getItemKey: React.PropTypes.func.isRequired, - selectItem: React.PropTypes.func.isRequired, - deselectItem: React.PropTypes.func.isRequired + items: PropTypes.array.isRequired, + renderItem: PropTypes.func.isRequired, + getItemKey: PropTypes.func.isRequired, + selectItem: PropTypes.func.isRequired, + deselectItem: PropTypes.func.isRequired }; render() { diff --git a/server/sonar-web/src/main/js/components/select-list/main.js b/server/sonar-web/src/main/js/components/select-list/main.js index 64902383add..3ebfeafaa9b 100644 --- a/server/sonar-web/src/main/js/components/select-list/main.js +++ b/server/sonar-web/src/main/js/components/select-list/main.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 Controls from './controls'; import List from './list'; import Footer from './footer'; export default class Main extends React.PureComponent { static propTypes = { - loadItems: React.PropTypes.func.isRequired, - renderItem: React.PropTypes.func.isRequired, - getItemKey: React.PropTypes.func.isRequired, - selectItem: React.PropTypes.func.isRequired, - deselectItem: React.PropTypes.func.isRequired + loadItems: PropTypes.func.isRequired, + renderItem: PropTypes.func.isRequired, + getItemKey: PropTypes.func.isRequired, + selectItem: PropTypes.func.isRequired, + deselectItem: PropTypes.func.isRequired }; state = { diff --git a/server/sonar-web/src/main/js/components/shared/WithStore.js b/server/sonar-web/src/main/js/components/shared/WithStore.js index 5d8a41939cf..c406d118aff 100644 --- a/server/sonar-web/src/main/js/components/shared/WithStore.js +++ b/server/sonar-web/src/main/js/components/shared/WithStore.js @@ -19,6 +19,7 @@ */ // @flow import React from 'react'; +import PropTypes from 'prop-types'; import getStore from '../../app/utils/getStore'; type Props = { @@ -30,7 +31,7 @@ export default class WithStore extends React.PureComponent { store: {}; static childContextTypes = { - store: React.PropTypes.object + store: PropTypes.object }; constructor(props: Props) { diff --git a/server/sonar-web/src/main/js/components/shared/complexity-distribution.js b/server/sonar-web/src/main/js/components/shared/complexity-distribution.js index 6c7b49221a5..7853ee91800 100644 --- a/server/sonar-web/src/main/js/components/shared/complexity-distribution.js +++ b/server/sonar-web/src/main/js/components/shared/complexity-distribution.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 { BarChart } from '../charts/bar-chart'; import { formatMeasure } from '../../helpers/measures'; import { translateWithParameters } from '../../helpers/l10n'; @@ -26,8 +27,8 @@ const HEIGHT = 80; export class ComplexityDistribution extends React.PureComponent { static propTypes = { - distribution: React.PropTypes.string.isRequired, - of: React.PropTypes.string.isRequired + distribution: PropTypes.string.isRequired, + of: PropTypes.string.isRequired }; renderBarChart = () => { diff --git a/server/sonar-web/src/main/js/components/shared/drilldown-link.js b/server/sonar-web/src/main/js/components/shared/drilldown-link.js index 55b64727a8a..13b0afeb0c3 100644 --- a/server/sonar-web/src/main/js/components/shared/drilldown-link.js +++ b/server/sonar-web/src/main/js/components/shared/drilldown-link.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 { getComponentDrilldownUrl, getComponentIssuesUrl } from '../../helpers/urls'; @@ -48,14 +49,11 @@ const ISSUE_MEASURES = [ export class DrilldownLink extends React.PureComponent { static propTypes = { - children: React.PropTypes.oneOfType([ - React.PropTypes.node, - React.PropTypes.arrayOf(React.PropTypes.node) - ]), - className: React.PropTypes.string, - component: React.PropTypes.string.isRequired, - metric: React.PropTypes.string.isRequired, - sinceLeakPeriod: React.PropTypes.bool + children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]), + className: PropTypes.string, + component: PropTypes.string.isRequired, + metric: PropTypes.string.isRequired, + sinceLeakPeriod: PropTypes.bool }; isIssueMeasure = () => { return ISSUE_MEASURES.indexOf(this.props.metric) !== -1; diff --git a/server/sonar-web/src/main/js/components/ui/Avatar.js b/server/sonar-web/src/main/js/components/ui/Avatar.js index fcd34da318f..a2a53f474aa 100644 --- a/server/sonar-web/src/main/js/components/ui/Avatar.js +++ b/server/sonar-web/src/main/js/components/ui/Avatar.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 md5 from 'blueimp-md5'; import classNames from 'classnames'; @@ -47,13 +48,13 @@ function getTextColor(background) { class Avatar extends React.PureComponent { static propTypes = { - enableGravatar: React.PropTypes.bool.isRequired, - gravatarServerUrl: React.PropTypes.string.isRequired, - email: React.PropTypes.string, - hash: React.PropTypes.string, - name: React.PropTypes.string.isRequired, - size: React.PropTypes.number.isRequired, - className: React.PropTypes.string + enableGravatar: PropTypes.bool.isRequired, + gravatarServerUrl: PropTypes.string.isRequired, + email: PropTypes.string, + hash: PropTypes.string, + name: PropTypes.string.isRequired, + size: PropTypes.number.isRequired, + className: PropTypes.string }; renderFallback() { diff --git a/server/sonar-web/src/main/js/components/ui/Level.js b/server/sonar-web/src/main/js/components/ui/Level.js index 66a2bbe5025..013618021ef 100644 --- a/server/sonar-web/src/main/js/components/ui/Level.js +++ b/server/sonar-web/src/main/js/components/ui/Level.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 classNames from 'classnames'; import { formatMeasure } from '../../helpers/measures'; import './Level.css'; export default class Level extends React.PureComponent { static propTypes = { - level: React.PropTypes.oneOf(['ERROR', 'WARN', 'OK']).isRequired, - small: React.PropTypes.bool, - muted: React.PropTypes.bool + level: PropTypes.oneOf(['ERROR', 'WARN', 'OK']).isRequired, + small: PropTypes.bool, + muted: PropTypes.bool }; static defaultProps = { diff --git a/server/sonar-web/src/main/js/components/ui/Rating.js b/server/sonar-web/src/main/js/components/ui/Rating.js index 65a56c46999..1f30a388d04 100644 --- a/server/sonar-web/src/main/js/components/ui/Rating.js +++ b/server/sonar-web/src/main/js/components/ui/Rating.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 classNames from 'classnames'; import { formatMeasure } from '../../helpers/measures'; import './Rating.css'; export default class Rating extends React.PureComponent { static propTypes = { - className: React.PropTypes.string, + className: PropTypes.string, value: (props, propName, componentName) => { // allow both numbers and strings const numberValue = Number(props[propName]); @@ -32,8 +33,8 @@ export default class Rating extends React.PureComponent { throw new Error(`Invalid prop "${propName}" passed to "${componentName}".`); } }, - small: React.PropTypes.bool, - muted: React.PropTypes.bool + small: PropTypes.bool, + muted: PropTypes.bool }; static defaultProps = { |