diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-08-14 15:15:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-14 15:15:26 +0200 |
commit | 90306cb436e4fadceda6c106adc407618674f0d0 (patch) | |
tree | 4884373f2827b3fb59adb4516aa63bc4c4b1ae47 /server/sonar-web/src/main/js/components/shared | |
parent | ffff02cbed3e5f94bbf0c1718425d66e19ac3901 (diff) | |
download | sonarqube-90306cb436e4fadceda6c106adc407618674f0d0.tar.gz sonarqube-90306cb436e4fadceda6c106adc407618674f0d0.zip |
comment flow annotations (#2335)
Diffstat (limited to 'server/sonar-web/src/main/js/components/shared')
8 files changed, 25 insertions, 12 deletions
diff --git a/server/sonar-web/src/main/js/components/shared/Organization.js b/server/sonar-web/src/main/js/components/shared/Organization.js index aae52f11127..3debbb2a878 100644 --- a/server/sonar-web/src/main/js/components/shared/Organization.js +++ b/server/sonar-web/src/main/js/components/shared/Organization.js @@ -23,10 +23,13 @@ import { connect } from 'react-redux'; import { getOrganizationByKey, areThereCustomOrganizations } from '../../store/rootReducer'; import OrganizationLink from '../ui/OrganizationLink'; +/*:: type OwnProps = { organizationKey: string }; +*/ +/*:: type Props = { link?: boolean, linkClassName?: string, @@ -34,9 +37,10 @@ type Props = { organization: { key: string, name: string } | null, shouldBeDisplayed: boolean }; +*/ class Organization extends React.PureComponent { - props: Props; + /*:: props: Props; */ static defaultProps = { link: true @@ -62,7 +66,7 @@ class Organization extends React.PureComponent { } } -const mapStateToProps = (state, ownProps: OwnProps) => ({ +const mapStateToProps = (state, ownProps /*: OwnProps */) => ({ organization: getOrganizationByKey(state, ownProps.organizationKey), shouldBeDisplayed: areThereCustomOrganizations(state) }); diff --git a/server/sonar-web/src/main/js/components/shared/QualifierIcon.js b/server/sonar-web/src/main/js/components/shared/QualifierIcon.js index 82ed9f7e5e1..e00dc8ab41f 100644 --- a/server/sonar-web/src/main/js/components/shared/QualifierIcon.js +++ b/server/sonar-web/src/main/js/components/shared/QualifierIcon.js @@ -20,13 +20,15 @@ import React from 'react'; import classNames from 'classnames'; +/*:: type Props = { className?: string, qualifier: ?string }; +*/ export default class QualifierIcon extends React.PureComponent { - props: Props; + /*:: props: Props; */ render() { if (!this.props.qualifier) { diff --git a/server/sonar-web/src/main/js/components/shared/SeverityHelper.js b/server/sonar-web/src/main/js/components/shared/SeverityHelper.js index 2ac4e149f1e..6b9171e40c8 100644 --- a/server/sonar-web/src/main/js/components/shared/SeverityHelper.js +++ b/server/sonar-web/src/main/js/components/shared/SeverityHelper.js @@ -22,7 +22,7 @@ import React from 'react'; import SeverityIcon from './SeverityIcon'; import { translate } from '../../helpers/l10n'; -export default function SeverityHelper(props: { severity: ?string, className?: string }) { +export default function SeverityHelper(props /*: { severity: ?string, className?: string } */) { const { severity } = props; if (!severity) { return null; diff --git a/server/sonar-web/src/main/js/components/shared/SeverityIcon.js b/server/sonar-web/src/main/js/components/shared/SeverityIcon.js index aea18812a32..2b254650b1a 100644 --- a/server/sonar-web/src/main/js/components/shared/SeverityIcon.js +++ b/server/sonar-web/src/main/js/components/shared/SeverityIcon.js @@ -21,7 +21,7 @@ import React from 'react'; import classNames from 'classnames'; -export default function SeverityIcon(props: { severity: ?string, className?: string }) { +export default function SeverityIcon(props /*: { severity: ?string, className?: string } */) { if (!props.severity) { return null; } diff --git a/server/sonar-web/src/main/js/components/shared/StatusHelper.js b/server/sonar-web/src/main/js/components/shared/StatusHelper.js index a355348f720..b6e55f388ec 100644 --- a/server/sonar-web/src/main/js/components/shared/StatusHelper.js +++ b/server/sonar-web/src/main/js/components/shared/StatusHelper.js @@ -22,11 +22,13 @@ import React from 'react'; import StatusIcon from './StatusIcon'; import { translate } from '../../helpers/l10n'; -export default function StatusHelper(props: { +export default function StatusHelper( + props /*: { resolution?: string, status: string, className?: string -}) { +} */ +) { const resolution = props.resolution != null && ` (${translate('issue.resolution', props.resolution)})`; return ( diff --git a/server/sonar-web/src/main/js/components/shared/StatusIcon.js b/server/sonar-web/src/main/js/components/shared/StatusIcon.js index b98b4cccfd3..60403fbac42 100644 --- a/server/sonar-web/src/main/js/components/shared/StatusIcon.js +++ b/server/sonar-web/src/main/js/components/shared/StatusIcon.js @@ -21,7 +21,7 @@ import React from 'react'; import classNames from 'classnames'; -export default function StatusIcon(props: { status: string, className?: string }) { +export default function StatusIcon(props /*: { status: string, className?: string } */) { const className = classNames('icon-status-' + props.status.toLowerCase(), props.className); return <i className={className} />; } diff --git a/server/sonar-web/src/main/js/components/shared/TypeHelper.js b/server/sonar-web/src/main/js/components/shared/TypeHelper.js index 030337e5242..e734f22a8d5 100644 --- a/server/sonar-web/src/main/js/components/shared/TypeHelper.js +++ b/server/sonar-web/src/main/js/components/shared/TypeHelper.js @@ -22,11 +22,13 @@ import React from 'react'; import IssueTypeIcon from '../ui/IssueTypeIcon'; import { translate } from '../../helpers/l10n'; +/*:: type Props = { type: string }; +*/ -const TypeHelper = (props: Props) => +const TypeHelper = (props /*: Props */) => <span> <IssueTypeIcon className="little-spacer-right" query={props.type} /> {translate('issue.type', props.type)} 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 c406d118aff..73b18dc67ea 100644 --- a/server/sonar-web/src/main/js/components/shared/WithStore.js +++ b/server/sonar-web/src/main/js/components/shared/WithStore.js @@ -22,19 +22,22 @@ import React from 'react'; import PropTypes from 'prop-types'; import getStore from '../../app/utils/getStore'; +/*:: type Props = { children: React.Element<*> }; +*/ export default class WithStore extends React.PureComponent { - props: Props; - store: {}; + /*:: props: Props; */ + /*:: store: {}; +*/ static childContextTypes = { store: PropTypes.object }; - constructor(props: Props) { + constructor(props /*: Props */) { super(props); this.store = getStore(); } |