diff options
author | Stas Vilchik <stas-vilchik@users.noreply.github.com> | 2017-03-24 10:01:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-24 10:01:05 +0100 |
commit | c066c9818690903ca656e33060d4d77f36cbdc5b (patch) | |
tree | 2a29d528d46f14b62aed5ec2833b81f1e3474661 /server/sonar-web/src/main/js/apps/projectActivity | |
parent | 70d52b56bb19ef9725b3cb598563e6684bc3327a (diff) | |
download | sonarqube-c066c9818690903ca656e33060d4d77f36cbdc5b.tar.gz sonarqube-c066c9818690903ca656e33060d4d77f36cbdc5b.zip |
add flow-typed definitions (#1847)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projectActivity')
8 files changed, 60 insertions, 12 deletions
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.js b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.js index eb1a476b2c6..ed02adadef5 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.js +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.js @@ -45,12 +45,18 @@ class ProjectActivityApp extends React.Component { }; componentDidMount() { - document.querySelector('html').classList.add('dashboard-page'); + const html = document.querySelector('html'); + if (html) { + html.classList.add('dashboard-page'); + } this.props.fetchProjectActivity(this.props.location.query.id); } componentWillUnmount() { - document.querySelector('html').classList.remove('dashboard-page'); + const html = document.querySelector('html'); + if (html) { + html.classList.remove('dashboard-page'); + } } handleFilter = (filter: ?string) => { diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/AddCustomEventForm.js b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/AddCustomEventForm.js index c7da027a6bb..b5e58a800b6 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/AddCustomEventForm.js +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/AddCustomEventForm.js @@ -22,8 +22,14 @@ import React from 'react'; import { connect } from 'react-redux'; import { addCustomEvent } from '../../actions'; import AddEventForm from './AddEventForm'; +import type { Analysis } from '../../../../store/projectActivity/duck'; -const AddCustomEventForm = props => ( +type Props = { + addEvent: () => Promise<*>, + analysis: Analysis +}; + +const AddCustomEventForm = (props: Props) => ( <AddEventForm {...props} addEventButtonText="project_activity.add_custom_event" /> ); diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/AddVersionForm.js b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/AddVersionForm.js index 423a538b506..769bf5ba45b 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/AddVersionForm.js +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/AddVersionForm.js @@ -22,8 +22,14 @@ import React from 'react'; import { connect } from 'react-redux'; import { addVersion } from '../../actions'; import AddEventForm from './AddEventForm'; +import type { Analysis } from '../../../../store/projectActivity/duck'; -const AddVersionForm = props => ( +type Props = { + addEvent: () => Promise<*>, + analysis: Analysis +}; + +const AddVersionForm = (props: Props) => ( <AddEventForm {...props} addEventButtonText="project_activity.add_version" /> ); diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/ChangeCustomEventForm.js b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/ChangeCustomEventForm.js index a05895d37b0..0d17f70cb2d 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/ChangeCustomEventForm.js +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/ChangeCustomEventForm.js @@ -22,8 +22,15 @@ import React from 'react'; import { connect } from 'react-redux'; import ChangeEventForm from './ChangeEventForm'; import { changeEvent } from '../../actions'; +import type { Event } from '../../../../store/projectActivity/duck'; -const ChangeCustomEventForm = props => ( +type Props = { + changeEvent: () => Promise<*>, + event: Event, + onClose: () => void +}; + +const ChangeCustomEventForm = (props: Props) => ( <ChangeEventForm {...props} changeEventButtonText="project_activity.change_custom_event" /> ); diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/ChangeVersionForm.js b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/ChangeVersionForm.js index 50abf9ae8a9..d57f9234939 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/ChangeVersionForm.js +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/ChangeVersionForm.js @@ -22,8 +22,15 @@ import React from 'react'; import { connect } from 'react-redux'; import ChangeEventForm from './ChangeEventForm'; import { changeEvent } from '../../actions'; +import type { Event } from '../../../../store/projectActivity/duck'; -const ChangeVersionForm = props => ( +type Props = { + changeEvent: () => Promise<*>, + event: Event, + onClose: () => void +}; + +const ChangeVersionForm = (props: Props) => ( <ChangeEventForm {...props} changeEventButtonText="project_activity.change_version" /> ); diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveCustomEventForm.js b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveCustomEventForm.js index 1b97fb0efbf..4f18821b611 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveCustomEventForm.js +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveCustomEventForm.js @@ -22,8 +22,16 @@ import React from 'react'; import { connect } from 'react-redux'; import RemoveEventForm from './RemoveEventForm'; import { deleteEvent } from '../../actions'; +import type { Event } from '../../../../store/projectActivity/duck'; -const RemoveCustomEventForm = props => ( +type Props = { + analysis: string, + event: Event, + deleteEvent: (string, string) => Promise<*>, + onClose: () => void +}; + +const RemoveCustomEventForm = (props: Props) => ( <RemoveEventForm {...props} removeEventButtonText="project_activity.remove_custom_event" diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveEventForm.js b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveEventForm.js index 155af276a76..90c589f2a5b 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveEventForm.js +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveEventForm.js @@ -20,12 +20,12 @@ // @flow import React from 'react'; import Modal from 'react-modal'; -import type { Analysis, Event } from '../../../../store/projectActivity/duck'; +import type { Event } from '../../../../store/projectActivity/duck'; import { translate } from '../../../../helpers/l10n'; type Props = { - analysis: Analysis, - deleteEvent: () => Promise<*>, + analysis: string, + deleteEvent: (string, string) => Promise<*>, event: Event, removeEventButtonText: string, removeEventQuestion: string, @@ -36,7 +36,7 @@ type State = { processing: boolean }; -export default class RemoveVersionForm extends React.Component { +export default class RemoveEventForm extends React.Component { mounted: boolean; props: Props; diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveVersionForm.js b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveVersionForm.js index d7c92607bfd..1a8938719cb 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveVersionForm.js +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveVersionForm.js @@ -22,8 +22,16 @@ import React from 'react'; import { connect } from 'react-redux'; import RemoveEventForm from './RemoveEventForm'; import { deleteEvent } from '../../actions'; +import type { Event } from '../../../../store/projectActivity/duck'; -const RemoveVersionForm = props => ( +type Props = { + analysis: string, + event: Event, + deleteEvent: (string, string) => Promise<*>, + onClose: () => void +}; + +const RemoveVersionForm = (props: Props) => ( <RemoveEventForm {...props} removeEventButtonText="project_activity.remove_version" |